Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Right click with mouse
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
then put flag"
dangelog last edited by
Override the mouse events and implement the logic.
Is there an example available?
giesbert last edited by
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 :-)