PDA

View Full Version : Custom Widget gaining Focus



NIteLordz
15th September 2016, 15:03
I currently have a custom widget that has two children, QLabel and QComboBox. I want to change the stylesheet of the QLabel when the QComboBox gains focus, and loses focus. Currently i have a version working, however, when the QComboBox opens, and the popup displays, QComboBox loses focus ( I presume so that the popup can gain focus ), however, i can not track the popup focus events.

Suggestions ?

wysota
16th September 2016, 10:01
Why can't you track popup focus events?

NIteLordz
16th September 2016, 17:48
I am not sure how to gain focus of from the popup menu.

I have solved my issue by overriding showPopup and hidePopup and use them as focus getter.

Would like a more elegant way of doing this, if you know of one.

anda_skoa
17th September 2016, 10:05
Sounds pretty elegant to me.

These two methods indicate the beginning and the end of the "override" state in which your normal tracking doesn't apply.

Cheers,
_