Create application to build diagrams
-
Hello,
I'm trying to build an application that must have a work panel containing some images (in SVG format); they represent some pieces, and can be dragged, connected in between, etc...
For now, I've drwn a widget with SVG inside, by sub-classing QWidget. Now, I would ask you for some techniques to be able to drag, drop, connect with lines and all this stuff with these items that are inside it. I am a bit lost, because I ve never created a such application.
Thank you.
-
Investigate "Qt Graphics View Framework":https://qt-project.org/doc/qt-4.8/graphicsview.html. QML could also help you here.
-
don't you think that such a application is too much for your current skills then? I think when we start helping you we would end up writing the application for you...
You should check out the resources on the web for drag-n-drop and QGraphicsView i would say. Then make a rough overview of the concept and how you could implement each feature with the given technology. Then connect each piece with each other.
-
Also check the examples in QtCreator for this! Use this as basis for a demo app and combine these pieces of information to a newly designed app.
Greetz -
This thread might be useful:
http://qt-project.org/forums/viewthread/23246/#115372Also, I tried something similar and was able to draw a line connecting 2 points (even after dragging them around) in QML + JS code, by means of the Canvas element in QtQuick 2.
-
Just in case it's (even marginally) useful, I uploaded the proof of concept (and full of commented code which was a Work In Progress) line connection code which I just talked about: