harakiri
3rd March 2008, 13:34
hi, i have a QGraphicsScene in a QGraphicsView:
view = new GraphicsView( this );
scene = new GraphicsScene( this );
scene->setSceneRect( 0.0, 0.0, 512.0, 512.0 );
scene->add....(...
....
view->setScene( scene );
view->show();
all objects added to the scene are displayed correctely, but
void GraphicsScene::mouseMoveEvent( QGraphicsSceneMouseEvent *event ) {
cout << " moved to: X->" << event->pos().toPoint().x();
cout << " moved to: Y->" << event->pos().toPoint().y() << endl;
event->accept();
}
always results in X->0 and Y->0
why is that so?
view = new GraphicsView( this );
scene = new GraphicsScene( this );
scene->setSceneRect( 0.0, 0.0, 512.0, 512.0 );
scene->add....(...
....
view->setScene( scene );
view->show();
all objects added to the scene are displayed correctely, but
void GraphicsScene::mouseMoveEvent( QGraphicsSceneMouseEvent *event ) {
cout << " moved to: X->" << event->pos().toPoint().x();
cout << " moved to: Y->" << event->pos().toPoint().y() << endl;
event->accept();
}
always results in X->0 and Y->0
why is that so?