QtQuery (31st August 2010)
Hello,
i've the same problem, i need to merge 2 tree models into one treeview.
The first model is a simple QStandardItemModel. The second model is a QDirModel.
Now i want to display both models into one treeview. So from the posting i think i need an overlay...
Qt Code:
CustomModel Items DirModel ItemsTo copy to clipboard, switch view to plain text mode
So, i think i need two functions setCustomModel(QAbstractItemModel *pModel); and a function setDirModel(QAbstractItemModel *pModel); for example.
But how can i handle it that when i click on an item in the QDirModel to display a file content and if i click on an item in the QStandardItemModel to display for example the a string? To simplify this, i want to know how the treeview knows which model must be accessed.
I've also attached a screenshot of the current situation. In the left (empty) TreeView i will merge the right ones.
Thanks in advance
Best Regards
NoRulez
Bookmarks