84
83
void TestUtil::ensureTouchRegistryInstalled()
86
if (m_installedTouchRegistry)
89
TouchRegistry *touchRegistry;
90
if (TouchRegistry::instance() == nullptr) {
91
// Tests can be *very* slow to run and we don't want things timing out because
92
// of that. So give it fake timers to use (they will never time out)
93
touchRegistry = new TouchRegistry(this, new FakeTimerFactory);
95
touchRegistry = TouchRegistry::instance();
96
if (touchRegistry->parent() != this) {
97
// someone else created it. leave it alone
98
m_installedTouchRegistry = true;
102
ensureTargetWindow();
104
if (m_targetWindow) {
105
QQuickView *view = qobject_cast<QQuickView*>(m_targetWindow);
107
view->installEventFilter(touchRegistry);
108
touchRegistry->setParent(view);
109
m_installedTouchRegistry = true;
85
if (TouchRegistry::instance())
91
// Tests can be *very* slow to run and we don't want things timing out because
92
// of that. So give it fake timers to use (they will never time out)
93
TouchRegistry *touchRegistry = new TouchRegistry(this, new FakeTimerFactory);
95
QQuickView *view = qobject_cast<QQuickView*>(m_targetWindow);
97
view->installEventFilter(touchRegistry);
98
touchRegistry->setParent(view);