diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-03-22 15:08:10 +0100 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-04-17 12:55:06 +0000 |
commit | 49b4433adf254b81f8b7727fbcf88ce2a48100ba (patch) | |
tree | b7981f3364ee345f9d46131ce50c0bd5d6a6ea8d /src/gui | |
parent | 8e2a9705669e11a1510bca37121fc27cddd13007 (diff) |
Provide QPlatformWindow::hasPendingUpdateRequest() helper function
So that platform plugins don't need to dive into QWindowPrivate.
Change-Id: Ia2d94b3e9236e4a68857e6afe7af063f1b0d0aeb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qplatformwindow.cpp | 12 | ||||
-rw-r--r-- | src/gui/kernel/qplatformwindow.h | 1 |
2 files changed, 13 insertions, 0 deletions
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 @@ -749,6 +749,16 @@ void QPlatformWindow::requestUpdate() } /*! + 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. QPlatformWindow subclasses can re-implement this function to @@ -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 |