Results 1 to 2 of 2

Thread: Changing selected item color in non-current window.

  1. #1
    Join Date
    Jan 2006
    Location
    Berkeley California
    Posts
    109
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Changing selected item color in non-current window.

    I have a dialog for associating items in a list widget (QListWidget) with files in a Directory Tree (QTreeView) - the user needs to select (highlight) an item in the list widget, an item in the directory tree, then click an "Associate" button. When either widget has the focus the highlighing is distinctive, while the highlighted item in the widget without foucus is much less distinctive - I would like the current item highlighting to be the same in both widgets regardless of which has the focus. I assume that I need to alter the palette so that the non-focused widget displayes the same as the widget with focus - but I do not see any ColorGroup or ColorRole that corresponds to a selected item without focus.

    How to implement?

    Thanks
    Doug

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Changing selected item color in non-current window.

    Implement delegates for your item views and paint them as you want.

    Actually, for the list widget you could do without a delegate, since you can set the background of an item with QListWidgetItem::setBackground.

Similar Threads

  1. Distributing QT application for Mac OS
    By mb0 in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2007, 18:59
  2. Replies: 1
    Last Post: 19th April 2007, 22:23

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.