summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-03-05 09:26:07 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-03-05 09:26:07 (GMT)
commitdd1f2a39b90e22337773153b9f655ee74717b57c (patch)
treee2ed2eed4ff3039a0e6222590c66bb54f0dbdd6b /src/gui
parent5d7aaf0a63b01b2fbdd952b0e37442cce62456a9 (diff)
parent0f89d7ef7b5e961cfc6ee7960ad6bf07eff71691 (diff)
downloadQt-dd1f2a39b90e22337773153b9f655ee74717b57c.zip
Qt-dd1f2a39b90e22337773153b9f655ee74717b57c.tar.gz
Qt-dd1f2a39b90e22337773153b9f655ee74717b57c.tar.bz2
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Wrong dirty region after row selection in right-to-left mode in QTableView Fixes: Mysql truncation of integer values + some autotest cleanup
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/itemviews/qtableview.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/gui/itemviews/qtableview.cpp b/src/gui/itemviews/qtableview.cpp
index 3111896..cf1b542 100644
--- a/src/gui/itemviews/qtableview.cpp
+++ b/src/gui/itemviews/qtableview.cpp
@@ -1908,6 +1908,7 @@ QRegion QTableView::visualRegionForSelection(const QItemSelection &selection) co
width, rowHeight(r)));
}
} else { // nothing moved
+ const int gridAdjust = showGrid() ? 1 : 0;
for (int i = 0; i < selection.count(); ++i) {
QItemSelectionRange range = selection.at(i);
if (range.parent() != d->root || !range.isValid())
@@ -1916,9 +1917,16 @@ QRegion QTableView::visualRegionForSelection(const QItemSelection &selection) co
const int rtop = rowViewportPosition(range.top());
const int rbottom = rowViewportPosition(range.bottom()) + rowHeight(range.bottom());
- const int rleft = columnViewportPosition(range.left());
- const int rright = columnViewportPosition(range.right()) + columnWidth(range.right());
- selectionRegion += QRect(QPoint(rleft, rtop), QPoint(rright, rbottom));
+ int rleft;
+ int rright;
+ if (isLeftToRight()) {
+ rleft = columnViewportPosition(range.left());
+ rright = columnViewportPosition(range.right()) + columnWidth(range.right());
+ } else {
+ rleft = columnViewportPosition(range.right());
+ rright = columnViewportPosition(range.left()) + columnWidth(range.left());
+ }
+ selectionRegion += QRect(QPoint(rleft, rtop), QPoint(rright - 1 - gridAdjust, rbottom - 1 - gridAdjust));
if (d->hasSpans()) {
foreach (QSpanCollection::Span *s,
d->spans.spansInRect(range.left(), range.top(), range.width(), range.height())) {