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.cpp | |
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.cpp')
-rw-r--r-- | examples/wayland/custom-extension/client-common/customextension.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/examples/wayland/custom-extension/client-common/customextension.cpp b/examples/wayland/custom-extension/client-common/customextension.cpp index 81f524d9d..41b4a30e9 100644 --- a/examples/wayland/custom-extension/client-common/customextension.cpp +++ b/examples/wayland/custom-extension/client-common/customextension.cpp @@ -109,6 +109,12 @@ void CustomExtension::registerWindow(QWindow *window) sendWindowRegistration(window); } +CustomExtensionObject *CustomExtension::createCustomObject(const QString &color, const QString &text) +{ + auto *obj = create_local_object(color, text); + return new CustomExtensionObject(obj, text); +} + void CustomExtension::sendBounce(QWindow *window, uint ms) { QtWayland::qt_example_extension::bounce(getWlSurface(window), ms); @@ -152,4 +158,24 @@ void CustomExtension::example_extension_set_window_decoration(uint32_t state) } } +CustomExtensionObject::CustomExtensionObject(struct ::qt_example_local_object *wl_object, const QString &text) + : QWaylandClientExtensionTemplate<CustomExtensionObject>(1) + , QtWayland::qt_example_local_object(wl_object) + , m_text(text) +{ + +} + +void CustomExtensionObject::example_local_object_clicked() +{ + qDebug() << "Object clicked:" << m_text; + emit clicked(); +} + +void CustomExtensionObject::setText(const QString &text) +{ + m_text = text; + set_text(text); +} + QT_END_NAMESPACE |