Trace application notification handler events if longer than 2 ms

This commit is contained in:
Brad Davis 2019-03-26 13:32:29 -07:00
parent 36cecef166
commit 413091fed3
2 changed files with 10 additions and 0 deletions

View file

@ -3961,6 +3961,15 @@ static void dumpEventQueue(QThread* thread) {
}
#endif // DEBUG_EVENT_QUEUE
bool Application::notify(QObject * object, QEvent * event) {
if (thread() == QThread::currentThread()) {
PROFILE_RANGE_IF_LONGER(app, "notify", 2)
return QApplication::notify(object, event);
}
return QApplication::notify(object, event);
}
bool Application::event(QEvent* event) {
if (_aboutToQuit) {

View file

@ -156,6 +156,7 @@ public:
void updateCamera(RenderArgs& renderArgs, float deltaTime);
void resizeGL();
bool notify(QObject *, QEvent *) override;
bool event(QEvent* event) override;
bool eventFilter(QObject* object, QEvent* event) override;