teorias
7th March 2011, 02:48
Hi!
I'm using the code from example "elastic nodes " (http://doc.trolltech.com/4.3/graphicsview-elasticnodes.html) and I'm add some things to this example like right buttons mouse events.
I would like to create this scenario:
-> right click in a node: open a context menu
-> right click in other point of scene that it isn't a node: create a node
In the graphicwidget I created the GraphWidget::mousePressEvent(QMouseEvent *event)
and i want to know in this function if there are some node in the position of the event.
The problem is that the position is in view coordinates and i want in scene coordinates... to use in method itemAt(http://doc.qt.nokia.com/4.6/qgraphicsscene.html#itemAt)
Other problem is that i use the method items() (http://doc.qt.nokia.com/4.6/qgraphicsscene.html#items) but i get <unavailable synchoneous data> why?
Thanks for any help...
João
I'm using the code from example "elastic nodes " (http://doc.trolltech.com/4.3/graphicsview-elasticnodes.html) and I'm add some things to this example like right buttons mouse events.
I would like to create this scenario:
-> right click in a node: open a context menu
-> right click in other point of scene that it isn't a node: create a node
In the graphicwidget I created the GraphWidget::mousePressEvent(QMouseEvent *event)
and i want to know in this function if there are some node in the position of the event.
The problem is that the position is in view coordinates and i want in scene coordinates... to use in method itemAt(http://doc.qt.nokia.com/4.6/qgraphicsscene.html#itemAt)
Other problem is that i use the method items() (http://doc.qt.nokia.com/4.6/qgraphicsscene.html#items) but i get <unavailable synchoneous data> why?
Thanks for any help...
João