diff options
Diffstat (limited to 'src/datavisualizationqml')
32 files changed, 249 insertions, 892 deletions
diff --git a/src/datavisualizationqml/CMakeLists.txt b/src/datavisualizationqml/CMakeLists.txt index e185e9de..110a5ef0 100644 --- a/src/datavisualizationqml/CMakeLists.txt +++ b/src/datavisualizationqml/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + set(qml_files "designer/Bars3DSpecifics.qml" "designer/Scatter3DSpecifics.qml" @@ -41,17 +44,20 @@ qt_internal_add_qml_module(DataVisualizationQml enumtostringmap.cpp enumtostringmap_p.h foreigntypes_p.h glstatestore.cpp glstatestore_p.h + NO_PCH_SOURCES + declarativetheme.cpp # undef QT_NO_FOREACH QML_FILES ${qml_files} RESOURCES ${resources} - PUBLIC_LIBRARIES - Qt::Core + LIBRARIES + Qt::CorePrivate Qt::Gui Qt::OpenGL Qt::Qml Qt::Quick - DataVisualizationPrivate + Qt::DataVisualizationPrivate + NO_GENERATE_CPP_EXPORTS ) qt_internal_extend_target(DataVisualizationQml CONDITION MACOS diff --git a/src/datavisualizationqml/abstractdeclarative.cpp b/src/datavisualizationqml/abstractdeclarative.cpp index 81a889a0..af19d46f 100644 --- a/src/datavisualizationqml/abstractdeclarative.cpp +++ b/src/datavisualizationqml/abstractdeclarative.cpp @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "abstractdeclarative_p.h" #include "declarativetheme_p.h" @@ -34,7 +8,7 @@ #if defined(Q_OS_IOS) #include <QtCore/QTimer> #endif -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) #include <qpa/qplatformnativeinterface.h> #endif @@ -50,6 +24,7 @@ static QHash<AbstractDeclarative *, QQuickWindow *> graphWindowList; AbstractDeclarative::AbstractDeclarative(QQuickItem *parent) : QQuickItem(parent), + AbstractDeclarativeInterface(), m_controller(0), m_contextWindow(0), m_renderMode(RenderIndirect), @@ -68,6 +43,9 @@ AbstractDeclarative::AbstractDeclarative(QQuickItem *parent) : // Set contents to false in case we are in qml designer to make component look nice m_runningInDesigner = QGuiApplication::applicationDisplayName() == QLatin1String("Qml2Puppet"); setFlag(ItemHasContents, !m_runningInDesigner); + + // Accept touchevents + setAcceptTouchEvents(true); } AbstractDeclarative::~AbstractDeclarative() @@ -86,8 +64,11 @@ AbstractDeclarative::~AbstractDeclarative() void AbstractDeclarative::setRenderingMode(AbstractDeclarative::RenderingMode mode) { - if (mode == m_renderMode) + if (mode == m_renderMode + || mode <= AbstractDeclarative::RenderingMode::RenderDirectToBackground + || mode >= AbstractDeclarative::RenderingMode::RenderIndirect) { return; + } RenderingMode previousMode = m_renderMode; @@ -182,6 +163,11 @@ void AbstractDeclarative::clearSelection() m_controller->clearSelection(); } +bool AbstractDeclarative::hasSeries(QAbstract3DSeries *series) +{ + return m_controller->hasSeries(series); +} + void AbstractDeclarative::setSelectionMode(SelectionFlags mode) { int intmode = int(mode); @@ -442,7 +428,7 @@ void AbstractDeclarative::handleWindowChanged(QQuickWindow *window) if (!window) return; -#if defined(Q_OS_OSX) +#if defined(Q_OS_MACOS) bool previousVisibility = window->isVisible(); // Enable touch events for Mac touchpads window->setVisible(true); @@ -579,7 +565,7 @@ void AbstractDeclarative::render() QOpenGLFunctions *funcs = QOpenGLContext::currentContext()->functions(); - if (isVisible()) { + if (funcs && isVisible()) { funcs->glDepthMask(GL_TRUE); funcs->glEnable(GL_DEPTH_TEST); funcs->glDepthFunc(GL_LESS); @@ -661,8 +647,8 @@ void AbstractDeclarative::checkWindowList(QQuickWindow *window) } QList<QQuickWindow *> windowList; - - foreach (AbstractDeclarative *graph, graphWindowList.keys()) { + const auto graphs = graphWindowList.keys(); + for (AbstractDeclarative *graph : graphs) { if (graph->m_renderMode == RenderDirectToBackground || graph->m_renderMode == RenderDirectToBackground_NoClear) { windowList.append(graphWindowList.value(graph)); diff --git a/src/datavisualizationqml/abstractdeclarative_p.h b/src/datavisualizationqml/abstractdeclarative_p.h index 3b9d4d96..090738c5 100644 --- a/src/datavisualizationqml/abstractdeclarative_p.h +++ b/src/datavisualizationqml/abstractdeclarative_p.h @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // // W A R N I N G @@ -44,6 +18,7 @@ #include <private/datavisualizationglobal_p.h> #include <private/abstract3dcontroller_p.h> +#include <QtDataVisualization/private/abstractdeclarativeinterface_p.h> #include <QtQuick/QQuickItem> #include <QtCore/QPointer> @@ -55,7 +30,7 @@ class GLStateStore; QT_BEGIN_NAMESPACE -class AbstractDeclarative : public QQuickItem +class AbstractDeclarative : public QQuickItem, public AbstractDeclarativeInterface { Q_OBJECT Q_PROPERTY(SelectionFlags selectionMode READ selectionMode WRITE setSelectionMode NOTIFY selectionModeChanged) @@ -135,6 +110,8 @@ public: Q_ENUM(ShadowQuality) Q_ENUM(RenderingMode) Q_ENUM(ElementType) + Q_ENUM(SelectionFlag) + Q_ENUM(OptimizationHint) Q_FLAGS(SelectionFlag SelectionFlags) Q_FLAGS(OptimizationHint OptimizationHints) @@ -168,6 +145,8 @@ public: Q_INVOKABLE virtual void clearSelection(); + Q_REVISION(6, 3) Q_INVOKABLE virtual bool hasSeries(QAbstract3DSeries *series); + Q_REVISION(1, 1) Q_INVOKABLE virtual int addCustomItem(QCustom3DItem *item); Q_REVISION(1, 1) Q_INVOKABLE virtual void removeCustomItems(); Q_REVISION(1, 1) Q_INVOKABLE virtual void removeCustomItem(QCustom3DItem *item); @@ -237,7 +216,7 @@ public: QMutex *mutex() { return &m_mutex; } - bool isReady() { return isComponentComplete(); } + bool isReady() const override { return isComponentComplete(); } public Q_SLOTS: virtual void handleAxisXChanged(QAbstract3DAxis *axis) = 0; diff --git a/src/datavisualizationqml/colorgradient.cpp b/src/datavisualizationqml/colorgradient.cpp index 3f6881b0..c00c43aa 100644 --- a/src/datavisualizationqml/colorgradient.cpp +++ b/src/datavisualizationqml/colorgradient.cpp @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "colorgradient_p.h" diff --git a/src/datavisualizationqml/colorgradient_p.h b/src/datavisualizationqml/colorgradient_p.h index ec21cd2f..5e5d0e51 100644 --- a/src/datavisualizationqml/colorgradient_p.h +++ b/src/datavisualizationqml/colorgradient_p.h @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // // W A R N I N G @@ -67,7 +41,7 @@ public: Q_SIGNALS: void positionChanged(qreal position); - void colorChanged(QColor color); + void colorChanged(const QColor &color); private: void updateGradient(); diff --git a/src/datavisualizationqml/declarativebars.cpp b/src/datavisualizationqml/declarativebars.cpp index fe90e159..1cba987a 100644 --- a/src/datavisualizationqml/declarativebars.cpp +++ b/src/datavisualizationqml/declarativebars.cpp @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "declarativebars_p.h" #include <QtCore/QMutexLocker> @@ -112,7 +86,7 @@ float DeclarativeBars::barThickness() const return m_barsController->barThickness(); } -void DeclarativeBars::setBarSpacing(QSizeF spacing) +void DeclarativeBars::setBarSpacing(const QSizeF &spacing) { if (spacing != barSpacing()) { m_barsController->setBarSpecs(GLfloat(barThickness()), spacing, isBarSpacingRelative()); @@ -138,6 +112,19 @@ bool DeclarativeBars::isBarSpacingRelative() const return m_barsController->isBarSpecRelative(); } +void DeclarativeBars::setBarSeriesMargin(const QSizeF &margin) +{ + if (margin != barSeriesMargin()) { + m_barsController->setBarSeriesMargin(margin); + emit barSeriesMarginChanged(barSeriesMargin()); + } +} + +QSizeF DeclarativeBars::barSeriesMargin() const +{ + return m_barsController->barSeriesMargin(); +} + QBar3DSeries *DeclarativeBars::selectedSeries() const { return m_barsController->selectedSeries(); diff --git a/src/datavisualizationqml/declarativebars_p.h b/src/datavisualizationqml/declarativebars_p.h index acf1a030..82653ab2 100644 --- a/src/datavisualizationqml/declarativebars_p.h +++ b/src/datavisualizationqml/declarativebars_p.h @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // // W A R N I N G @@ -56,6 +30,7 @@ class DeclarativeBars : public AbstractDeclarative Q_PROPERTY(float barThickness READ barThickness WRITE setBarThickness NOTIFY barThicknessChanged) Q_PROPERTY(QSizeF barSpacing READ barSpacing WRITE setBarSpacing NOTIFY barSpacingChanged) Q_PROPERTY(bool barSpacingRelative READ isBarSpacingRelative WRITE setBarSpacingRelative NOTIFY barSpacingRelativeChanged) + Q_PROPERTY(QSizeF barSeriesMargin READ barSeriesMargin WRITE setBarSeriesMargin NOTIFY barSeriesMarginChanged REVISION(6, 3)) Q_PROPERTY(QQmlListProperty<QBar3DSeries> seriesList READ seriesList) Q_PROPERTY(QBar3DSeries *selectedSeries READ selectedSeries NOTIFY selectedSeriesChanged) Q_PROPERTY(QBar3DSeries *primarySeries READ primarySeries WRITE setPrimarySeries NOTIFY primarySeriesChanged) @@ -82,12 +57,15 @@ public: void setBarThickness(float thicknessRatio); float barThickness() const; - void setBarSpacing(QSizeF spacing); + void setBarSpacing(const QSizeF &spacing); QSizeF barSpacing() const; void setBarSpacingRelative(bool relative); bool isBarSpacingRelative() const; + void setBarSeriesMargin(const QSizeF &margin); + QSizeF barSeriesMargin() const; + QQmlListProperty<QBar3DSeries> seriesList(); static void appendSeriesFunc(QQmlListProperty<QBar3DSeries> *list, QBar3DSeries *series); static qsizetype countSeriesFunc(QQmlListProperty<QBar3DSeries> *list); @@ -114,9 +92,10 @@ Q_SIGNALS: void columnAxisChanged(QCategory3DAxis *axis); void multiSeriesUniformChanged(bool uniform); void barThicknessChanged(float thicknessRatio); - void barSpacingChanged(QSizeF spacing); + void barSpacingChanged(const QSizeF &spacing); void barSpacingRelativeChanged(bool relative); - void meshFileNameChanged(QString filename); + Q_REVISION(6, 3) void barSeriesMarginChanged(const QSizeF &margin); + void meshFileNameChanged(const QString &filename); void primarySeriesChanged(QBar3DSeries *series); void selectedSeriesChanged(QBar3DSeries *series); Q_REVISION(1, 2) void floorLevelChanged(float level); diff --git a/src/datavisualizationqml/declarativecolor.cpp b/src/datavisualizationqml/declarativecolor.cpp index 177c0fbe..979c3f1e 100644 --- a/src/datavisualizationqml/declarativecolor.cpp +++ b/src/datavisualizationqml/declarativecolor.cpp @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "declarativecolor_p.h" diff --git a/src/datavisualizationqml/declarativecolor_p.h b/src/datavisualizationqml/declarativecolor_p.h index d197fcf6..426d674d 100644 --- a/src/datavisualizationqml/declarativecolor_p.h +++ b/src/datavisualizationqml/declarativecolor_p.h @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // // W A R N I N G @@ -61,7 +35,7 @@ public: QColor color() const; Q_SIGNALS: - void colorChanged(QColor color); + void colorChanged(const QColor &color); private: QColor m_color; diff --git a/src/datavisualizationqml/declarativerendernode.cpp b/src/datavisualizationqml/declarativerendernode.cpp index f99e1375..5a9f466c 100644 --- a/src/datavisualizationqml/declarativerendernode.cpp +++ b/src/datavisualizationqml/declarativerendernode.cpp @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "declarativerendernode_p.h" #include "abstractdeclarative_p.h" diff --git a/src/datavisualizationqml/declarativerendernode_p.h b/src/datavisualizationqml/declarativerendernode_p.h index 28cb0538..2f6d22ec 100644 --- a/src/datavisualizationqml/declarativerendernode_p.h +++ b/src/datavisualizationqml/declarativerendernode_p.h @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // // W A R N I N G diff --git a/src/datavisualizationqml/declarativescatter.cpp b/src/datavisualizationqml/declarativescatter.cpp index 1417bc6d..1e3795a0 100644 --- a/src/datavisualizationqml/declarativescatter.cpp +++ b/src/datavisualizationqml/declarativescatter.cpp @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "declarativescatter_p.h" #include <QtCore/QMutexLocker> diff --git a/src/datavisualizationqml/declarativescatter_p.h b/src/datavisualizationqml/declarativescatter_p.h index 18848e0b..4b020b76 100644 --- a/src/datavisualizationqml/declarativescatter_p.h +++ b/src/datavisualizationqml/declarativescatter_p.h @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // // W A R N I N G diff --git a/src/datavisualizationqml/declarativescene.cpp b/src/datavisualizationqml/declarativescene.cpp index f4e5ae00..75508994 100644 --- a/src/datavisualizationqml/declarativescene.cpp +++ b/src/datavisualizationqml/declarativescene.cpp @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "declarativescene_p.h" diff --git a/src/datavisualizationqml/declarativescene_p.h b/src/datavisualizationqml/declarativescene_p.h index 26591d43..ba38b5e8 100644 --- a/src/datavisualizationqml/declarativescene_p.h +++ b/src/datavisualizationqml/declarativescene_p.h @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // // W A R N I N G @@ -68,7 +42,7 @@ public: QPoint invalidSelectionPoint() const; Q_SIGNALS: - void selectionQueryPositionChanged(const QPointF position); + void selectionQueryPositionChanged(const QPointF &position); }; QT_END_NAMESPACE diff --git a/src/datavisualizationqml/declarativeseries.cpp b/src/datavisualizationqml/declarativeseries.cpp index 38263a32..65c2cc76 100644 --- a/src/datavisualizationqml/declarativeseries.cpp +++ b/src/datavisualizationqml/declarativeseries.cpp @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "declarativeseries_p.h" #include <QtCore/QMetaMethod> @@ -103,7 +77,8 @@ DeclarativeBar3DSeries::DeclarativeBar3DSeries(QObject *parent) : QBar3DSeries(parent), m_baseGradient(0), m_singleHighlightGradient(0), - m_multiHighlightGradient(0) + m_multiHighlightGradient(0), + m_dummyColors(false) { QObject::connect(this, &QBar3DSeries::selectedBarChanged, this, &DeclarativeBar3DSeries::selectedBarChanged); @@ -171,6 +146,37 @@ ColorGradient *DeclarativeBar3DSeries::multiHighlightGradient() const return m_multiHighlightGradient; } +QQmlListProperty<DeclarativeColor> DeclarativeBar3DSeries::rowColors() +{ + return QQmlListProperty<DeclarativeColor>(this, this, + &DeclarativeBar3DSeries::appendRowColorsFunc, + &DeclarativeBar3DSeries::countRowColorsFunc, + &DeclarativeBar3DSeries::atRowColorsFunc, + &DeclarativeBar3DSeries::clearRowColorsFunc); +} + +void DeclarativeBar3DSeries::appendRowColorsFunc(QQmlListProperty<DeclarativeColor> *list, + DeclarativeColor *color) +{ + reinterpret_cast<DeclarativeBar3DSeries *>(list->data)->addColor(color); +} + +qsizetype DeclarativeBar3DSeries::countRowColorsFunc(QQmlListProperty<DeclarativeColor> *list) +{ + return reinterpret_cast<DeclarativeBar3DSeries *>(list->data)->colorList().size(); +} + +DeclarativeColor *DeclarativeBar3DSeries::atRowColorsFunc(QQmlListProperty<DeclarativeColor> *list, + qsizetype index) +{ + return reinterpret_cast<DeclarativeBar3DSeries *>(list->data)->colorList().at(index); +} + +void DeclarativeBar3DSeries::clearRowColorsFunc(QQmlListProperty<DeclarativeColor> *list) +{ + reinterpret_cast<DeclarativeBar3DSeries *>(list->data)->clearColors(); +} + void DeclarativeBar3DSeries::handleBaseGradientUpdate() { if (m_baseGradient) @@ -189,6 +195,73 @@ void DeclarativeBar3DSeries::handleMultiHighlightGradientUpdate() setSeriesGradient(this, *m_multiHighlightGradient, GradientTypeMulti); } +void DeclarativeBar3DSeries::handleRowColorUpdate() +{ + int colorCount = m_rowColors.size(); + int changed = 0; + + DeclarativeColor *color = qobject_cast<DeclarativeColor*>(QObject::sender()); + for (int i = 0; i < colorCount; i++) { + if (color == m_rowColors.at(i)) { + changed = i; + break; + } + } + QList<QColor> list = QBar3DSeries::rowColors(); + list[changed] = m_rowColors.at(changed)->color(); + QBar3DSeries::setRowColors(list); +} + +void DeclarativeBar3DSeries::addColor(DeclarativeColor *color) +{ + if (!color) { + qWarning("Color is invalid, use ThemeColor"); + return; + } + clearDummyColors(); + m_rowColors.append(color); + connect(color, &DeclarativeColor::colorChanged, this, + &DeclarativeBar3DSeries::handleRowColorUpdate); + QList<QColor> list = QBar3DSeries::rowColors(); + list.append(color->color()); + QBar3DSeries::setRowColors(list); +} + +QList<DeclarativeColor *> DeclarativeBar3DSeries::colorList() +{ + if (m_rowColors.isEmpty()) { + m_dummyColors = true; + const QList<QColor> list = QBar3DSeries::rowColors(); + for (const QColor &item : list) { + DeclarativeColor *color = new DeclarativeColor(this); + color->setColor(item); + m_rowColors.append(color); + connect(color, &DeclarativeColor::colorChanged, this, + &DeclarativeBar3DSeries::handleRowColorUpdate); + } + } + return m_rowColors; +} + +void DeclarativeBar3DSeries::clearColors() +{ + clearDummyColors(); + for (const auto color : std::as_const(m_rowColors)) + disconnect(color, 0, this, 0); + + m_rowColors.clear(); + QBar3DSeries::setRowColors(QList<QColor>()); +} + +void DeclarativeBar3DSeries::clearDummyColors() +{ + if (m_dummyColors) { + qDeleteAll(m_rowColors); + m_rowColors.clear(); + m_dummyColors = false; + } +} + DeclarativeScatter3DSeries::DeclarativeScatter3DSeries(QObject *parent) : QScatter3DSeries(parent), m_baseGradient(0), diff --git a/src/datavisualizationqml/declarativeseries_p.h b/src/datavisualizationqml/declarativeseries_p.h index 115e67e0..13b1eda3 100644 --- a/src/datavisualizationqml/declarativeseries_p.h +++ b/src/datavisualizationqml/declarativeseries_p.h @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // // W A R N I N G @@ -44,6 +18,7 @@ #include "qscatter3dseries.h" #include "qsurface3dseries.h" #include "colorgradient_p.h" +#include "declarativecolor_p.h" #include <private/datavisualizationglobal_p.h> #include <QtQml/qqml.h> @@ -68,6 +43,7 @@ class DeclarativeBar3DSeries : public QBar3DSeries Q_PROPERTY(ColorGradient *baseGradient READ baseGradient WRITE setBaseGradient NOTIFY baseGradientChanged) Q_PROPERTY(ColorGradient *singleHighlightGradient READ singleHighlightGradient WRITE setSingleHighlightGradient NOTIFY singleHighlightGradientChanged) Q_PROPERTY(ColorGradient *multiHighlightGradient READ multiHighlightGradient WRITE setMultiHighlightGradient NOTIFY multiHighlightGradientChanged) + Q_PROPERTY(QQmlListProperty<DeclarativeColor> rowColors READ rowColors REVISION(6, 3)) Q_CLASSINFO("DefaultProperty", "seriesChildren") QML_NAMED_ELEMENT(Bar3DSeries) @@ -91,13 +67,22 @@ public: void setMultiHighlightGradient(ColorGradient *gradient); ColorGradient *multiHighlightGradient() const; + QQmlListProperty<DeclarativeColor> rowColors(); + static void appendRowColorsFunc(QQmlListProperty<DeclarativeColor> *list, + DeclarativeColor *color); + static qsizetype countRowColorsFunc(QQmlListProperty<DeclarativeColor> *list); + static DeclarativeColor *atRowColorsFunc(QQmlListProperty<DeclarativeColor> *list, + qsizetype index); + static void clearRowColorsFunc(QQmlListProperty<DeclarativeColor> *list); + public Q_SLOTS: void handleBaseGradientUpdate(); void handleSingleHighlightGradientUpdate(); void handleMultiHighlightGradientUpdate(); + void handleRowColorUpdate(); Q_SIGNALS: - void selectedBarChanged(QPointF position); + void selectedBarChanged(const QPointF &position); void baseGradientChanged(ColorGradient *gradient); void singleHighlightGradientChanged(ColorGradient *gradient); void multiHighlightGradientChanged(ColorGradient *gradient); @@ -106,6 +91,14 @@ private: ColorGradient *m_baseGradient; // Not owned ColorGradient *m_singleHighlightGradient; // Not owned ColorGradient *m_multiHighlightGradient; // Not owned + + QList<DeclarativeColor *> m_rowColors; + bool m_dummyColors; + + void addColor(DeclarativeColor *color); + QList<DeclarativeColor *> colorList(); + void clearColors(); + void clearDummyColors(); }; class DeclarativeScatter3DSeries : public QScatter3DSeries @@ -195,7 +188,7 @@ public Q_SLOTS: void handleMultiHighlightGradientUpdate(); Q_SIGNALS: - void selectedPointChanged(QPointF position); + void selectedPointChanged(const QPointF &position); void baseGradientChanged(ColorGradient *gradient); void singleHighlightGradientChanged(ColorGradient *gradient); void multiHighlightGradientChanged(ColorGradient *gradient); diff --git a/src/datavisualizationqml/declarativesurface.cpp b/src/datavisualizationqml/declarativesurface.cpp index d422992a..cff80e98 100644 --- a/src/datavisualizationqml/declarativesurface.cpp +++ b/src/datavisualizationqml/declarativesurface.cpp @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "declarativesurface_p.h" #include <QtCore/QMutexLocker> diff --git a/src/datavisualizationqml/declarativesurface_p.h b/src/datavisualizationqml/declarativesurface_p.h index 71f3c470..4634834a 100644 --- a/src/datavisualizationqml/declarativesurface_p.h +++ b/src/datavisualizationqml/declarativesurface_p.h @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // // W A R N I N G diff --git a/src/datavisualizationqml/declarativetheme.cpp b/src/datavisualizationqml/declarativetheme.cpp index 282f14b1..02f3becc 100644 --- a/src/datavisualizationqml/declarativetheme.cpp +++ b/src/datavisualizationqml/declarativetheme.cpp @@ -1,31 +1,7 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses #include "declarativetheme_p.h" diff --git a/src/datavisualizationqml/declarativetheme_p.h b/src/datavisualizationqml/declarativetheme_p.h index ea59641d..8bc2f049 100644 --- a/src/datavisualizationqml/declarativetheme_p.h +++ b/src/datavisualizationqml/declarativetheme_p.h @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // // W A R N I N G diff --git a/src/datavisualizationqml/designer/Bars3DSpecifics.qml b/src/datavisualizationqml/designer/Bars3DSpecifics.qml index cd1e76b4..d509fd84 100644 --- a/src/datavisualizationqml/designer/Bars3DSpecifics.qml +++ b/src/datavisualizationqml/designer/Bars3DSpecifics.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import HelperWidgets 2.0 diff --git a/src/datavisualizationqml/designer/Scatter3DSpecifics.qml b/src/datavisualizationqml/designer/Scatter3DSpecifics.qml index b864fb16..ffc79d44 100644 --- a/src/datavisualizationqml/designer/Scatter3DSpecifics.qml +++ b/src/datavisualizationqml/designer/Scatter3DSpecifics.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import HelperWidgets 2.0 diff --git a/src/datavisualizationqml/designer/Surface3DSpecifics.qml b/src/datavisualizationqml/designer/Surface3DSpecifics.qml index 90c2f763..33ca7d75 100644 --- a/src/datavisualizationqml/designer/Surface3DSpecifics.qml +++ b/src/datavisualizationqml/designer/Surface3DSpecifics.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import HelperWidgets 2.0 diff --git a/src/datavisualizationqml/designer/default/Bars3D.qml b/src/datavisualizationqml/designer/default/Bars3D.qml index 32f4c939..8c56b67c 100644 --- a/src/datavisualizationqml/designer/default/Bars3D.qml +++ b/src/datavisualizationqml/designer/default/Bars3D.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 diff --git a/src/datavisualizationqml/designer/default/Scatter3D.qml b/src/datavisualizationqml/designer/default/Scatter3D.qml index 2c92d192..5a6cd261 100644 --- a/src/datavisualizationqml/designer/default/Scatter3D.qml +++ b/src/datavisualizationqml/designer/default/Scatter3D.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 diff --git a/src/datavisualizationqml/designer/default/Surface3D.qml b/src/datavisualizationqml/designer/default/Surface3D.qml index 66fd10fb..24561890 100644 --- a/src/datavisualizationqml/designer/default/Surface3D.qml +++ b/src/datavisualizationqml/designer/default/Surface3D.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 diff --git a/src/datavisualizationqml/enumtostringmap.cpp b/src/datavisualizationqml/enumtostringmap.cpp index e10e8bc0..c411f7a9 100644 --- a/src/datavisualizationqml/enumtostringmap.cpp +++ b/src/datavisualizationqml/enumtostringmap.cpp @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "enumtostringmap_p.h" diff --git a/src/datavisualizationqml/enumtostringmap_p.h b/src/datavisualizationqml/enumtostringmap_p.h index ee613433..b8be3f18 100644 --- a/src/datavisualizationqml/enumtostringmap_p.h +++ b/src/datavisualizationqml/enumtostringmap_p.h @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // // W A R N I N G @@ -47,6 +21,7 @@ #include <QtGui/qopengl.h> #include <QMap> #include <QString> +#include <private/qglobal_p.h> class EnumToStringMap { diff --git a/src/datavisualizationqml/foreigntypes_p.h b/src/datavisualizationqml/foreigntypes_p.h index 9bf9b1c7..0b92d862 100644 --- a/src/datavisualizationqml/foreigntypes_p.h +++ b/src/datavisualizationqml/foreigntypes_p.h @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2021 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // // W A R N I N G @@ -72,6 +46,7 @@ #include <QtDataVisualization/qtouch3dinputhandler.h> #include <QtDataVisualization/qvalue3daxis.h> #include <QtDataVisualization/qvalue3daxisformatter.h> +#include <QtCore/private/qglobal_p.h> QT_BEGIN_NAMESPACE @@ -82,20 +57,20 @@ QT_BEGIN_NAMESPACE QML_ADDED_IN_VERSION(1, minor) \ #define DEFINE_FOREIGN_UNCREATABLE_TYPE(type, name) \ - struct type##Foreign \ + struct type##DataVisForeign \ { \ DEFINE_FOREIGN_BASE_ATTRIBUTES(type, name, 0) \ QML_UNCREATABLE("Trying to create uncreatable: " #name ".") \ }; #define DEFINE_FOREIGN_CREATABLE_TYPE(type, name, minor) \ - struct type##Foreign \ + struct type##DataVisForeign \ { \ DEFINE_FOREIGN_BASE_ATTRIBUTES(type, name, minor) \ }; #define DEFINE_FOREIGN_REPLACED_TYPE(type, name, better) \ - struct type##Foreign \ + struct type##DataVisForeign \ { \ DEFINE_FOREIGN_BASE_ATTRIBUTES(type, name, 0) \ QML_UNCREATABLE("Trying to create uncreatable: " #name ", use " #better " instead.") \ diff --git a/src/datavisualizationqml/glstatestore.cpp b/src/datavisualizationqml/glstatestore.cpp index dfb4266f..573835a3 100644 --- a/src/datavisualizationqml/glstatestore.cpp +++ b/src/datavisualizationqml/glstatestore.cpp @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include "glstatestore_p.h" #include <QDebug> diff --git a/src/datavisualizationqml/glstatestore_p.h b/src/datavisualizationqml/glstatestore_p.h index f5aa0bdd..b34a4c0d 100644 --- a/src/datavisualizationqml/glstatestore_p.h +++ b/src/datavisualizationqml/glstatestore_p.h @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization 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$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only // // W A R N I N G |