summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorMarkku Heikkila <markku.heikkila@digia.com>2012-01-27 11:53:09 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-02-01 14:32:07 (GMT)
commit4f388c383e39b598d997e21bd9a4f16d89bd0625 (patch)
treead810f35e118a8222a850350bfd9d5f085a6febf /src/gui
parent9ad459913c8a277f3a6fbc7ee50937f126fe87ef (diff)
downloadQt-4f388c383e39b598d997e21bd9a4f16d89bd0625.zip
Qt-4f388c383e39b598d997e21bd9a4f16d89bd0625.tar.gz
Qt-4f388c383e39b598d997e21bd9a4f16d89bd0625.tar.bz2
Fix crash in QTreeWidgetItem::sortChildren when adding new item.
Recursive call is caused if user code calls QtreeWidgetItem()::sortChildren and sorting is enbled in QTreeWidget. First call is from user code and second is caused by timer. When timer expires second call is made. This recursion is prevented with QTreeModel::SkipSorting skipSorting() in QTreeWidgetItem::sortChildren(); Task-number: QTBUG-20345 Change-Id: I48af98b03c0291de8da90d1581bc55cc89846b8c Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/itemviews/qtreewidget.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/itemviews/qtreewidget.cpp b/src/gui/itemviews/qtreewidget.cpp
index f851688..2816966 100644
--- a/src/gui/itemviews/qtreewidget.cpp
+++ b/src/gui/itemviews/qtreewidget.cpp
@@ -2108,6 +2108,7 @@ void QTreeWidgetItem::sortChildren(int column, Qt::SortOrder order, bool climb)
return;
if (model->isChanging())
return;
+ QTreeModel::SkipSorting skipSorting(model);
int oldSortColumn = view->d_func()->explicitSortColumn;
view->d_func()->explicitSortColumn = column;
emit model->layoutAboutToBeChanged();