Right click with mouse
-
Hello.
I made a minesweeper game and i want to implement the "put flag" function.
I want to put the flag on a PushButton by right clicking.How can i implement that?
Some sort of
"If rightClick
then put flag"
many thanks.
-
How?
Is there an example available?
Thanks.
-
You can overwrite the mouse event of the button "mousePressEvent":http://doc.qt.nokia.com/4.7/qwidget.html#mousePressEvent or install an event Filter for the buttons in you parent class. How to do that, have a look at the documentation. How to do that, "have a look at the docs":http://doc.qt.nokia.com/4.7/qobject.html#installEventFilter
-
Many thanks :-)