[Solved] QTreeView add data before expand item
-
Hi all
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 examplesExists another way except use own subclass of QTreeView and reimplement MouseClick event???
thank you for help
good luck -
Hi!
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
http://lists.trolltech.com/qt-interest/2006-08/thread00282-0.html