How to change color border QComboBox only?
-
@vinh not surprising, you have with that overwritten all default stylesheet settings and only specified an universal border
take a look at this extensive stylesheet example, what else you can modify in combination with what selector
https://doc.qt.io/qt-5/stylesheet-examples.html#customizing-qcombobox
-
Hi,
When you use style sheets you have to do the complete styling. Style sheets ignores the original style used to draw the controls.
-
Depending on what you want to use that border color for you could consider using a QRubberBand.
-
Hi
You could also put the QComboBox in a QFrame+layout.
(set all margins on layout to zero)
-
@vinh
Hi
Make sure to set the style sheet on the QFrame (ONLY)
and change it so it says
"QFrame {border: 1px solid red;}"So you don't affect the Combobox inside. but only the QFrame.
So no stylesheet on Combobox but only on QFrame.