diff options
author | Samuel Rødal <samuel.rodal@nokia.com> | 2011-02-07 16:50:31 (GMT) |
---|---|---|
committer | Samuel Rødal <samuel.rodal@nokia.com> | 2011-02-07 17:31:02 (GMT) |
commit | 573901d760414ad7c1fd74bad75b2c21532d0ce0 (patch) | |
tree | a36dfee53b75e00b2c5fb575ddab802476abb1d9 /src | |
parent | 3c603d35d46257ceee50bfe315d4cd5abd97b24f (diff) | |
download | Qt-573901d760414ad7c1fd74bad75b2c21532d0ce0.zip Qt-573901d760414ad7c1fd74bad75b2c21532d0ce0.tar.gz Qt-573901d760414ad7c1fd74bad75b2c21532d0ce0.tar.bz2 |
Added support for scrolling in XCB window surface.
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbwindowsurface.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
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<QRect> rects = area.rects(); + for (int i = 0; i < rects.size(); ++i) + qt_scrollRectInImage(m_image, rects.at(i), QPoint(dx, dy)); + + return true; } |