The error is pretty clear.
QMouseEvent *mouse;
– you declare a pointer to the a QMouseEvent, but where is it instantiated? This is only a pointer which points to something.
If you want to handle mouse events you probably have to overload some kind of widget’s mouse event (mouseMoveEvent
, mousePressEvent
, etc.). Those will provide you a valid QMouseEvent input.
4
solved Shift key click in qt?