QTreeWidgetItemIterator craches.
-
I meant a check in code.. @while(QTreeWidgetItem *item = tw->topLevelItem(0)){
....
}@
[quote author="p-himik" date="1316932916"]I did check. More than that, QTreeWidget constructed with "item" as a top level item is displayed normally.[/quote]Am Just curious, is it necessary to create deep copy of the item ?
-
-
Sounds like you need to use real model/view instead of the *widget version... If you go about cloning the tree to display it in another window, you are on the wrong road, if you ask me.
Instead, you could considder using a QStandardItemModel (API is similar to QTreeWidget and -Item), replace the QTreeWidget with a QTreeView and use a QSortFilterProxyModel to filter out the unwanted items from the model for display on the second window.
-
[quote author="p-himik" date="1316950625"]I don't know well MVC-part of Qt and this is rather simple application so i decided just to copy items.
But what about QTreeWidgetItemIterator? Why can it crash when passed parameter is valid?[/quote]
If you show us more code, we could perhaps help you, but if we only get one or two lines, we have to gess the rest, which is not very easy.
-
Here is a short example: http://dl.dropbox.com/u/26596688/testProject.tar.gz