summaryrefslogtreecommitdiffstats
path: root/examples/gui/rasterwindow/rasterwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/gui/rasterwindow/rasterwindow.cpp')
-rw-r--r--examples/gui/rasterwindow/rasterwindow.cpp10
1 files changed, 2 insertions, 8 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]