Setting CSS width and height for QComboBox::drop-down and QComboBox::down-arrow
Solved
General and Desktop
-
Hi all,
I am trying to set the CSS for the dropdown and down-arrow but it seems to be ignored:
The QComboBox I am addressing has a QLineEdit and a QCompleter, so some users complain that the down-arrow is too small for them to hit it with fingers on the touch screen.This is how it looks before applying the css
and after
#1206::down-arrow { width: 70px; height: 70px; } #1206::drop-down { width: 70px; height: 70px; }
I get this
The style changes to somewhat ugly but the size is not set.
What is the proper way to set the width/height for it?
--EDIT
To add: the Style is set to Fusion withQApplication a(argc, argv); //... a.setStyle(QStyleFactory::create("Fusion"));
in the main.cpp
Thanks in advance
r
-
why you not use stylesheet?
QComboBox[urgent = false] {color: black; border: 3px solid #5E749C;text-align: top;padding: 4px;border-radius: 7px; border-bottom-left-radius: 7px;background: white;width: 15px;height: 54px;} QComboBox[urgent = true] {color: black; border: 3px solid #5E749C;text-align: top;padding: 4px;border-radius: 7px; border-bottom-left-radius: 7px;background:#19ff4f;width: 15px;height: 54px;} QComboBox:drop-down {font-weight: bold;color: #5E749C; border: 3px solid #5E749C;border-radius: 4px;background: rgb(242, 242, 242, 150); background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #FFFFFD, stop: 0.3 #96ADB2);width: 44px; max-height: 44px;} QComboBox:down-arrow {image: url(/home/st/Qt/B/C/res/downarrow.png); width: 24px; height: 24px;}
arrow size is related to QCombobox size ... but stylesheet can help you to break these link.
regards
Giorgio -