-2

I need to handle mouse moving.

I overrided function

void MouseMoveEvent(QMouseEvent *event)

And it works only when mouse button is pressed.

Ufx
  • 2,595
  • 12
  • 44
  • 83

1 Answers1

1

From documentation: "If mouse tracking is switched off, mouse move events only occur if a mouse button is pressed while the mouse is being moved. If mouse tracking is switched on, mouse move events occur even if no mouse button is pressed."

Read about setMouseTracking().

Silicomancer
  • 8,604
  • 10
  • 63
  • 130