Results 1 to 2 of 2

Thread: Hhilight text of QToolButton or QPushButton

  1. #1
    Join Date
    Dec 2010
    Posts
    15
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Hhilight text of QToolButton or QPushButton

    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!

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Hhilight text of QToolButton or QPushButton

    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.

Similar Threads

  1. Replies: 0
    Last Post: 23rd March 2011, 05:07
  2. Background Color of QToolButton or QPushButton
    By metdos in forum Qt Programming
    Replies: 5
    Last Post: 17th June 2010, 11:02
  3. Replies: 1
    Last Post: 15th March 2009, 20:02
  4. QToolButton & QPushButton
    By hrcariaga in forum Qt Programming
    Replies: 5
    Last Post: 15th July 2008, 21:17
  5. QToolButton text alignment
    By Vladimir in forum Qt Programming
    Replies: 6
    Last Post: 2nd March 2007, 07:42

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.