[Solved] QTreeView add data before expand item
I have tree that related with objects in DB, user not use tree all the time, but sometimes user want to see list of objects in some folder and I should fill this folder before expand. I am use inheritor of QBaseTreeItem from Qt examples
Exists another way except use own subclass of QTreeView and reimplement MouseClick event???
thank you for help
Can you link to this example?
But if you mean lazy model you don't need subclass TreeView. In this cases you need subclass QAbstractItemModel and reimplement:
@bool canFetchMore(const QModelIndex & parent) const;
void fetchMore(const QModelIndex & parent);@
as strart point for creating tree models you can take "this":http://qt-project.org/doc/qt-5.0/qtwidgets/itemviews-editabletreemodel.html
Thank you qxoz, I'll try your way
information about overriding mauseClickEvent I found there
all work in the best way )
I am glad to be helpful :)