diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/egl/qegl_wince.cpp | 4 | ||||
-rw-r--r-- | src/gui/itemviews/qtableview.cpp | 14 |
2 files changed, 12 insertions, 6 deletions
diff --git a/src/gui/egl/qegl_wince.cpp b/src/gui/egl/qegl_wince.cpp index dfef39f..87ec648 100644 --- a/src/gui/egl/qegl_wince.cpp +++ b/src/gui/egl/qegl_wince.cpp @@ -89,9 +89,7 @@ EGLSurface QEglContext::createSurface(QPaintDevice *device, const QEglProperties EGLNativeDisplayType QEglContext::nativeDisplay() { - //HWND win = (static_cast<QWidget*>(device))->winId(); - //HDC myDc = GetDC(win); - HDC myDc = GetWindowDC(0); + HDC myDc = GetDC(0); if (!myDc) { qWarning("QEglContext::nativeDisplay(): WinCE display is not open"); 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())) { |