PDA

View Full Version : save and restore TreeWidgetItem



raj_iv
15th June 2011, 20:18
Hi,
Suppose i have a treewidget with a number of QTreeWidgetItem which may or may not have some children (having 2 columns=> text, value) underneath it.
I want to save these QTreeWidgetItem structure somehow in QList or watever (i dunno hw to do this in qt) and later want to restore it.
How to do this in Qt.

stampede
15th June 2011, 20:32
What do you mean by "later" ? You want the data to be available next time you start the app, or few minutes "later" during program execution ?

Santosh Reddy
16th June 2011, 04:34
You can store them in QList, ans use them later, if you want to use next time the application starts then save into QList, and then save QList to a file or database... or even QSettings can be used

ante
26th August 2011, 09:12
Hi, I use this to refresh file and directory list in my "browse folder" application. I store items opened or selected in a map but there is a problem when I collapse item. The "on_treeWidgetName_itemCollapsed()" private slot of my c++ class are not called (=> closed item is not removed from map).
Have you any suggestion to solve this?