diff options
author | Paul Olav Tvete <paul.tvete@qt.io> | 2017-10-25 14:06:54 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2017-10-25 14:06:54 +0200 |
commit | 523cf490b4c46916c6f5253c666a492f5cce2aad (patch) | |
tree | b4514f338b143ab430fe2b91ec7699cb176a147e /examples/wayland/custom-extension/client-common/customextension.h | |
parent | 8e3c71b2d1ec37222bf1648aa23eb033062b4ea6 (diff) | |
parent | f1407493d6d25f24a3c71fbcedc00598baa44b56 (diff) |
Merge remote-tracking branch 'qt/5.9' into 5.10v5.10.0-beta3
Change-Id: I6c283081669594b3e8c6b30194bb96e389319cb2
Diffstat (limited to 'examples/wayland/custom-extension/client-common/customextension.h')
-rw-r--r-- | examples/wayland/custom-extension/client-common/customextension.h | 34 |
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 |