summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-19 12:36:13 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-19 12:36:13 (GMT)
commit8a97a1cac688d0e6e6aef40bfa396a81d7bfc0b8 (patch)
tree7770157160a1f0fd60b0a411378019662335ffa0 /src/gui/itemviews
parentde0858687898f6e0e54cce3f986779c7aa1a350e (diff)
parent8cbf269e14b372ee3174c2706dd0cc4df37eef1a (diff)
downloadQt-8a97a1cac688d0e6e6aef40bfa396a81d7bfc0b8.zip
Qt-8a97a1cac688d0e6e6aef40bfa396a81d7bfc0b8.tar.gz
Qt-8a97a1cac688d0e6e6aef40bfa396a81d7bfc0b8.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fix platform regression: Support QFont::setStretch() on Cocoa Fix a memory leak from QItemSelectionModel when changing the model Small hack to allow forcing off font smoothing on Mac OS X
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp
index 6d4562a..4fb93fc 100644
--- a/src/gui/itemviews/qabstractitemview.cpp
+++ b/src/gui/itemviews/qabstractitemview.cpp
@@ -679,7 +679,11 @@ void QAbstractItemView::setModel(QAbstractItemModel *model)
connect(d->model, SIGNAL(modelReset()), this, SLOT(reset()));
connect(d->model, SIGNAL(layoutChanged()), this, SLOT(_q_layoutChanged()));
}
- setSelectionModel(new QItemSelectionModel(d->model, this));
+
+ QItemSelectionModel *selection_model = new QItemSelectionModel(d->model, this);
+ connect(d->model, SIGNAL(destroyed()), selection_model, SLOT(deleteLater()));
+ setSelectionModel(selection_model);
+
reset(); // kill editors, set new root and do layout
}