Answer the question
In order to leave comments, you need to log in
Qt. How to combine mouseMoveEvent and mousePressEvent events?
It is necessary to draw a rectangle (I was going to do this by calling paintEvent) while holding down the left mouse button, and after releasing it, place this rectangle in a vector.
It is clear that for clamping - mousePressEvent, for tracking movement - mouseMoveEvent, and for releasing - mouseLeaveEvent (I enabled mouseTracking). The question is, how do I combine the actions of these events? After all, you need to draw not when moving, and not when clamping, but when clamping and moving at the same time.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question