Results 1 to 4 of 4

Thread: QListWidget - stylesheet problem

  1. #1
    Join Date
    Feb 2009
    Posts
    29
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QListWidget - stylesheet problem

    The below code is not working on QT4.3
    QListWidget, QLabel {
    selection-background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 lightblue, stop: 1 navy);
    }
    But this code work in QLineEdit

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QListWidget - stylesheet problem

    Works for me with Qt 4.4.3.
    J-P Nurmi

  3. #3
    Join Date
    Feb 2009
    Posts
    29
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QListWidget - stylesheet problem

    We also checked in QT4.4. But its not working for me. We set the style sheet in the below manner.
    We set QListWidget style sheet as selection-background-color:
    qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 lightblue, stop: 1
    navy);
    Then I got selection back color as black and selection color as light
    black color. No lightblue color and navy color is there.
    Please suggest some solution to that.

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QListWidget - stylesheet problem

    There's not much to suggest. As I said, it works fine for me. I bet it works for you too if you test it with a simple test case or Qt Designer, without the complexity of your application. Do you set a style sheet to the parent (or one of the grand parents) of the list view, or do you set a global application-wide style sheet?
    J-P Nurmi

Similar Threads

  1. QListWidget SIGNAL Problem
    By skuda in forum Qt Programming
    Replies: 19
    Last Post: 28th October 2009, 14:42
  2. Problem with events changing behavior of QListWidget
    By riklaunim in forum Qt Programming
    Replies: 10
    Last Post: 22nd December 2008, 19:10
  3. The problem with the display of QListWidget
    By whyisosad in forum Qt Programming
    Replies: 1
    Last Post: 12th May 2008, 19:41
  4. QListWidget Problem
    By pmabie in forum Qt Programming
    Replies: 1
    Last Post: 7th October 2007, 06:52
  5. StyleSheet Problem with QTabWidget
    By December in forum Qt Programming
    Replies: 1
    Last Post: 8th August 2007, 22:16

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.