combobox should just show down-arrow but not drop-down button
-
Hello everyone,
I have a QComboBox for which i should just show the down-arrow icon& hide the drop-down button, i mean border sorrounding the down-arrow icon.
I tried with the following style sheet,QComboBox::drop-down:!editable {border: 0px; subcontrol-origin: padding; subcontrol-position: center right; } ");
this hides the down-arrow button too. but i want to show the down-arrow button but not border which surrounds it. Any idea how i can achieve this.?
-
combo box in the following image is what i want to achieve
https://www.google.ca/search?q=combo+box+images&espv=2&biw=1366&bih=599&source=lnms&tbm=isch&sa=X&ved=0CAYQ_AUoAWoVChMIgZiz2t7_yAIVghUeCh0nZwva#imgrc=e8dbdN9cVRyr8M%3AAny ideas would be greatly appreciated & Thanks in advance..
-
Hi,
Take a look at the QComboBox styling example as a base, Set border-left-width to 0 and you should have something work on.
Hope it helps
-
the code in here, QComboBox styling example din't work for me.
Also if i set the border-width or border-left-width to 0, the whole button is invisible.
What i want is the down arrow but not the drop down button.
Does anybody know how exactly Qcombobox laid out on it's subcontrols, coz that would give me a solution for this problem -
The arrow was missing ? If so it's because you don't have the file where the style sheet expects it. It's easy to fix by using e.g.
/path/to/qt5/qtbase/examples/widgets/widgets/stylesheet/images/down_arrow.png
It it's something else, what was not working ? On what platform ?
-
how can i use this arrow image @SGaist , can i use this directly in stylesheet.?
-
Yes, you can put that icon in a .qrc file and use it with the
:/
prefix