QSS issue about QComboBox
-
For QComboBox, I want to test the QSS style settings, When I only put:
QComboBox::drop-down { image: url(:/images/res/drop-down.png); }The result is ok, just like:

while, when I add something like this:
QComboBox{ border: 1px solid red; font-size: 12px; } QComboBox::drop-down { image: url(:/images/res/drop-down.png); }The result is not what I imagined:

Here is my picture:

So, why is the result like this?
-
For QComboBox, I want to test the QSS style settings, When I only put:
QComboBox::drop-down { image: url(:/images/res/drop-down.png); }The result is ok, just like:

while, when I add something like this:
QComboBox{ border: 1px solid red; font-size: 12px; } QComboBox::drop-down { image: url(:/images/res/drop-down.png); }The result is not what I imagined:

Here is my picture:

So, why is the result like this?
You probably need to set width and height of the drop-down.
-
@sierdzio So why it is ok when I do not add QComboBox {} block? And I also add width and height like:
QComboBox { border: 1px solid red; font-size: 12px; } QComboBox::drop-down { width 20; height 20; image: url(drop-down.png); }It not work, The result keeps like:

-
@sierdzio So why it is ok when I do not add QComboBox {} block? And I also add width and height like:
QComboBox { border: 1px solid red; font-size: 12px; } QComboBox::drop-down { width 20; height 20; image: url(drop-down.png); }It not work, The result keeps like:

Missing colons?
width: 20; height: 20; -
S ShannonW has marked this topic as solved on
-
S ShannonW has marked this topic as unsolved on
-
@sierdzio Thanks! I did ignore the comma, and now it is ok when set width and height to 20px. Now the question is why it is ok when I do not add QComboBox {} block?
-
S ShannonW has marked this topic as solved on