summaryrefslogtreecommitdiffstats
path: root/tests/auto/compositor/compositor/tst_compositor.cpp
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2016-09-07 16:32:05 +0200
committerJohan Helsing <johan.helsing@qt.io>2016-09-30 14:21:39 +0000
commit04c05e9a53f4fe59c58967809b91ea792b6cffbd (patch)
tree280aebaeef2349da8373bf6c7e00ad84665b27fc /tests/auto/compositor/compositor/tst_compositor.cpp
parent5372ec5c131e23cccfbabc43d700ffbbbad973ec (diff)
Make QWaylandKeymap a QObject
This makes it possible to use defaultSeat declaratively by allowing it to be uninitialized until the QWaylandCompositor::create has been called. Change-Id: I962cc7cc82a0bbc9240abb50cf92dee77e4a0ba6 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@hawaiios.org> Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Diffstat (limited to 'tests/auto/compositor/compositor/tst_compositor.cpp')
-rw-r--r--tests/auto/compositor/compositor/tst_compositor.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/auto/compositor/compositor/tst_compositor.cpp b/tests/auto/compositor/compositor/tst_compositor.cpp
index 3052b7b4..16aedd8e 100644
--- a/tests/auto/compositor/compositor/tst_compositor.cpp
+++ b/tests/auto/compositor/compositor/tst_compositor.cpp
@@ -347,20 +347,21 @@ void tst_WaylandCompositor::seatCreation()
MockClient client;
Q_UNUSED(client);
- TestSeat* dev = static_cast<TestSeat*>(compositor.defaultSeat());
+ TestSeat* seat = qobject_cast<TestSeat *>(compositor.defaultSeat());
+ QTRY_VERIFY(seat);
// The compositor will create the default input device
- QTRY_COMPARE(compositor.defaultSeat(), dev);
+ QTRY_VERIFY(seat->isInitialized());
QList<QMouseEvent *> allEvents;
- allEvents += dev->createMouseEvents(5);
+ allEvents += seat->createMouseEvents(5);
foreach (QMouseEvent *me, allEvents) {
compositor.seatFor(me);
}
// The default input device will get called exatly the number of times it has created
// the events
- QTRY_COMPARE(dev->queryCount(), 5);
+ QTRY_COMPARE(seat->queryCount(), 5);
}
void tst_WaylandCompositor::seatKeyboardFocus()