[Qt-interest] Tracking mouse over label

Bo Thorsen bo at fioniasoftware.dk
Thu Jan 20 18:23:06 CET 2011


Den 20-01-2011 18:20, Nikos Chantziaras skrev:
> On 01/20/2011 07:15 PM, Cole, Derek wrote:
>> I have a label that I am using to display a QPixmap. I want to be able
>> to track the mouse any time it is crossing over the QLabel to give me
>> the XY coordinates of the image. I see that there is a mouseTracking
>> checkbox in QtCreator that I checked, but how do I get the mouseover
>> event on the label?
> You need to subclass from QLabel and reimplement the event handler.

Or set an event handler if you don't want to subclass just to get those 
coordinates.

Bo Thorsen,
Fionia Software.

-- 

Expert Qt and C++ developer for hire
Contact me if you need expert Qt help
http://www.fioniasoftware.dk




More information about the Qt-interest-old mailing list