Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Drawing with QML
a4030687 last edited by
I am planning to expand a project and have some general questions you may can help me with.
Currently I am programming with QWidgets only (Qt 4.7.4, cannot change the version). For a GUI I want to compare QWidgets and QML.
What I want to display is a graph. There are nodes(moveable) and edges(fixed. calculated by node pos). Both have geometric attributes which describe them.
With QWidgets I use QGraphicItems/QGraphicsScene/QGraphicsView to display my graph. I created some easy QML GUIS with tutorials only so I dont have much experience.
I also have basic knowledge with OpenGL, but im not sure if this is the right thing to do here.
There are some things that need to be possible.
- I want to use my QGraphicsItems derived models so I can choose between QML and QWidget (expanding the models with geometric properties is enough?)
- Some objects should be fixed, some moveable. Moving a object should emit a signal, redrawing the edges connected to it.
- Objects need access to model function. E.g getting a QMenu getContextMenu() and display it as context menu.
- Export the Graph to PDF/SVG
- Zooming and selecting an area should be possible. The selected elements should be returned in some way.
Is there something like a QGraphicScene/View in QML(VisualItemModel??)? I am not sure if using OpenGL is a good idea, since the graphic is not read-only and must be interactive.
Is this even possible with QML 4.7? If not, would it be in QML 5?
Any suggestion or hints would be great. Thanks in advance.