Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between Clicked and Pressed in Qt?

Can you give me some help about how to distinguish Clicked and Pressed ? Thank you .. and What does Released means? would you give me a sample ?

like image 209
Mr.Tu Avatar asked Feb 26 '12 08:02

Mr.Tu


2 Answers

  • 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.

like image 160
Gergely Bacso Avatar answered Nov 05 '22 16:11

Gergely Bacso


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.

like image 7
f2lollpll Avatar answered Nov 05 '22 16:11

f2lollpll