summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorFrans Englich <frans.englich@nokia.com>2009-08-11 15:19:51 (GMT)
committerFrans Englich <frans.englich@nokia.com>2009-08-11 15:19:51 (GMT)
commit598ee0994a7ca14ef0bc4265dab99d716ba6f189 (patch)
tree8df27194728c4aea4a4127090ac8d56627914b55 /src/gui
parent5c5310803f34c8fcf3aee6b7bb5c2bc6caf3107c (diff)
downloadQt-598ee0994a7ca14ef0bc4265dab99d716ba6f189.zip
Qt-598ee0994a7ca14ef0bc4265dab99d716ba6f189.tar.gz
Qt-598ee0994a7ca14ef0bc4265dab99d716ba6f189.tar.bz2
Revert "QItemSelectionModel did not send selectionChanged signal when deleting an item"
This reverts commit d13418effc5f00474541ae513a30c9a42c2a1cb3.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/itemviews/qitemselectionmodel.cpp22
-rw-r--r--src/gui/itemviews/qitemselectionmodel_p.h2
2 files changed, 1 insertions, 23 deletions
diff --git a/src/gui/itemviews/qitemselectionmodel.cpp b/src/gui/itemviews/qitemselectionmodel.cpp
index 0f35ac1..9dad95f 100644
--- a/src/gui/itemviews/qitemselectionmodel.cpp
+++ b/src/gui/itemviews/qitemselectionmodel.cpp
@@ -593,30 +593,10 @@ void QItemSelectionModelPrivate::_q_rowsAboutToBeRemoved(const QModelIndex &pare
// update selectionsx
QModelIndex tl = model->index(start, 0, parent);
QModelIndex br = model->index(end, model->columnCount(parent) - 1, parent);
- recursiveDeselect(QItemSelectionRange(tl, br));
+ q->select(QItemSelection(tl, br), QItemSelectionModel::Deselect);
finalize();
}
-void QItemSelectionModelPrivate::recursiveDeselect(const QItemSelectionRange &range)
-{
- Q_Q(QItemSelectionModel);
-
- QItemSelection sel(range.topLeft(), range.bottomRight());
- q->select(sel, QItemSelectionModel::Deselect);
-
- QModelIndexList idxList = range.indexes();
- QModelIndexList::const_iterator it = idxList.begin();
- for (; it != idxList.end(); ++it)
- {
- if (!model->hasChildren(*it))
- continue;
-
- const QModelIndex &firstChild = it->child(0,0);
- const QModelIndex &lastChild = it->child(model->rowCount(*it) - 1, model->columnCount(*it) - 1);
- recursiveDeselect(QItemSelectionRange(firstChild, lastChild));
- }
-}
-
/*!
\internal
*/
diff --git a/src/gui/itemviews/qitemselectionmodel_p.h b/src/gui/itemviews/qitemselectionmodel_p.h
index 8176d4c..18ad506 100644
--- a/src/gui/itemviews/qitemselectionmodel_p.h
+++ b/src/gui/itemviews/qitemselectionmodel_p.h
@@ -77,8 +77,6 @@ public:
void _q_layoutAboutToBeChanged();
void _q_layoutChanged();
- void recursiveDeselect(const QItemSelectionRange &range);
-
inline void remove(QList<QItemSelectionRange> &r)
{
QList<QItemSelectionRange>::const_iterator it = r.constBegin();