summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-05-18 16:08:20 +0200
committerQt by Nokia <qt-info@nokia.com>2012-05-21 16:02:06 +0200
commit061968d0825b2f12dd99ec94ef03b87955af894a (patch)
treeeca74631129cb8720b2c3518ba77efd54fcdd2de
parent09c90c9fc3f30a4ef5166afa6c5c81aab7ac278e (diff)
QWindowsBackingStore: Implement scroll.
Similar to XCB. Task-number: QTBUG-24299 Task-number: QTBUG-24296 (partially fixed) Change-Id: I4c9d813d9645f957f2caad0c4e395ce0d3d222cc Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
-rw-r--r--src/plugins/platforms/windows/qwindowsbackingstore.cpp14
-rw-r--r--src/plugins/platforms/windows/qwindowsbackingstore.h1
-rw-r--r--tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp5
-rw-r--r--tests/auto/widgets/itemviews/qlistwidget/qlistwidget.pro2
4 files changed, 15 insertions, 7 deletions
diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.cpp b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
index e86b41a48a..aad115a30b 100644
--- a/src/plugins/platforms/windows/qwindowsbackingstore.cpp
+++ b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
@@ -121,6 +121,20 @@ void QWindowsBackingStore::resize(const QSize &size, const QRegion &region)
}
}
+Q_GUI_EXPORT void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset);
+
+bool QWindowsBackingStore::scroll(const QRegion &area, int dx, int dy)
+{
+ if (m_image.isNull() || m_image->image().isNull())
+ return false;
+
+ const QVector<QRect> rects = area.rects();
+ for (int i = 0; i < rects.size(); ++i)
+ qt_scrollRectInImage(m_image->image(), rects.at(i), QPoint(dx, dy));
+
+ return true;
+}
+
void QWindowsBackingStore::beginPaint(const QRegion &region)
{
Q_UNUSED(region);
diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.h b/src/plugins/platforms/windows/qwindowsbackingstore.h
index 75b6e5f736..f9a0603642 100644
--- a/src/plugins/platforms/windows/qwindowsbackingstore.h
+++ b/src/plugins/platforms/windows/qwindowsbackingstore.h
@@ -62,6 +62,7 @@ public:
virtual QPaintDevice *paintDevice();
virtual void flush(QWindow *window, const QRegion &region, const QPoint &offset);
virtual void resize(const QSize &size, const QRegion &r);
+ virtual bool scroll(const QRegion &area, int dx, int dy);
virtual void beginPaint(const QRegion &);
HDC getDC() const;
diff --git a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
index 156d815765..5200109097 100644
--- a/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/widgets/graphicsview/qgraphicsview/tst_qgraphicsview.cpp
@@ -3423,9 +3423,6 @@ void tst_QGraphicsView::moveItemWhileScrolling()
int a = adjustForAntialiasing ? 2 : 1;
expectedRegion += QRect(40, 50, 10, 10).adjusted(-a, -a, a, a);
expectedRegion += QRect(40, 60, 10, 10).adjusted(-a, -a, a, a);
-#ifdef Q_OS_WIN
- QEXPECT_FAIL("", "QTBUG-24296", Abort);
-#endif
COMPARE_REGIONS(view.lastPaintedRegion, expectedRegion);
}
@@ -4389,9 +4386,7 @@ void tst_QGraphicsView::task259503_scrollingArtifacts()
if (itSTimeToTest)
{
-#ifndef Q_OS_WIN
QEXPECT_FAIL("", "QTBUG-24296", Continue);
-#endif
QCOMPARE(event->region(), updateRegion);
}
}
diff --git a/tests/auto/widgets/itemviews/qlistwidget/qlistwidget.pro b/tests/auto/widgets/itemviews/qlistwidget/qlistwidget.pro
index 8821ac7038..f397957609 100644
--- a/tests/auto/widgets/itemviews/qlistwidget/qlistwidget.pro
+++ b/tests/auto/widgets/itemviews/qlistwidget/qlistwidget.pro
@@ -5,5 +5,3 @@ QT += core-private gui-private
SOURCES += tst_qlistwidget.cpp
contains(QT_CONFIG,xcb):CONFIG+=insignificant_test # QTBUG-21098, fails unstably
-
-win32:CONFIG += insignificant_test # QTBUG-24299