cnd
cnd

Reputation: 33794

Is it possible to connect to QApplication notify signal?

I've seen example of QApplication::notify usage here: How to detect if a Qt GUI application has been idle, inside the app itself (Qt)?

I need to do the same without basing QApplication method. qApp has connectNotify method so I suppose it should be possible just to make own action on notify signal.

If that is possible I need basic example how can I connect to this event.

Upvotes: 3

Views: 676

Answers (1)

nh_
nh_

Reputation: 2241

Maybe you should have a look at event filters, which you can install for all QObjects: QObject::installEventFilter.

Write your own class, which you inherit from QObject and implement the eventFilter method, where you insert your event processing logic. Then install an object of this class to your QApplication instance (qApp for example)

Upvotes: 2

Related Questions