Mr.Tu
Mr.Tu

Reputation: 2733

What is the difference between clicked and pressed in Qt?

How do I distinguish between Clicked and Pressed?

What does Released mean?

Upvotes: 29

Views: 26600

Answers (2)

Gergely Bacso
Gergely Bacso

Reputation: 14651

  • Pressed: event is generated when you push down the mouse button

  • Released: event is generated when you release the mouse button (which has been pressed down before)

  • Clicked: event is generated when a mouse button Pressed & Released.

With these functions you can create a snap-switch for example:

when you press the button, the light will switch off / the music stop / etc , when you release it, light switches back on / the music starts again etc.

Upvotes: 59

f2lollpll
f2lollpll

Reputation: 1007

Clicked is a complete click (press and release), released is when you let go of the mouse button and pressed is when you press down on your mouse button.

Upvotes: 8

Related Questions