Reputation: 157
I want to add a help webpage for my Qt Application. The user can use the Qt::WhatsThis "tooltip" to have a explanation about the topic and a URL to a webpage. I edit the WhatsthisTooltips with the Qt Designer and have it language indepentend.
Now I create a "LinkFilter" class for filtering, install it in the viewclass and react on the QEvent::WhatsThisClicked event. This works fine.
Now i would catch every QEvent::WhatsThisClicked in my application, but i looks really messy to install it on really every dialog/view/action/widget. This there some kind of global eventHandler, were I can install my "LinkEvent"class? There must be a nice Qt style way for solving this.
For installing the EventFilter I strongly followed this video-tutorial http://youtu.be/DHgbYxpZkbg
Upvotes: 1
Views: 1729
Reputation: 17535
http://qt-project.org/doc/qt-4.8/qapplication.html#notify
Essentially you need to subclass QApplication
and override this function. Then you can check if it's the type of event you're looking for and act accordingly.
Upvotes: 3