From 7069ebd1f66e624e69b980619112b692ed40efe4 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 3 Oct 2014 13:05:42 +0200 Subject: Use requestUpdate in QOpenGL and RasterWindow Change-Id: Ibed4b8d2e2185f1bcf3430932701f81577b59408 Reviewed-by: Gunnar Sletta --- src/gui/kernel/qpaintdevicewindow.cpp | 5 ++--- src/gui/kernel/qpaintdevicewindow_p.h | 12 ------------ 2 files changed, 2 insertions(+), 15 deletions(-) (limited to 'src/gui/kernel') diff --git a/src/gui/kernel/qpaintdevicewindow.cpp b/src/gui/kernel/qpaintdevicewindow.cpp index cf8653426f..d5b15ed5f5 100644 --- a/src/gui/kernel/qpaintdevicewindow.cpp +++ b/src/gui/kernel/qpaintdevicewindow.cpp @@ -76,7 +76,7 @@ void QPaintDeviceWindow::update(const QRect &rect) { Q_D(QPaintDeviceWindow); d->dirtyRegion += rect; - d->triggerUpdate(); + requestUpdate(); } /*! @@ -89,7 +89,7 @@ void QPaintDeviceWindow::update(const QRegion ®ion) { Q_D(QPaintDeviceWindow); d->dirtyRegion += region; - d->triggerUpdate(); + requestUpdate(); } /*! @@ -179,7 +179,6 @@ bool QPaintDeviceWindow::event(QEvent *event) Q_D(QPaintDeviceWindow); if (event->type() == QEvent::UpdateRequest) { - d->paintEventSent = false; if (handle()) // platform window may be gone when the window is closed during app exit d->handleUpdateEvent(); return true; diff --git a/src/gui/kernel/qpaintdevicewindow_p.h b/src/gui/kernel/qpaintdevicewindow_p.h index 1935bb6db5..865861125b 100644 --- a/src/gui/kernel/qpaintdevicewindow_p.h +++ b/src/gui/kernel/qpaintdevicewindow_p.h @@ -46,8 +46,6 @@ class Q_GUI_EXPORT QPaintDeviceWindowPrivate : public QWindowPrivate Q_DECLARE_PUBLIC(QPaintDeviceWindow) public: - QPaintDeviceWindowPrivate() : paintEventSent(false) { } - virtual void beginPaint(const QRegion ®ion) { Q_UNUSED(region); @@ -82,15 +80,6 @@ public: return true; } - void triggerUpdate() - { - Q_Q(QPaintDeviceWindow); - if (!paintEventSent) { - QCoreApplication::postEvent(q, new QEvent(QEvent::UpdateRequest)); - paintEventSent = true; - } - } - void doFlush(const QRegion ®ion) { QRegion toFlush = region; @@ -113,7 +102,6 @@ public: private: QRegion dirtyRegion; - bool paintEventSent; }; -- cgit v1.2.3