How I can grab the mouse move even when I don't press a mouse button?
Guys,I have QWidget derived class. I seen that QAbstractScrollArea can get mouseMoveEvent when the mouse moves. But using just QWidget mouseMoveEvent handler, it is triggered only when there's a mousePressEvent (hold). So does someone knows how I can grab the mouse move even when I don't press a mouse button?
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Sachin SinghRank #66 · 26.2K reputationPosted Nov 20, 2020, 9:14 PM EST
mouseMoveEvent()is called whenever the mouse moves while a mouse button is held down. This can be useful during drag and drop operations.setMouseTracking(true), you get mouse move events even when no buttons are held down.Gopal153 reputationPosted Nov 20, 2020, 9:28 PM EST
Gopal153 reputationPosted Feb 25, 2021, 5:01 AM EST