on xenial help sign in
The fake MirSurfaceItem should consume mouse events just like the real one.
26f5b47Daniel d'Andrada
tests/mocks/Unity/Application/MirSurfaceItem.cpp+15
@@ -161,6 +161,21 @@ void MirSurfaceItem::touchEvent(QTouchEvent * event)
161 }
161 }
162}
162}
163
163
164+void MirSurfaceItem::mousePressEvent(QMouseEvent * event)
165+{
166+ event->accept();
167+}
168+
169+void MirSurfaceItem::mouseMoveEvent(QMouseEvent * event)
170+{
171+ event->accept();
172+}
173+
174+void MirSurfaceItem::mouseReleaseEvent(QMouseEvent * event)
175+{
176+ event->accept();
177+}
178+
164void MirSurfaceItem::setSurface(MirSurfaceInterface* surface)
179void MirSurfaceItem::setSurface(MirSurfaceInterface* surface)
165{
180{
166 qDebug().nospace() << "MirSurfaceItem::setSurface() this=" << (void*)(this)
181 qDebug().nospace() << "MirSurfaceItem::setSurface() this=" << (void*)(this)
tests/mocks/Unity/Application/MirSurfaceItem.h+3
@@ -79,6 +79,9 @@ Q_SIGNALS:
79
79
80protected:
80protected:
81 void touchEvent(QTouchEvent * event) override;
81 void touchEvent(QTouchEvent * event) override;
82+ void mousePressEvent(QMouseEvent * event) override;
83+ void mouseMoveEvent(QMouseEvent * event) override;
84+ void mouseReleaseEvent(QMouseEvent * event) override;
82 void itemChange(ItemChange change, const ItemChangeData & value) override;
85 void itemChange(ItemChange change, const ItemChangeData & value) override;
83
86
84private Q_SLOTS:
87private Q_SLOTS: