Issue
By default, QDialog
windows have a question mark pushbutton in the upper-right corner. When I press it, the mouse cursor is changed to the 'Forbidden' cursor, and nothing else seems to happen.
While there is lots of information generated from those who want to remove the question mark (at least three SO threads are devoted to the topic), the documentation for QDialog doesn't have anything about how to actually use it.
How do I get my application to display information when the question mark is clicked? E.g., how do I get the clicked
signal from the button? Better yet, where is this button documented?
Solution
It is not a button documented by Qt. You can detect this by catching events and checking event type:
http://qt-project.org/doc/qt-5/qevent.html#Type-enum
There are different types as QEvent::EnterWhatsThisMode
QEvent::WhatsThisClicked
and so on. I achieved something similar to what are you looking for using event filter in mainwindow.
if(event->type() == QEvent::EnterWhatsThisMode)
qDebug() << "click";
I saw "click" when I clicked on ?
button.
Answered By - Jablonski
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.