Dynamic PropertyGrid with QML and C++



  • Hello.
    I have something like PropertyGrid defined in QML (using GridView element).
    I can add my elements (PGRow, which is a row with two rectangles with labels). I'm doing it using ListModel:

    @
    GridView {
    [...]
    delegate: rowDelegate
    model: pgModel
    }

    ListModel{
        id: pgModel
        objectName: "pgModel"
        ListElement{
            caption: "Property 1"
            value: "12345"
        }
    }
    Component{
        id: rowDelegate
        PGRow{
            caption: model.caption
            value: model.value
        }
    }
    

    @

    My problem is: I want to add rows dynamically using C++. How should I do it?
    I've read this: "Using QML Bindings in C++ Applications":http://doc.qt.nokia.com/4.7-snapshot/qtbinding.html but still have no idea how to get to the pgModel elements from C++.


Log in to reply
 

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