Thanks for the replies. That's right d_stranz. But hovering over the modal window if open generates events. That would be sufficient for me. Anyway, just for the understanding, is that what you meant: ?
int main(int argc, char *argv[]){
MainWindow w;
w.installEventFilter(&a);
w.show();
return a.exec();
}
int main(int argc, char *argv[]){
QApplication a(argc, argv);
MainWindow w;
w.installEventFilter(&a);
w.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
If so, where do I locate the SLOT, which I modified as follows:
// track user-interaction
// check for specific content of "event" and react
if (event
->type
() == QEvent::KeyPress || event
->type
() == QEvent::MouseMove){ activityHappened = true;
}
// pass event to parent for further use
}
// track user-interaction
bool MainWindow::eventFilter(QObject *obj, QEvent *event){
// check for specific content of "event" and react
if (event->type() == QEvent::KeyPress || event->type() == QEvent::MouseMove){
activityHappened = true;
}
// pass event to parent for further use
return QMainWindow::eventFilter(obj, event);
}
To copy to clipboard, switch view to plain text mode
To me as a non prof that's a little confusing. Sorry again for that.
Thanks so much. Regards, Lars
Bookmarks