How can I know when the application is not being used, ex:
user switches windows, minimizes app, etc..?
How can I know when the application is not being used, ex:
user switches windows, minimizes app, etc..?
One option is QWidget::hasFocus() or the focusOutEvent().
I thought hasFocus() only applied to keyboard focus, as stated in the documentation.
Besides hasFocus() are there other methods?
Scan the input events.
If for a certain amount of time there's no input event, then there is a probability that it is not being used (not a certainty)
As for minimizing, there's an event for that too.
The switching windows is handled by the focus event as already stated.
Bookmarks