summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2019-02-27 16:02:44 +0100
committerJohan Helsing <johan.helsing@qt.io>2019-03-05 11:02:09 +0000
commitcab9fd474304dac5aeb4ac75087ceb80b82eeb82 (patch)
tree3dfefa9d86b603e12046f05afeecc42e80785a41
parent6ddd66f19442ddf4bee13930dfa3ec0070f67138 (diff)
Compositor: Add revision number for new API
Revisioning API in QML serves two purposes: - Making sure QML code developed against an older version of Qt doesn't change its behavior when run with newer versions. This can otherwise happen due to QML being interpreted, and QML's liberal scoping rules. - Allowing developers to target an older version of Qt, but developing a newer version by explicitly asking for an older import. Change-Id: I837cd449028c4b84c33afa97bcf6c1149801facd Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
-rw-r--r--src/compositor/compositor_api/qwaylandquickitem.h2
-rw-r--r--src/compositor/compositor_api/qwaylandsurface.h8
-rw-r--r--src/imports/compositor/qwaylandquickcompositorplugin.cpp2
3 files changed, 7 insertions, 5 deletions
diff --git a/src/compositor/compositor_api/qwaylandquickitem.h b/src/compositor/compositor_api/qwaylandquickitem.h
index 269e55567..2aa8e1b73 100644
--- a/src/compositor/compositor_api/qwaylandquickitem.h
+++ b/src/compositor/compositor_api/qwaylandquickitem.h
@@ -102,7 +102,7 @@ public:
bool inputRegionContains(const QPointF &localPosition) const;
bool inputRegionContains(const QPointF &localPosition);
Q_INVOKABLE QPointF mapToSurface(const QPointF &point) const;
- Q_INVOKABLE QPointF mapFromSurface(const QPointF &point) const;
+ Q_REVISION(13) Q_INVOKABLE QPointF mapFromSurface(const QPointF &point) const;
bool sizeFollowsSurface() const;
void setSizeFollowsSurface(bool sizeFollowsSurface);
diff --git a/src/compositor/compositor_api/qwaylandsurface.h b/src/compositor/compositor_api/qwaylandsurface.h
index 9bf842900..cc09561f9 100644
--- a/src/compositor/compositor_api/qwaylandsurface.h
+++ b/src/compositor/compositor_api/qwaylandsurface.h
@@ -81,8 +81,8 @@ class Q_WAYLAND_COMPOSITOR_EXPORT QWaylandSurface : public QWaylandObject
Q_OBJECT
Q_DECLARE_PRIVATE(QWaylandSurface)
Q_PROPERTY(QWaylandClient *client READ client CONSTANT)
- Q_PROPERTY(QRectF sourceGeometry READ sourceGeometry NOTIFY sourceGeometryChanged)
- Q_PROPERTY(QSize destinationSize READ destinationSize NOTIFY destinationSizeChanged)
+ Q_PROPERTY(QRectF sourceGeometry READ sourceGeometry NOTIFY sourceGeometryChanged REVISION 13)
+ Q_PROPERTY(QSize destinationSize READ destinationSize NOTIFY destinationSizeChanged REVISION 13)
#if QT_DEPRECATED_SINCE(5, 13)
Q_PROPERTY(QSize size READ size NOTIFY sizeChanged) // Qt 6: Remove
#endif
@@ -164,8 +164,8 @@ Q_SIGNALS:
void damaged(const QRegion &rect);
void parentChanged(QWaylandSurface *newParent, QWaylandSurface *oldParent);
void childAdded(QWaylandSurface *child);
- void sourceGeometryChanged();
- void destinationSizeChanged();
+ Q_REVISION(13) void sourceGeometryChanged();
+ Q_REVISION(13) void destinationSizeChanged();
#if QT_DEPRECATED_SINCE(5, 13)
QT_DEPRECATED void sizeChanged();
#endif
diff --git a/src/imports/compositor/qwaylandquickcompositorplugin.cpp b/src/imports/compositor/qwaylandquickcompositorplugin.cpp
index d0a38c58c..df7536ed1 100644
--- a/src/imports/compositor/qwaylandquickcompositorplugin.cpp
+++ b/src/imports/compositor/qwaylandquickcompositorplugin.cpp
@@ -132,10 +132,12 @@ public:
{
qmlRegisterType<QWaylandQuickCompositorQuickExtensionContainer>(uri, 1, 0, "WaylandCompositor");
qmlRegisterType<QWaylandQuickItem>(uri, 1, 0, "WaylandQuickItem");
+ qmlRegisterType<QWaylandQuickItem, 13>(uri, 1, 13, "WaylandQuickItem");
qmlRegisterType<QWaylandQuickHardwareLayer>(uri, 1, 2, "WaylandHardwareLayer");
qmlRegisterType<QWaylandMouseTracker>(uri, 1, 0, "WaylandMouseTracker");
qmlRegisterType<QWaylandQuickOutput>(uri, 1, 0, "WaylandOutput");
qmlRegisterType<QWaylandQuickSurface>(uri, 1, 0, "WaylandSurface");
+ qmlRegisterType<QWaylandQuickSurface, 13>(uri, 1, 13, "WaylandSurface");
qmlRegisterType<QWaylandKeymap>(uri, 1, 0, "WaylandKeymap");
qmlRegisterUncreatableType<QWaylandCompositorExtension>(uri, 1, 0, "WaylandExtension", QObject::tr("Cannot create instance of WaylandExtension"));