Results 1 to 5 of 5

Thread: Highlighting Current Selection

  1. #1
    Join Date
    Aug 2009
    Posts
    47
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded PyQt3 PyQt4
    Platforms
    Unix/X11 Symbian S60

    Unhappy Highlighting Current Selection

    Hi,

    I have a MainWindow Application contains five Tool Buttons on it.By pressing Up,Down,Left and Right i can move around the button.While Moving i want to highlight the buttons .Please guide me to do this one

    Regards
    Kavin

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Highlighting Current Selection

    How do you move ?
    do you change focus ? or simulate button click ?

    and what do you mean by highlighting ? what way you want ? background changed ? border in some color, or color overlay ?

  3. #3
    Join Date
    Aug 2009
    Posts
    47
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded PyQt3 PyQt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: Highlighting Current Selection

    HI,

    Like changing the Focus i am moving.Highlighting means Change the BackGround colour of the tool button

    Regards
    Kavin

  4. #4
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: Highlighting Current Selection

    You can try setFocus(). But you should be aware that highlighting on focus doesn't always appear; some styles don't draw focused widgets with highlighting. You can experiment with this in the Designer and see what different styles do, although results will also vary from platform to platform.

    If you need to be certain, you can either select a style that supports highlighting, or you can add specialized rendering through a customized paint() routine or (possibly) through stylesheets.

  5. #5
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Highlighting Current Selection

    It would be nice if you subclass QPushButton / QToolButton and then draw highlight in the paintEvent function.

Similar Threads

  1. Highlighting Current Selection
    By kavinsiva in forum Newbie
    Replies: 2
    Last Post: 27th May 2010, 12:59
  2. QTableWidget Highlighting and Selection Colors
    By Slewman in forum Qt Programming
    Replies: 1
    Last Post: 11th February 2010, 23:14
  3. highlighting a QPushButton
    By qtUser500 in forum Qt Programming
    Replies: 6
    Last Post: 14th July 2009, 21:21
  4. Replies: 2
    Last Post: 4th April 2008, 13:00
  5. Replies: 1
    Last Post: 26th August 2007, 08:05

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.