Important: Please read the Qt Code of Conduct -

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

        id: pgModel
        objectName: "pgModel"
            caption: "Property 1"
            value: "12345"
        id: rowDelegate
            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": but still have no idea how to get to the pgModel elements from C++.

Log in to reply