QComboBox foregroun color not displayed in main widget
-
Hey
I'm trying to set different color of text per item. However when the item gets picked the color is still as "standard" and not the one I set.. Any hints?
self.comboTest = QComboBox() self.comboTest.addItems(["test A", "testB", "testC"]) self.comboTest.setItemData(1, QBrush(Qt.red),Qt.ForegroundRole ) self.comboTest.setItemData(2, QBrush(Qt.blue), Qt.ForegroundRole )
Any ideas?
TIA
-
Hi
That sets the colors when drawn.
It sounds like you want to also change the selection color ?https://forum.qt.io/topic/108718/change-qcombobox-popup-highlighted-item-background-color/12
-
@mrjj said in QComboBox foregroun color not displayed in main widget:
Hi
That sets the colors when drawn.
It sounds like you want to also change the selection color ?https://forum.qt.io/topic/108718/change-qcombobox-popup-highlighted-item-background-color/12
So in a "human" test it works, if I set it, it works properly. But when I try to load my settings and set it "programmatically", even tho it says it sets pallets (btw I had to use ButtonText). Then it does not work... sigh. Its bananas. Will try to make simple examples.