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();
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();
To copy to clipboard, switch view to plain text mode
all objects added to the scene are displayed correctely, but
cout << " moved to: X->" << event->pos().toPoint().x();
cout << " moved to: Y->" << event->pos().toPoint().y() << endl;
event->accept();
}
void GraphicsScene::mouseMoveEvent( QGraphicsSceneMouseEvent *event ) {
cout << " moved to: X->" << event->pos().toPoint().x();
cout << " moved to: Y->" << event->pos().toPoint().y() << endl;
event->accept();
}
To copy to clipboard, switch view to plain text mode
always results in X->0 and Y->0
why is that so?
Bookmarks