diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-10-26 08:18:39 (GMT) |
---|---|---|
committer | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-10-26 13:23:00 (GMT) |
commit | 5d411794d18f33ed8438744216b8ec5095682e20 (patch) | |
tree | 3e2428c753e4b9d4ca89634b150b8aa2277e02dc | |
parent | f417a6e7729a506e5a59e7fd38e03166515198b1 (diff) | |
download | Qt-5d411794d18f33ed8438744216b8ec5095682e20.zip Qt-5d411794d18f33ed8438744216b8ec5095682e20.tar.gz Qt-5d411794d18f33ed8438744216b8ec5095682e20.tar.bz2 |
Create dummy window surface if if _q_DummyWindowSurface property is set
Task-number: MOBILITY-1315
Reviewed-by: Jason Barron
Reviewed-by: bnilsen
-rw-r--r-- | src/gui/kernel/qwidget.cpp | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/gui/kernel/qwidget.cpp b/src/gui/kernel/qwidget.cpp index 6c64ffc..e22ec55 100644 --- a/src/gui/kernel/qwidget.cpp +++ b/src/gui/kernel/qwidget.cpp @@ -337,15 +337,27 @@ QWidgetPrivate::~QWidgetPrivate() #endif //QT_NO_GRAPHICSEFFECT } +class QDummyWindowSurface : public QWindowSurface +{ +public: + QDummyWindowSurface(QWidget *window) : QWindowSurface(window) {} + QPaintDevice *paintDevice() { return window(); } + void flush(QWidget *, const QRegion &, const QPoint &) {} +}; + QWindowSurface *QWidgetPrivate::createDefaultWindowSurface() { Q_Q(QWidget); QWindowSurface *surface; - if (QApplicationPrivate::graphicsSystem()) - surface = QApplicationPrivate::graphicsSystem()->createWindowSurface(q); - else - surface = createDefaultWindowSurface_sys(); + if (q->property("_q_DummyWindowSurface").toBool()) { + surface = new QDummyWindowSurface(q); + } else { + if (QApplicationPrivate::graphicsSystem()) + surface = QApplicationPrivate::graphicsSystem()->createWindowSurface(q); + else + surface = createDefaultWindowSurface_sys(); + } return surface; } |