on xenial help sign in
Ensure the QML engine doesn't delete our mock MirSurfaces on its own.

That would cause some hard-to-track failures in QML test runs. Approved by: Unity8 CI Bot, Michael Zanetti

commitf5d9c63f72757c23f8406775a09f0dccdc92ae31 authorDaniel d'Andrada <daniel.dandrada@canonical.com> dateThu 10 Mar 2016, 22:38 (11 years ago) parent9d64c0d77eba27
1 file changed+3
tests/mocks/Unity/Application/MirSurface.cpp+3
tests/mocks/Unity/Application/MirSurface.cpp+3
@@ -17,6 +17,7 @@
1717#include "MirSurface.h"
1818
1919#include <QDebug>
20+#include <QQmlEngine>
2021
2122MirSurface::MirSurface(const QString& name,
2223 Mir::Type type,
@@ -38,6 +39,8 @@ MirSurface::MirSurface(const QString& name,
3839 , m_slowToResize(false)
3940{
4041// qDebug() << "MirSurface::MirSurface() " << name;
42+ QQmlEngine::setObjectOwnership(this, QQmlEngine::CppOwnership);
43+
4144 m_delayedResizeTimer.setInterval(600);
4245 m_delayedResizeTimer.setSingleShot(true);
4346 connect(&m_delayedResizeTimer, &QTimer::timeout, this, &MirSurface::applyDelayedResize);