Create treeview Use in log file tags
-
Hi
I am new to Qt development and i need some advice ,My problem is like that I had Qt application with treeview i want to fill that tree view use in log file data Some one have better idea about that please help me to solve that problem.(Assume log file had tags like main item,sub main item etc... i want to get that tags in to treeview )
Thanks
-
Hi!
Did you try do something? Is your question about using treeview, or reading log file or make model for treeview? There are few examples for treeviews: "Itemview Examples":http://qt-project.org/doc/qt-5.0/qtwidgets/examples-itemviews.html -
Really thanks for your fast reply actually its like that i had log file with tags in this tags in some order like
<1>
<1.1>
<1.1.1>
data ....
<\1.1.1>
<\1.1>
<\1>
Now i want create treeview base on that tags simply i plan create XML file use in that log file tags after use in that XML file data i decide to create treeview its possible or cost effictive or their are any solution to do that requirement ?Thanks
-
You could basically write your own model derived from the QAbstractItemModel and load data only when the use clicks the parent indexes to view the child indexes. Basically, functions
QAbstractItemModel::canFetchMore, QAbstractItemModel::fetchMore, QAbstractItemModel::hasChildren and QAbstractItemModel::rowCount. need to be overridden and manipulated.
Just to cut short "this":http://www.qtcentre.org/archive/index.php/t-28082.html will help you.