From 49b4433adf254b81f8b7727fbcf88ce2a48100ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 22 Mar 2018 15:08:10 +0100 Subject: Provide QPlatformWindow::hasPendingUpdateRequest() helper function So that platform plugins don't need to dive into QWindowPrivate. Change-Id: Ia2d94b3e9236e4a68857e6afe7af063f1b0d0aeb Reviewed-by: Simon Hausmann --- src/gui/kernel/qplatformwindow.cpp | 12 ++++++++++++ src/gui/kernel/qplatformwindow.h | 1 + 2 files changed, 13 insertions(+) (limited to 'src/gui') diff --git a/src/gui/kernel/qplatformwindow.cpp b/src/gui/kernel/qplatformwindow.cpp index bc1aeb8217..9fe68bd564 100644 --- a/src/gui/kernel/qplatformwindow.cpp +++ b/src/gui/kernel/qplatformwindow.cpp @@ -748,6 +748,16 @@ void QPlatformWindow::requestUpdate() wp->updateTimer = w->startTimer(timeout, Qt::PreciseTimer); } +/*! + Returns true if the window has a pending update request. + + \sa requestUpdate(), deliverUpdateRequest() +*/ +bool QPlatformWindow::hasPendingUpdateRequest() const +{ + return qt_window_private(window())->updateRequestPending; +} + /*! Delivers an QEvent::UpdateRequest event to the window. @@ -757,6 +767,8 @@ void QPlatformWindow::requestUpdate() */ void QPlatformWindow::deliverUpdateRequest() { + Q_ASSERT(hasPendingUpdateRequest()); + QWindow *w = window(); QWindowPrivate *wp = qt_window_private(w); wp->updateRequestPending = false; diff --git a/src/gui/kernel/qplatformwindow.h b/src/gui/kernel/qplatformwindow.h index 2fe8ad94e6..2b353959c7 100644 --- a/src/gui/kernel/qplatformwindow.h +++ b/src/gui/kernel/qplatformwindow.h @@ -144,6 +144,7 @@ public: const QRect &initialGeometry, int defaultWidth, int defaultHeight); virtual void requestUpdate(); + bool hasPendingUpdateRequest() const; virtual void deliverUpdateRequest(); // Window property accessors. Platform plugins should use these -- cgit v1.2.3