QML TreeView
-
@VeNToR There is no built-in way in QML to do this. You have to have a
QAbstractItemModel
implementation. I recall seeing people discussing making a reusable model implementation that can be configured from data defined in QML but unless you can find something like this ready made somewhere, you will have to implement something in C++. -
@VeNToR
TreeView
can be quite daunting when first encountered, especially if you are new to QML and Qt. It can be useful to start with an example that someone has already made and try to make changes that make it closer to your requirements. This should help you to understand how to implement a model. You might either end up gradually adapting it to what you need, or at some point you will be sufficiently confident to start from scratch based on the knowledge you have gained.If I remember correctly, this is one I referred to myself when I started out. I believe it's an adaptation to QML of one of Qt's own C++ QWidgets examples.
-
@Bob64 Thank you again... I'm not new on Qt and QML, but this is first time to use TreeView :) On the other hand, how can I extent my extension as ListElement feature like dynamic role ?
like follows;MyElement
{
myRole : "test"
.
..
...
}"myRole" is dynamic (you can add many...), but my extension's must be defined by Q_PROPERTY.
when I use any undefined role/property by Q_PROPERTY, I get this "Cannot assign to non-existent property" error.