diff options
author | Kai Uwe Broulik <kde@privat.broulik.de> | 2021-08-02 19:37:26 +0200 |
---|---|---|
committer | Kai Uwe Broulik <kde@privat.broulik.de> | 2021-08-10 14:57:54 +0200 |
commit | 8ef15a868c6135cb5d00ef4b1db89e3b06fd9870 (patch) | |
tree | 87285050279c41d2a68109356cade304eb121163 /src | |
parent | 3c04dd8b26e276ae7649021135496d1ed3b111f1 (diff) | |
download | qtwayland-8ef15a868c6135cb5d00ef4b1db89e3b06fd9870.tar.gz |
QWaylandQuickItem: Invoke handleSubsurfaceAdded also with QVariant
Docs for WaylandQuickItem subsurfaceHandler suggest you use it like so:
subsurfaceHandler: QtObject {
function handleSubsurfaceAdded(child) {
...
}
}
However, as far as C++ is concerned all arguments of a JavaScript
function are QVariant, so the type-specific invocation fails.
Change-Id: I2d1a32bef5b30099cf34edc8a9e50b42fb26f217
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/compositor/compositor_api/qwaylandquickitem.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/compositor/compositor_api/qwaylandquickitem.cpp b/src/compositor/compositor_api/qwaylandquickitem.cpp index 708baf36..bf165b15 100644 --- a/src/compositor/compositor_api/qwaylandquickitem.cpp +++ b/src/compositor/compositor_api/qwaylandquickitem.cpp @@ -846,6 +846,10 @@ void QWaylandQuickItem::handleSubsurfaceAdded(QWaylandSurface *childSurface) } else { bool success = QMetaObject::invokeMethod(d->subsurfaceHandler, "handleSubsurfaceAdded", Q_ARG(QWaylandSurface *, childSurface)); if (!success) + success = QMetaObject::invokeMethod(d->subsurfaceHandler, "handleSubsurfaceAdded", + Q_ARG(QVariant, QVariant::fromValue(childSurface))); + + if (!success) qWarning("QWaylandQuickItem: subsurfaceHandler does not implement handleSubsurfaceAdded()"); } } |