PDA

View Full Version : Hhilight text of QToolButton or QPushButton



bahbah30
15th September 2011, 08:22
Hi,

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.

Exaple:

Imput LineEdit: "bu"

highlight or change the color of buttons text

(button1)
(button2)
(button3)


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

thanks!

Lykurg
15th September 2011, 08: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.