diff options
Diffstat (limited to 'examples/gui/rasterwindow')
-rw-r--r-- | examples/gui/rasterwindow/rasterwindow.cpp | 10 | ||||
-rw-r--r-- | examples/gui/rasterwindow/rasterwindow.h | 1 |
2 files changed, 2 insertions, 9 deletions
diff --git a/examples/gui/rasterwindow/rasterwindow.cpp b/examples/gui/rasterwindow/rasterwindow.cpp index eb34bec252..fb717a4c8a 100644 --- a/examples/gui/rasterwindow/rasterwindow.cpp +++ b/examples/gui/rasterwindow/rasterwindow.cpp @@ -53,7 +53,6 @@ //! [1] RasterWindow::RasterWindow(QWindow *parent) : QWindow(parent) - , m_update_pending(false) { create(); m_backingStore = new QBackingStore(this); @@ -68,7 +67,6 @@ RasterWindow::RasterWindow(QWindow *parent) bool RasterWindow::event(QEvent *event) { if (event->type() == QEvent::UpdateRequest) { - m_update_pending = false; renderNow(); return true; } @@ -79,10 +77,7 @@ bool RasterWindow::event(QEvent *event) //! [6] void RasterWindow::renderLater() { - if (!m_update_pending) { - m_update_pending = true; - QCoreApplication::postEvent(this, new QEvent(QEvent::UpdateRequest)); - } + requestUpdate(); } //! [6] @@ -99,9 +94,8 @@ void RasterWindow::resizeEvent(QResizeEvent *resizeEvent) //! [2] void RasterWindow::exposeEvent(QExposeEvent *) { - if (isExposed()) { + if (isExposed()) renderNow(); - } } //! [2] diff --git a/examples/gui/rasterwindow/rasterwindow.h b/examples/gui/rasterwindow/rasterwindow.h index be640814d4..2ccecbf704 100644 --- a/examples/gui/rasterwindow/rasterwindow.h +++ b/examples/gui/rasterwindow/rasterwindow.h @@ -74,7 +74,6 @@ protected: private: QBackingStore *m_backingStore; - bool m_update_pending; }; //! [1] #endif // RASTERWINDOW_H |