PDA

View Full Version : click on QImage and get QPoint



Qiieha
17th January 2012, 20:58
Hi,
how can I get the QPoint of a mouseclick on a QImage? I tried to subclass QImage and implement a QMouseEvent, but this is impossible...
What can I do? If I use the subjacent widget, the QPoint doesn't match with the QImage, because I use Qt::KeepAspectRatio.

thank u

Lykurg
17th January 2012, 21:08
QImage only holds the image informations. You can't reimp a mouse event there! First: How/where do you display the image. In that class you need to get the point. If the image is scaled, then you have to calculate the point yourself! But that shouldn't be a problem.

Qiieha
17th January 2012, 21:26
Thank u for your reply!
I use a QWidget.