PDA

View Full Version : QGraphicsView: Ladder editor - move object in a "grid"



PeterMacGonagan
7th July 2011, 07:48
Hello :),

I would like to make a Ladder Editor (for simulation). Here is a video which shows what I would like to do:

http://www.youtube.com/watch?v=L6VFGb7t-04


I would like to make a widget which can build a network. The items in the widget could be moved like in the video: it's my main problem! How to do that? :confused:
A listbox permits to link a contact to the PLC (IN, OUT, MEMORY).
The grid can have a fixed width by default (10 elements for example).
A network drives only one coil.
There are three types of coil: NORMAL, SET AND RESET.


For the moment, my contacts and my coil are derived from QGraphicsWidget. I enabled their "selectable" properties. All is working but I don't know how to move them (Do I have to use their "movable" properties?)

It's a holiday project.

Thank you in advance ;)