Highlight all text in QTextBrowser when gaining focus
Hello,
I want to highlight all text in QTextBrowser when it gains focus. I couldn't find a suitable signal that tells me that the TextBrowser widget just gained focus.
So I thought about reimplementing the focusInEvent, which seems to be the correct way. I derived a class MyTextBrowser from QTextBrowser.
But as I am using the Designer for layouting my windows I don't know how to "replace" the used QTextBrowser object with a MyTextbrowser object.
Or is there any other way to highlight all text in QTextBrowser when it gains focus?
Re: Highlight all text in QTextBrowser when gaining focus
Quote:
Originally Posted by
Boron
I want to highlight all text in QTextBrowser when it gains focus. I couldn't find a suitable signal that tells me that the TextBrowser widget just gained focus.
So I thought about reimplementing the focusInEvent, which seems to be the correct way. I derived a class MyTextBrowser from QTextBrowser.
Correct, it's not a signal but an event.
Quote:
But as I am using the Designer for layouting my windows I don't know how to "replace" the used QTextBrowser object with a MyTextbrowser object.
See Promoting Widgets.