Details
-
Bug
-
Resolution: Done
-
P4: Low
-
5.3.1, 5.4.0 Beta
-
None
-
Windows 8.1, Windows 7
-
-
f140ef04a0c54c2c8a699db33433b8d7235d137c (qt/qtbase/dev) 3a2fe41c9fa1082e1ef89f8745777950270ed44c (qt/qtbase/6.0) 13cb272a705359beee0b28dccd544485b49c9eff (qt/qtbase/6.1) c6803b0ef71278e68c371158db368d59ab198bc1 (qt/tqtc-qtbase/5.15)
Description
We create a QTreeWidget with setAnimation to true, and we add two top level items with 1 children in both of them; we connect the itemExpanded(QTreeWidgetItem*) SIGNAL with a method that hides all top level items except the expanded one : it crashes.
Example of code :
QWidget* l_widget = new QWidget(); QTreeWidget* l_treeWidget = new QTreeWidget(l_widget); l_treeWidget->addTopLevelItem(new QTreeWidgetItem(QStringList("item1"))); l_treeWidget->addTopLevelItem(new QTreeWidgetItem(QStringList("item2"))); l_treeWidget->topLevelItem(1)->addChild(new QTreeWidgetItem(QStringList("child1"))); l_treeWidget->setAnimated(true); QObject::connect(l_treeWidget, &QTreeWidget::itemExpanded, [=](QTreeWidgetItem* p_item) { for (int j = 0; j < l_treeWidget->topLevelItemCount(); ++j) if (l_treeWidget->topLevelItem(j) != p_item) l_treeWidget->topLevelItem(j)->setHidden(true); }); l_widget->show();