Populating TreeView data from external QSettings file
-
Just ask Google :-) Four example, you could start with binary trees
-
check the examples in qt doc:
"Simple Tree Model Example":qthelp://com.trolltech.qt.485/qdoc/itemviews-simpletreemodel.html
"Editable Tree Model Example":qthelp://com.trolltech.qt.485/qdoc/itemviews-editabletreemodel.htmlor in your case, I think using direct a QTreeWdiget having a predefined model would be enough ... I would suggest to play with someone in QtCreator, add few items,build the project and then check the ui header file to find out how should look your populating code ...
Cheers!
-
You can use "QSettings":http://qt-project.org/doc/qt-5.0/qtcore/qsettings.html to read the .ini file.
To create and display your tree, you could use "QTreeWidget":http://qt-project.org/doc/qt-5.0/qtwidgets/qtreewidget.html and "QTreeWidgetItem":http://qt-project.org/doc/qt-5.0/qtwidgets/qtreewidgetitem.html..
Alternatively, you could use "QStandardItemModel":http://qt-project.org/doc/qt-5.0/qtgui/qstandarditemmodel.html, "QStandardItem":http://qt-project.org/doc/qt-5.0/qtgui/qstandarditem.html and "QTreeView":http://qt-project.org/doc/qt-5.0/qtwidgets/qtreeview.html for that purpose.
Hope it helps!
-
Thanks for the reply.
I am able to read an INI file and write to in by functions I am already femiliar with , and creating views and modifying them BUT from internal sources, where I modify the data inside the program, however I am laking on knowledge with which functions I should use for my purposes...