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 [doc.qt.nokia.com] but still have no idea how to get to the pgModel elements from C++.
0 replies
You must log in to post a reply. Not a member yet? Register here!
