summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qtablewidget.cpp
diff options
context:
space:
mode:
authorGunnar Sletta <gunnar@trolltech.com>2009-10-19 04:58:20 (GMT)
committerGunnar Sletta <gunnar@trolltech.com>2009-10-19 04:58:20 (GMT)
commit91e133d9eeba0b7ea87a3ddb3f10d2a2b345473d (patch)
tree499f3a3e0ba67c76da18a33fd331569670578a79 /src/gui/itemviews/qtablewidget.cpp
parent4a0e3170c779a6a37954c3dfcfd0b9f0ce144701 (diff)
parentc3bab81d5966c9bd3a42d9c5cbb9d8ad35a1b330 (diff)
downloadQt-91e133d9eeba0b7ea87a3ddb3f10d2a2b345473d.zip
Qt-91e133d9eeba0b7ea87a3ddb3f10d2a2b345473d.tar.gz
Qt-91e133d9eeba0b7ea87a3ddb3f10d2a2b345473d.tar.bz2
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into 4.6
Diffstat (limited to 'src/gui/itemviews/qtablewidget.cpp')
-rw-r--r--src/gui/itemviews/qtablewidget.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/itemviews/qtablewidget.cpp b/src/gui/itemviews/qtablewidget.cpp
index a086498..21c4e0a 100644
--- a/src/gui/itemviews/qtablewidget.cpp
+++ b/src/gui/itemviews/qtablewidget.cpp
@@ -571,6 +571,8 @@ void QTableModel::ensureSorted(int column, Qt::SortOrder order,
colItems.remove(oldRow);
vit = sortedInsertionIterator(vit, colItems.end(), order, item);
int newRow = qMax((int)(vit - colItems.begin()), 0);
+ if ((newRow < oldRow) && !(*item < *colItems.at(oldRow - 1)) && !(*colItems.at(oldRow - 1) < *item))
+ newRow = oldRow;
vit = colItems.insert(vit, item);
if (newRow != oldRow) {
changed = true;