diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-06-03 08:44:35 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2021-06-05 09:06:27 +0200 |
commit | 1a9799d015337f405a2eb1264fe5e90ec68c47bf (patch) | |
tree | ccb28db25d7201f5083ef544ece03f35cdf8d45f /src | |
parent | 686f8f6e500ca0e84e8b95da54d2a5a0193a3299 (diff) |
Port to new CMake qml API
Change-Id: I043af5dabef71aa08b19252b0ecee6663ca25a7d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/chartsqml2/CMakeLists.txt | 182 | ||||
-rw-r--r-- | src/chartsqml2/chartsqml2_plugin.cpp | 50 | ||||
-rw-r--r-- | src/chartsqml2/qmldir | 4 |
3 files changed, 80 insertions, 156 deletions
diff --git a/src/chartsqml2/CMakeLists.txt b/src/chartsqml2/CMakeLists.txt index ab21ac77..848f9c10 100644 --- a/src/chartsqml2/CMakeLists.txt +++ b/src/chartsqml2/CMakeLists.txt @@ -1,97 +1,3 @@ -# Generated from chartsqml2.pro. - -##################################################################### -## qtchartsqml2 Plugin: -##################################################################### - -qt_internal_add_qml_module(qtchartsqml2 - URI "QtCharts" # special case - VERSION "${PROJECT_VERSION}" - CLASSNAME QtChartsQml2Plugin - PLUGIN_OPTIONAL - SKIP_TYPE_REGISTRATION - PAST_MAJOR_VERSIONS 1 2 - DEPENDENCIES - QtQuick - SOURCES - chartsqml2_plugin.cpp - declarativeabstractrendernode_p.h - declarativeaxes.cpp declarativeaxes_p.h - declarativecategoryaxis.cpp declarativecategoryaxis_p.h - declarativechart.cpp declarativechart_p.h - declarativechartglobal_p.h - declarativechartnode.cpp declarativechartnode_p.h - declarativeforeigntypes_p.h - declarativemargins.cpp declarativemargins_p.h - declarativepolarchart.cpp declarativepolarchart_p.h - declarativexypoint.cpp declarativexypoint_p.h - declarativexyseries.cpp declarativexyseries_p.h - DEFINES - QT_BUILD_QMLCHARTS_LIB - INCLUDE_DIRECTORIES - ${CMAKE_CURRENT_SOURCE_DIR} - LIBRARIES - Qt::ChartsPrivate - Qt::CorePrivate - PUBLIC_LIBRARIES - Qt::Charts - Qt::Core - Qt::Gui - Qt::Qml - Qt::Quick -) - -qt_internal_extend_target(qtchartsqml2 CONDITION QT_FEATURE_opengl - SOURCES - declarativeopenglrendernode.cpp declarativeopenglrendernode_p.h - PUBLIC_LIBRARIES - Qt::OpenGL -) - -qt_internal_extend_target(qtchartsqml2 CONDITION QT_FEATURE_charts_line_chart - SOURCES - declarativelineseries.cpp declarativelineseries_p.h -) - -qt_internal_extend_target(qtchartsqml2 CONDITION QT_FEATURE_charts_spline_chart - SOURCES - declarativesplineseries.cpp declarativesplineseries_p.h -) - -qt_internal_extend_target(qtchartsqml2 CONDITION QT_FEATURE_charts_area_chart - SOURCES - declarativeareaseries.cpp declarativeareaseries_p.h -) - -qt_internal_extend_target(qtchartsqml2 CONDITION QT_FEATURE_charts_scatter_chart - SOURCES - declarativescatterseries.cpp declarativescatterseries_p.h -) - -qt_internal_extend_target(qtchartsqml2 CONDITION QT_FEATURE_charts_pie_chart - SOURCES - declarativepieseries.cpp declarativepieseries_p.h -) - -qt_internal_extend_target(qtchartsqml2 CONDITION QT_FEATURE_charts_bar_chart - SOURCES - declarativebarseries.cpp declarativebarseries_p.h -) - -qt_internal_extend_target(qtchartsqml2 CONDITION QT_FEATURE_charts_boxplot_chart - SOURCES - declarativeboxplotseries.cpp declarativeboxplotseries_p.h -) - -qt_internal_extend_target(qtchartsqml2 CONDITION QT_FEATURE_charts_candlestick_chart - SOURCES - declarativecandlestickseries.cpp declarativecandlestickseries_p.h -) - -#### Keys ignored in scope 11:.:.:chartsqml2.pro:WIN32: -# QMAKE_TARGET_DESCRIPTION = "Charts QML plugin for Qt." -# QMAKE_TARGET_PRODUCT = "Qt Charts (Qt $$QT_VERSION)" - set(qml_files "designer/ChartViewSpecifics.qml" "designer/default/AreaSeries.qml" @@ -144,6 +50,7 @@ set(qml_files "designer/images/splineseries-polar-icon.png" "designer/images/splineseries-polar-icon16.png" ) + set_source_files_properties(designer/ChartViewSpecifics.qml PROPERTIES QT_QML_SKIP_QMLDIR_ENTRY TRUE ) @@ -295,15 +202,86 @@ set_source_files_properties(designer/images/splineseries-polar-icon16.png PROPER QT_QML_SKIP_QMLDIR_ENTRY TRUE ) -qt6_target_qml_files(qtchartsqml2 - FILES - ${qml_files} +qt_internal_add_qml_module(ChartsQml + URI "QtCharts" # special case + VERSION "${PROJECT_VERSION}" + CLASS_NAME QtChartsQml2Plugin + PLUGIN_TARGET qtchartsqml2 + QML_FILES ${qml_files} + PAST_MAJOR_VERSIONS 1 2 + DEPENDENCIES + QtQuick + QtCharts + SOURCES + declarativeabstractrendernode_p.h + declarativeaxes.cpp declarativeaxes_p.h + declarativecategoryaxis.cpp declarativecategoryaxis_p.h + declarativechart.cpp declarativechart_p.h + declarativechartglobal_p.h + declarativechartnode.cpp declarativechartnode_p.h + declarativeforeigntypes_p.h + declarativemargins.cpp declarativemargins_p.h + declarativepolarchart.cpp declarativepolarchart_p.h + declarativexypoint.cpp declarativexypoint_p.h + declarativexyseries.cpp declarativexyseries_p.h + DEFINES + QT_BUILD_QMLCHARTS_LIB + INCLUDE_DIRECTORIES + ${CMAKE_CURRENT_SOURCE_DIR} + LIBRARIES + Qt::ChartsPrivate + Qt::CorePrivate + PUBLIC_LIBRARIES + Qt::Charts + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick ) -set_target_properties(qtchartsqml2 PROPERTIES - QT_QML_MODULE_INSTALL_QMLTYPES TRUE - QT_QML_MODULE_VERSION "${PROJECT_VERSION}" - QT_QML_MODULE_URI QtCharts +qt_internal_extend_target(ChartsQml CONDITION QT_FEATURE_opengl + SOURCES + declarativeopenglrendernode.cpp declarativeopenglrendernode_p.h + PUBLIC_LIBRARIES + Qt::OpenGL +) + +qt_internal_extend_target(ChartsQml CONDITION QT_FEATURE_charts_line_chart + SOURCES + declarativelineseries.cpp declarativelineseries_p.h +) + +qt_internal_extend_target(ChartsQml CONDITION QT_FEATURE_charts_spline_chart + SOURCES + declarativesplineseries.cpp declarativesplineseries_p.h +) + +qt_internal_extend_target(ChartsQml CONDITION QT_FEATURE_charts_area_chart + SOURCES + declarativeareaseries.cpp declarativeareaseries_p.h +) + +qt_internal_extend_target(ChartsQml CONDITION QT_FEATURE_charts_scatter_chart + SOURCES + declarativescatterseries.cpp declarativescatterseries_p.h ) -qt6_qml_type_registration(qtchartsqml2) +qt_internal_extend_target(ChartsQml CONDITION QT_FEATURE_charts_pie_chart + SOURCES + declarativepieseries.cpp declarativepieseries_p.h +) + +qt_internal_extend_target(ChartsQml CONDITION QT_FEATURE_charts_bar_chart + SOURCES + declarativebarseries.cpp declarativebarseries_p.h +) + +qt_internal_extend_target(ChartsQml CONDITION QT_FEATURE_charts_boxplot_chart + SOURCES + declarativeboxplotseries.cpp declarativeboxplotseries_p.h +) + +qt_internal_extend_target(ChartsQml CONDITION QT_FEATURE_charts_candlestick_chart + SOURCES + declarativecandlestickseries.cpp declarativecandlestickseries_p.h +) diff --git a/src/chartsqml2/chartsqml2_plugin.cpp b/src/chartsqml2/chartsqml2_plugin.cpp deleted file mode 100644 index ddd01b02..00000000 --- a/src/chartsqml2/chartsqml2_plugin.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Charts module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) 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.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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QtQml/qqmlextensionplugin.h> -#include "declarativechartglobal_p.h" - -QT_BEGIN_NAMESPACE - -class QtChartsQml2Plugin : public QQmlEngineExtensionPlugin -{ - Q_OBJECT - Q_PLUGIN_METADATA(IID QQmlEngineExtensionInterface_iid) - -public: - QtChartsQml2Plugin(QObject *parent = nullptr) : QQmlEngineExtensionPlugin(parent) - { - volatile auto registration = &qml_register_types_QtCharts; - Q_UNUSED(registration); - } -}; - -QT_END_NAMESPACE - -#include "chartsqml2_plugin.moc" diff --git a/src/chartsqml2/qmldir b/src/chartsqml2/qmldir deleted file mode 100644 index 10f4c598..00000000 --- a/src/chartsqml2/qmldir +++ /dev/null @@ -1,4 +0,0 @@ -module QtCharts -plugin qtchartsqml2 -classname QtChartsQml2Plugin - |