[Interest] QGraphicsSceneMouseEvent, mapFromScene...

Dmitrii Volosnykh dmitrii.volosnykh at gmail.com
Tue Apr 29 13:14:29 CEST 2014


As for me the output of the code below is as expected when placed into
QGraphicsItem::mousePressEvent():

    qDebug() << "scene:" << event->scenePos();
    qDebug() << "map to scene:" << mapToScene(event->pos());
    qDebug() << "local:" << event->pos();
    qDebug() << "map to local:" << mapFromScene(event->scenePos());

Probably, you have messed up with screenPos() and scenePos() methods
of QGraphicsSceneMouseEvent class? Please, double check your test code.

Regards,
Dmitrii.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140429/cd836822/attachment.html>


More information about the Interest mailing list