PDA

View Full Version : Mouse events



Maluko_Da_Tola
24th August 2010, 20:32
Hi,

I have an aplication that consists in a window with several widgets, such as buttons and labels. I would like to get the mouse clicking events that occur in one of the labels. Do I have to create a custom label to get these mouse events?

Thanks

Lykurg
24th August 2010, 21:34
You can install an event filter and catch the events and handle them. See QObject::installEventFilter().

Maluko_Da_Tola
25th August 2010, 01:24
Do you know of any good tutorial on event filters?

Cheers

Lykurg
25th August 2010, 07:55
I found the description in the doc right under QObject::installEventFilter() useful enough but you can also have a look at http://www.qtrac.eu/marksummerfield.html and download the free 1st edition of C++ GUI Programming with Qt 4 and read the chapter about event processing.