PDA

View Full Version : How to get mouse events from qgraphicswidget



newtolinux
21st October 2010, 09:18
Hi,
I have placed some qgraphicswidgets on a scene. i want to write call back function while widgets were dragged. some one please tell me how can i do that.( how to get signals from widgets)

high_flyer
21st October 2010, 10:20
Wait...
Can you lease explain in more detail what it is you want to do?

newtolinux
21st October 2010, 10:49
Here is the description:

I have a qgraphicsscene. on top of it i have placed a qgraphicswidget(its is icon image). If i drag this icon i need to do some custom operation. Now how can i catch the mouse events when i clicked or dragged my icon.How can i register and call the callbacks for these events. can you PLEASE explain me with some sample code if possible?

lyuts
21st October 2010, 13:12
Get the Qt's source code, unpack it and go to examples/draganddrop directory. I think that will be enough at this point. Good luck.

high_flyer
21st October 2010, 13:42
See QGrpahicsWidget doc.
Look for the various event handlers.