Drawing with QML

  • Hi everyone,

    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.

    1. I want to use my QGraphicsItems derived models so I can choose between QML and QWidget (expanding the models with geometric properties is enough?)
    2. Some objects should be fixed, some moveable. Moving a object should emit a signal, redrawing the edges connected to it.
    3. Objects need access to model function. E.g getting a QMenu getContextMenu() and display it as context menu.
    4. Export the Graph to PDF/SVG
    5. 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.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.