Results 1 to 2 of 2

Thread: QListWidget style icon selection

  1. #1
    Join Date
    Aug 2009
    Posts
    1
    Qt products
    Qt4

    Default QListWidget style icon selection

    Hello, I'm using a style sheet on my QListWidget to make it look nice I have a small problem though. When the style sheet is set and an item is selected the selection box (pointed in the picture by the red arrow) does no wrap around my icon! How can I make it go around the whole QListWidgetItem (including the icon) and not just the text.

    This does not seem to happen when I turn off my style.
    This is the only style I use in the whole program:

    Qt Code:
    1. QListView::item {
    2. border: 1px solid #d9d9d9;
    3. border-top-color: transparent;
    4. border-bottom-color: transparent;
    5. }
    6.  
    7. QListView::item:selected:active {
    8. background: qlineargradient(x1: 1, y1: 0, x2: 0, y2: 3, stop: 0 #cbdaf1, stop: 1 #bfcde4);
    9. }
    10.  
    11.  
    12. QListView::item:hover {
    13. background: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #e7effd, stop: 1 #cbdaf1);
    14. border: 1px solid #bfcde4;
    15. }
    To copy to clipboard, switch view to plain text mode 

    Heres the image:



    Thanks for any help!

  2. #2
    Join Date
    Jul 2010
    Location
    Ahmedabad,Gujarat,India
    Posts
    25
    Thanks
    14
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: QListWidget style icon selection

    #listWidget_ManageGroup is My ListWidget name..... it's for perticular widget.. that's why....

    #listWidget_MangeGroup{
    selection-background-color : rgb(98,100,105);
    selection-color: rgb(255,255,255);
    border: 1px solid rgb(98,100,105);
    }



    #listWidget_MangeGroup QListWidgetItem{
    margin: 1px;
    text-align: center;
    background-color: rgb(247,247,247);
    }

Similar Threads

  1. QTabWidget transparent background problem
    By destroyar0 in forum Qt Programming
    Replies: 10
    Last Post: 25th June 2009, 12:19
  2. Replies: 5
    Last Post: 8th June 2009, 22:16
  3. QListwidget Icon
    By jasplye in forum Qt Programming
    Replies: 3
    Last Post: 27th November 2008, 09:17
  4. QListWidget multi selection
    By user in forum Qt Programming
    Replies: 1
    Last Post: 6th February 2008, 07:36
  5. QTreeWidget & QListWidget different selection
    By munna in forum Qt Programming
    Replies: 9
    Last Post: 21st July 2006, 06:50

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.