python - Selection of text in QTextBrowser -
I have I tried with the signal Any suggestions? Thank you! Edit: I like this work: I need the status of the click here: myself. Mousepress and myself. Moussurellis. But when I select the text in my QTextBrowser, the highlight does not appear. I hope I am more clear ... edit 2: or this: You have to pass the incident to the normal handler, because you have normal behavior Has changed the following line at the end of the appropriate event handler: QTextBrowser and when I select a part of the text, I need a status Selection and the end of the beginning. I do this with
MousePressEvent and
mouseReleaseEvent and it works, but the highlight selection (dark blue) is not visible. Why? So I can not see what I have chosen.
selectionChanged but the problem is that whenever I select I select the text and when I release the mouse and the end of the selection.
class MyBrowser (QTextBrowser): def __init __ (self, parent = none , textableAnnotate = none): Super (MyBrowser, self) .__ init __ (parent) self.textableAnnotate = textableAnnotate self.mousepress = 0 Self.mouserelease = 0 def mousePressEvent (self, mouseEvent): self.mousepress = self.cursorForPosition (MouseEvent.pos ()) Status () DEF mouseReleaseEvent (auto, mouseewent): self.mouseRelease = self.cursorForPosition (mouseEvent.pos ()). Status ()
self.browserInput.selectionChanged.connect ( self.jpg) Def position (self): start = self.browserInput.textCursor (). SelectionStart () end = self.browserInput.textCursor (). SelectionEnd ()
QTextBrowser.mousePressEvent (auto, mouse Event) QTextBrowser.mouseReleaseEvent (auto, mouseewart)
Comments
Post a Comment