In Qt4 is there a way to know from inside a widget if the focus has been lost?
I am trying to design a couple of simple widgets in order to get a better knowledge of Qt 4. (This is my first attempt at desktop programming - coming from a background of web development)
One of these widgets is formed from a label, and a tool window which pops up when the label is clicked.
My question is related to a method for the original widget to know when it loses mouses focus (ie, the user clicked somewhere开发者_运维百科 else than inside the pop-up or the label) so it can hide the pop-up.
There are focusInEvent
and focusOutEvent
events. You can override these to get notified about focus changes.
精彩评论