summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/kernel/qwindow/tst_qwindow.cpp')
-rw-r--r--tests/auto/gui/kernel/qwindow/tst_qwindow.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
index 02f3959802..b4659b7caf 100644
--- a/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
+++ b/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp
@@ -164,6 +164,8 @@ public:
{
m_received[event->type()]++;
m_order << event->type();
+ if (event->type() == QEvent::Expose)
+ m_exposeRegion = static_cast<QExposeEvent *>(event)->region();
return QWindow::event(event);
}
@@ -178,9 +180,15 @@ public:
return m_order.indexOf(type);
}
+ QRegion exposeRegion() const
+ {
+ return m_exposeRegion;
+ }
+
private:
QHash<QEvent::Type, int> m_received;
QVector<QEvent::Type> m_order;
+ QRegion m_exposeRegion;
};
void tst_QWindow::eventOrderOnShow()
@@ -358,6 +366,14 @@ void tst_QWindow::isExposed()
QTRY_VERIFY(window.received(QEvent::Expose) > 0);
QTRY_VERIFY(window.isExposed());
+ // This is a top-level window so assuming it is completely exposed, the
+ // expose region must be (0, 0), (width, height). If this is not the case,
+ // the platform plugin is sending expose events with a region in an
+ // incorrect coordinate system.
+ QRect r = window.exposeRegion().boundingRect();
+ r = QRect(window.mapToGlobal(r.topLeft()), r.size());
+ QCOMPARE(r, window.geometry());
+
window.hide();
QCoreApplication::processEvents();