diff options
author | Paul Olav Tvete <paul.tvete@qt.io> | 2017-10-27 10:37:21 +0200 |
---|---|---|
committer | Paul Olav Tvete <paul.tvete@qt.io> | 2017-10-27 10:37:21 +0200 |
commit | 62293cefae129bbfebb0317b39d059b0abb1a16a (patch) | |
tree | 159080c98a85baa02e34776cf2618642ae55d456 /examples/wayland/custom-extension/client-common/customextension.cpp | |
parent | c2b272ac73617a8d5ff25151534feda95ace63ee (diff) | |
parent | 523cf490b4c46916c6f5253c666a492f5cce2aad (diff) |
Merge remote-tracking branch 'qt/5.10' into dev
Change-Id: I4f885a551093ada07da97fd3d99902e36f98595e
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 |