[Qt-interest] parse items of QTreeWidget into file/QSettings
Mystical Groovy
mysticalgr at gmail.com
Sat Nov 7 15:28:36 CET 2009
2009/11/7 Arnold Krille <arnold at arnoldarts.de>
> On Saturday 07 November 2009 13:50:21 Mystical Groovy wrote:
> > 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
> <snip>
>
> QTreeWidget is a QTreeView with its own internal model. And as QTreeView is
> a
> QAbstractItemView, you should be able to traverse the model yourself (as
> given
> by QAbstractITemView::model()).
>
> If its a tree, a recursive function to evaluate the branches would be
> appropriate...
> And don't hesitate, the needed parts are only QModelIndex and on
> QAbstractItemModel the members rowCount, columnCount, index, parent and
> data.
>
> Hope that helps,
>
> Arnold
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20091107/1e0799ed/attachment.html
More information about the Qt-interest-old
mailing list