From ac46c9f6ce9ef757e0ccba8a283cb0efabaef56e Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 31 Jan 2020 16:05:52 +0100 Subject: Synthetically reference type registration functions Add unused volatile pointers to the type registration functions in each import plugin. We need to do this in order to prevent the linker from optimizing the registration away. There are two ways for this to happen: When linking statically, the linker will examine the referenced symbols on a per-object base and leave out all unreferenced objects. When linking dynamically, the linker may do the same on a per-library base and drop any unreferenced libraries from the dependencies. Forcing a reference to the type registration function prevents both. The volatile technique allows us to remove the previous qCDebug() hack. Having an unused volatile auto variable should only result in a single memory read as runtime overhead. The qCDebug() technique would generate a read and a block of mostly dead code (as no one would ever use that logging category). Fixes: QTBUG-81622 Change-Id: I255667276dfd355b19baa17b1aad3db406bf1954 Reviewed-by: Fabian Kosmale --- src/quickshapes/qquickshapesglobal_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/quickshapes') diff --git a/src/quickshapes/qquickshapesglobal_p.h b/src/quickshapes/qquickshapesglobal_p.h index 2f559b45a0..40f6cfbdcf 100644 --- a/src/quickshapes/qquickshapesglobal_p.h +++ b/src/quickshapes/qquickshapesglobal_p.h @@ -59,5 +59,6 @@ QT_BEGIN_NAMESPACE QT_END_NAMESPACE +void Q_QUICKSHAPES_PRIVATE_EXPORT qml_register_types_QtQuick_Shapes(); #endif // QQUICKSHAPESGLOBAL_P_H -- cgit v1.2.3 From ddde036f6a5781dc0481fae293bd387b3344171a Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 16 Jan 2020 13:42:11 +0100 Subject: Add major version to all Q_REVISIONs Change-Id: Id72fbe10c16de61bd847773d0055d83cfe03f63c Reviewed-by: Fabian Kosmale --- src/quickshapes/qquickshape_p.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/quickshapes') diff --git a/src/quickshapes/qquickshape_p.h b/src/quickshapes/qquickshape_p.h index f86f2b03d6..ca72c628c5 100644 --- a/src/quickshapes/qquickshape_p.h +++ b/src/quickshapes/qquickshape_p.h @@ -76,6 +76,7 @@ class Q_QUICKSHAPES_PRIVATE_EXPORT QQuickShapeGradient : public QQuickGradient Q_CLASSINFO("DefaultProperty", "stops") QML_NAMED_ELEMENT(ShapeGradient) + QML_ADDED_IN_VERSION(1, 0) QML_UNCREATABLE("ShapeGradient is an abstract base class."); public: @@ -107,6 +108,7 @@ class Q_QUICKSHAPES_PRIVATE_EXPORT QQuickShapeLinearGradient : public QQuickShap Q_PROPERTY(qreal y2 READ y2 WRITE setY2 NOTIFY y2Changed) Q_CLASSINFO("DefaultProperty", "stops") QML_NAMED_ELEMENT(LinearGradient) + QML_ADDED_IN_VERSION(1, 0) public: QQuickShapeLinearGradient(QObject *parent = nullptr); @@ -142,6 +144,7 @@ class Q_QUICKSHAPES_PRIVATE_EXPORT QQuickShapeRadialGradient : public QQuickShap Q_PROPERTY(qreal focalRadius READ focalRadius WRITE setFocalRadius NOTIFY focalRadiusChanged) Q_CLASSINFO("DefaultProperty", "stops") QML_NAMED_ELEMENT(RadialGradient) + QML_ADDED_IN_VERSION(1, 0) public: QQuickShapeRadialGradient(QObject *parent = nullptr); @@ -187,6 +190,7 @@ class Q_QUICKSHAPES_PRIVATE_EXPORT QQuickShapeConicalGradient : public QQuickSha Q_PROPERTY(qreal angle READ angle WRITE setAngle NOTIFY angleChanged) Q_CLASSINFO("DefaultProperty", "stops") QML_NAMED_ELEMENT(ConicalGradient) + QML_ADDED_IN_VERSION(1, 0) public: QQuickShapeConicalGradient(QObject *parent = nullptr); @@ -225,8 +229,9 @@ class Q_QUICKSHAPES_PRIVATE_EXPORT QQuickShapePath : public QQuickPath Q_PROPERTY(qreal dashOffset READ dashOffset WRITE setDashOffset NOTIFY dashOffsetChanged) Q_PROPERTY(QVector dashPattern READ dashPattern WRITE setDashPattern NOTIFY dashPatternChanged) Q_PROPERTY(QQuickShapeGradient *fillGradient READ fillGradient WRITE setFillGradient RESET resetFillGradient) - Q_PROPERTY(QSizeF scale READ scale WRITE setScale NOTIFY scaleChanged REVISION 14) + Q_PROPERTY(QSizeF scale READ scale WRITE setScale NOTIFY scaleChanged REVISION(1, 14)) QML_NAMED_ELEMENT(ShapePath) + QML_ADDED_IN_VERSION(1, 0) public: enum FillRule { @@ -318,10 +323,11 @@ class Q_QUICKSHAPES_PRIVATE_EXPORT QQuickShape : public QQuickItem Q_PROPERTY(bool asynchronous READ asynchronous WRITE setAsynchronous NOTIFY asynchronousChanged) Q_PROPERTY(bool vendorExtensionsEnabled READ vendorExtensionsEnabled WRITE setVendorExtensionsEnabled NOTIFY vendorExtensionsEnabledChanged) Q_PROPERTY(Status status READ status NOTIFY statusChanged) - Q_PROPERTY(ContainsMode containsMode READ containsMode WRITE setContainsMode NOTIFY containsModeChanged REVISION 11) + Q_PROPERTY(ContainsMode containsMode READ containsMode WRITE setContainsMode NOTIFY containsModeChanged REVISION(1, 11)) Q_PROPERTY(QQmlListProperty data READ data) Q_CLASSINFO("DefaultProperty", "data") QML_NAMED_ELEMENT(Shape) + QML_ADDED_IN_VERSION(1, 0) public: enum RendererType { @@ -377,7 +383,7 @@ Q_SIGNALS: void asynchronousChanged(); void vendorExtensionsEnabledChanged(); void statusChanged(); - Q_REVISION(11) void containsModeChanged(); + Q_REVISION(1, 11) void containsModeChanged(); private: Q_DISABLE_COPY(QQuickShape) -- cgit v1.2.3 From e33e250080dbbb01015daafc8a79b569806d9467 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Fri, 17 Jan 2020 10:46:54 +0100 Subject: Fix all import versions Bump all the *.15 versions to QT_VERSION and use QML_IMPORT_VERSION rather than IMPORT_VERSION. Change-Id: I5bfbc960d119a7386bdcedb9bdbfdbfa4486a187 Reviewed-by: Fabian Kosmale Reviewed-by: Mitch Curtis --- src/quickshapes/quickshapes.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/quickshapes') diff --git a/src/quickshapes/quickshapes.pro b/src/quickshapes/quickshapes.pro index 7c71aa4f4a..7b77391d92 100644 --- a/src/quickshapes/quickshapes.pro +++ b/src/quickshapes/quickshapes.pro @@ -35,5 +35,5 @@ load(qt_module) QMLTYPES_FILENAME = plugins.qmltypes QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQuick/Shapes QML_IMPORT_NAME = QtQuick.Shapes -IMPORT_VERSION = 1.15 +QML_IMPORT_VERSION = $$QT_VERSION CONFIG += qmltypes install_qmltypes install_metatypes -- cgit v1.2.3