summaryrefslogtreecommitdiffstats
path: root/examples/wayland/custom-extension/client-common/customextension.h
diff options
context:
space:
mode:
authorPaul Olav Tvete <paul.tvete@qt.io>2017-10-27 10:37:21 +0200
committerPaul Olav Tvete <paul.tvete@qt.io>2017-10-27 10:37:21 +0200
commit62293cefae129bbfebb0317b39d059b0abb1a16a (patch)
tree159080c98a85baa02e34776cf2618642ae55d456 /examples/wayland/custom-extension/client-common/customextension.h
parentc2b272ac73617a8d5ff25151534feda95ace63ee (diff)
parent523cf490b4c46916c6f5253c666a492f5cce2aad (diff)
Merge remote-tracking branch 'qt/5.10' into dev
Diffstat (limited to 'examples/wayland/custom-extension/client-common/customextension.h')
-rw-r--r--examples/wayland/custom-extension/client-common/customextension.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/examples/wayland/custom-extension/client-common/customextension.h b/examples/wayland/custom-extension/client-common/customextension.h
index e76682f62..003a5a008 100644
--- a/examples/wayland/custom-extension/client-common/customextension.h
+++ b/examples/wayland/custom-extension/client-common/customextension.h
@@ -58,6 +58,8 @@
QT_BEGIN_NAMESPACE
+class CustomExtensionObject;
+
class CustomExtension : public QWaylandClientExtensionTemplate<CustomExtension>
, public QtWayland::qt_example_extension
{
@@ -66,6 +68,8 @@ public:
CustomExtension();
Q_INVOKABLE void registerWindow(QWindow *window);
+ CustomExtensionObject *createCustomObject(const QString &color, const QString &text);
+
public slots:
void sendBounce(QWindow *window, uint ms);
void sendSpin(QWindow *window, uint ms);
@@ -92,6 +96,36 @@ private:
bool m_activated;
};
+class CustomExtensionObject : public QWaylandClientExtensionTemplate<CustomExtensionObject>
+ , public QtWayland::qt_example_local_object
+{
+ Q_OBJECT
+ Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged)
+public:
+ CustomExtensionObject(struct ::qt_example_local_object *wl_object, const QString &text);
+
+ QString text() const
+ {
+ return m_text;
+ }
+
+protected:
+ void example_local_object_clicked() override;
+
+public slots:
+ void setText(const QString &text);
+
+
+signals:
+ void textChanged(const QString &text);
+ void clicked();
+
+private:
+ QString m_text;
+};
+
+
+
QT_END_NAMESPACE
#endif // CUSTOMEXTENSION_H