Unsolved QTreeview with QStandardItemModel
-
I would like to create treeview using qstandarditem model.The treeview should be in the following format(Like a windows explorer tree).Single column UsersList->UserDEPT1->UsersName .Under userlist all dept should be added under each dept user name to be added.I have tried with QTreeviewWidget but i want to implement it with a model.I am stuck any help is appreciated
-
Can you post an image of your desired outcome?
-
Its almost similar to the QT IDE class view tree or the project tree in some cases check boxes are required .
-
where do you stuck? can you explain more.
-
Hi @Shiv ,
Is something like this, are you trying?
-
-User //Parent +UserDept1 //child +UserDept2 //Child -USerDept3 //child userName1//Grandchild username2//Grandchild userName3//Grandchild
-
-
Hi @Ni-Sumi , Yes Exactly .
Hi @asanka424 I am stuck in implementing with a qstandarditem model.I will explain the whole context all data is present in the database firstly i have to load the user list with their corresponding dept.Whenever user is selected I have to fetch the other info of the user for editing updating and other activities.So every time i need to update the tree with the changes take place and any new entry i have to add the details to the tree.Hope I have explained the context. -
Hi all I have got an example and i am working on it to achieve my custom model structure.
http://doc.qt.io/qt-5/qtwidgets-itemviews-editabletreemodel-example.html