Unsolved Need help for a TreeView
-
@Fheanor Hi, so I didn't manage to make it work, now just forget about the Rectangle thing, I just want to make a Treeview so can you help me ?
-
-
@Fheanor I have some assigning the model value, the example that you gave me the TableViewColumn part work but not the model one, Qt tell me that fileSystemModel doesn't exist. Actually I just want to add some "node" or p"parent" to my Treeview and of course some "children" I suppose it has a link with the model but I don't know how to do it. Hope it is more clear now. Thanks again for your time !
-
@Arkning
This example is in your QtExample folder.
Just open your IDE, click onExamples
and then write :TreeView
. You will see the project. -
@Fheanor I don't have Examples on my IDE... Where should it be on the screen ?
-
-
@Arkning Do you use QtCreator ? Because there are Examples folders in it.
If you don't use it, download and install QtCreator. -
@Fheanor Yes I'm using QtCreator
-
@Arkning This is on the Welcome page of your IDE... There is an Example Button
-
@Fheanor Ok I found it but how can it help me ? I don't see were they create parent or children.
-
@Fheanor said in Need help for a TreeView:
You can also create a TreeModel in C++ and then bind it to your Qml TreeView :
model: myTreeModel
If you don't understand how to bind model and view, have a look on this
-
@Fheanor The problem is for now I only use Qml I'm not coding in C++ so do you know how to do it in Qml ?
-
@Arkning I don't know any way to create a TreeModel in Qml, sorry. I think you need to create your model in C++ if you want to use a TreeView
-
@Fheanor Ok, anyway thanks for your time I hope I will find how to do it...
-
Hi Arkning,
As Fheanor already suggested, you need to make a model.
To do it in Qt C++ you can follow The simple Tree model example to help you fully understand how it works.
You're lucky because It has been converted to QML
Hope it helps
Eddy
-
@Eddy Thanks, but I've checked it and It didn't help me out, sorry.