nilot
3rd November 2016, 13:28
Hello,
In my custom QGraphicsScene class, I display the following two values :
void MainScene::contextMenuEvent(QGraphicsSceneContextM enuEvent *event)
{
qDebug()<<views()[0]->mapToScene(event->screenPos());
qDebug()<<event->scenePos(); // not equal to the previous value
QGraphicsScene::contextMenuEvent(event);
}
I don't understand why the two values are different. How can I map event->screenPos() to scene coordinates correctly ?
Thank you
In my custom QGraphicsScene class, I display the following two values :
void MainScene::contextMenuEvent(QGraphicsSceneContextM enuEvent *event)
{
qDebug()<<views()[0]->mapToScene(event->screenPos());
qDebug()<<event->scenePos(); // not equal to the previous value
QGraphicsScene::contextMenuEvent(event);
}
I don't understand why the two values are different. How can I map event->screenPos() to scene coordinates correctly ?
Thank you