[Solved] Custom layouting



  • Hi,

    As I understand, you can add custom shapes in Qml (QtQuick 2) with QQuickItem/QQuickPaintedItem...
    But is there a way to implement custom views/containers in C++ ? Like some QQuickContainer class ?

    How does one implement some complex/dynamic layouting (treeview, mindmapview) in Qml ?

    Alternatively, is there a way to embed Qml shapes/nodes into a complex OpenGL view ? (the opposite is described here : http://qt-project.org/doc/qt-5.0/qtquick/scenegraph-openglunderqml.html )



  • There is nothing particularly magic about implementing custom views that separate them from implementing custom shapes in C++. Any QQuickItem can be a container with children so there is no special container class. You would simply derive from QQuickItem and operate on the x and y coordinates of child items.

    That said, it will probably take a bit more effort to get it working properly. As a starting point, you could take a look at the existing implementations of Row or Column in the qt sources. (qquickpositioners)



  • Thanx for the suggestion =)


Log in to reply
 

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