1 year ago

#62472

test-img

David Fleury

Qt6 - QComboBox applying style(sheet) to one specific item

In a QComboBox, I have an item list. One of this item is the default value (whatever the item currenlty selected).

enter image description here

For example, here, the current selected item is "INST IN", but the default value is "ALL" for this combobox.

Currently, I am using cb->model()->item to call setForeground, setBackround and changing the font. But this disable the stylesheet.

Is there a way to acheive this using stylesheet only ? (I have not seen any property available in QStandardItem for example).

or any other idea to "view" this default value ?

Regards,

c++

qtstylesheets

qcombobox

qt6

0 Answers

Your Answer

Accepted video resources