summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-02-12 15:28:12 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2015-02-16 15:56:29 +0000
commiteffc6b4cd15aefa1bef30c27f0458390735fafb5 (patch)
treed77f1e07cf62e80f53e43bdeb117c0b4efa9843b /tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
parent1748b7e7d2f619dc32df7ccbd3aa24316aa63c82 (diff)
Add widget support for requestUpdate() and improve its docs and tests
We must do something when requestUpdate() is called on a QWidgetWindow. The semantics of UpdateRequest for QWindow and QWidget are unfortunately different: for widgets an UpdateRequest means "sync the backing store". For QWindow it also involves marking as dirty. Change-Id: Idf40b3fc0873652dc081edeb12c96b3007a126ef Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com> Reviewed-by: Jørgen Lind <jorgen.lind@theqtcompany.com>
Diffstat (limited to 'tests/auto/gui/kernel/qwindow/tst_qwindow.cpp')
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index e542c85218..89490525c9 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -91,6 +91,7 @@ private slots:
void modalWindowModallity();
void modalWindowPosition();
void windowsTransientChildren();
+ void requestUpdate();
void initTestCase();
void cleanup();
@@ -1666,6 +1667,25 @@ void tst_QWindow::windowsTransientChildren()
QVERIFY(isNativeWindowVisible(&child)); // Real children should be visible.
}
+void tst_QWindow::requestUpdate()
+{
+ QRect geometry(m_availableTopLeft + QPoint(80, 80), m_testWindowSize);
+
+ Window window;
+ window.setGeometry(geometry);
+ window.show();
+ QCoreApplication::processEvents();
+ QTRY_VERIFY(window.isExposed());
+
+ QVERIFY(window.received(QEvent::UpdateRequest) == 0);
+
+ window.requestUpdate();
+ QTRY_VERIFY(window.received(QEvent::UpdateRequest) == 1);
+
+ window.requestUpdate();
+ QTRY_VERIFY(window.received(QEvent::UpdateRequest) == 2);
+}
+
#include <tst_qwindow.moc>
QTEST_MAIN(tst_QWindow)