QComboBox styling is not dyamic
Unsolved
General and Desktop
-
Hey!
I am having a problem with QComboBox:
-
I will show you a picture of my closed QComboBox
-
This is opened:
-
When closed again:
-
When hovered:
As you can see I have a problem of combobox now changing style on close, but staying in its "opened " style.
Here is my combobox code:
// Create filter combo box QComboBox *filterComboBox = new QComboBox(); filterComboBox->addItem("All"); filterComboBox->addItem("Errors"); filterComboBox->addItem("Warnings"); filterComboBox->addItem("Ok"); filterComboBox->setFixedSize(250, 50); filterComboBox->setStyleSheet( "QComboBox {" " border-radius: 10px;" " background: qradialgradient(cx:0.5, cy:-0.3, radius:1.2, " " fx:0.5, fy:0.0, stop:0 #555555, stop:1 #222222);" " border: 2px solid #E67A4A;" /* Solid red border */ " padding: 5px;" " color: white;" " font-size: 16px;" "}" /* Remove the dropdown button */ "QComboBox::drop-down {" " border: none;" " background: transparent;" " width: 0px;" "}" /* Dropdown menu styling */ "QComboBox QAbstractItemView {" " background: qradialgradient(cx:0.5, cy:1.3, radius:1.2, " " fx:0.5, fy:1.0, stop:0 #555555, stop:1 #222222);" " color: white;" " border-top: 0px;" " border-left: 2px solid #E67A4A;" " border-right: 2px solid #E67A4A;" " border-bottom: 2px solid #E67A4A;" " padding: 5px;" " border-bottom-left-radius: 10px;" " border-bottom-right-radius: 10px;" "}" /* When the dropdown is open */ "QComboBox:open {" " border-top-left-radius: 10px;" " border-top-right-radius: 10px;" " border-bottom-left-radius: 0px;" " border-bottom-right-radius: 0px;" " border-top: 2px solid #E67A4A;" " border-left: 2px solid #E67A4A;" " border-right: 2px solid #E67A4A;" " border-bottom: 0px;" "}"); hbox->addWidget(filterComboBox);
Thank you in advance!
Qt version: 6.6.2
-
-
Hi,
Which OS are you on ?
With 6.7.2 on macOS 14.7 I don't have the issue you describe however the position of the drop down is different when opened. -
Hi,
Which OS are you on ?
With 6.7.2 on macOS 14.7 I don't have the issue you describe however the position of the drop down is different when opened.