PDA

View Full Version : Another question for QGraphicsScene.



aaron
13th April 2009, 07:05
Hi all,
I use QGraphicsItem ,QGraphicsScene and QGraphicsView classes to create and show some item, these item's shape is rectangle.
I have a new function is that add another item in the scene, when user press "A" key , a new small rectangle(QGraphicsItem) will be showing under mouse, and it can move when mouse moving.
My question is after zooming in the picture, pressing "A" key to add a new item, but the item can not be seen at the mouse's position. Why and how to fix it?
I use the "viewport()->mapFromGlobal(QCursor::pos())" to get the positon.
Thanks for your help!