From 573901d760414ad7c1fd74bad75b2c21532d0ce0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20R=C3=B8dal?= Date: Mon, 7 Feb 2011 17:50:31 +0100 Subject: Added support for scrolling in XCB window surface. --- src/plugins/platforms/xcb/qxcbwindowsurface.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/xcb/qxcbwindowsurface.cpp b/src/plugins/platforms/xcb/qxcbwindowsurface.cpp index 27912cc..ad91c34 100644 --- a/src/plugins/platforms/xcb/qxcbwindowsurface.cpp +++ b/src/plugins/platforms/xcb/qxcbwindowsurface.cpp @@ -99,8 +99,17 @@ void QXcbWindowSurface::resize(const QSize &size) m_image = QImage(size, QImage::Format_RGB32); } +extern void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset); + bool QXcbWindowSurface::scroll(const QRegion &area, int dx, int dy) { - return false; + if (m_image.isNull()) + return false; + + const QVector rects = area.rects(); + for (int i = 0; i < rects.size(); ++i) + qt_scrollRectInImage(m_image, rects.at(i), QPoint(dx, dy)); + + return true; } -- cgit v0.12