summaryrefslogtreecommitdiff
path: root/examples/wayland/custom-extension/client-common/customextension.h
diff options
context:
space:
mode:
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 e76682f6..003a5a00 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