Mystical Groovy
7th November 2009, 12:51
Good morning everyone
does anyone know how to parse the items of a QTreeWidget into a file?
Im trying to save the list of items in QTreeWIdget with QSettigns but currentItem()->text(0);
works only for one item
Iv tried to do : selectAll(); and then currentItem()->text(0) but it freezes my program..
Some samples Ive tried
Trying to parse the items on QSettings value
treeWidget->selectAll();
settings.setValue("repositoriesLastState",treeWidget->currentItem()->text(0));
the above on freezes my program, segmentation fault....
Trying to parse the items on a file for futher processing later.
QFile repos("/tmp/repositories");
repos.open(QFile::WriteOnly | QFile::Truncate);
QTextStream repoList(&repos);
repoList << treeWidget->currentItem()->text(0);
repos.close();
the above write to /tmp/repositories file only one item
Please help, thank you :)
does anyone know how to parse the items of a QTreeWidget into a file?
Im trying to save the list of items in QTreeWIdget with QSettigns but currentItem()->text(0);
works only for one item
Iv tried to do : selectAll(); and then currentItem()->text(0) but it freezes my program..
Some samples Ive tried
Trying to parse the items on QSettings value
treeWidget->selectAll();
settings.setValue("repositoriesLastState",treeWidget->currentItem()->text(0));
the above on freezes my program, segmentation fault....
Trying to parse the items on a file for futher processing later.
QFile repos("/tmp/repositories");
repos.open(QFile::WriteOnly | QFile::Truncate);
QTextStream repoList(&repos);
repoList << treeWidget->currentItem()->text(0);
repos.close();
the above write to /tmp/repositories file only one item
Please help, thank you :)