View Full Version : ComboBox StyleSheet Help
ale6111
29th July 2010, 14:07
Hi,
I'm a bit noob whit stylesheet since I never used before and I can't understand how I can change down-arrow style.
Please look at attachments to understand.
The first image is what I have, the second what I would.
Can someone help me.
Thanks
Ginsengelf
29th July 2010, 14:18
Hi, please show us your current style sheet.
Ginsengelf
ale6111
29th July 2010, 14:22
At the moment I only have this:
QFontComboBox::down-arrow {
image: url(:/buttons/Icons/down_arrow.png);
}
QFontComboBox {
border: 1px solid gray;
border-radius: 3px;
}
Ginsengelf
29th July 2010, 15:53
Hi, have you tried to use drop-down instead of down-arrow? This should access the whole button, not only the image.
Ginsengelf
ale6111
29th July 2010, 16:30
I tried but it replace also the part where the text should be put not only the button.
GreenScape
29th July 2010, 17:04
At the moment I only have this:
QFontComboBox::down-arrow {
image: url(:/buttons/Icons/down_arrow.png);
}
QFontComboBox {
border: 1px solid gray;
border-radius: 3px;
}
use 'background:' insted of 'image:'
here example
QComboBox::down-arrow {
background: url(:/Resources/mail.png);
};
or better would be using QComboBox::setIconSize ( const QSize & size ).
and the best would be reimplementing QComboBox::paintEvent ( QPaintEvent * )
ale6111
29th July 2010, 17:17
Background doesn't show nothing
GreenScape
29th July 2010, 17:29
Background doesn't show nothing
set desired icon size with QComboBox::setIconSize ( const QSize & size ); before setting your stylesheet for combobox, and be happy.
ale6111
29th July 2010, 18:59
I solved in this way:
QComboBox {
border: 1px solid black;
border-radius: 3px;
}
QComboBox::drop-down {
width: 32px;
border-top-right-radius: 3px;
border-bottom-right-radius: 3px;
}
QComboBox::down-arrow {
image: url(:/buttons/Icons/down_arrow.png);
width: 32;
height: 32;
}
shrawan0786
1st December 2010, 12:14
Hi All,
I know this is old thread but my problem is related to Combobox (Qt on Symbian), So I am placing my points here. I have created 1 combo-box in Qt on Symbian S60 5th edition & it is looking fine on N97, Nokia5800 & others. I have ported my application on Nokia N8 device which is new Symbian^3 device, but here the selected item of combo box is not looking proper, you can see the attachment. I am new in Qt, Could you please guide me, how can I fix this issue. I think I have to use custom style-sheet for selected items, but don't know how to do..
Thanks in advance...
Shrawan.
Tomasz
20th December 2010, 14:34
Hello!
I'm trying to change width of down-arrow space. Now I have:
QComboBox {color: #FFFFFF; background-color:#000000;}
QComboBox::drop-down {border: solid; width: 45px;}
QComboBox::down-arrow {image: url("/downArrow.png"); width: 25px; height: 25px;}
But the down-arrow space, whatever I do is always very thin. Any idea?
thanks in advance
best regards
Tomasz
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.