[Solved] Window Active Focus signal
-
Is there a way to know when a window looses active focus without polling isActiveWindow? I would like to connect to a signal if possible.
-
-
you are looking for the focus or for isActiveWindow? that's a difference, because for the activeWindow, one child may also have the input focus.
If it's about activeWindow, you could check "QWidget::changeEvent":http://doc.qt.nokia.com/4.7/qwidget.html#changeEvent and emit a custom signal
-
I used the focusChanged signal from QApplication.
I feel like there should be a better way of doing this without having to watch every focus changed event and check if its the focus change I'm looking for.
Thanks for the help.
-
[quote author="bundickt" date="1312305933"]I feel like there should be a better way of doing this without having to watch every focus changed event and check if its the focus change I'm looking for.[/quote]
The point here is, there are many things that could be more elegant for few people, but then we would have thousands of signals.
-
Personally I like the idea of having thousands of signals.
Qt Quick seems to be designed with this philosophy.