[Qt-interest] QGraphicsSceneMouseEvent questions

Yifei Li yifli at mtu.edu
Thu Nov 5 03:43:00 CET 2009


I made a stupid mistake, answer this one by myself. 

I did not notice scenePos() returns QPointF instead of QPoint, I should have printed out the result as floating point number instead of integers.


----- Original Message -----
From: "Yifei Li" <yifli at mtu.edu>
To: "qt-interest" <qt-interest at trolltech.com>
Sent: Wednesday, November 4, 2009 9:05:10 PM GMT -05:00 US/Canada Eastern
Subject: [Qt-interest] QGraphicsSceneMouseEvent questions

Hi,

I reimplemented mosuePressEvent(QGraphicsSceneMouseEvent* event) in a class derived from QGraphicsScene.

But no matter where in the scene mouse is clicked:

1) event->pos() always returns (0, 0) 


event->screenPos() works correctly.

Why is that? All I want is where the mouse is pressed in the scene.

Does any one have an answer? Thanks

Yifei 
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest



More information about the Qt-interest-old mailing list