diff options
author | Maximilian Goldstein <max.goldstein@qt.io> | 2021-01-21 12:22:35 +0100 |
---|---|---|
committer | Maximilian Goldstein <max.goldstein@qt.io> | 2021-01-21 13:26:00 +0100 |
commit | e9af4fcf54046d077b6792b25e080ffdacc3f327 (patch) | |
tree | 96248e03133d93d8b416033126ab274a107b549b /src | |
parent | 2fdf354c66cb650605e0349ebf1228f3aa43dacc (diff) |
Qt.labs.animation: Make plugin optional
This moves the animation types into a new library and is meant to make
them availabe to the QML compiler at some point in the future.
Task-number: QTBUG-90487
Change-Id: I19bd864253941931706933f7e517bb31938e9cc2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 3 | ||||
-rw-r--r-- | src/imports/labsanimation/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/imports/labsanimation/plugin.cpp | 4 | ||||
-rw-r--r-- | src/labs/CMakeLists.txt | 5 | ||||
-rw-r--r-- | src/labs/animation/CMakeLists.txt | 21 | ||||
-rw-r--r-- | src/labs/animation/qqmlanimationglobal_p.h | 73 | ||||
-rw-r--r-- | src/labs/animation/qquickboundaryrule.cpp (renamed from src/imports/labsanimation/qquickboundaryrule.cpp) | 0 | ||||
-rw-r--r-- | src/labs/animation/qquickboundaryrule_p.h (renamed from src/imports/labsanimation/qquickboundaryrule_p.h) | 4 |
8 files changed, 107 insertions, 8 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 54de0ba58b..db06625dfd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,7 +8,6 @@ endif() add_subdirectory(qmltyperegistrar) add_subdirectory(qml) add_subdirectory(qmlmodels) -add_subdirectory(labs) if(QT_FEATURE_qml_worker_script) add_subdirectory(qmlworkerscript) @@ -38,6 +37,8 @@ if(TARGET Qt::Gui AND QT_FEATURE_qml_animation) endif() endif() +add_subdirectory(labs) + # special case begin # These need to be included here since they have dependencies on the modules # specified above. diff --git a/src/imports/labsanimation/CMakeLists.txt b/src/imports/labsanimation/CMakeLists.txt index fa460034f2..cdf50468ac 100644 --- a/src/imports/labsanimation/CMakeLists.txt +++ b/src/imports/labsanimation/CMakeLists.txt @@ -9,14 +9,13 @@ qt_internal_add_qml_module(labsanimationplugin VERSION "${CMAKE_PROJECT_VERSION}" CLASSNAME QtLabsAnimationPlugin SKIP_TYPE_REGISTRATION - GENERATE_QMLTYPES - INSTALL_QMLTYPES + PLUGIN_OPTIONAL SOURCES plugin.cpp - qquickboundaryrule.cpp qquickboundaryrule_p.h PUBLIC_LIBRARIES Qt::QmlPrivate Qt::QuickPrivate + Qt::LabsAnimationPrivate ) #### Keys ignored in scope 1:.:.:labsanimation.pro:<TRUE>: diff --git a/src/imports/labsanimation/plugin.cpp b/src/imports/labsanimation/plugin.cpp index ea1c03a56f..11367ab287 100644 --- a/src/imports/labsanimation/plugin.cpp +++ b/src/imports/labsanimation/plugin.cpp @@ -40,9 +40,7 @@ #include <QtQml/qqmlextensionplugin.h> #include <QtQml/qqml.h> -#include "qquickboundaryrule_p.h" - -extern void qml_register_types_Qt_labs_animation(); +#include <QtLabsAnimation/private/qqmlanimationglobal_p.h> QT_BEGIN_NAMESPACE diff --git a/src/labs/CMakeLists.txt b/src/labs/CMakeLists.txt index 5dc715db60..de832a1db2 100644 --- a/src/labs/CMakeLists.txt +++ b/src/labs/CMakeLists.txt @@ -1,4 +1,9 @@ add_subdirectory(settings) + if(QT_FEATURE_qml_itemmodel) add_subdirectory(folderlistmodel) endif() + +if(TARGET Qt::Quick) + add_subdirectory(animation) +endif() diff --git a/src/labs/animation/CMakeLists.txt b/src/labs/animation/CMakeLists.txt new file mode 100644 index 0000000000..77b8ab7fec --- /dev/null +++ b/src/labs/animation/CMakeLists.txt @@ -0,0 +1,21 @@ +qt_internal_add_module(LabsAnimation + GENERATE_METATYPES + SOURCES + qquickboundaryrule.cpp qquickboundaryrule_p.h + qqmlanimationglobal_p.h + DEFINES + QT_BUILD_LABSANIMATION_LIB + PUBLIC_LIBRARIES + Qt::QmlPrivate + Qt::QuickPrivate +) + +set_target_properties(LabsAnimation PROPERTIES + QT_QML_MODULE_INSTALL_QMLTYPES TRUE + QT_QML_MODULE_VERSION ${CMAKE_PROJECT_VERSION} + QT_QML_MODULE_URI Qt.labs.animation + QT_QMLTYPES_FILENAME plugins.qmltypes + QT_QML_MODULE_INSTALL_DIR "${INSTALL_QMLDIR}/Qt/labs/animation" +) + +qt6_qml_type_registration(LabsAnimation) diff --git a/src/labs/animation/qqmlanimationglobal_p.h b/src/labs/animation/qqmlanimationglobal_p.h new file mode 100644 index 0000000000..9ba3ecea2a --- /dev/null +++ b/src/labs/animation/qqmlanimationglobal_p.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2021 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtQml module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QTLABSANIMATIONGLOBAL_P_H +#define QTLABSANIMATIONGLOBAL_P_H + +#include <QtCore/qglobal.h> + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +QT_BEGIN_NAMESPACE + +#if !defined(QT_STATIC) +# if defined(QT_BUILD_LABSANIMATION_LIB) +# define Q_LABSANIMATION_EXPORT Q_DECL_EXPORT +# else +# define Q_LABSANIMATION_EXPORT Q_DECL_IMPORT +# endif +#else +# define Q_LABSANIMATION_EXPORT +#endif +#define Q_LABSANIMATION_PRIVATE_EXPORT Q_LABSANIMATION_EXPORT + +QT_END_NAMESPACE + +void Q_LABSANIMATION_PRIVATE_EXPORT qml_register_types_Qt_labs_animation(); + +#endif // QTLABSANIMATIONGLOBAL_P_H diff --git a/src/imports/labsanimation/qquickboundaryrule.cpp b/src/labs/animation/qquickboundaryrule.cpp index 3083dd26d2..3083dd26d2 100644 --- a/src/imports/labsanimation/qquickboundaryrule.cpp +++ b/src/labs/animation/qquickboundaryrule.cpp diff --git a/src/imports/labsanimation/qquickboundaryrule_p.h b/src/labs/animation/qquickboundaryrule_p.h index 33cf0bb094..0f097b74ad 100644 --- a/src/imports/labsanimation/qquickboundaryrule_p.h +++ b/src/labs/animation/qquickboundaryrule_p.h @@ -40,6 +40,8 @@ #ifndef QQUICKBOUNDARYRULE_H #define QQUICKBOUNDARYRULE_H +#include "qqmlanimationglobal_p.h" + // // W A R N I N G // ------------- @@ -60,7 +62,7 @@ QT_BEGIN_NAMESPACE class QQuickAbstractAnimation; class QQuickBoundaryRulePrivate; -class QQuickBoundaryRule : public QObject, public QQmlPropertyValueInterceptor +class Q_LABSANIMATION_PRIVATE_EXPORT QQuickBoundaryRule : public QObject, public QQmlPropertyValueInterceptor { Q_OBJECT Q_DECLARE_PRIVATE(QQuickBoundaryRule) |