View Full Version : Hhilight text of QToolButton or QPushButton

15th September 2011, 09:22

i try to explain my Problem:
I have in my app leftside menu buttons(QPushBottons). I filter them (hide or show) by imput a text in QLineEdit. And it works fine! But I wont do more. I wont to highlight a button's text , that was iputed in lineedit.


Imput LineEdit: "bu"

highlight or change the color of buttons text


I have no idea how can i do this. Have somebody a suggestion?


15th September 2011, 09:25
Subclass QPushButton and do the painting yourself, which is not so hard. So you have full control. Or alter the paint event to accept HTML. Then you can simply change the text property with proper HTML.