how to hide the drop-arrow in the Combobox?
Solved
General and Desktop
-
Hi @opengpu
Customizing the Combobox is best solution.
For
QComboBox
usingsetStyleSheet()
Refer Qt : Qt Style Sheets Examples
Refer QML : ComboBoxStyle QML TypeExample :
QComboBox
QComboBox *_cb = new QComboBox(this); _cb->setStyleSheet("QComboBox::drop-down { " "subcontrol-origin: padding; " "subcontrol-position: top right; " "width: 15px; " "border-left-width: 1px; " "border-left-color: darkgray; " "border-left-style: solid; "/* just a single line */ "border-top-right-radius: 3px; "/* same radius as the QComboBox */ "border-bottom-right-radius: 3px; " "}");
Example:
ComboBox
ComboBox { width: 200 model: // provide the model style: ComboBoxStyle { renderType : Text.NativeRendering background: Rectangle { implicitWidth: 100 implicitHeight: 25 border.width: 1 } label: Label { anchors { fill: parent left: parent.left leftMargin: 5 } font.pixelSize: 12 text: control.currentText verticalAlignment: Qt.AlignVCenter } } }
All the best.
-
Hi @opengpu
Was that helpful ?
Can you make the ticket as SOLVED if you have got the solution ?Thank You.