How I can create a interactive TreeView using QML?
-
I want to create an interactive TreeView using QML, a tree that will expand and vice-versa, can someone give a code snippet on how I can do that, or maybe a reference on where I can learn how I can do that? thank you
-
I want to create an interactive TreeView using QML, a tree that will expand and vice-versa, can someone give a code snippet on how I can do that, or maybe a reference on where I can learn how I can do that? thank you
@mandruk1331 If you search for "qml treeview" on Google you will find http://doc.qt.io/qt-5/qml-qtquick-controls-treeview.html
Isn't that what you are looking for? -
@mandruk1331 If you search for "qml treeview" on Google you will find http://doc.qt.io/qt-5/qml-qtquick-controls-treeview.html
Isn't that what you are looking for?@jsulm yes. But the problem that I don't really get how to build a tree model, it has to be like an ordinary tree and then I have to pass the object of the completed tree to QML?
-
@jsulm yes. But the problem that I don't really get how to build a tree model, it has to be like an ordinary tree and then I have to pass the object of the completed tree to QML?
@mandruk1331 You need to provide a model like in the example:
TreeView { TableViewColumn { title: "Name" role: "fileName" width: 300 } TableViewColumn { title: "Permissions" role: "filePermissions" width: 100 } model: fileSystemModel }
If you need something special, then you will need to implement such a model by yourself.