PDA

View Full Version : QListWidget - stylesheet problem



febil
20th February 2009, 11:14
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

jpn
20th February 2009, 12:14
Works for me with Qt 4.4.3.

febil
20th February 2009, 13:31
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.

jpn
23rd February 2009, 17:44
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?