@@ -37,6 +37,10 @@ class MirSurfaceItem : public QQuickItem
37 Q_PROPERTY(bool live READ live NOTIFY liveChanged)
37 Q_PROPERTY(bool live READ live NOTIFY liveChanged)
38 Q_PROPERTY(OrientationAngle orientationAngle READ orientationAngle WRITE setOrientationAngle
38 Q_PROPERTY(OrientationAngle orientationAngle READ orientationAngle WRITE setOrientationAngle
39 NOTIFY orientationAngleChanged DESIGNABLE false)
39 NOTIFY orientationAngleChanged DESIGNABLE false)
40+ Q_PROPERTY(int touchPressCount READ touchPressCount WRITE setTouchPressCount
41+ NOTIFY touchPressCountChanged DESIGNABLE false)
42+ Q_PROPERTY(int touchReleaseCount READ touchReleaseCount WRITE setTouchReleaseCount
43+ NOTIFY touchReleaseCountChanged DESIGNABLE false)
42 enum Type {
46 enum Type {
@@ -85,11 +89,19 @@ public:
85 Q_INVOKABLE void setState(State newState);
89 Q_INVOKABLE void setState(State newState);
86 Q_INVOKABLE void release();
90 Q_INVOKABLE void release();
92+ int touchPressCount() const { return m_touchPressCount; }
93+ void setTouchPressCount(int count) { m_touchPressCount = count; Q_EMIT touchPressCountChanged(count); }
95+ int touchReleaseCount() const { return m_touchReleaseCount; }
96+ void setTouchReleaseCount(int count) { m_touchReleaseCount = count; Q_EMIT touchReleaseCountChanged(count); }
89 void typeChanged(Type);
99 void typeChanged(Type);
90 void stateChanged(State);
100 void stateChanged(State);
91 void liveChanged(bool live);
101 void liveChanged(bool live);
92 void orientationAngleChanged(OrientationAngle angle);
102 void orientationAngleChanged(OrientationAngle angle);
103+ void touchPressCountChanged(int count);
104+ void touchReleaseCountChanged(int count);
94 // internal mock use
106 // internal mock use
95 void deregister();
107 void deregister();
@@ -102,6 +114,8 @@ protected:
102 const QString &qmlFilePath = QString(),
114 const QString &qmlFilePath = QString(),
103 QQuickItem *parent = 0);
115 QQuickItem *parent = 0);
117+ void touchEvent(QTouchEvent * event) override;
105private Q_SLOTS:
119private Q_SLOTS:
106 void onComponentStatusChanged(QQmlComponent::Status status);
120 void onComponentStatusChanged(QQmlComponent::Status status);
@@ -120,6 +134,9 @@ private:
120 QQuickItem *m_qmlItem;
134 QQuickItem *m_qmlItem;
121 QUrl m_screenshotUrl;
135 QUrl m_screenshotUrl;
137+ int m_touchPressCount;
138+ int m_touchReleaseCount;
123 friend class SurfaceManager;
140 friend class SurfaceManager;