diff options
Diffstat (limited to 'tests')
167 files changed, 2338 insertions, 3189 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7d60f9ff..898ece00 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + if(QT_BUILD_STANDALONE_TESTS) endif() qt_build_tests() diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt index ffa2e824..6f440eaa 100644 --- a/tests/auto/CMakeLists.txt +++ b/tests/auto/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + if(NOT ANDROID) add_subdirectory(cpptest) endif() diff --git a/tests/auto/cpptest/CMakeLists.txt b/tests/auto/cpptest/CMakeLists.txt index 7b6ef00b..939b32c9 100644 --- a/tests/auto/cpptest/CMakeLists.txt +++ b/tests/auto/cpptest/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + add_subdirectory(q3dbars) add_subdirectory(q3dbars-proxy) add_subdirectory(q3dbars-modelproxy) @@ -9,6 +12,7 @@ add_subdirectory(q3dscatter-series) add_subdirectory(q3dsurface) add_subdirectory(q3dsurface-proxy) add_subdirectory(q3dsurface-modelproxy) +add_subdirectory(q3dsurface-modelproxy-nan) add_subdirectory(q3dsurface-heightproxy) add_subdirectory(q3dsurface-series) add_subdirectory(q3daxis-category) diff --git a/tests/auto/cpptest/common/cpptestutil.h b/tests/auto/cpptest/common/cpptestutil.h index 986ba8b9..546c60f9 100644 --- a/tests/auto/cpptest/common/cpptestutil.h +++ b/tests/auto/cpptest/common/cpptestutil.h @@ -1,30 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2017 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-EXCEPT$ -** 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 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** 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) 2017 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0 #ifndef CPPTESTUTIL_H #define CPPTESTUTIL_H diff --git a/tests/auto/cpptest/q3daxis-category/CMakeLists.txt b/tests/auto/cpptest/q3daxis-category/CMakeLists.txt index 3bac4408..f148b184 100644 --- a/tests/auto/cpptest/q3daxis-category/CMakeLists.txt +++ b/tests/auto/cpptest/q3daxis-category/CMakeLists.txt @@ -1,7 +1,10 @@ -qt_internal_add_test(q3daxis-category +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3daxis-category_datavis SOURCES tst_axis.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::DataVisualization ) diff --git a/tests/auto/cpptest/q3daxis-category/tst_axis.cpp b/tests/auto/cpptest/q3daxis-category/tst_axis.cpp index ef0d36ef..d1440d6a 100644 --- a/tests/auto/cpptest/q3daxis-category/tst_axis.cpp +++ b/tests/auto/cpptest/q3daxis-category/tst_axis.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 <QtTest/QtTest> @@ -80,7 +54,7 @@ void tst_axis::initialProperties() { QVERIFY(m_axis); - QCOMPARE(m_axis->labels().length(), 0); + QCOMPARE(m_axis->labels().size(), 0); // Common (from QAbstract3DAxis) QCOMPARE(m_axis->isAutoAdjustRange(), true); @@ -100,7 +74,7 @@ void tst_axis::initializeProperties() m_axis->setLabels(QStringList() << "first" << "second"); - QCOMPARE(m_axis->labels().length(), 2); + QCOMPARE(m_axis->labels().size(), 2); QCOMPARE(m_axis->labels().at(1), QString("second")); // Common (from QAbstract3DAxis) diff --git a/tests/auto/cpptest/q3daxis-logvalue/CMakeLists.txt b/tests/auto/cpptest/q3daxis-logvalue/CMakeLists.txt index 1c5932d1..0bba27a9 100644 --- a/tests/auto/cpptest/q3daxis-logvalue/CMakeLists.txt +++ b/tests/auto/cpptest/q3daxis-logvalue/CMakeLists.txt @@ -1,7 +1,10 @@ -qt_internal_add_test(q3daxis-logvalue +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3daxis-logvalue_datavis SOURCES tst_axis.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::DataVisualization ) diff --git a/tests/auto/cpptest/q3daxis-logvalue/tst_axis.cpp b/tests/auto/cpptest/q3daxis-logvalue/tst_axis.cpp index 9382f887..cf2b055c 100644 --- a/tests/auto/cpptest/q3daxis-logvalue/tst_axis.cpp +++ b/tests/auto/cpptest/q3daxis-logvalue/tst_axis.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 <QtTest/QtTest> diff --git a/tests/auto/cpptest/q3daxis-value/CMakeLists.txt b/tests/auto/cpptest/q3daxis-value/CMakeLists.txt index addb2c10..5c412106 100644 --- a/tests/auto/cpptest/q3daxis-value/CMakeLists.txt +++ b/tests/auto/cpptest/q3daxis-value/CMakeLists.txt @@ -1,7 +1,10 @@ -qt_internal_add_test(q3daxis-value +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3daxis-value_datavis SOURCES tst_axis.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::DataVisualization ) diff --git a/tests/auto/cpptest/q3daxis-value/tst_axis.cpp b/tests/auto/cpptest/q3daxis-value/tst_axis.cpp index 3b8455ca..54d36d3d 100644 --- a/tests/auto/cpptest/q3daxis-value/tst_axis.cpp +++ b/tests/auto/cpptest/q3daxis-value/tst_axis.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 <QtTest/QtTest> @@ -88,7 +62,7 @@ void tst_axis::initialProperties() // Common (from QAbstract3DAxis) QCOMPARE(m_axis->isAutoAdjustRange(), true); QCOMPARE(m_axis->labelAutoRotation(), 0.0f); - QCOMPARE(m_axis->labels().length(), 6); + QCOMPARE(m_axis->labels().size(), 6); QCOMPARE(m_axis->labels().at(0), QString("0.00")); QCOMPARE(m_axis->labels().at(1), QString("2.00")); QCOMPARE(m_axis->labels().at(2), QString("4.00")); @@ -129,7 +103,7 @@ void tst_axis::initializeProperties() QCOMPARE(m_axis->isAutoAdjustRange(), false); QCOMPARE(m_axis->labelAutoRotation(), 15.0f); - QCOMPARE(m_axis->labels().length(), 3); + QCOMPARE(m_axis->labels().size(), 3); QCOMPARE(m_axis->labels().at(0), QString("5m")); QCOMPARE(m_axis->labels().at(1), QString("15m")); QCOMPARE(m_axis->labels().at(2), QString("25m")); diff --git a/tests/auto/cpptest/q3dbars-modelproxy/CMakeLists.txt b/tests/auto/cpptest/q3dbars-modelproxy/CMakeLists.txt index 89fcaa60..f9b05902 100644 --- a/tests/auto/cpptest/q3dbars-modelproxy/CMakeLists.txt +++ b/tests/auto/cpptest/q3dbars-modelproxy/CMakeLists.txt @@ -1,9 +1,12 @@ -qt_internal_add_test(q3dbars-modelproxy +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dbars-modelproxy_datavis SOURCES tst_proxy.cpp INCLUDE_DIRECTORIES ../common - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::GuiPrivate Qt::Widgets diff --git a/tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp b/tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp index dd5d7284..424aad3f 100644 --- a/tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp +++ b/tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.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 <QtTest/QtTest> @@ -92,8 +66,8 @@ void tst_proxy::construct() QCOMPARE(proxy->columnRole(), QString("")); QCOMPARE(proxy->valueRole(), QString("val")); QCOMPARE(proxy->rotationRole(), QString("")); - QCOMPARE(proxy->rowCategories().length(), 0); - QCOMPARE(proxy->columnCategories().length(), 0); + QCOMPARE(proxy->rowCategories().size(), 0); + QCOMPARE(proxy->columnCategories().size(), 0); delete proxy; proxy = new QItemModelBarDataProxy(table->model(), "row", "col", "val"); @@ -102,8 +76,8 @@ void tst_proxy::construct() QCOMPARE(proxy->columnRole(), QString("col")); QCOMPARE(proxy->valueRole(), QString("val")); QCOMPARE(proxy->rotationRole(), QString("")); - QCOMPARE(proxy->rowCategories().length(), 0); - QCOMPARE(proxy->columnCategories().length(), 0); + QCOMPARE(proxy->rowCategories().size(), 0); + QCOMPARE(proxy->columnCategories().size(), 0); delete proxy; proxy = new QItemModelBarDataProxy(table->model(), "row", "col", "val", "rot"); @@ -112,8 +86,8 @@ void tst_proxy::construct() QCOMPARE(proxy->columnRole(), QString("col")); QCOMPARE(proxy->valueRole(), QString("val")); QCOMPARE(proxy->rotationRole(), QString("rot")); - QCOMPARE(proxy->rowCategories().length(), 0); - QCOMPARE(proxy->columnCategories().length(), 0); + QCOMPARE(proxy->rowCategories().size(), 0); + QCOMPARE(proxy->columnCategories().size(), 0); delete proxy; proxy = new QItemModelBarDataProxy(table->model(), "row", "col", "val", @@ -123,8 +97,8 @@ void tst_proxy::construct() QCOMPARE(proxy->columnRole(), QString("col")); QCOMPARE(proxy->valueRole(), QString("val")); QCOMPARE(proxy->rotationRole(), QString("")); - QCOMPARE(proxy->rowCategories().length(), 1); - QCOMPARE(proxy->columnCategories().length(), 1); + QCOMPARE(proxy->rowCategories().size(), 1); + QCOMPARE(proxy->columnCategories().size(), 1); delete proxy; proxy = new QItemModelBarDataProxy(table->model(), "row", "col", "val", "rot", @@ -134,8 +108,8 @@ void tst_proxy::construct() QCOMPARE(proxy->columnRole(), QString("col")); QCOMPARE(proxy->valueRole(), QString("val")); QCOMPARE(proxy->rotationRole(), QString("rot")); - QCOMPARE(proxy->rowCategories().length(), 1); - QCOMPARE(proxy->columnCategories().length(), 1); + QCOMPARE(proxy->rowCategories().size(), 1); + QCOMPARE(proxy->columnCategories().size(), 1); delete proxy; } @@ -163,9 +137,9 @@ void tst_proxy::initialProperties() QCOMPARE(m_proxy->valueRolePattern(), QRegularExpression()); QCOMPARE(m_proxy->valueRoleReplace(), QString()); - QCOMPARE(m_proxy->columnLabels().count(), 0); + QCOMPARE(m_proxy->columnLabels().size(), 0); QCOMPARE(m_proxy->rowCount(), 0); - QCOMPARE(m_proxy->rowLabels().count(), 0); + QCOMPARE(m_proxy->rowLabels().size(), 0); QVERIFY(!m_proxy->series()); QCOMPARE(m_proxy->type(), QAbstractDataProxy::DataTypeBar); @@ -199,7 +173,7 @@ void tst_proxy::initializeProperties() QCOMPARE(m_proxy->autoColumnCategories(), false); QCOMPARE(m_proxy->autoRowCategories(), false); - QCOMPARE(m_proxy->columnCategories().count(), 2); + QCOMPARE(m_proxy->columnCategories().size(), 2); QCOMPARE(m_proxy->columnRole(), QString("column")); QCOMPARE(m_proxy->columnRolePattern(), QRegularExpression("/^.*-(\\d\\d)$/")); QCOMPARE(m_proxy->columnRoleReplace(), QString("\\\\1")); @@ -208,7 +182,7 @@ void tst_proxy::initializeProperties() QCOMPARE(m_proxy->rotationRole(), QString("rotation")); QCOMPARE(m_proxy->rotationRolePattern(), QRegularExpression("/-/")); QCOMPARE(m_proxy->rotationRoleReplace(), QString("\\\\1")); - QCOMPARE(m_proxy->rowCategories().count(), 2); + QCOMPARE(m_proxy->rowCategories().size(), 2); QCOMPARE(m_proxy->rowRole(), QString("row")); QCOMPARE(m_proxy->rowRolePattern(), QRegularExpression("/^(\\d\\d\\d\\d).*$/")); QCOMPARE(m_proxy->rowRoleReplace(), QString("\\\\1")); @@ -272,9 +246,9 @@ void tst_proxy::multiMatch() QCoreApplication::processEvents(); QCOMPARE(graph.valueAxis()->max(), 15.0f); - QCOMPARE(m_proxy->columnLabels().count(), 1); + QCOMPARE(m_proxy->columnLabels().size(), 1); QCOMPARE(m_proxy->rowCount(), 1); - QCOMPARE(m_proxy->rowLabels().count(), 1); + QCOMPARE(m_proxy->rowLabels().size(), 1); QVERIFY(m_proxy->series()); m_proxy = 0; // Proxy gets deleted as graph gets deleted diff --git a/tests/auto/cpptest/q3dbars-proxy/CMakeLists.txt b/tests/auto/cpptest/q3dbars-proxy/CMakeLists.txt index d257b113..23c6997d 100644 --- a/tests/auto/cpptest/q3dbars-proxy/CMakeLists.txt +++ b/tests/auto/cpptest/q3dbars-proxy/CMakeLists.txt @@ -1,7 +1,10 @@ -qt_internal_add_test(q3dbars-proxy +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dbars-proxy_datavis SOURCES tst_proxy.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::DataVisualization ) diff --git a/tests/auto/cpptest/q3dbars-proxy/tst_proxy.cpp b/tests/auto/cpptest/q3dbars-proxy/tst_proxy.cpp index 0a9dec52..4c343cb4 100644 --- a/tests/auto/cpptest/q3dbars-proxy/tst_proxy.cpp +++ b/tests/auto/cpptest/q3dbars-proxy/tst_proxy.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 <QtTest/QtTest> @@ -79,9 +53,9 @@ void tst_proxy::initialProperties() { QVERIFY(m_proxy); - QCOMPARE(m_proxy->columnLabels().count(), 0); + QCOMPARE(m_proxy->columnLabels().size(), 0); QCOMPARE(m_proxy->rowCount(), 0); - QCOMPARE(m_proxy->rowLabels().count(), 0); + QCOMPARE(m_proxy->rowLabels().size(), 0); QVERIFY(!m_proxy->series()); QCOMPARE(m_proxy->type(), QAbstractDataProxy::DataTypeBar); @@ -97,9 +71,9 @@ void tst_proxy::initializeProperties() m_proxy->addRow(data); m_proxy->setRowLabels(QStringList() << "1"); - QCOMPARE(m_proxy->columnLabels().count(), 3); + QCOMPARE(m_proxy->columnLabels().size(), 3); QCOMPARE(m_proxy->rowCount(), 1); - QCOMPARE(m_proxy->rowLabels().count(), 1); + QCOMPARE(m_proxy->rowLabels().size(), 1); } QTEST_MAIN(tst_proxy) diff --git a/tests/auto/cpptest/q3dbars-series/CMakeLists.txt b/tests/auto/cpptest/q3dbars-series/CMakeLists.txt index c3e44bef..f160c81c 100644 --- a/tests/auto/cpptest/q3dbars-series/CMakeLists.txt +++ b/tests/auto/cpptest/q3dbars-series/CMakeLists.txt @@ -1,7 +1,10 @@ -qt_internal_add_test(q3dbars-series +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dbars-series_datavis SOURCES tst_series.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::DataVisualization ) diff --git a/tests/auto/cpptest/q3dbars-series/tst_series.cpp b/tests/auto/cpptest/q3dbars-series/tst_series.cpp index 11dfd3f2..6e0272ac 100644 --- a/tests/auto/cpptest/q3dbars-series/tst_series.cpp +++ b/tests/auto/cpptest/q3dbars-series/tst_series.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 <QtTest/QtTest> @@ -90,6 +64,7 @@ void tst_series::initialProperties() QVERIFY(m_series->dataProxy()); QCOMPARE(m_series->meshAngle(), 0.0f); QCOMPARE(m_series->selectedBar(), m_series->invalidSelectionPosition()); + QCOMPARE(m_series->rowColors().size(), 0); // Common properties QCOMPARE(m_series->baseColor(), QColor(Qt::black)); @@ -132,6 +107,13 @@ void tst_series::initializeProperties() gradient3.setColorAt(0.0, Qt::white); gradient3.setColorAt(1.0, Qt::gray); + QList<QColor> rowColors; + rowColors.append(QColor(Qt::green)); + rowColors.append(QColor(Qt::blue)); + rowColors.append(QColor(Qt::red)); + + m_series->setRowColors(rowColors); + // Common properties m_series->setBaseColor(QColor(Qt::blue)); m_series->setBaseGradient(gradient1); @@ -165,6 +147,11 @@ void tst_series::initializeProperties() QCOMPARE(m_series->singleHighlightGradient().stops().at(0).second, QColor(Qt::white)); QCOMPARE(m_series->userDefinedMesh(), QString(":/customitem.obj")); QCOMPARE(m_series->isVisible(), false); + + QCOMPARE(m_series->rowColors().size(), 3); + QCOMPARE(m_series->rowColors().at(0), QColor(Qt::green)); + QCOMPARE(m_series->rowColors().at(1), QColor(Qt::blue)); + QCOMPARE(m_series->rowColors().at(2), QColor(Qt::red)); } void tst_series::invalidProperties() diff --git a/tests/auto/cpptest/q3dbars/CMakeLists.txt b/tests/auto/cpptest/q3dbars/CMakeLists.txt index 95bb5a3d..c2f05908 100644 --- a/tests/auto/cpptest/q3dbars/CMakeLists.txt +++ b/tests/auto/cpptest/q3dbars/CMakeLists.txt @@ -1,9 +1,12 @@ -qt_internal_add_test(q3dbars +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dbars_datavis SOURCES tst_bars.cpp INCLUDE_DIRECTORIES ../common - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::GuiPrivate Qt::DataVisualization diff --git a/tests/auto/cpptest/q3dbars/tst_bars.cpp b/tests/auto/cpptest/q3dbars/tst_bars.cpp index 02de1fba..96219cb0 100644 --- a/tests/auto/cpptest/q3dbars/tst_bars.cpp +++ b/tests/auto/cpptest/q3dbars/tst_bars.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 <QtTest/QtTest> @@ -57,6 +31,7 @@ private slots: void selectSeries(); void removeSeries(); void removeMultipleSeries(); + void hasSeries(); // The following tests are not required for scatter or surface, as they are handled identically void addInputHandler(); @@ -121,8 +96,9 @@ void tst_bars::initialProperties() QCOMPARE(m_graph->isMultiSeriesUniform(), false); QCOMPARE(m_graph->barThickness(), 1.0); QCOMPARE(m_graph->barSpacing(), QSizeF(1.0f, 1.0f)); + QCOMPARE(m_graph->barSeriesMargin(), QSizeF(0.0f, 0.0f)); QCOMPARE(m_graph->isBarSpacingRelative(), true); - QCOMPARE(m_graph->seriesList().length(), 0); + QCOMPARE(m_graph->seriesList().size(), 0); QVERIFY(!m_graph->selectedSeries()); QVERIFY(!m_graph->primarySeries()); QCOMPARE(m_graph->floorLevel(), 0.0); @@ -157,12 +133,14 @@ void tst_bars::initializeProperties() m_graph->setMultiSeriesUniform(true); m_graph->setBarThickness(0.2f); m_graph->setBarSpacing(QSizeF(0.1f, 0.1f)); + m_graph->setBarSeriesMargin(QSizeF(0.3f, 0.3f)); m_graph->setBarSpacingRelative(false); m_graph->setFloorLevel(1.0f); QCOMPARE(m_graph->isMultiSeriesUniform(), true); QCOMPARE(m_graph->barThickness(), 0.2f); QCOMPARE(m_graph->barSpacing(), QSizeF(0.1f, 0.1f)); + QCOMPARE(m_graph->barSeriesMargin(), QSizeF(0.3f, 0.3f)); QCOMPARE(m_graph->isBarSpacingRelative(), false); QCOMPARE(m_graph->floorLevel(), 1.0f); @@ -208,9 +186,9 @@ void tst_bars::invalidProperties() m_graph->setLocale(QLocale("XX")); QCOMPARE(m_graph->selectionMode(), QAbstract3DGraph::SelectionItem); - QCOMPARE(m_graph->aspectRatio(), -1.0/*2.0*/); // TODO: Fix once QTRD-3367 is done - QCOMPARE(m_graph->horizontalAspectRatio(), -1.0/*0.0*/); // TODO: Fix once QTRD-3367 is done - QCOMPARE(m_graph->reflectivity(), -1.0/*0.5*/); // TODO: Fix once QTRD-3367 is done + QCOMPARE(m_graph->aspectRatio(), 2.0); + QCOMPARE(m_graph->horizontalAspectRatio(), 0.0); + QCOMPARE(m_graph->reflectivity(), 0.5); QCOMPARE(m_graph->locale(), QLocale("C")); } @@ -220,7 +198,7 @@ void tst_bars::addSeries() m_graph->addSeries(series); - QCOMPARE(m_graph->seriesList().length(), 1); + QCOMPARE(m_graph->seriesList().size(), 1); QVERIFY(!m_graph->selectedSeries()); QCOMPARE(m_graph->primarySeries(), series); } @@ -235,7 +213,7 @@ void tst_bars::addMultipleSeries() m_graph->addSeries(series2); m_graph->addSeries(series3); - QCOMPARE(m_graph->seriesList().length(), 3); + QCOMPARE(m_graph->seriesList().size(), 3); QCOMPARE(m_graph->primarySeries(), series); m_graph->setPrimarySeries(series2); @@ -250,7 +228,7 @@ void tst_bars::selectSeries() m_graph->addSeries(series); m_graph->primarySeries()->setSelectedBar(QPoint(0, 0)); - QCOMPARE(m_graph->seriesList().length(), 1); + QCOMPARE(m_graph->seriesList().size(), 1); QCOMPARE(m_graph->selectedSeries(), series); m_graph->clearSelection(); @@ -263,7 +241,7 @@ void tst_bars::removeSeries() m_graph->addSeries(series); m_graph->removeSeries(series); - QCOMPARE(m_graph->seriesList().length(), 0); + QCOMPARE(m_graph->seriesList().size(), 0); delete series; } @@ -281,22 +259,31 @@ void tst_bars::removeMultipleSeries() QCOMPARE(m_graph->selectedSeries(), series); m_graph->removeSeries(series); - QCOMPARE(m_graph->seriesList().length(), 2); + QCOMPARE(m_graph->seriesList().size(), 2); QCOMPARE(m_graph->primarySeries(), series2); QVERIFY(!m_graph->selectedSeries()); m_graph->removeSeries(series2); - QCOMPARE(m_graph->seriesList().length(), 1); + QCOMPARE(m_graph->seriesList().size(), 1); QCOMPARE(m_graph->primarySeries(), series3); m_graph->removeSeries(series3); - QCOMPARE(m_graph->seriesList().length(), 0); + QCOMPARE(m_graph->seriesList().size(), 0); delete series; delete series2; delete series3; } +void tst_bars::hasSeries() +{ + QBar3DSeries *series1 = newSeries(); + m_graph->addSeries(series1); + QCOMPARE(m_graph->hasSeries(series1), true); + QBar3DSeries *series2 = newSeries(); + QCOMPARE(m_graph->hasSeries(series2), false); +} + // The following tests are not required for scatter or surface, as they are handled identically void tst_bars::addInputHandler() { @@ -307,14 +294,14 @@ void tst_bars::addInputHandler() m_graph->addInputHandler(handler); m_graph->addInputHandler(handler2); - QCOMPARE(m_graph->inputHandlers().length(), 3); // Default, as it is still active, plus added ones + QCOMPARE(m_graph->inputHandlers().size(), 3); // Default, as it is still active, plus added ones QCOMPARE(m_graph->activeInputHandler(), initialHandler); m_graph->setActiveInputHandler(handler2); QCOMPARE(m_graph->activeInputHandler(), handler2); m_graph->setActiveInputHandler(NULL); QVERIFY(!m_graph->activeInputHandler()); - QCOMPARE(m_graph->inputHandlers().length(), 2); + QCOMPARE(m_graph->inputHandlers().size(), 2); } void tst_bars::removeInputHandler() @@ -326,12 +313,12 @@ void tst_bars::removeInputHandler() m_graph->addInputHandler(handler2); m_graph->setActiveInputHandler(handler2); - QCOMPARE(m_graph->inputHandlers().length(), 2); // Default handler removed by previous call + QCOMPARE(m_graph->inputHandlers().size(), 2); // Default handler removed by previous call QCOMPARE(m_graph->activeInputHandler(), handler2); m_graph->releaseInputHandler(handler2); - QCOMPARE(m_graph->inputHandlers().length(), 1); + QCOMPARE(m_graph->inputHandlers().size(), 1); m_graph->releaseInputHandler(handler); - QCOMPARE(m_graph->inputHandlers().length(), 0); + QCOMPARE(m_graph->inputHandlers().size(), 0); delete handler2; delete handler; @@ -345,7 +332,7 @@ void tst_bars::addTheme() m_graph->addTheme(theme); m_graph->addTheme(theme2); - QCOMPARE(m_graph->themes().length(), 3); // Default, plus added ones + QCOMPARE(m_graph->themes().size(), 3); // Default, plus added ones QCOMPARE(m_graph->activeTheme(), initialTheme); m_graph->setActiveTheme(theme2); QCOMPARE(m_graph->activeTheme(), theme2); @@ -361,9 +348,9 @@ void tst_bars::removeTheme() m_graph->setActiveTheme(theme2); QCOMPARE(m_graph->activeTheme(), theme2); m_graph->releaseTheme(theme2); - QCOMPARE(m_graph->themes().length(), 2); + QCOMPARE(m_graph->themes().size(), 2); m_graph->releaseTheme(theme); - QCOMPARE(m_graph->themes().length(), 1); // Default theme remains + QCOMPARE(m_graph->themes().size(), 1); // Default theme remains delete theme2; delete theme; @@ -375,9 +362,9 @@ void tst_bars::addCustomItem() QCustom3DItem *item2 = new QCustom3DItem(); m_graph->addCustomItem(item); - QCOMPARE(m_graph->customItems().length(), 1); + QCOMPARE(m_graph->customItems().size(), 1); m_graph->addCustomItem(item2); - QCOMPARE(m_graph->customItems().length(), 2); + QCOMPARE(m_graph->customItems().size(), 2); } void tst_bars::removeCustomItem() @@ -392,14 +379,14 @@ void tst_bars::removeCustomItem() m_graph->addCustomItem(item3); m_graph->releaseCustomItem(item); - QCOMPARE(m_graph->customItems().length(), 2); + QCOMPARE(m_graph->customItems().size(), 2); m_graph->removeCustomItem(item2); - QCOMPARE(m_graph->customItems().length(), 1); + QCOMPARE(m_graph->customItems().size(), 1); m_graph->addCustomItem(item); m_graph->removeCustomItemAt(QVector3D(1, 1, 1)); - QCOMPARE(m_graph->customItems().length(), 1); + QCOMPARE(m_graph->customItems().size(), 1); m_graph->removeCustomItems(); - QCOMPARE(m_graph->customItems().length(), 0); + QCOMPARE(m_graph->customItems().size(), 0); } void tst_bars::renderToImage() diff --git a/tests/auto/cpptest/q3dcustom-label/CMakeLists.txt b/tests/auto/cpptest/q3dcustom-label/CMakeLists.txt index ae29c699..3baea7fa 100644 --- a/tests/auto/cpptest/q3dcustom-label/CMakeLists.txt +++ b/tests/auto/cpptest/q3dcustom-label/CMakeLists.txt @@ -1,9 +1,12 @@ -qt_internal_add_test(q3dcustom-label +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dcustom-label_datavis SOURCES tst_custom.cpp INCLUDE_DIRECTORIES ../common - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::GuiPrivate Qt::DataVisualization diff --git a/tests/auto/cpptest/q3dcustom-label/tst_custom.cpp b/tests/auto/cpptest/q3dcustom-label/tst_custom.cpp index 4b6b3e5b..6914031f 100644 --- a/tests/auto/cpptest/q3dcustom-label/tst_custom.cpp +++ b/tests/auto/cpptest/q3dcustom-label/tst_custom.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 <QtTest/QtTest> diff --git a/tests/auto/cpptest/q3dcustom-volume/CMakeLists.txt b/tests/auto/cpptest/q3dcustom-volume/CMakeLists.txt index 5f8d2576..858f2dfc 100644 --- a/tests/auto/cpptest/q3dcustom-volume/CMakeLists.txt +++ b/tests/auto/cpptest/q3dcustom-volume/CMakeLists.txt @@ -1,7 +1,10 @@ -qt_internal_add_test(q3dcustom-volume +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dcustom-volume_datavis SOURCES tst_custom.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::DataVisualization ) diff --git a/tests/auto/cpptest/q3dcustom-volume/tst_custom.cpp b/tests/auto/cpptest/q3dcustom-volume/tst_custom.cpp index 495b8ba8..21040df3 100644 --- a/tests/auto/cpptest/q3dcustom-volume/tst_custom.cpp +++ b/tests/auto/cpptest/q3dcustom-volume/tst_custom.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 <QtTest/QtTest> @@ -96,7 +70,7 @@ void tst_custom::construct() QCOMPARE(custom->sliceIndexY(), -1); QCOMPARE(custom->sliceIndexZ(), -1); QCOMPARE(custom->useHighDefShader(), true); - QCOMPARE(custom->textureData()->length(), 1000); + QCOMPARE(custom->textureData()->size(), 1000); QCOMPARE(custom->textureDataWidth(), 40); QCOMPARE(custom->textureFormat(), QImage::Format_ARGB32); QCOMPARE(custom->textureHeight(), 10); diff --git a/tests/auto/cpptest/q3dcustom/CMakeLists.txt b/tests/auto/cpptest/q3dcustom/CMakeLists.txt index e0816b76..4126a884 100644 --- a/tests/auto/cpptest/q3dcustom/CMakeLists.txt +++ b/tests/auto/cpptest/q3dcustom/CMakeLists.txt @@ -1,7 +1,10 @@ -qt_internal_add_test(q3dcustom +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dcustom_datavis SOURCES tst_custom.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::DataVisualization ) diff --git a/tests/auto/cpptest/q3dcustom/tst_custom.cpp b/tests/auto/cpptest/q3dcustom/tst_custom.cpp index 19607431..05e09f98 100644 --- a/tests/auto/cpptest/q3dcustom/tst_custom.cpp +++ b/tests/auto/cpptest/q3dcustom/tst_custom.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 <QtTest/QtTest> diff --git a/tests/auto/cpptest/q3dinput-touch/CMakeLists.txt b/tests/auto/cpptest/q3dinput-touch/CMakeLists.txt index 507c78c8..7550bf2b 100644 --- a/tests/auto/cpptest/q3dinput-touch/CMakeLists.txt +++ b/tests/auto/cpptest/q3dinput-touch/CMakeLists.txt @@ -1,7 +1,10 @@ -qt_internal_add_test(q3dinput-touch +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dinput-touch_datavis SOURCES tst_input.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::DataVisualization ) diff --git a/tests/auto/cpptest/q3dinput-touch/tst_input.cpp b/tests/auto/cpptest/q3dinput-touch/tst_input.cpp index c6a5d548..6a11741c 100644 --- a/tests/auto/cpptest/q3dinput-touch/tst_input.cpp +++ b/tests/auto/cpptest/q3dinput-touch/tst_input.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 <QtTest/QtTest> diff --git a/tests/auto/cpptest/q3dinput/CMakeLists.txt b/tests/auto/cpptest/q3dinput/CMakeLists.txt index 8254b259..ac0fe9a9 100644 --- a/tests/auto/cpptest/q3dinput/CMakeLists.txt +++ b/tests/auto/cpptest/q3dinput/CMakeLists.txt @@ -1,7 +1,10 @@ -qt_internal_add_test(q3dinput +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dinput_datavis SOURCES tst_input.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::DataVisualization ) diff --git a/tests/auto/cpptest/q3dinput/tst_input.cpp b/tests/auto/cpptest/q3dinput/tst_input.cpp index 2b36f4aa..95912b8a 100644 --- a/tests/auto/cpptest/q3dinput/tst_input.cpp +++ b/tests/auto/cpptest/q3dinput/tst_input.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 <QtTest/QtTest> diff --git a/tests/auto/cpptest/q3dscatter-modelproxy/CMakeLists.txt b/tests/auto/cpptest/q3dscatter-modelproxy/CMakeLists.txt index 3f6e0203..438c05f8 100644 --- a/tests/auto/cpptest/q3dscatter-modelproxy/CMakeLists.txt +++ b/tests/auto/cpptest/q3dscatter-modelproxy/CMakeLists.txt @@ -1,7 +1,10 @@ -qt_internal_add_test(q3dscatter-modelproxy +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dscatter-modelproxy_datavis SOURCES tst_proxy.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::Widgets Qt::DataVisualization diff --git a/tests/auto/cpptest/q3dscatter-modelproxy/tst_proxy.cpp b/tests/auto/cpptest/q3dscatter-modelproxy/tst_proxy.cpp index 9bcfbe8a..d6950f1f 100644 --- a/tests/auto/cpptest/q3dscatter-modelproxy/tst_proxy.cpp +++ b/tests/auto/cpptest/q3dscatter-modelproxy/tst_proxy.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 <QtTest/QtTest> diff --git a/tests/auto/cpptest/q3dscatter-proxy/CMakeLists.txt b/tests/auto/cpptest/q3dscatter-proxy/CMakeLists.txt index 7875bab5..c813e9fb 100644 --- a/tests/auto/cpptest/q3dscatter-proxy/CMakeLists.txt +++ b/tests/auto/cpptest/q3dscatter-proxy/CMakeLists.txt @@ -1,7 +1,10 @@ -qt_internal_add_test(q3dscatter-proxy +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dscatter-proxy_datavis SOURCES tst_proxy.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::DataVisualization ) diff --git a/tests/auto/cpptest/q3dscatter-proxy/tst_proxy.cpp b/tests/auto/cpptest/q3dscatter-proxy/tst_proxy.cpp index 1d40e845..e2633225 100644 --- a/tests/auto/cpptest/q3dscatter-proxy/tst_proxy.cpp +++ b/tests/auto/cpptest/q3dscatter-proxy/tst_proxy.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 <QtTest/QtTest> diff --git a/tests/auto/cpptest/q3dscatter-series/CMakeLists.txt b/tests/auto/cpptest/q3dscatter-series/CMakeLists.txt index 7191dec6..c2eb2c4a 100644 --- a/tests/auto/cpptest/q3dscatter-series/CMakeLists.txt +++ b/tests/auto/cpptest/q3dscatter-series/CMakeLists.txt @@ -1,7 +1,10 @@ -qt_internal_add_test(q3dscatter-series +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dscatter-series_datavis SOURCES tst_series.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::DataVisualization ) diff --git a/tests/auto/cpptest/q3dscatter-series/tst_series.cpp b/tests/auto/cpptest/q3dscatter-series/tst_series.cpp index aa5cc205..c0c23b07 100644 --- a/tests/auto/cpptest/q3dscatter-series/tst_series.cpp +++ b/tests/auto/cpptest/q3dscatter-series/tst_series.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 <QtTest/QtTest> diff --git a/tests/auto/cpptest/q3dscatter/CMakeLists.txt b/tests/auto/cpptest/q3dscatter/CMakeLists.txt index 78136693..176fb66e 100644 --- a/tests/auto/cpptest/q3dscatter/CMakeLists.txt +++ b/tests/auto/cpptest/q3dscatter/CMakeLists.txt @@ -1,9 +1,12 @@ -qt_internal_add_test(q3dscatter +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dscatter_datavis SOURCES tst_scatter.cpp INCLUDE_DIRECTORIES ../common - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::GuiPrivate Qt::DataVisualization diff --git a/tests/auto/cpptest/q3dscatter/tst_scatter.cpp b/tests/auto/cpptest/q3dscatter/tst_scatter.cpp index 502c2923..f6ac402e 100644 --- a/tests/auto/cpptest/q3dscatter/tst_scatter.cpp +++ b/tests/auto/cpptest/q3dscatter/tst_scatter.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 <QtTest/QtTest> @@ -54,6 +28,7 @@ private slots: void selectSeries(); void removeSeries(); void removeMultipleSeries(); + void hasSeries(); private: Q3DScatter *m_graph; @@ -103,7 +78,7 @@ void tst_scatter::construct() void tst_scatter::initialProperties() { QVERIFY(m_graph); - QCOMPARE(m_graph->seriesList().length(), 0); + QCOMPARE(m_graph->seriesList().size(), 0); QVERIFY(!m_graph->selectedSeries()); QCOMPARE(m_graph->axisX()->orientation(), QAbstract3DAxis::AxisOrientationX); QCOMPARE(m_graph->axisY()->orientation(), QAbstract3DAxis::AxisOrientationY); @@ -173,9 +148,9 @@ void tst_scatter::invalidProperties() m_graph->setLocale(QLocale("XX")); QCOMPARE(m_graph->selectionMode(), QAbstract3DGraph::SelectionItem); - QCOMPARE(m_graph->aspectRatio(), -1.0/*2.0*/); // TODO: Fix once QTRD-3367 is done - QCOMPARE(m_graph->horizontalAspectRatio(), -1.0/*0.0*/); // TODO: Fix once QTRD-3367 is done - QCOMPARE(m_graph->reflectivity(), -1.0/*0.5*/); // TODO: Fix once QTRD-3367 is done + QCOMPARE(m_graph->aspectRatio(), 2.0); + QCOMPARE(m_graph->horizontalAspectRatio(), 0.0); + QCOMPARE(m_graph->reflectivity(), 0.5); QCOMPARE(m_graph->locale(), QLocale("C")); } @@ -183,7 +158,7 @@ void tst_scatter::addSeries() { m_graph->addSeries(newSeries()); - QCOMPARE(m_graph->seriesList().length(), 1); + QCOMPARE(m_graph->seriesList().size(), 1); QVERIFY(!m_graph->selectedSeries()); } @@ -197,7 +172,7 @@ void tst_scatter::addMultipleSeries() m_graph->addSeries(series2); m_graph->addSeries(series3); - QCOMPARE(m_graph->seriesList().length(), 3); + QCOMPARE(m_graph->seriesList().size(), 3); } void tst_scatter::selectSeries() @@ -207,7 +182,7 @@ void tst_scatter::selectSeries() m_graph->addSeries(series); m_graph->seriesList()[0]->setSelectedItem(1); - QCOMPARE(m_graph->seriesList().length(), 1); + QCOMPARE(m_graph->seriesList().size(), 1); QCOMPARE(m_graph->selectedSeries(), series); m_graph->clearSelection(); @@ -220,7 +195,7 @@ void tst_scatter::removeSeries() m_graph->addSeries(series); m_graph->removeSeries(series); - QCOMPARE(m_graph->seriesList().length(), 0); + QCOMPARE(m_graph->seriesList().size(), 0); delete series; } @@ -239,19 +214,28 @@ void tst_scatter::removeMultipleSeries() QCOMPARE(m_graph->selectedSeries(), series); m_graph->removeSeries(series); - QCOMPARE(m_graph->seriesList().length(), 2); + QCOMPARE(m_graph->seriesList().size(), 2); QVERIFY(!m_graph->selectedSeries()); m_graph->removeSeries(series2); - QCOMPARE(m_graph->seriesList().length(), 1); + QCOMPARE(m_graph->seriesList().size(), 1); m_graph->removeSeries(series3); - QCOMPARE(m_graph->seriesList().length(), 0); + QCOMPARE(m_graph->seriesList().size(), 0); delete series; delete series2; delete series3; } +void tst_scatter::hasSeries() +{ + QScatter3DSeries *series1 = newSeries(); + m_graph->addSeries(series1); + QCOMPARE(m_graph->hasSeries(series1), true); + QScatter3DSeries *series2 = newSeries(); + QCOMPARE(m_graph->hasSeries(series2), false); +} + QTEST_MAIN(tst_scatter) #include "tst_scatter.moc" diff --git a/tests/auto/cpptest/q3dscene-camera/CMakeLists.txt b/tests/auto/cpptest/q3dscene-camera/CMakeLists.txt index e8abcd46..63cd964c 100644 --- a/tests/auto/cpptest/q3dscene-camera/CMakeLists.txt +++ b/tests/auto/cpptest/q3dscene-camera/CMakeLists.txt @@ -1,7 +1,10 @@ -qt_internal_add_test(q3dscene-camera +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dscene-camera_datavis SOURCES tst_camera.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::DataVisualization ) diff --git a/tests/auto/cpptest/q3dscene-camera/tst_camera.cpp b/tests/auto/cpptest/q3dscene-camera/tst_camera.cpp index dbfb1367..8c8f4b45 100644 --- a/tests/auto/cpptest/q3dscene-camera/tst_camera.cpp +++ b/tests/auto/cpptest/q3dscene-camera/tst_camera.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 <QtTest/QtTest> diff --git a/tests/auto/cpptest/q3dscene-light/CMakeLists.txt b/tests/auto/cpptest/q3dscene-light/CMakeLists.txt index 5908e8ce..fc70b804 100644 --- a/tests/auto/cpptest/q3dscene-light/CMakeLists.txt +++ b/tests/auto/cpptest/q3dscene-light/CMakeLists.txt @@ -1,7 +1,10 @@ -qt_internal_add_test(q3dscene-light +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dscene-light_datavis SOURCES tst_light.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::DataVisualization ) diff --git a/tests/auto/cpptest/q3dscene-light/tst_light.cpp b/tests/auto/cpptest/q3dscene-light/tst_light.cpp index a02ee1ed..fb5ba325 100644 --- a/tests/auto/cpptest/q3dscene-light/tst_light.cpp +++ b/tests/auto/cpptest/q3dscene-light/tst_light.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 <QtTest/QtTest> diff --git a/tests/auto/cpptest/q3dscene/CMakeLists.txt b/tests/auto/cpptest/q3dscene/CMakeLists.txt index 766d3388..a7c25ff2 100644 --- a/tests/auto/cpptest/q3dscene/CMakeLists.txt +++ b/tests/auto/cpptest/q3dscene/CMakeLists.txt @@ -1,9 +1,12 @@ -qt_internal_add_test(q3dscene +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dscene_datavis SOURCES tst_scene.cpp INCLUDE_DIRECTORIES ../common - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::GuiPrivate Qt::DataVisualization diff --git a/tests/auto/cpptest/q3dscene/tst_scene.cpp b/tests/auto/cpptest/q3dscene/tst_scene.cpp index b40072ef..23d3392c 100644 --- a/tests/auto/cpptest/q3dscene/tst_scene.cpp +++ b/tests/auto/cpptest/q3dscene/tst_scene.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 <QtTest/QtTest> diff --git a/tests/auto/cpptest/q3dsurface-heightproxy/CMakeLists.txt b/tests/auto/cpptest/q3dsurface-heightproxy/CMakeLists.txt index ddff28fd..b7285b3a 100644 --- a/tests/auto/cpptest/q3dsurface-heightproxy/CMakeLists.txt +++ b/tests/auto/cpptest/q3dsurface-heightproxy/CMakeLists.txt @@ -1,7 +1,10 @@ -qt_internal_add_test(q3dsurface-heightproxy +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dsurface-heightproxy_datavis SOURCES tst_proxy.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::DataVisualization ) @@ -10,7 +13,7 @@ set(q3dsurface-heightproxy_resource_files "customtexture.jpg" ) -qt_internal_add_resource(q3dsurface-heightproxy "q3dsurface-heightproxy" +qt_internal_add_resource(q3dsurface-heightproxy_datavis "q3dsurface-heightproxy" PREFIX "/" FILES diff --git a/tests/auto/cpptest/q3dsurface-heightproxy/tst_proxy.cpp b/tests/auto/cpptest/q3dsurface-heightproxy/tst_proxy.cpp index 4bc88405..2d28398a 100644 --- a/tests/auto/cpptest/q3dsurface-heightproxy/tst_proxy.cpp +++ b/tests/auto/cpptest/q3dsurface-heightproxy/tst_proxy.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 <QtTest/QtTest> diff --git a/tests/auto/cpptest/q3dsurface-modelproxy-nan/CMakeLists.txt b/tests/auto/cpptest/q3dsurface-modelproxy-nan/CMakeLists.txt new file mode 100644 index 00000000..835a3bad --- /dev/null +++ b/tests/auto/cpptest/q3dsurface-modelproxy-nan/CMakeLists.txt @@ -0,0 +1,14 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dsurface-modelproxy-nan_datavis + SOURCES + tst_proxy.cpp + INCLUDE_DIRECTORIES + ../common + LIBRARIES + Qt::Gui + Qt::GuiPrivate + Qt::Widgets + Qt::DataVisualization +) diff --git a/tests/auto/cpptest/q3dsurface-modelproxy-nan/tst_proxy.cpp b/tests/auto/cpptest/q3dsurface-modelproxy-nan/tst_proxy.cpp new file mode 100644 index 00000000..c6e0841a --- /dev/null +++ b/tests/auto/cpptest/q3dsurface-modelproxy-nan/tst_proxy.cpp @@ -0,0 +1,266 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include <QtTest/QtTest> + +#include <QtDataVisualization/QItemModelSurfaceDataProxy> +#include <QtDataVisualization/Q3DSurface> + +#include "cpptestutil.h" + +class tst_proxy: public QObject +{ + Q_OBJECT + +private slots: + void initTestCase(); + void cleanupTestCase(); + void init(); + void cleanup(); + + void dataContainingNaNFirstRow(); + void dataContainingNaNLastRow(); + void dataContainingNaNFirstLastRow(); +}; + +void tst_proxy::initTestCase() +{ +} + +void tst_proxy::cleanupTestCase() +{ +} + +void tst_proxy::init() +{ +} + +void tst_proxy::cleanup() +{ +} + +void tst_proxy::dataContainingNaNFirstRow() +{ + if (!CpptestUtil::isOpenGLSupported()) + QSKIP("OpenGL not supported on this platform"); + + const int size = 10; + const int missingRow = 0; + + QItemModelSurfaceDataProxy *proxy = new QItemModelSurfaceDataProxy(); + QSurface3DSeries *series = new QSurface3DSeries(proxy); + Q3DSurface *graph = new Q3DSurface(); + graph->addSeries(series); + + // X + QSurfaceDataArray *array = new QSurfaceDataArray(); + array->reserve(size); + for (int i = 0; i < size; i++) { + QSurfaceDataRow *row = new QSurfaceDataRow(size); + for (int j = 0; j < size; j++) { + (*row)[j].setPosition(QVector3D((i == missingRow) ? std::numeric_limits<float>::quiet_NaN() + : static_cast<float>(i), + qSin(static_cast<float>(i)), static_cast<float>(j))); + } + *array << row; + } + proxy->resetArray(array); + QVERIFY(!qIsNaN(graph->axisX()->min())); + QVERIFY(!qIsNaN(graph->axisX()->max())); + QVERIFY(!qIsNaN(graph->axisY()->min())); + QVERIFY(!qIsNaN(graph->axisY()->max())); + QVERIFY(!qIsNaN(graph->axisZ()->min())); + QVERIFY(!qIsNaN(graph->axisZ()->max())); + + // Y + for (int i = 0; i < size; i++) { + QSurfaceDataRow *row = new QSurfaceDataRow(size); + for (int j = 0; j < size; j++) { + (*row)[j].setPosition(QVector3D(static_cast<float>(i), + (i == missingRow) ? std::numeric_limits<float>::quiet_NaN() + : qSin(static_cast<float>(i)), + static_cast<float>(j))); + } + *array << row; + } + proxy->resetArray(array); + QVERIFY(!qIsNaN(graph->axisX()->min())); + QVERIFY(!qIsNaN(graph->axisX()->max())); + QVERIFY(!qIsNaN(graph->axisY()->min())); + QVERIFY(!qIsNaN(graph->axisY()->max())); + QVERIFY(!qIsNaN(graph->axisZ()->min())); + QVERIFY(!qIsNaN(graph->axisZ()->max())); + + // Z + for (int i = 0; i < size; i++) { + QSurfaceDataRow *row = new QSurfaceDataRow(size); + for (int j = 0; j < size; j++) { + (*row)[j].setPosition(QVector3D(static_cast<float>(i), + qSin(static_cast<float>(i)), + (i == missingRow) ? std::numeric_limits<float>::quiet_NaN() + : static_cast<float>(j))); + } + *array << row; + } + proxy->resetArray(array); + QVERIFY(!qIsNaN(graph->axisX()->min())); + QVERIFY(!qIsNaN(graph->axisX()->max())); + QVERIFY(!qIsNaN(graph->axisY()->min())); + QVERIFY(!qIsNaN(graph->axisY()->max())); + QVERIFY(!qIsNaN(graph->axisZ()->min())); + QVERIFY(!qIsNaN(graph->axisZ()->max())); + + delete graph; + +} + +void tst_proxy::dataContainingNaNLastRow() +{ + if (!CpptestUtil::isOpenGLSupported()) + QSKIP("OpenGL not supported on this platform"); + + const int size = 10; + const int missingRow = size - 1; + QItemModelSurfaceDataProxy *proxy = new QItemModelSurfaceDataProxy(); + QSurface3DSeries *series = new QSurface3DSeries(proxy); + Q3DSurface *graph = new Q3DSurface(); + graph->addSeries(series); + + // X + QSurfaceDataArray *array = new QSurfaceDataArray(); + array->reserve(size); + for (int i = 0; i < size; i++) { + QSurfaceDataRow *row = new QSurfaceDataRow(size); + for (int j = 0; j < size; j++) { + (*row)[j].setPosition(QVector3D((i == missingRow) ? std::numeric_limits<float>::quiet_NaN() + : static_cast<float>(i), + qSin(static_cast<float>(i)), static_cast<float>(j))); + } + *array << row; + } + proxy->resetArray(array); + QVERIFY(!qIsNaN(graph->axisX()->min())); + QVERIFY(!qIsNaN(graph->axisX()->max())); + QVERIFY(!qIsNaN(graph->axisY()->min())); + QVERIFY(!qIsNaN(graph->axisY()->max())); + QVERIFY(!qIsNaN(graph->axisZ()->min())); + QVERIFY(!qIsNaN(graph->axisZ()->max())); + + // Y + for (int i = 0; i < size; i++) { + QSurfaceDataRow *row = new QSurfaceDataRow(size); + for (int j = 0; j < size; j++) { + (*row)[j].setPosition(QVector3D(static_cast<float>(i), + (i == missingRow) ? std::numeric_limits<float>::quiet_NaN() + : qSin(static_cast<float>(i)), + static_cast<float>(j))); + } + *array << row; + } + proxy->resetArray(array); + QVERIFY(!qIsNaN(graph->axisX()->min())); + QVERIFY(!qIsNaN(graph->axisX()->max())); + QVERIFY(!qIsNaN(graph->axisY()->min())); + QVERIFY(!qIsNaN(graph->axisY()->max())); + QVERIFY(!qIsNaN(graph->axisZ()->min())); + QVERIFY(!qIsNaN(graph->axisZ()->max())); + + // Z + for (int i = 0; i < size; i++) { + QSurfaceDataRow *row = new QSurfaceDataRow(size); + for (int j = 0; j < size; j++) { + (*row)[j].setPosition(QVector3D(static_cast<float>(i), + qSin(static_cast<float>(i)), + (i == missingRow) ? std::numeric_limits<float>::quiet_NaN() + : static_cast<float>(j))); + } + *array << row; + } + proxy->resetArray(array); + QVERIFY(!qIsNaN(graph->axisX()->min())); + QVERIFY(!qIsNaN(graph->axisX()->max())); + QVERIFY(!qIsNaN(graph->axisY()->min())); + QVERIFY(!qIsNaN(graph->axisY()->max())); + QVERIFY(!qIsNaN(graph->axisZ()->min())); + QVERIFY(!qIsNaN(graph->axisZ()->max())); + delete graph; +} + +void tst_proxy::dataContainingNaNFirstLastRow() +{ + if (!CpptestUtil::isOpenGLSupported()) + QSKIP("OpenGL not supported on this platform"); + + const int size = 10; + const int rowFirst = 0; + const int rowLast = size - 1; + QItemModelSurfaceDataProxy *proxy = new QItemModelSurfaceDataProxy(); + QSurface3DSeries *series = new QSurface3DSeries(proxy); + Q3DSurface *graph = new Q3DSurface(); + graph->addSeries(series); + + // X + QSurfaceDataArray *array = new QSurfaceDataArray(); + array->reserve(size); + for (int i = 0; i < size; i++) { + bool missingRow = (i == rowFirst || i == rowLast); + QSurfaceDataRow *row = new QSurfaceDataRow(size); + for (int j = 0; j < size; j++) { + (*row)[j].setPosition(QVector3D(missingRow ? std::numeric_limits<float>::quiet_NaN() + : static_cast<float>(i), + qSin(static_cast<float>(i)), static_cast<float>(j))); + } + *array << row; + } + proxy->resetArray(array); + QVERIFY(!qIsNaN(graph->axisX()->min())); + QVERIFY(!qIsNaN(graph->axisX()->max())); + QVERIFY(!qIsNaN(graph->axisY()->min())); + QVERIFY(!qIsNaN(graph->axisY()->max())); + QVERIFY(!qIsNaN(graph->axisZ()->min())); + QVERIFY(!qIsNaN(graph->axisZ()->max())); + + // Y + for (int i = 0; i < size; i++) { + bool missingRow = (i == rowFirst || i == rowLast); + QSurfaceDataRow *row = new QSurfaceDataRow(size); + for (int j = 0; j < size; j++) { + (*row)[j].setPosition(QVector3D(static_cast<float>(i), + missingRow ? std::numeric_limits<float>::quiet_NaN() + : qSin(static_cast<float>(i)), + static_cast<float>(j))); + } + *array << row; + } + proxy->resetArray(array); + QVERIFY(!qIsNaN(graph->axisX()->min())); + QVERIFY(!qIsNaN(graph->axisX()->max())); + QVERIFY(!qIsNaN(graph->axisY()->min())); + QVERIFY(!qIsNaN(graph->axisY()->max())); + QVERIFY(!qIsNaN(graph->axisZ()->min())); + QVERIFY(!qIsNaN(graph->axisZ()->max())); + + // Z + for (int i = 0; i < size; i++) { + bool missingRow = (i == rowFirst || i == rowLast); + QSurfaceDataRow *row = new QSurfaceDataRow(size); + for (int j = 0; j < size; j++) { + (*row)[j].setPosition(QVector3D(static_cast<float>(i), + qSin(static_cast<float>(i)), + missingRow ? std::numeric_limits<float>::quiet_NaN() + : static_cast<float>(j))); + } + *array << row; + } + proxy->resetArray(array); + QVERIFY(!qIsNaN(graph->axisX()->min())); + QVERIFY(!qIsNaN(graph->axisX()->max())); + QVERIFY(!qIsNaN(graph->axisY()->min())); + QVERIFY(!qIsNaN(graph->axisY()->max())); + QVERIFY(!qIsNaN(graph->axisZ()->min())); + QVERIFY(!qIsNaN(graph->axisZ()->max())); + delete graph; +} + +QTEST_MAIN(tst_proxy) +#include "tst_proxy.moc" diff --git a/tests/auto/cpptest/q3dsurface-modelproxy/CMakeLists.txt b/tests/auto/cpptest/q3dsurface-modelproxy/CMakeLists.txt index 0738ba32..4b42431a 100644 --- a/tests/auto/cpptest/q3dsurface-modelproxy/CMakeLists.txt +++ b/tests/auto/cpptest/q3dsurface-modelproxy/CMakeLists.txt @@ -1,9 +1,12 @@ -qt_internal_add_test(q3dsurface-modelproxy +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dsurface-modelproxy_datavis SOURCES tst_proxy.cpp INCLUDE_DIRECTORIES ../common - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::GuiPrivate Qt::Widgets diff --git a/tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp b/tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp index 09c0c383..a442b1f3 100644 --- a/tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp +++ b/tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.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 <QtTest/QtTest> @@ -94,8 +68,8 @@ void tst_proxy::construct() QCOMPARE(proxy->xPosRole(), QString("")); QCOMPARE(proxy->yPosRole(), QString("y")); QCOMPARE(proxy->zPosRole(), QString("")); - QCOMPARE(proxy->rowCategories().length(), 0); - QCOMPARE(proxy->columnCategories().length(), 0); + QCOMPARE(proxy->rowCategories().size(), 0); + QCOMPARE(proxy->columnCategories().size(), 0); delete proxy; proxy = new QItemModelSurfaceDataProxy(table.model(), "row", "column", "y"); @@ -105,8 +79,8 @@ void tst_proxy::construct() QCOMPARE(proxy->xPosRole(), QString("column")); QCOMPARE(proxy->yPosRole(), QString("y")); QCOMPARE(proxy->zPosRole(), QString("row")); - QCOMPARE(proxy->rowCategories().length(), 0); - QCOMPARE(proxy->columnCategories().length(), 0); + QCOMPARE(proxy->rowCategories().size(), 0); + QCOMPARE(proxy->columnCategories().size(), 0); delete proxy; proxy = new QItemModelSurfaceDataProxy(table.model(), "row", "column", "x", "y", "z"); @@ -116,8 +90,8 @@ void tst_proxy::construct() QCOMPARE(proxy->xPosRole(), QString("x")); QCOMPARE(proxy->yPosRole(), QString("y")); QCOMPARE(proxy->zPosRole(), QString("z")); - QCOMPARE(proxy->rowCategories().length(), 0); - QCOMPARE(proxy->columnCategories().length(), 0); + QCOMPARE(proxy->rowCategories().size(), 0); + QCOMPARE(proxy->columnCategories().size(), 0); delete proxy; proxy = new QItemModelSurfaceDataProxy(table.model(), "row", "column", "y", @@ -128,8 +102,8 @@ void tst_proxy::construct() QCOMPARE(proxy->xPosRole(), QString("column")); QCOMPARE(proxy->yPosRole(), QString("y")); QCOMPARE(proxy->zPosRole(), QString("row")); - QCOMPARE(proxy->rowCategories().length(), 1); - QCOMPARE(proxy->columnCategories().length(), 1); + QCOMPARE(proxy->rowCategories().size(), 1); + QCOMPARE(proxy->columnCategories().size(), 1); delete proxy; proxy = new QItemModelSurfaceDataProxy(table.model(), "row", "column", "x", "y", "z", @@ -140,8 +114,8 @@ void tst_proxy::construct() QCOMPARE(proxy->xPosRole(), QString("x")); QCOMPARE(proxy->yPosRole(), QString("y")); QCOMPARE(proxy->zPosRole(), QString("z")); - QCOMPARE(proxy->rowCategories().length(), 1); - QCOMPARE(proxy->columnCategories().length(), 1); + QCOMPARE(proxy->rowCategories().size(), 1); + QCOMPARE(proxy->columnCategories().size(), 1); delete proxy; } @@ -210,13 +184,13 @@ void tst_proxy::initializeProperties() QCOMPARE(m_proxy->autoColumnCategories(), false); QCOMPARE(m_proxy->autoRowCategories(), false); - QCOMPARE(m_proxy->columnCategories().count(), 2); + QCOMPARE(m_proxy->columnCategories().size(), 2); QCOMPARE(m_proxy->columnRole(), QString("column")); QCOMPARE(m_proxy->columnRolePattern(), QRegularExpression("/^.*-(\\d\\d)$/")); QCOMPARE(m_proxy->columnRoleReplace(), QString("\\\\1")); QVERIFY(m_proxy->itemModel()); QCOMPARE(m_proxy->multiMatchBehavior(), QItemModelSurfaceDataProxy::MMBAverage); - QCOMPARE(m_proxy->rowCategories().count(), 2); + QCOMPARE(m_proxy->rowCategories().size(), 2); QCOMPARE(m_proxy->rowRole(), QString("row")); QCOMPARE(m_proxy->rowRolePattern(), QRegularExpression("/^(\\d\\d\\d\\d).*$/")); QCOMPARE(m_proxy->rowRoleReplace(), QString("\\\\1")); diff --git a/tests/auto/cpptest/q3dsurface-proxy/CMakeLists.txt b/tests/auto/cpptest/q3dsurface-proxy/CMakeLists.txt index 868c6e3e..5553d635 100644 --- a/tests/auto/cpptest/q3dsurface-proxy/CMakeLists.txt +++ b/tests/auto/cpptest/q3dsurface-proxy/CMakeLists.txt @@ -1,7 +1,10 @@ -qt_internal_add_test(q3dsurface-proxy +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dsurface-proxy_datavis SOURCES tst_proxy.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::DataVisualization ) diff --git a/tests/auto/cpptest/q3dsurface-proxy/tst_proxy.cpp b/tests/auto/cpptest/q3dsurface-proxy/tst_proxy.cpp index 16025964..bc5d9edc 100644 --- a/tests/auto/cpptest/q3dsurface-proxy/tst_proxy.cpp +++ b/tests/auto/cpptest/q3dsurface-proxy/tst_proxy.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 <QtTest/QtTest> diff --git a/tests/auto/cpptest/q3dsurface-series/CMakeLists.txt b/tests/auto/cpptest/q3dsurface-series/CMakeLists.txt index cd85f2ce..283829bd 100644 --- a/tests/auto/cpptest/q3dsurface-series/CMakeLists.txt +++ b/tests/auto/cpptest/q3dsurface-series/CMakeLists.txt @@ -1,7 +1,10 @@ -qt_internal_add_test(q3dsurface-series +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dsurface-series_datavis SOURCES tst_series.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::DataVisualization ) diff --git a/tests/auto/cpptest/q3dsurface-series/tst_series.cpp b/tests/auto/cpptest/q3dsurface-series/tst_series.cpp index 23f86dd5..59befddc 100644 --- a/tests/auto/cpptest/q3dsurface-series/tst_series.cpp +++ b/tests/auto/cpptest/q3dsurface-series/tst_series.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 <QtTest/QtTest> @@ -92,7 +66,7 @@ void tst_series::initialProperties() QCOMPARE(m_series->isFlatShadingEnabled(), true); QCOMPARE(m_series->isFlatShadingSupported(), true); QCOMPARE(m_series->selectedPoint(), m_series->invalidSelectionPosition()); - + QCOMPARE(m_series->wireframeColor(), QColor(Qt::black)); // Common properties. The ones identical between different series are tested in QBar3DSeries tests QCOMPARE(m_series->itemLabelFormat(), QString("@xLabel, @yLabel, @zLabel")); QCOMPARE(m_series->mesh(), QAbstract3DSeries::MeshSphere); @@ -107,10 +81,12 @@ void tst_series::initializeProperties() m_series->setDrawMode(QSurface3DSeries::DrawWireframe); m_series->setFlatShadingEnabled(false); m_series->setSelectedPoint(QPoint(0, 0)); + m_series->setWireframeColor(QColor(Qt::red)); QCOMPARE(m_series->drawMode(), QSurface3DSeries::DrawWireframe); QCOMPARE(m_series->isFlatShadingEnabled(), false); QCOMPARE(m_series->selectedPoint(), QPoint(0, 0)); + QCOMPARE(m_series->wireframeColor(), QColor(Qt::red)); // Common properties. The ones identical between different series are tested in QBar3DSeries tests m_series->setMesh(QAbstract3DSeries::MeshPyramid); diff --git a/tests/auto/cpptest/q3dsurface/CMakeLists.txt b/tests/auto/cpptest/q3dsurface/CMakeLists.txt index 0cbfae3a..71f78da8 100644 --- a/tests/auto/cpptest/q3dsurface/CMakeLists.txt +++ b/tests/auto/cpptest/q3dsurface/CMakeLists.txt @@ -1,9 +1,12 @@ -qt_internal_add_test(q3dsurface +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dsurface_datavis SOURCES tst_surface.cpp INCLUDE_DIRECTORIES ../common - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::GuiPrivate Qt::DataVisualization diff --git a/tests/auto/cpptest/q3dsurface/tst_surface.cpp b/tests/auto/cpptest/q3dsurface/tst_surface.cpp index e0add57c..b27dfa0c 100644 --- a/tests/auto/cpptest/q3dsurface/tst_surface.cpp +++ b/tests/auto/cpptest/q3dsurface/tst_surface.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 <QtTest/QtTest> @@ -54,6 +28,7 @@ private slots: void selectSeries(); void removeSeries(); void removeMultipleSeries(); + void hasSeries(); private: Q3DSurface *m_graph; @@ -108,7 +83,7 @@ void tst_surface::construct() void tst_surface::initialProperties() { QVERIFY(m_graph); - QCOMPARE(m_graph->seriesList().length(), 0); + QCOMPARE(m_graph->seriesList().size(), 0); QVERIFY(!m_graph->selectedSeries()); QCOMPARE(m_graph->flipHorizontalGrid(), false); QCOMPARE(m_graph->axisX()->orientation(), QAbstract3DAxis::AxisOrientationX); @@ -183,9 +158,9 @@ void tst_surface::invalidProperties() m_graph->setLocale(QLocale("XX")); QCOMPARE(m_graph->selectionMode(), QAbstract3DGraph::SelectionItem); - QCOMPARE(m_graph->aspectRatio(), -1.0/*2.0*/); // TODO: Fix once QTRD-3367 is done - QCOMPARE(m_graph->horizontalAspectRatio(), -1.0/*0.0*/); // TODO: Fix once QTRD-3367 is done - QCOMPARE(m_graph->reflectivity(), -1.0/*0.5*/); // TODO: Fix once QTRD-3367 is done + QCOMPARE(m_graph->aspectRatio(), 2.0); + QCOMPARE(m_graph->horizontalAspectRatio(), 0.0); + QCOMPARE(m_graph->reflectivity(), 0.5); QCOMPARE(m_graph->locale(), QLocale("C")); } @@ -193,7 +168,7 @@ void tst_surface::addSeries() { m_graph->addSeries(newSeries()); - QCOMPARE(m_graph->seriesList().length(), 1); + QCOMPARE(m_graph->seriesList().size(), 1); QVERIFY(!m_graph->selectedSeries()); } @@ -207,7 +182,7 @@ void tst_surface::addMultipleSeries() m_graph->addSeries(series2); m_graph->addSeries(series3); - QCOMPARE(m_graph->seriesList().length(), 3); + QCOMPARE(m_graph->seriesList().size(), 3); } void tst_surface::selectSeries() @@ -217,7 +192,7 @@ void tst_surface::selectSeries() m_graph->addSeries(series); m_graph->seriesList()[0]->setSelectedPoint(QPoint(0, 0)); - QCOMPARE(m_graph->seriesList().length(), 1); + QCOMPARE(m_graph->seriesList().size(), 1); QCOMPARE(m_graph->selectedSeries(), series); m_graph->clearSelection(); @@ -230,7 +205,7 @@ void tst_surface::removeSeries() m_graph->addSeries(series); m_graph->removeSeries(series); - QCOMPARE(m_graph->seriesList().length(), 0); + QCOMPARE(m_graph->seriesList().size(), 0); delete series; } @@ -249,19 +224,28 @@ void tst_surface::removeMultipleSeries() QCOMPARE(m_graph->selectedSeries(), series); m_graph->removeSeries(series); - QCOMPARE(m_graph->seriesList().length(), 2); + QCOMPARE(m_graph->seriesList().size(), 2); QVERIFY(!m_graph->selectedSeries()); m_graph->removeSeries(series2); - QCOMPARE(m_graph->seriesList().length(), 1); + QCOMPARE(m_graph->seriesList().size(), 1); m_graph->removeSeries(series3); - QCOMPARE(m_graph->seriesList().length(), 0); + QCOMPARE(m_graph->seriesList().size(), 0); delete series; delete series2; delete series3; } +void tst_surface::hasSeries() +{ + QSurface3DSeries *series1 = newSeries(); + m_graph->addSeries(series1); + QCOMPARE(m_graph->hasSeries(series1), true); + QSurface3DSeries *series2 = newSeries(); + QCOMPARE(m_graph->hasSeries(series2), false); +} + QTEST_MAIN(tst_surface) #include "tst_surface.moc" diff --git a/tests/auto/cpptest/q3dtheme/CMakeLists.txt b/tests/auto/cpptest/q3dtheme/CMakeLists.txt index 29c1ff21..0b59ed6e 100644 --- a/tests/auto/cpptest/q3dtheme/CMakeLists.txt +++ b/tests/auto/cpptest/q3dtheme/CMakeLists.txt @@ -1,7 +1,10 @@ -qt_internal_add_test(q3dtheme +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +qt_internal_add_test(q3dtheme_datavis SOURCES tst_theme.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::DataVisualization ) diff --git a/tests/auto/cpptest/q3dtheme/tst_theme.cpp b/tests/auto/cpptest/q3dtheme/tst_theme.cpp index 58a22592..24503d95 100644 --- a/tests/auto/cpptest/q3dtheme/tst_theme.cpp +++ b/tests/auto/cpptest/q3dtheme/tst_theme.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 <QtTest/QtTest> @@ -80,10 +54,10 @@ void tst_theme::construct() QCOMPARE(theme->ambientLightStrength(), 0.5f); QCOMPARE(theme->backgroundColor(), QColor(Qt::black)); QCOMPARE(theme->isBackgroundEnabled(), true); - QCOMPARE(theme->baseColors().length(), 5); + QCOMPARE(theme->baseColors().size(), 5); QCOMPARE(theme->baseColors().at(0), QColor(Qt::white)); QCOMPARE(theme->baseColors().at(4), QColor(QRgb(0x6b6b6b))); - QCOMPARE(theme->baseGradients().length(), 5); + QCOMPARE(theme->baseGradients().size(), 5); QCOMPARE(theme->baseGradients().at(0).stops().at(1).second, QColor(Qt::white)); QCOMPARE(theme->baseGradients().at(4).stops().at(1).second, QColor(QRgb(0x6b6b6b))); QCOMPARE(theme->colorStyle(), Q3DTheme::ColorStyleUniform); @@ -113,9 +87,9 @@ void tst_theme::initialProperties() QCOMPARE(m_theme->ambientLightStrength(), 0.25f); QCOMPARE(m_theme->backgroundColor(), QColor(Qt::black)); QCOMPARE(m_theme->isBackgroundEnabled(), true); - QCOMPARE(m_theme->baseColors().length(), 1); + QCOMPARE(m_theme->baseColors().size(), 1); QCOMPARE(m_theme->baseColors().at(0), QColor(Qt::black)); - QCOMPARE(m_theme->baseGradients().length(), 1); + QCOMPARE(m_theme->baseGradients().size(), 1); QCOMPARE(m_theme->baseGradients().at(0).stops().at(0).second, QColor(Qt::black)); QCOMPARE(m_theme->baseGradients().at(0).stops().at(1).second, QColor(Qt::white)); QCOMPARE(m_theme->colorStyle(), Q3DTheme::ColorStyleUniform); @@ -178,10 +152,10 @@ void tst_theme::initializeProperties() QCOMPARE(m_theme->ambientLightStrength(), 0.3f); QCOMPARE(m_theme->backgroundColor(), QColor(Qt::red)); QCOMPARE(m_theme->isBackgroundEnabled(), false); - QCOMPARE(m_theme->baseColors().length(), 2); + QCOMPARE(m_theme->baseColors().size(), 2); QCOMPARE(m_theme->baseColors().at(0), QColor(Qt::red)); QCOMPARE(m_theme->baseColors().at(1), QColor(Qt::blue)); - QCOMPARE(m_theme->baseGradients().length(), 2); + QCOMPARE(m_theme->baseGradients().size(), 2); QCOMPARE(m_theme->baseGradients().at(0), gradient1); QCOMPARE(m_theme->baseGradients().at(0), gradient2); QCOMPARE(m_theme->colorStyle(), Q3DTheme::ColorStyleRangeGradient); diff --git a/tests/auto/qmltest/CMakeLists.txt b/tests/auto/qmltest/CMakeLists.txt index 8ab433b4..3f891438 100644 --- a/tests/auto/qmltest/CMakeLists.txt +++ b/tests/auto/qmltest/CMakeLists.txt @@ -1,9 +1,18 @@ -qt_internal_add_test(tst_qmltest +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + *) +list(APPEND test_data ${test_data_glob}) + +qt_internal_add_test(tst_qmltest_datavis QMLTEST SOURCES tst_qmltest.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui + TESTDATA ${test_data} ) set(qmltest_resource_files @@ -11,7 +20,7 @@ set(qmltest_resource_files "customtexture.jpg" ) -qt_internal_add_resource(tst_qmltest "qmltest" +qt_internal_add_resource(tst_qmltest_datavis "qmltest" PREFIX "/" FILES diff --git a/tests/auto/qmltest/axis3d/tst_category.qml b/tests/auto/qmltest/axis3d/tst_category.qml index 0792ad8f..7400177e 100644 --- a/tests/auto/qmltest/axis3d/tst_category.qml +++ b/tests/auto/qmltest/axis3d/tst_category.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/tests/auto/qmltest/axis3d/tst_logvalue.qml b/tests/auto/qmltest/axis3d/tst_logvalue.qml index d92f98d7..323bc194 100644 --- a/tests/auto/qmltest/axis3d/tst_logvalue.qml +++ b/tests/auto/qmltest/axis3d/tst_logvalue.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/tests/auto/qmltest/axis3d/tst_value.qml b/tests/auto/qmltest/axis3d/tst_value.qml index 6e15cb85..d284a874 100644 --- a/tests/auto/qmltest/axis3d/tst_value.qml +++ b/tests/auto/qmltest/axis3d/tst_value.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/tests/auto/qmltest/bars3d/tst_bars.qml b/tests/auto/qmltest/bars3d/tst_bars.qml index 75cf10a2..03638501 100644 --- a/tests/auto/qmltest/bars3d/tst_bars.qml +++ b/tests/auto/qmltest/bars3d/tst_bars.qml @@ -1,34 +1,8 @@ -/**************************************************************************** -** -** 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 +import QtDataVisualization import QtTest 1.0 Item { @@ -40,8 +14,8 @@ Item { function constructBars() { bars3d = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Bars3D { anchors.fill: parent }", top) @@ -89,6 +63,14 @@ Item { compare(bars3d.selectedSeries, series1) waitForRendering(top) + } + + function test_6_has_series() { + bars3d.seriesList = [series1] + compare(bars3d.hasSeries(series1), true) + compare(bars3d.hasSeries(series2), false) + + waitForRendering(top) bars3d.destroy() waitForRendering(top) } @@ -103,8 +85,8 @@ Item { function constructBarsWithCustomItemList() { bars3d = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Bars3D { anchors.fill: parent customItemList: [item1, item2] diff --git a/tests/auto/qmltest/bars3d/tst_barseries.qml b/tests/auto/qmltest/bars3d/tst_barseries.qml index 3db19615..7ee38d29 100644 --- a/tests/auto/qmltest/bars3d/tst_barseries.qml +++ b/tests/auto/qmltest/bars3d/tst_barseries.qml @@ -1,34 +1,8 @@ -/**************************************************************************** -** -** 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 +import QtDataVisualization import QtTest 1.0 Item { @@ -64,6 +38,20 @@ Item { ] } + ThemeColor { + id: rowColor1 + color: "green" + } + + ThemeColor { + id: rowColor2 + color: "blue" + } + ThemeColor { + id: rowColor3 + color: "red" + } + Bar3DSeries { id: initialized dataProxy: ItemModelBarDataProxy { @@ -92,6 +80,7 @@ Item { singleHighlightGradient: gradient3 userDefinedMesh: ":/customitem.obj" visible: false + rowColors: [ rowColor1, rowColor2, rowColor3 ] } ItemModelBarDataProxy { @@ -118,6 +107,7 @@ Item { compare(initial.invalidSelectionPosition, Qt.point(-1, -1)) compare(initial.meshAngle, 0) compare(initial.selectedBar, Qt.point(-1, -1)) + compare(initial.rowColors.length, 0) } function test_2_initial_common() { @@ -149,6 +139,7 @@ Item { compare(initialized.dataProxy.rowCount, 2) fuzzyCompare(initialized.meshAngle, 15.0, 0.01) compare(initialized.selectedBar, Qt.point(0, 0)) + compare(initialized.rowColors.length, 3) } function test_2_initialized_common() { @@ -177,6 +168,7 @@ Item { change.dataProxy = proxy1 change.meshAngle = 15.0 change.selectedBar = Qt.point(0, 0) + change.rowColors = [rowColor1, rowColor2, rowColor3] } function test_2_test_change() { @@ -222,5 +214,10 @@ Item { gradient1.stops[0].color = "yellow" compare(change.baseGradient.stops[0].color, "#ffff00") } + + function test_5_change_rowColors() { + rowColor2.color = "purple" + compare(change.rowColors[1].color, "#800080") + } } } diff --git a/tests/auto/qmltest/bars3d/tst_basic.qml b/tests/auto/qmltest/bars3d/tst_basic.qml index 3ef7101d..881d629e 100644 --- a/tests/auto/qmltest/bars3d/tst_basic.qml +++ b/tests/auto/qmltest/bars3d/tst_basic.qml @@ -1,34 +1,8 @@ -/**************************************************************************** -** -** 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 +import QtDataVisualization import QtTest 1.0 Item { @@ -43,22 +17,24 @@ Item { function constructEmpty() { empty = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Bars3D { }", top) } function constructBasic() { basic = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Bars3D { anchors.fill: parent multiSeriesUniform: true barThickness: 0.1 barSpacing.width: 0.1 barSpacing.height: 0.1 + barSeriesMargin.width: 0.3 + barSeriesMargin.height: 0.3 barSpacingRelative: false floorLevel: 1.0 }", top) @@ -67,8 +43,8 @@ Item { function constructCommon() { common = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Bars3D { anchors.fill: parent }", top) @@ -77,8 +53,8 @@ Item { function constructCommonInit() { common_init = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Bars3D { anchors.fill: parent selectionMode: AbstractGraph3D.SelectionNone @@ -112,6 +88,7 @@ Item { compare(empty.multiSeriesUniform, false, "multiSeriesUniform") compare(empty.barThickness, 1.0, "barThickness") compare(empty.barSpacing, Qt.size(1.0, 1.0), "barSpacing") + compare(empty.barSeriesMargin, Qt.size(0.0, 0.0), "barSeriesMargin") compare(empty.barSpacingRelative, true, "barSpacingRelative") compare(empty.seriesList.length, 0, "seriesList") compare(empty.selectedSeries, null, "selectedSeries") @@ -124,8 +101,6 @@ Item { compare(empty.rowAxis.type, AbstractAxis3D.AxisTypeCategory) compare(empty.valueAxis.type, AbstractAxis3D.AxisTypeValue) waitForRendering(top) - empty.destroy() - waitForRendering(top) } } @@ -140,6 +115,7 @@ Item { compare(basic.multiSeriesUniform, true, "multiSeriesUniform") compare(basic.barThickness, 0.1, "barThickness") compare(basic.barSpacing, Qt.size(0.1, 0.1), "barSpacing") + compare(basic.barSeriesMargin, Qt.size(0.3, 0.3), "barSeriesMargin") compare(basic.barSpacingRelative, false, "barSpacingRelative") compare(basic.floorLevel, 1.0, "floorLevel") waitForRendering(top) @@ -149,11 +125,13 @@ Item { basic.multiSeriesUniform = false basic.barThickness = 0.5 basic.barSpacing = Qt.size(1.0, 0.0) + basic.barSeriesMargin = Qt.size(0.5, 0.0) basic.barSpacingRelative = true basic.floorLevel = 0.2 compare(basic.multiSeriesUniform, false, "multiSeriesUniform") compare(basic.barThickness, 0.5, "barThickness") compare(basic.barSpacing, Qt.size(1.0, 0.0), "barSpacing") + compare(basic.barSeriesMargin, Qt.size(0.5, 0.0), "barSeriesMargin") compare(basic.barSpacingRelative, true, "barSpacingRelative") compare(basic.floorLevel, 0.2, "floorLevel") waitForRendering(top) @@ -162,10 +140,10 @@ Item { function test_3_basic_change_invalid() { basic.barThickness = -1 basic.barSpacing = Qt.size(-1.0, -1.0) + basic.barSeriesMargin = Qt.size(-1.0, -1.0) compare(basic.barThickness, -1/*0.5*/, "barThickness") // TODO: Fix once QTRD-3367 is done compare(basic.barSpacing, Qt.size(-1.0, -1.0), "barSpacing") - waitForRendering(top) - basic.destroy() + compare(basic.barSeriesMargin, Qt.size(-1.0, -1.0), "barSeriesMargin") waitForRendering(top) } } @@ -175,13 +153,16 @@ Item { when: windowShown function test_1_common() { + if (Qt.platform.os === "android") + return; + constructCommon() + if (common.shadowsSupported === false) + return; + compare(common.selectionMode, AbstractGraph3D.SelectionItem, "selectionMode") compare(common.shadowQuality, AbstractGraph3D.ShadowQualityMedium, "shadowQuality") - if (common.shadowsSupported === true) - compare(common.msaaSamples, 4, "msaaSamples") - else - compare(common.msaaSamples, 0, "msaaSamples") + compare(common.msaaSamples, 4, "msaaSamples") compare(common.theme.type, Theme3D.ThemeQt, "theme") compare(common.renderingMode, AbstractGraph3D.RenderIndirect, "renderingMode") compare(common.measureFps, false, "measureFps") @@ -202,14 +183,14 @@ Item { } function test_2_change_common() { + if (Qt.platform.os === "android" || common.shadowsSupported === false) + return; + common.selectionMode = AbstractGraph3D.SelectionItem | AbstractGraph3D.SelectionRow | AbstractGraph3D.SelectionSlice common.shadowQuality = AbstractGraph3D.ShadowQualitySoftHigh - compare(common.shadowQuality, AbstractGraph3D.ShadowQualitySoftHigh, "shadowQuality") common.msaaSamples = 8 - if (common.shadowsSupported === true) - compare(common.msaaSamples, 8, "msaaSamples") - else - compare(common.msaaSamples, 0, "msaaSamples") + compare(common.shadowQuality, AbstractGraph3D.ShadowQualitySoftHigh, "shadowQuality") + compare(common.msaaSamples, 8, "msaaSamples") common.theme.type = Theme3D.ThemeRetro common.renderingMode = AbstractGraph3D.RenderDirectToBackground_NoClear common.measureFps = true @@ -243,6 +224,9 @@ Item { } function test_3_change_invalid_common() { + if (Qt.platform.os === "android" || common.shadowsSupported === false) + return; + common.selectionMode = AbstractGraph3D.SelectionRow | AbstractGraph3D.SelectionColumn | AbstractGraph3D.SelectionSlice common.theme.type = -2 common.renderingMode = -1 @@ -254,28 +238,30 @@ Item { common.reflection = false common.reflectivity = -1.0 compare(common.selectionMode, AbstractGraph3D.SelectionItem | AbstractGraph3D.SelectionRow | AbstractGraph3D.SelectionSlice, "selectionMode") - compare(common.theme.type, -2/*Theme3D.ThemeRetro*/, "theme") // TODO: Fix once QTRD-3367 is done - compare(common.renderingMode, -1/*AbstractGraph3D.RenderDirectToBackground_NoClear*/, "renderingMode") // TODO: Fix once QTRD-3367 is done - compare(common.aspectRatio, -1.0/*1.0*/, "aspectRatio") // TODO: Fix once QTRD-3367 is done - compare(common.horizontalAspectRatio, -2/*1*/, "horizontalAspectRatio") // TODO: Fix once QTRD-3367 is done - compare(common.reflectivity, -1.0/*1.0*/, "reflectivity") // TODO: Fix once QTRD-3367 is done - - waitForRendering(top) - common.destroy() + compare(common.theme.type, Theme3D.ThemeRetro, "theme") + compare(common.renderingMode, AbstractGraph3D.RenderDirectToBackground_NoClear, "renderingMode") + compare(common.aspectRatio, 1.0, "aspectRatio") + compare(common.horizontalAspectRatio, 1.0, "horizontalAspectRatio") + compare(common.reflectivity, 1.0, "reflectivity") waitForRendering(top) } + } + + TestCase { + name: "Bars3D Common Initialized" + when: windowShown + + function test_1_common_initialized() { + if (Qt.platform.os === "android") + return; - function test_4_common_initialized() { constructCommonInit() + if (common_init.shadowsSupported === false) // This test is flaky on VM, use shadowsSupported to detect being run in VM + return; compare(common_init.selectionMode, AbstractGraph3D.SelectionNone, "selectionMode") - if (common_init.shadowsSupported === true) { - tryCompare(common_init, "shadowQuality", AbstractGraph3D.ShadowQualityLow) - compare(common_init.msaaSamples, 2, "msaaSamples") - } else { - tryCompare(common_init, "shadowQuality", AbstractGraph3D.ShadowQualityNone) - compare(common_init.msaaSamples, 0, "msaaSamples") - } + tryCompare(common_init, "shadowQuality", AbstractGraph3D.ShadowQualityLow) + compare(common_init.msaaSamples, 2, "msaaSamples") compare(common_init.theme.type, Theme3D.ThemeUserDefined, "theme") compare(common_init.renderingMode, AbstractGraph3D.RenderIndirect, "renderingMode") compare(common_init.measureFps, true, "measureFps") @@ -290,9 +276,6 @@ Item { compare(common_init.reflectivity, 0.1, "reflectivity") compare(common_init.locale, Qt.locale("UK"), "locale") compare(common_init.margin, 0.2, "margin") - - waitForRendering(top) - common_init.destroy(); waitForRendering(top) } } diff --git a/tests/auto/qmltest/bars3d/tst_proxy.qml b/tests/auto/qmltest/bars3d/tst_proxy.qml index ca8b8516..bd337017 100644 --- a/tests/auto/qmltest/bars3d/tst_proxy.qml +++ b/tests/auto/qmltest/bars3d/tst_proxy.qml @@ -1,34 +1,8 @@ -/**************************************************************************** -** -** 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 +import QtDataVisualization import QtTest 1.0 Item { diff --git a/tests/auto/qmltest/custom3d/tst_customitem.qml b/tests/auto/qmltest/custom3d/tst_customitem.qml index 862aa67a..eebfaac1 100644 --- a/tests/auto/qmltest/custom3d/tst_customitem.qml +++ b/tests/auto/qmltest/custom3d/tst_customitem.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/tests/auto/qmltest/custom3d/tst_customlabel.qml b/tests/auto/qmltest/custom3d/tst_customlabel.qml index f4094efd..28f062ab 100644 --- a/tests/auto/qmltest/custom3d/tst_customlabel.qml +++ b/tests/auto/qmltest/custom3d/tst_customlabel.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/tests/auto/qmltest/custom3d/tst_customvolume.qml b/tests/auto/qmltest/custom3d/tst_customvolume.qml index aa97a7e2..21630394 100644 --- a/tests/auto/qmltest/custom3d/tst_customvolume.qml +++ b/tests/auto/qmltest/custom3d/tst_customvolume.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/tests/auto/qmltest/input3d/tst_input.qml b/tests/auto/qmltest/input3d/tst_input.qml index 44b06b65..a2904c53 100644 --- a/tests/auto/qmltest/input3d/tst_input.qml +++ b/tests/auto/qmltest/input3d/tst_input.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/tests/auto/qmltest/input3d/tst_touch.qml b/tests/auto/qmltest/input3d/tst_touch.qml index 13af8afd..047abb97 100644 --- a/tests/auto/qmltest/input3d/tst_touch.qml +++ b/tests/auto/qmltest/input3d/tst_touch.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/tests/auto/qmltest/qmltest.qrc b/tests/auto/qmltest/qmltest.qrc deleted file mode 100644 index 61f19086..00000000 --- a/tests/auto/qmltest/qmltest.qrc +++ /dev/null @@ -1,6 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>customitem.obj</file> - <file>customtexture.jpg</file> - </qresource> -</RCC> diff --git a/tests/auto/qmltest/scatter3d/tst_basic.qml b/tests/auto/qmltest/scatter3d/tst_basic.qml index a5f20d01..7320ac49 100644 --- a/tests/auto/qmltest/scatter3d/tst_basic.qml +++ b/tests/auto/qmltest/scatter3d/tst_basic.qml @@ -1,34 +1,8 @@ -/**************************************************************************** -** -** 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 +import QtDataVisualization import QtTest 1.0 Item { @@ -43,16 +17,16 @@ Item { function constructEmpty() { empty = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Scatter3D { }", top) } function constructBasic() { basic = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Scatter3D { anchors.fill: parent }", top) @@ -61,8 +35,8 @@ Item { function constructCommon() { common = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Scatter3D { anchors.fill: parent }", top) @@ -71,8 +45,8 @@ Item { function constructCommonInit() { common_init = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Scatter3D { anchors.fill: parent selectionMode: AbstractGraph3D.SelectionNone @@ -112,8 +86,6 @@ Item { compare(empty.axisZ.type, AbstractAxis3D.AxisTypeValue) compare(empty.axisY.type, AbstractAxis3D.AxisTypeValue) waitForRendering(top) - empty.destroy() - waitForRendering(top) } } @@ -126,8 +98,6 @@ Item { compare(basic.width, 150, "width") compare(basic.height, 150, "height") waitForRendering(top) - basic.destroy() - waitForRendering(top) } } @@ -136,13 +106,16 @@ Item { when: windowShown function test_1_common() { + if (Qt.platform.os === "android") + return; + constructCommon() + if (common.shadowsSupported === false) + return; + compare(common.selectionMode, AbstractGraph3D.SelectionItem, "selectionMode") compare(common.shadowQuality, AbstractGraph3D.ShadowQualityMedium, "shadowQuality") - if (common.shadowsSupported === true) - compare(common.msaaSamples, 4, "msaaSamples") - else - compare(common.msaaSamples, 0, "msaaSamples") + compare(common.msaaSamples, 4, "msaaSamples") compare(common.theme.type, Theme3D.ThemeQt, "theme") compare(common.renderingMode, AbstractGraph3D.RenderIndirect, "renderingMode") compare(common.measureFps, false, "measureFps") @@ -163,14 +136,14 @@ Item { } function test_2_change_common() { + if (Qt.platform.os === "android" || common.shadowsSupported === false) + return; + common.selectionMode = AbstractGraph3D.SelectionNone common.shadowQuality = AbstractGraph3D.ShadowQualitySoftHigh - compare(common.shadowQuality, AbstractGraph3D.ShadowQualitySoftHigh, "shadowQuality") common.msaaSamples = 8 - if (common.shadowsSupported === true) - compare(common.msaaSamples, 8, "msaaSamples") - else - compare(common.msaaSamples, 0, "msaaSamples") + compare(common.shadowQuality, AbstractGraph3D.ShadowQualitySoftHigh, "shadowQuality") + compare(common.msaaSamples, 8, "msaaSamples") common.theme.type = Theme3D.ThemeRetro common.renderingMode = AbstractGraph3D.RenderDirectToBackground_NoClear common.measureFps = true @@ -204,6 +177,9 @@ Item { } function test_3_change_invalid_common() { + if (Qt.platform.os === "android" || common.shadowsSupported === false) + return; + common.selectionMode = AbstractGraph3D.SelectionRow | AbstractGraph3D.SelectionColumn | AbstractGraph3D.SelectionSlice common.theme.type = -2 common.renderingMode = -1 @@ -215,28 +191,30 @@ Item { common.reflection = false common.reflectivity = -1.0 compare(common.selectionMode, AbstractGraph3D.SelectionNone, "selectionMode") - compare(common.theme.type, -2/*Theme3D.ThemeRetro*/, "theme") // TODO: Fix once QTRD-3367 is done - compare(common.renderingMode, -1/*AbstractGraph3D.RenderDirectToBackground_NoClear*/, "renderingMode") // TODO: Fix once QTRD-3367 is done - compare(common.aspectRatio, -1.0/*1.0*/, "aspectRatio") // TODO: Fix once QTRD-3367 is done - compare(common.horizontalAspectRatio, -2/*1*/, "horizontalAspectRatio") // TODO: Fix once QTRD-3367 is done - compare(common.reflectivity, -1.0/*1.0*/, "reflectivity") // TODO: Fix once QTRD-3367 is done - - waitForRendering(top) - common.destroy() + compare(common.theme.type, Theme3D.ThemeRetro, "theme") + compare(common.renderingMode, AbstractGraph3D.RenderDirectToBackground_NoClear, "renderingMode") + compare(common.aspectRatio, 1.0, "aspectRatio") + compare(common.horizontalAspectRatio, 1.0, "horizontalAspectRatio") + compare(common.reflectivity, 1.0, "reflectivity") waitForRendering(top) - } + } + } + + TestCase { + name: "Scatter3D Common Initialized" + when: windowShown + + function test_1_common_initialized() { + if (Qt.platform.os === "android") + return; - function test_4_common_initialized() { constructCommonInit() + if (common_init.shadowsSupported === false) + return; compare(common_init.selectionMode, AbstractGraph3D.SelectionNone, "selectionMode") - if (common_init.shadowsSupported === true) { - tryCompare(common_init, "shadowQuality", AbstractGraph3D.ShadowQualityLow) - compare(common_init.msaaSamples, 2, "msaaSamples") - } else { - tryCompare(common_init, "shadowQuality", AbstractGraph3D.ShadowQualityNone) - compare(common_init.msaaSamples, 0, "msaaSamples") - } + tryCompare(common_init, "shadowQuality", AbstractGraph3D.ShadowQualityLow) + compare(common_init.msaaSamples, 2, "msaaSamples") compare(common_init.theme.type, Theme3D.ThemeUserDefined, "theme") compare(common_init.renderingMode, AbstractGraph3D.RenderIndirect, "renderingMode") compare(common_init.measureFps, true, "measureFps") @@ -251,9 +229,6 @@ Item { compare(common_init.reflectivity, 0.1, "reflectivity") compare(common_init.locale, Qt.locale("UK"), "locale") compare(common_init.margin, 0.2, "margin") - - waitForRendering(top) - common_init.destroy(); waitForRendering(top) } } diff --git a/tests/auto/qmltest/scatter3d/tst_proxy.qml b/tests/auto/qmltest/scatter3d/tst_proxy.qml index bd8c0c74..c970b82a 100644 --- a/tests/auto/qmltest/scatter3d/tst_proxy.qml +++ b/tests/auto/qmltest/scatter3d/tst_proxy.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/tests/auto/qmltest/scatter3d/tst_scatter.qml b/tests/auto/qmltest/scatter3d/tst_scatter.qml index 9805b2e9..c8c8f93a 100644 --- a/tests/auto/qmltest/scatter3d/tst_scatter.qml +++ b/tests/auto/qmltest/scatter3d/tst_scatter.qml @@ -1,34 +1,8 @@ -/**************************************************************************** -** -** 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 +import QtDataVisualization import QtTest 1.0 Item { @@ -67,5 +41,11 @@ Item { series.seriesList[0].selectedItem = 0 compare(series.selectedSeries, series1) } + + function test_5_has_series() { + series.seriesList = [series1] + compare(series.hasSeries(series1), true) + compare(series.hasSeries(series2), false) + } } } diff --git a/tests/auto/qmltest/scatter3d/tst_scatterseries.qml b/tests/auto/qmltest/scatter3d/tst_scatterseries.qml index 7d84e83c..9e6cc80e 100644 --- a/tests/auto/qmltest/scatter3d/tst_scatterseries.qml +++ b/tests/auto/qmltest/scatter3d/tst_scatterseries.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/tests/auto/qmltest/scene3d/tst_camera.qml b/tests/auto/qmltest/scene3d/tst_camera.qml index 96418ae3..c6aa446a 100644 --- a/tests/auto/qmltest/scene3d/tst_camera.qml +++ b/tests/auto/qmltest/scene3d/tst_camera.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/tests/auto/qmltest/scene3d/tst_light.qml b/tests/auto/qmltest/scene3d/tst_light.qml index 68602316..faf3bce2 100644 --- a/tests/auto/qmltest/scene3d/tst_light.qml +++ b/tests/auto/qmltest/scene3d/tst_light.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.3 diff --git a/tests/auto/qmltest/scene3d/tst_scene.qml b/tests/auto/qmltest/scene3d/tst_scene.qml index 08a55662..b9f84202 100644 --- a/tests/auto/qmltest/scene3d/tst_scene.qml +++ b/tests/auto/qmltest/scene3d/tst_scene.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 @@ -44,7 +18,7 @@ Item { Bars3D { id: initialized scene.activeCamera: Camera3D { zoomLevel: 200 } - scene.devicePixelRatio: 2.0 + scene.devicePixelRatio: 2 // Will work only if actual pixel ratio is 2.0 scene.graphPositionQuery: Qt.point(0, 0) scene.primarySubViewport: Qt.rect(0, 0, 50, 50) scene.secondarySubViewport: Qt.rect(50, 50, 100, 100) @@ -67,7 +41,7 @@ Item { function test_initial() { verify(initial.scene.activeCamera) verify(initial.scene.activeLight) - compare(initial.scene.devicePixelRatio, 1.0) + compare(initial.scene.devicePixelRatio, Screen.devicePixelRatio) compare(initial.scene.graphPositionQuery, Qt.point(-1, -1)) compare(initial.scene.invalidSelectionPoint, Qt.point(-1, -1)) compare(initial.scene.primarySubViewport.x, 0) @@ -93,7 +67,7 @@ Item { function test_initialized() { compare(initialized.scene.activeCamera.zoomLevel, 200) - compare(initialized.scene.devicePixelRatio, 2.0) + compare(initialized.scene.devicePixelRatio, Screen.devicePixelRatio) compare(initialized.scene.graphPositionQuery, Qt.point(0, 0)) compare(initialized.scene.primarySubViewport.x, 0) compare(initialized.scene.primarySubViewport.y, 0) diff --git a/tests/auto/qmltest/surface3d/tst_basic.qml b/tests/auto/qmltest/surface3d/tst_basic.qml index a0a0bd19..2979d6d5 100644 --- a/tests/auto/qmltest/surface3d/tst_basic.qml +++ b/tests/auto/qmltest/surface3d/tst_basic.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 @@ -43,16 +17,16 @@ Item { function constructEmpty() { empty = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Surface3D { }", top) } function constructBasic() { basic = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Surface3D { anchors.fill: parent flipHorizontalGrid: true @@ -62,8 +36,8 @@ Item { function constructCommon() { common = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Surface3D { anchors.fill: parent }", top) @@ -72,8 +46,8 @@ Item { function constructCommonInit() { common_init = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Surface3D { anchors.fill: parent selectionMode: AbstractGraph3D.SelectionNone @@ -114,8 +88,6 @@ Item { compare(empty.axisZ.type, AbstractAxis3D.AxisTypeValue) compare(empty.axisY.type, AbstractAxis3D.AxisTypeValue) waitForRendering(top) - empty.destroy() - waitForRendering(top) } } @@ -134,8 +106,6 @@ Item { basic.flipHorizontalGrid = false compare(basic.flipHorizontalGrid, false, "flipHorizontalGrid") waitForRendering(top) - basic.destroy() - waitForRendering(top) } } @@ -144,13 +114,16 @@ Item { when: windowShown function test_1_common() { + if (Qt.platform.os === "android") + return; + constructCommon() + if (common.shadowsSupported === false) + return; + compare(common.selectionMode, AbstractGraph3D.SelectionItem, "selectionMode") compare(common.shadowQuality, AbstractGraph3D.ShadowQualityMedium, "shadowQuality") - if (common.shadowsSupported === true) - compare(common.msaaSamples, 4, "msaaSamples") - else - compare(common.msaaSamples, 0, "msaaSamples") + compare(common.msaaSamples, 4, "msaaSamples") compare(common.theme.type, Theme3D.ThemeQt, "theme") compare(common.renderingMode, AbstractGraph3D.RenderIndirect, "renderingMode") compare(common.measureFps, false, "measureFps") @@ -171,14 +144,14 @@ Item { } function test_2_change_common() { + if (Qt.platform.os === "android" || common.shadowsSupported === false) + return; + common.selectionMode = AbstractGraph3D.SelectionItem | AbstractGraph3D.SelectionRow | AbstractGraph3D.SelectionSlice common.shadowQuality = AbstractGraph3D.ShadowQualitySoftHigh - compare(common.shadowQuality, AbstractGraph3D.ShadowQualitySoftHigh, "shadowQuality") common.msaaSamples = 8 - if (common.shadowsSupported === true) - compare(common.msaaSamples, 8, "msaaSamples") - else - compare(common.msaaSamples, 0, "msaaSamples") + compare(common.shadowQuality, AbstractGraph3D.ShadowQualitySoftHigh, "shadowQuality") + compare(common.msaaSamples, 8, "msaaSamples") common.theme.type = Theme3D.ThemeRetro common.renderingMode = AbstractGraph3D.RenderDirectToBackground_NoClear common.measureFps = true @@ -212,6 +185,9 @@ Item { } function test_3_change_invalid_common() { + if (Qt.platform.os === "android" || common.shadowsSupported === false) + return; + common.selectionMode = AbstractGraph3D.SelectionRow | AbstractGraph3D.SelectionColumn | AbstractGraph3D.SelectionSlice common.theme.type = -2 common.renderingMode = -1 @@ -223,28 +199,30 @@ Item { common.reflection = false common.reflectivity = -1.0 compare(common.selectionMode, AbstractGraph3D.SelectionItem | AbstractGraph3D.SelectionRow | AbstractGraph3D.SelectionSlice, "selectionMode") - compare(common.theme.type, -2/*Theme3D.ThemeRetro*/, "theme") // TODO: Fix once QTRD-3367 is done - compare(common.renderingMode, -1/*AbstractGraph3D.RenderDirectToBackground_NoClear*/, "renderingMode") // TODO: Fix once QTRD-3367 is done - compare(common.aspectRatio, -1.0/*1.0*/, "aspectRatio") // TODO: Fix once QTRD-3367 is done - compare(common.horizontalAspectRatio, -2/*1*/, "horizontalAspectRatio") // TODO: Fix once QTRD-3367 is done - compare(common.reflectivity, -1.0/*1.0*/, "reflectivity") // TODO: Fix once QTRD-3367 is done - - waitForRendering(top) - common.destroy() + compare(common.theme.type, Theme3D.ThemeRetro, "theme") + compare(common.renderingMode, AbstractGraph3D.RenderDirectToBackground_NoClear, "renderingMode") + compare(common.aspectRatio, 1.0, "aspectRatio") + compare(common.horizontalAspectRatio, 1.0, "horizontalAspectRatio") + compare(common.reflectivity, 1.0, "reflectivity") waitForRendering(top) } + } + + TestCase { + name: "Surface3D Common Initialized" + when: windowShown + + function test_1_common_initialized() { + if (Qt.platform.os === "android") + return; - function test_4_common_initialized() { constructCommonInit() + if (common_init.shadowsSupported === false) + return; compare(common_init.selectionMode, AbstractGraph3D.SelectionNone, "selectionMode") - if (common_init.shadowsSupported === true) { - tryCompare(common_init, "shadowQuality", AbstractGraph3D.ShadowQualityLow) - compare(common_init.msaaSamples, 2, "msaaSamples") - } else { - tryCompare(common_init, "shadowQuality", AbstractGraph3D.ShadowQualityNone) - compare(common_init.msaaSamples, 0, "msaaSamples") - } + tryCompare(common_init, "shadowQuality", AbstractGraph3D.ShadowQualityLow) + compare(common_init.msaaSamples, 2, "msaaSamples") compare(common_init.theme.type, Theme3D.ThemeUserDefined, "theme") compare(common_init.renderingMode, AbstractGraph3D.RenderIndirect, "renderingMode") compare(common_init.measureFps, true, "measureFps") @@ -259,9 +237,6 @@ Item { compare(common_init.reflectivity, 0.1, "reflectivity") compare(common_init.locale, Qt.locale("UK"), "locale") compare(common_init.margin, 0.2, "margin") - - waitForRendering(top) - common_init.destroy(); waitForRendering(top) } } diff --git a/tests/auto/qmltest/surface3d/tst_heightproxy.qml b/tests/auto/qmltest/surface3d/tst_heightproxy.qml index f92d8198..c3c5b71d 100644 --- a/tests/auto/qmltest/surface3d/tst_heightproxy.qml +++ b/tests/auto/qmltest/surface3d/tst_heightproxy.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/tests/auto/qmltest/surface3d/tst_proxy.qml b/tests/auto/qmltest/surface3d/tst_proxy.qml index eddad5a2..57058f36 100644 --- a/tests/auto/qmltest/surface3d/tst_proxy.qml +++ b/tests/auto/qmltest/surface3d/tst_proxy.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/tests/auto/qmltest/surface3d/tst_surface.qml b/tests/auto/qmltest/surface3d/tst_surface.qml index 2ec96007..4c52d184 100644 --- a/tests/auto/qmltest/surface3d/tst_surface.qml +++ b/tests/auto/qmltest/surface3d/tst_surface.qml @@ -1,34 +1,8 @@ -/**************************************************************************** -** -** 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 +import QtDataVisualization import QtTest 1.0 Item { @@ -67,5 +41,11 @@ Item { series.seriesList[0].selectedPoint = Qt.point(0, 0) compare(series.selectedSeries, series1) } + + function test_5_has_series() { + series.seriesList = [series1] + compare(series.hasSeries(series1), true) + compare(series.hasSeries(series2), false) + } } } diff --git a/tests/auto/qmltest/surface3d/tst_surfaceseries.qml b/tests/auto/qmltest/surface3d/tst_surfaceseries.qml index a4593c94..7d681021 100644 --- a/tests/auto/qmltest/surface3d/tst_surfaceseries.qml +++ b/tests/auto/qmltest/surface3d/tst_surfaceseries.qml @@ -1,34 +1,8 @@ -/**************************************************************************** -** -** 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 +import QtDataVisualization import QtTest 1.0 Item { @@ -79,6 +53,7 @@ Item { flatShadingEnabled: false selectedPoint: Qt.point(0, 0) textureFile: ":\customtexture.jpg" + wireframeColor: "red" baseColor: "blue" baseGradient: gradient1 @@ -123,6 +98,7 @@ Item { compare(initial.flatShadingEnabled, true) compare(initial.flatShadingSupported, true) compare(initial.selectedPoint, Qt.point(-1, -1)) + compare(initial.wireframeColor, "#000000") } function test_2_initial_common() { @@ -156,6 +132,7 @@ Item { compare(initialized.flatShadingEnabled, false) compare(initialized.selectedPoint, Qt.point(0, 0)) compare(initialized.textureFile, ":\customtexture.jpg") + compare(initialized.wireframeColor, "#ff0000") } function test_2_initialized_common() { @@ -187,6 +164,7 @@ Item { change.flatShadingEnabled = false change.selectedPoint = Qt.point(0, 0) change.textureFile = ":\customtexture.jpg" + change.wireframeColor = "green" } function test_2_test_change() { @@ -196,6 +174,7 @@ Item { compare(change.flatShadingEnabled, false) compare(change.selectedPoint, Qt.point(0, 0)) compare(change.textureFile, ":\customtexture.jpg") + compare(change.wireframeColor, "#008000") } function test_3_change_common() { diff --git a/tests/auto/qmltest/theme3d/tst_colorgradient.qml b/tests/auto/qmltest/theme3d/tst_colorgradient.qml index e1a25400..6d2cdf35 100644 --- a/tests/auto/qmltest/theme3d/tst_colorgradient.qml +++ b/tests/auto/qmltest/theme3d/tst_colorgradient.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/tests/auto/qmltest/theme3d/tst_theme.qml b/tests/auto/qmltest/theme3d/tst_theme.qml index 880ff87b..3b44a5c8 100644 --- a/tests/auto/qmltest/theme3d/tst_theme.qml +++ b/tests/auto/qmltest/theme3d/tst_theme.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/tests/auto/qmltest/theme3d/tst_themecolor.qml b/tests/auto/qmltest/theme3d/tst_themecolor.qml index e7b4c1ca..6e662deb 100644 --- a/tests/auto/qmltest/theme3d/tst_themecolor.qml +++ b/tests/auto/qmltest/theme3d/tst_themecolor.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/tests/auto/qmltest/tst_qmltest.cpp b/tests/auto/qmltest/tst_qmltest.cpp index 746430c5..86482f65 100644 --- a/tests/auto/qmltest/tst_qmltest.cpp +++ b/tests/auto/qmltest/tst_qmltest.cpp @@ -1,40 +1,34 @@ -/**************************************************************************** -** -** 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 <QtQuickTest/quicktest.h> + +class tst_qmltest: public QObject +{ + Q_OBJECT +private slots: + void skiptest() { QSKIP("This test will fail, skipping."); }; +}; + int main(int argc, char **argv) { if (!qEnvironmentVariableIsEmpty("QEMU_LD_PREFIX")) { - qWarning("This test will fail due to QEMU emulation shortcomings."); - return 0; + qWarning("This test would fail due to QEMU emulation shortcomings, so it will be skipped."); + tst_qmltest skip; + return QTest::qExec(&skip, argc, argv); } +#ifdef Q_OS_QNX + if (qEnvironmentVariable("QTEST_ENVIRONMENT").split(' ').contains("ci") && + qEnvironmentVariable("QT_QPA_PLATFORM").split(' ').contains("offscreen") + ) { + qWarning("This test would fail on CI QNX QEMU without OpenGL support, so it will be skipped."); + tst_qmltest skip; + return QTest::qExec(&skip, argc, argv); + } +#endif qputenv("QSG_RHI_BACKEND", "opengl"); QTEST_SET_MAIN_SOURCE_PATH return quick_test_main(argc, argv, "qmltest", QUICK_TEST_SOURCE_DIR); } + +#include "tst_qmltest.moc" diff --git a/tests/manual/CMakeLists.txt b/tests/manual/CMakeLists.txt index 36175991..32112c6b 100644 --- a/tests/manual/CMakeLists.txt +++ b/tests/manual/CMakeLists.txt @@ -1,9 +1,14 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + if(TARGET Qt::Quick) add_subdirectory(qmldynamicdata) add_subdirectory(qmlmultitest) add_subdirectory(qmlvolume) add_subdirectory(qmlperf) add_subdirectory(qmlgradient) + add_subdirectory(qmlheightmap) + add_subdirectory(qmlbarsrowcolors) endif() if(NOT ANDROID AND NOT IOS AND NOT WINRT) add_subdirectory(barstest) diff --git a/tests/manual/barstest/CMakeLists.txt b/tests/manual/barstest/CMakeLists.txt index 8c4c9295..391b98aa 100644 --- a/tests/manual/barstest/CMakeLists.txt +++ b/tests/manual/barstest/CMakeLists.txt @@ -1,14 +1,18 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) qt_internal_add_manual_test(barstest GUI SOURCES chart.cpp chart.h + sliderwrapper.cpp sliderwrapper.h + buttonwrapper.cpp buttonwrapper.h custominputhandler.cpp custominputhandler.h main.cpp + NO_PCH_SOURCES + chart.cpp # undef QT_NO_FOREACH ) target_link_libraries(barstest PUBLIC Qt::Gui diff --git a/tests/manual/barstest/buttonwrapper.cpp b/tests/manual/barstest/buttonwrapper.cpp new file mode 100644 index 00000000..c8eef0c7 --- /dev/null +++ b/tests/manual/barstest/buttonwrapper.cpp @@ -0,0 +1,14 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only +#include "buttonwrapper.h" +#include <QPushButton> + +ButtonWrapper::ButtonWrapper(QPushButton *button) +{ + m_button = button; +} + +void ButtonWrapper::setEnabled(int state) +{ + m_button->setEnabled(state); +} diff --git a/tests/manual/barstest/buttonwrapper.h b/tests/manual/barstest/buttonwrapper.h new file mode 100644 index 00000000..d0112117 --- /dev/null +++ b/tests/manual/barstest/buttonwrapper.h @@ -0,0 +1,22 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only +#ifndef BUTTONWRAPPER_H +#define BUTTONWRAPPER_H + +#include <QObject> +class QPushButton; + +class ButtonWrapper : public QObject +{ + Q_OBJECT +public: + ButtonWrapper(QPushButton *button); + +public Q_SLOTS: + void setEnabled(int state); + +private: + QPushButton *m_button; +}; + +#endif // BUTTONWRAPPER_H diff --git a/tests/manual/barstest/chart.cpp b/tests/manual/barstest/chart.cpp index 7d878046..d427921a 100644 --- a/tests/manual/barstest/chart.cpp +++ b/tests/manual/barstest/chart.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 "chart.h" #include "custominputhandler.h" @@ -54,6 +30,8 @@ GraphModifier::GraphModifier(Q3DBars *barchart, QColorDialog *colorDialog) m_static(true), m_barSpacingX(0.1f), m_barSpacingZ(0.1f), + m_barSeriesMarginX(0.0f), + m_barSeriesMarginZ(0.0f), m_fontSize(20), m_segments(10), m_subSegments(3), @@ -266,7 +244,7 @@ void GraphModifier::start() restart(false); } -void GraphModifier::restart(bool dynamicData) +void GraphModifier::restart(int dynamicData) { m_static = !dynamicData; @@ -341,7 +319,7 @@ void GraphModifier::releaseSeries() m_graph->removeSeries(series); } -void GraphModifier::flipViews() +void GraphModifier::flipViews(bool checked) { m_graph->scene()->setSecondarySubviewOnTop(!m_graph->scene()->isSecondarySubviewOnTop()); qDebug() << "secondary subview on top:" << m_graph->scene()->isSecondarySubviewOnTop(); @@ -733,7 +711,7 @@ void GraphModifier::handleSelectionChange(const QPoint &position) qDebug() << "Selected bar position:" << position << "series:" << index; } -void GraphModifier::setUseNullInputHandler(bool useNull) +void GraphModifier::setUseNullInputHandler(int useNull) { qDebug() << "setUseNullInputHandler" << useNull; if (m_useNullInputHandler == useNull) @@ -826,7 +804,7 @@ QBarDataArray *GraphModifier::makeDummyData() } // Executes one step of the primary series test -void GraphModifier::primarySeriesTest() +void GraphModifier::primarySeriesTest(bool checked) { static int nextStep = 0; @@ -1048,7 +1026,7 @@ void GraphModifier::insertRemoveTestToggle() } } -void GraphModifier::toggleRotation() +void GraphModifier::toggleRotation(bool checked) { if (m_rotationTimer.isActive()) m_rotationTimer.stop(); @@ -1056,7 +1034,7 @@ void GraphModifier::toggleRotation() m_rotationTimer.start(20); } -void GraphModifier::useLogAxis() +void GraphModifier::useLogAxis(bool checked) { static int counter = -1; static QLogValue3DAxisFormatter *logFormatter = 0; @@ -1212,7 +1190,7 @@ void GraphModifier::addRemoveSeries() counter++; } -void GraphModifier::testItemAndRowChanges() +void GraphModifier::testItemAndRowChanges(bool checked) { static int counter = 0; const int rowCount = 12; @@ -1602,7 +1580,7 @@ void GraphModifier::rotateY(int rotation) m_graph->scene()->activeCamera()->setCameraPosition(m_xRotation, m_yRotation); } -void GraphModifier::setFpsMeasurement(bool enable) +void GraphModifier::setFpsMeasurement(int enable) { m_graph->setMeasureFps(enable); } @@ -1624,6 +1602,18 @@ void GraphModifier::setSpacingSpecsZ(int spacing) m_graph->setBarSpacing(QSizeF(m_barSpacingX, m_barSpacingZ)); } +void GraphModifier::setMarginX(int margin) +{ + m_barSeriesMarginX = (float)margin / 100.0f; + m_graph->setBarSeriesMargin(QSizeF(m_barSeriesMarginX, m_barSeriesMarginZ)); +} + +void GraphModifier::setMarginZ(int margin) +{ + m_barSeriesMarginZ = (float)margin / 100.0f; + m_graph->setBarSeriesMargin(QSizeF(m_barSeriesMarginX, m_barSeriesMarginZ)); +} + void GraphModifier::setSampleCountX(int samples) { m_columnCount = samples; @@ -1659,7 +1649,7 @@ void GraphModifier::setMaxY(int max) m_maxval = max; } -void GraphModifier::changeColorStyle() +void GraphModifier::changeColorStyle(bool checked) { int style = m_graph->activeTheme()->colorStyle(); @@ -1669,7 +1659,7 @@ void GraphModifier::changeColorStyle() m_graph->activeTheme()->setColorStyle(Q3DTheme::ColorStyle(style)); } -void GraphModifier::useOwnTheme() +void GraphModifier::useOwnTheme(bool checked) { // Own theme is persistent, any changes to it via UI will be remembered if (!m_ownTheme) { @@ -1708,7 +1698,7 @@ void GraphModifier::changeBaseColor(const QColor &color) m_graph->activeTheme()->setBaseColors(colors); } -void GraphModifier::setGradient() +void GraphModifier::setGradient(bool checked) { QLinearGradient barGradient(0, 0, 1, 100); barGradient.setColorAt(1.0, Qt::lightGray); @@ -1748,7 +1738,7 @@ void GraphModifier::toggleMultiseriesScaling() m_graph->setMultiSeriesUniform(!m_graph->isMultiSeriesUniform()); } -void GraphModifier::setReflection(bool enabled) +void GraphModifier::setReflection(int enabled) { m_graph->setReflection(enabled); } diff --git a/tests/manual/barstest/chart.h b/tests/manual/barstest/chart.h index 9a4cd60e..ae72318e 100644 --- a/tests/manual/barstest/chart.h +++ b/tests/manual/barstest/chart.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 #ifndef CHARTMODIFIER_H #define CHARTMODIFIER_H @@ -68,13 +42,15 @@ public: void changeFontSize(int fontsize); void rotateX(int rotation); void rotateY(int rotation); - void setFpsMeasurement(bool enable); + void setFpsMeasurement(int state); void setBackgroundEnabled(int enabled); void setGridEnabled(int enabled); void setSpecsRatio(int barwidth); void setSpecsZ(int bardepth); void setSpacingSpecsX(int spacing); void setSpacingSpecsZ(int spacing); + void setMarginX(int margin); + void setMarginZ(int margin); void setSampleCountX(int samples); void setSampleCountZ(int samples); void setMinX(int min); @@ -82,43 +58,43 @@ public: void setMinY(int min); void setMaxY(int max); void start(); - void restart(bool dynamicData); + void restart(int dynamicData); void selectBar(); void swapAxis(); void releaseAxes(); void releaseSeries(); void createMassiveArray(); - void useOwnTheme(); + void useOwnTheme(bool checked); void changeBaseColor(const QColor &color); - void changeColorStyle(); + void changeColorStyle(bool checked); void showFiveSeries(); QBarDataArray *makeDummyData(); - void primarySeriesTest(); + void primarySeriesTest(bool checked); void insertRemoveTestToggle(); - void toggleRotation(); - void useLogAxis(); + void toggleRotation(bool checked); + void useLogAxis(bool checked); void changeValueAxisFormat(const QString & text); void changeLogBase(const QString & text); void setFpsLabel(QLabel *fpsLabel) { m_fpsLabel = fpsLabel; } void addRemoveSeries(); - void testItemAndRowChanges(); + void testItemAndRowChanges(bool checked); void reverseValueAxis(int enabled); void setInputHandlerRotationEnabled(int enabled); void setInputHandlerZoomEnabled(int enabled); void setInputHandlerSelectionEnabled(int enabled); void setInputHandlerZoomAtTargetEnabled(int enabled); - void setReflection(bool enabled); + void setReflection(int enabled); void setReflectivity(int value); void toggleCustomItem(); public Q_SLOTS: - void flipViews(); - void setGradient(); + void flipViews(bool checked); + void setGradient(bool checked); void toggleMultiseriesScaling(); void changeShadowQuality(int quality); void shadowQualityUpdatedByVisual(QAbstract3DGraph::ShadowQuality shadowQuality); void handleSelectionChange(const QPoint &position); - void setUseNullInputHandler(bool useNull); + void setUseNullInputHandler(int useNull); void changeValueAxisSegments(int value); void handleRowAxisChanged(QCategory3DAxis *axis); @@ -150,9 +126,11 @@ private: int m_rowCount; float m_xRotation; float m_yRotation; - bool m_static; + int m_static; float m_barSpacingX; float m_barSpacingZ; + float m_barSeriesMarginX; + float m_barSeriesMarginZ; int m_fontSize; int m_segments; int m_subSegments; diff --git a/tests/manual/barstest/custominputhandler.cpp b/tests/manual/barstest/custominputhandler.cpp index e6fe9aa5..2740fddb 100644 --- a/tests/manual/barstest/custominputhandler.cpp +++ b/tests/manual/barstest/custominputhandler.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 "custominputhandler.h" diff --git a/tests/manual/barstest/custominputhandler.h b/tests/manual/barstest/custominputhandler.h index 62b87d31..ee762cee 100644 --- a/tests/manual/barstest/custominputhandler.h +++ b/tests/manual/barstest/custominputhandler.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 #ifndef CUSTOMINPUTHANDLER_H #define CUSTOMINPUTHANDLER_H diff --git a/tests/manual/barstest/main.cpp b/tests/manual/barstest/main.cpp index a0379fd7..178b91f3 100644 --- a/tests/manual/barstest/main.cpp +++ b/tests/manual/barstest/main.cpp @@ -1,33 +1,9 @@ -/**************************************************************************** -** -** 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 "chart.h" +#include "sliderwrapper.h" +#include "buttonwrapper.h" #include <QApplication> #include <QWidget> @@ -304,6 +280,18 @@ int main(int argc, char **argv) spacingSliderZ->setValue(10); spacingSliderZ->setMaximum(200); + QSlider *marginSliderX = new QSlider(Qt::Horizontal, widget); + marginSliderX->setTickInterval(1); + marginSliderX->setMinimum(0); + marginSliderX->setValue(0); + marginSliderX->setMaximum(100); + + QSlider *marginSliderZ = new QSlider(Qt::Horizontal, widget); + marginSliderZ->setTickInterval(1); + marginSliderZ->setMinimum(0); + marginSliderZ->setValue(0); + marginSliderZ->setMaximum(100); + QSlider *sampleSliderX = new QSlider(Qt::Horizontal, widget); sampleSliderX->setTickInterval(1); sampleSliderX->setMinimum(1); @@ -433,6 +421,9 @@ int main(int argc, char **argv) vLayout2->addWidget(new QLabel(QStringLiteral("Adjust relative bar spacing")), 0, Qt::AlignTop); vLayout2->addWidget(spacingSliderX, 0, Qt::AlignTop); vLayout2->addWidget(spacingSliderZ, 0, Qt::AlignTop); + vLayout2->addWidget(new QLabel(QStringLiteral("Adjust margin")), 0, Qt::AlignTop); + vLayout2->addWidget(marginSliderX, 0, Qt::AlignTop); + vLayout2->addWidget(marginSliderZ, 0, Qt::AlignTop); vLayout2->addWidget(new QLabel(QStringLiteral("Adjust sample count")), 0, Qt::AlignTop); vLayout2->addWidget(sampleSliderX, 0, Qt::AlignTop); vLayout2->addWidget(sampleSliderZ, 0, Qt::AlignTop); @@ -472,7 +463,7 @@ int main(int argc, char **argv) vLayout3->addWidget(toggleCustomItemButton, 0, Qt::AlignTop); vLayout3->addWidget(new QLabel(QStringLiteral("Adjust floor level")), 0, Qt::AlignTop); vLayout3->addWidget(floorLevelSlider, 0, Qt::AlignTop); - vLayout3->addWidget(new QLabel(QStringLiteral("Adjust margin")), 0, Qt::AlignTop); + vLayout3->addWidget(new QLabel(QStringLiteral("Adjust bar series margin")), 0, Qt::AlignTop); vLayout3->addWidget(marginSlider, 1, Qt::AlignTop); widget->show(); @@ -489,6 +480,9 @@ int main(int argc, char **argv) QObject::connect(spacingSliderZ, &QSlider::valueChanged, modifier, &GraphModifier::setSpacingSpecsZ); + QObject::connect(marginSliderX, &QSlider::valueChanged, modifier, &GraphModifier::setMarginX); + QObject::connect(marginSliderZ, &QSlider::valueChanged, modifier, &GraphModifier::setMarginZ); + QObject::connect(sampleSliderX, &QSlider::valueChanged, modifier, &GraphModifier::setSampleCountX); QObject::connect(sampleSliderZ, &QSlider::valueChanged, modifier, @@ -595,12 +589,14 @@ int main(int argc, char **argv) QObject::connect(rotationCheckBox, &QCheckBox::stateChanged, modifier, &GraphModifier::setUseNullInputHandler); - QObject::connect(rotationCheckBox, &QCheckBox::stateChanged, rotationSliderX, - &QSlider::setEnabled); + SliderWrapper *rotationSliderWrapperX = new SliderWrapper(rotationSliderX); + SliderWrapper *rotationSliderWrapperY = new SliderWrapper(rotationSliderY); + QObject::connect(rotationCheckBox, &QCheckBox::stateChanged, rotationSliderWrapperX, + &SliderWrapper::setEnabled); QObject::connect(rotationCheckBox, &QCheckBox::stateChanged, rotationSliderX, &QSlider::setValue); - QObject::connect(rotationCheckBox, &QCheckBox::stateChanged, rotationSliderY, - &QSlider::setEnabled); + QObject::connect(rotationCheckBox, &QCheckBox::stateChanged, rotationSliderWrapperY, + &SliderWrapper::setEnabled); QObject::connect(rotationCheckBox, &QCheckBox::stateChanged, rotationSliderY, &QSlider::setValue); @@ -615,40 +611,59 @@ int main(int argc, char **argv) QObject::connect(toggleCustomItemButton, &QPushButton::clicked, modifier, &GraphModifier::toggleCustomItem); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, addDataButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, addMultiDataButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, insertDataButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, insertMultiDataButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, changeSingleDataButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, changeRowButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, changeRowsButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, removeRowButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, removeRowsButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, massiveArrayButton, - &QPushButton::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, sampleSliderX, - &QSlider::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, sampleSliderZ, - &QSlider::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, minSliderX, - &QSlider::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, minSliderZ, - &QSlider::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, minSliderY, - &QSlider::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, maxSliderY, - &QSlider::setEnabled); - QObject::connect(staticCheckBox, &QCheckBox::stateChanged, swapAxisButton, - &QSlider::setEnabled); + ButtonWrapper *addDataButtonWrapper = new ButtonWrapper(addDataButton); + ButtonWrapper *addMultiDataButtonWrapper = new ButtonWrapper(addMultiDataButton); + ButtonWrapper *insertDataButtonWrapper = new ButtonWrapper(insertDataButton); + ButtonWrapper *insertMultiDataButtonWrapper = new ButtonWrapper(insertMultiDataButton); + ButtonWrapper *changeSingleDataButtonWrapper = new ButtonWrapper(changeSingleDataButton); + ButtonWrapper *changeRowButtonWrapper = new ButtonWrapper(changeRowButton); + ButtonWrapper *changeRowsButtonWrapper = new ButtonWrapper(changeRowsButton); + ButtonWrapper *massiveArrayButtonWrapper = new ButtonWrapper(massiveArrayButton); + ButtonWrapper *removeRowButtonWrapper = new ButtonWrapper(removeRowButton); + ButtonWrapper *removeRowsButtonWrapper = new ButtonWrapper(removeRowsButton); + + SliderWrapper *sampleSliderWrapperX = new SliderWrapper(sampleSliderX); + SliderWrapper *sampleSliderWrapperZ = new SliderWrapper(sampleSliderZ); + SliderWrapper *minSliderWrapperX = new SliderWrapper(minSliderX); + SliderWrapper *minSliderWrapperZ = new SliderWrapper(minSliderZ); + SliderWrapper *minSliderWrapperY = new SliderWrapper(minSliderY); + SliderWrapper *maxSliderWrapperY = new SliderWrapper(maxSliderY); + ButtonWrapper *swapAxisButtonWrapper = new ButtonWrapper(swapAxisButton); + + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, addDataButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, addMultiDataButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, insertDataButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, insertMultiDataButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, changeSingleDataButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, changeRowButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, changeRowsButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, removeRowButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, removeRowsButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, massiveArrayButtonWrapper, + &ButtonWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, sampleSliderWrapperX, + &SliderWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, sampleSliderWrapperZ, + &SliderWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, minSliderWrapperX, + &SliderWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, minSliderWrapperZ, + &SliderWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, minSliderWrapperY, + &SliderWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, maxSliderWrapperY, + &SliderWrapper::setEnabled); + QObject::connect(staticCheckBox, &QCheckBox::stateChanged, swapAxisButtonWrapper, + &ButtonWrapper::setEnabled); QObject::connect(staticCheckBox, &QCheckBox::stateChanged, modifier, &GraphModifier::restart); modifier->setFpsLabel(fpsLabel); diff --git a/tests/manual/barstest/sliderwrapper.cpp b/tests/manual/barstest/sliderwrapper.cpp new file mode 100644 index 00000000..bdfeb4f7 --- /dev/null +++ b/tests/manual/barstest/sliderwrapper.cpp @@ -0,0 +1,13 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only +#include "sliderwrapper.h" + +SliderWrapper::SliderWrapper(QSlider *slider) +{ + m_slider = slider; +} + +void SliderWrapper::setEnabled(int enabled) +{ + m_slider->setEnabled(enabled); +} diff --git a/tests/manual/barstest/sliderwrapper.h b/tests/manual/barstest/sliderwrapper.h new file mode 100644 index 00000000..f6d9404a --- /dev/null +++ b/tests/manual/barstest/sliderwrapper.h @@ -0,0 +1,23 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only +#ifndef SLIDERWRAPPER_H +#define SLIDERWRAPPER_H +#include <QObject> +#include <QSlider> + +class SliderWrapper : public QObject +{ + Q_OBJECT + +public: + explicit SliderWrapper(QSlider *slider); + +public Q_SLOTS: + void setEnabled(int enabled); + +private: + QSlider *m_slider = nullptr; + +}; + +#endif // SLIDERWRAPPER_H diff --git a/tests/manual/directional/CMakeLists.txt b/tests/manual/directional/CMakeLists.txt index c1bd2798..43b961e0 100644 --- a/tests/manual/directional/CMakeLists.txt +++ b/tests/manual/directional/CMakeLists.txt @@ -1,7 +1,7 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) qt_internal_add_manual_test(directional GUI diff --git a/tests/manual/directional/main.cpp b/tests/manual/directional/main.cpp index 06bf137f..66b80d40 100644 --- a/tests/manual/directional/main.cpp +++ b/tests/manual/directional/main.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 "scatterdatamodifier.h" diff --git a/tests/manual/directional/scatterdatamodifier.cpp b/tests/manual/directional/scatterdatamodifier.cpp index 6968920c..b537a8a2 100644 --- a/tests/manual/directional/scatterdatamodifier.cpp +++ b/tests/manual/directional/scatterdatamodifier.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 "scatterdatamodifier.h" #include <QtDataVisualization/qscatterdataproxy.h> diff --git a/tests/manual/directional/scatterdatamodifier.h b/tests/manual/directional/scatterdatamodifier.h index 7ca463c3..c794d17c 100644 --- a/tests/manual/directional/scatterdatamodifier.h +++ b/tests/manual/directional/scatterdatamodifier.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 #ifndef SCATTERDATAMODIFIER_H #define SCATTERDATAMODIFIER_H @@ -65,7 +39,7 @@ Q_SIGNALS: void backgroundEnabledChanged(bool enabled); void gridEnabledChanged(bool enabled); void shadowQualityChanged(int quality); - void fontChanged(QFont font); + void fontChanged(const QFont &font); private: Q3DScatter *m_graph; diff --git a/tests/manual/galaxy/CMakeLists.txt b/tests/manual/galaxy/CMakeLists.txt index 1a530dae..f089ed7d 100644 --- a/tests/manual/galaxy/CMakeLists.txt +++ b/tests/manual/galaxy/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + set(CMAKE_INCLUDE_CURRENT_DIR ON) qt_add_executable(galaxy cumulativedistributor.cpp cumulativedistributor.h diff --git a/tests/manual/galaxy/cumulativedistributor.cpp b/tests/manual/galaxy/cumulativedistributor.cpp index 4506480c..961583ff 100644 --- a/tests/manual/galaxy/cumulativedistributor.cpp +++ b/tests/manual/galaxy/cumulativedistributor.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 /* * Galaxy creation code obtained from http://beltoforion.de/galaxy/galaxy_en.html diff --git a/tests/manual/galaxy/cumulativedistributor.h b/tests/manual/galaxy/cumulativedistributor.h index 56276e98..60c48ccc 100644 --- a/tests/manual/galaxy/cumulativedistributor.h +++ b/tests/manual/galaxy/cumulativedistributor.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 /* * Galaxy creation code obtained from http://beltoforion.de/galaxy/galaxy_en.html diff --git a/tests/manual/galaxy/galaxydata.cpp b/tests/manual/galaxy/galaxydata.cpp index c49e07fd..73ccf9c5 100644 --- a/tests/manual/galaxy/galaxydata.cpp +++ b/tests/manual/galaxy/galaxydata.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 /* * Galaxy creation code obtained from http://beltoforion.de/galaxy/galaxy_en.html diff --git a/tests/manual/galaxy/galaxydata.h b/tests/manual/galaxy/galaxydata.h index e01db67b..6127482e 100644 --- a/tests/manual/galaxy/galaxydata.h +++ b/tests/manual/galaxy/galaxydata.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 #ifndef SCATTERDATAMODIFIER_H #define SCATTERDATAMODIFIER_H diff --git a/tests/manual/galaxy/main.cpp b/tests/manual/galaxy/main.cpp index 5fb7b0ca..a0cbda52 100644 --- a/tests/manual/galaxy/main.cpp +++ b/tests/manual/galaxy/main.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 "galaxydata.h" diff --git a/tests/manual/galaxy/star.cpp b/tests/manual/galaxy/star.cpp index ca6b66f0..5b639125 100644 --- a/tests/manual/galaxy/star.cpp +++ b/tests/manual/galaxy/star.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 "star.h" diff --git a/tests/manual/galaxy/star.h b/tests/manual/galaxy/star.h index 9c5dc1ac..045a9702 100644 --- a/tests/manual/galaxy/star.h +++ b/tests/manual/galaxy/star.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 #ifndef STAR_H #define STAR_H diff --git a/tests/manual/itemmodeltest/CMakeLists.txt b/tests/manual/itemmodeltest/CMakeLists.txt index 7b5faf60..8fee8d00 100644 --- a/tests/manual/itemmodeltest/CMakeLists.txt +++ b/tests/manual/itemmodeltest/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + qt_internal_add_manual_test(itemmodeltest GUI SOURCES diff --git a/tests/manual/itemmodeltest/main.cpp b/tests/manual/itemmodeltest/main.cpp index a9a7f357..feebd1b1 100644 --- a/tests/manual/itemmodeltest/main.cpp +++ b/tests/manual/itemmodeltest/main.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 <QtDataVisualization/q3dbars.h> #include <QtDataVisualization/q3dsurface.h> @@ -234,8 +208,8 @@ void GraphDataGenerator::changeSelectedButtonClicked() { // Change all selected cells to a random value 1-10 QVariant value = QVariant::fromValue(QRandomGenerator::global()->bounded(10.0) + 1); - QList<QTableWidgetItem *> selectedItems = m_tableWidget->selectedItems(); - foreach (QTableWidgetItem *item, selectedItems) { + const QList<QTableWidgetItem *> selectedItems = m_tableWidget->selectedItems(); + for (QTableWidgetItem *item : selectedItems) { QString oldData = item->data(Qt::DisplayRole).toString(); item->setData(Qt::DisplayRole, oldData.left(5) @@ -292,7 +266,7 @@ int main(int argc, char **argv) barProxy->setValueRoleReplace(QStringLiteral("\\4")); barProxy->setRotationRoleReplace(QStringLiteral("\\5")); surfaceProxy->setXPosRole(tableWidget->model()->roleNames().value(Qt::DisplayRole)); - surfaceProxy->setZPosRole(tableWidget->model()->roleNames().value(Qt::DisplayRole)); + surfaceProxy->setYPosRole(tableWidget->model()->roleNames().value(Qt::DisplayRole)); surfaceProxy->setXPosRolePattern(QRegularExpression(QStringLiteral("^(\\d*)\\/(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$"))); surfaceProxy->setXPosRoleReplace(QStringLiteral("\\2")); surfaceProxy->setYPosRolePattern(QRegularExpression(QStringLiteral("^\\d*(\\/)(\\d*)\\/(\\d*[\\.\\,]?\\d*)\\/\\d*[\\.\\,]?\\d*$"))); diff --git a/tests/manual/minimalbars/CMakeLists.txt b/tests/manual/minimalbars/CMakeLists.txt index 9f72f667..50ae8a61 100644 --- a/tests/manual/minimalbars/CMakeLists.txt +++ b/tests/manual/minimalbars/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + qt_internal_add_manual_test(MinimalBars GUI SOURCES diff --git a/tests/manual/minimalscatter/CMakeLists.txt b/tests/manual/minimalscatter/CMakeLists.txt index a1cdcc39..5f9c07ae 100644 --- a/tests/manual/minimalscatter/CMakeLists.txt +++ b/tests/manual/minimalscatter/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + qt_internal_add_manual_test(MinimalScatter GUI SOURCES diff --git a/tests/manual/minimalsurface/CMakeLists.txt b/tests/manual/minimalsurface/CMakeLists.txt index a8ca7275..39c3b04d 100644 --- a/tests/manual/minimalsurface/CMakeLists.txt +++ b/tests/manual/minimalsurface/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + qt_internal_add_manual_test(MinimalSurface GUI SOURCES diff --git a/tests/manual/multigraphs/CMakeLists.txt b/tests/manual/multigraphs/CMakeLists.txt index fdb9e08b..8e6da82a 100644 --- a/tests/manual/multigraphs/CMakeLists.txt +++ b/tests/manual/multigraphs/CMakeLists.txt @@ -1,7 +1,7 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) qt_internal_add_manual_test(multigraphs GUI diff --git a/tests/manual/multigraphs/data.cpp b/tests/manual/multigraphs/data.cpp index f5f855cd..b46c6a0d 100644 --- a/tests/manual/multigraphs/data.cpp +++ b/tests/manual/multigraphs/data.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 #define NOMINMAX diff --git a/tests/manual/multigraphs/data.h b/tests/manual/multigraphs/data.h index fcd0f54f..a2c43452 100644 --- a/tests/manual/multigraphs/data.h +++ b/tests/manual/multigraphs/data.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 #ifndef DATA_H #define DATA_H diff --git a/tests/manual/multigraphs/main.cpp b/tests/manual/multigraphs/main.cpp index 1597a2b9..b13dd2ce 100644 --- a/tests/manual/multigraphs/main.cpp +++ b/tests/manual/multigraphs/main.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 "data.h" diff --git a/tests/manual/qmlbarsrowcolors/CMakeLists.txt b/tests/manual/qmlbarsrowcolors/CMakeLists.txt new file mode 100644 index 00000000..62a2ed98 --- /dev/null +++ b/tests/manual/qmlbarsrowcolors/CMakeLists.txt @@ -0,0 +1,31 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +qt_internal_add_manual_test(qmlbarsrowcolors + GUI + SOURCES + main.cpp + ) + +target_link_libraries(qmlbarsrowcolors PUBLIC + Qt::Core + Qt::Gui + Qt::Qml + Qt::Quick + Qt::DataVisualization +) + +set(qmlbarsrowcolors_resource_files + "qml/qmlbarsrowcolors/Axes.qml" + "qml/qmlbarsrowcolors/Data.qml" + "qml/qmlbarsrowcolors/main.qml" +) + +qt6_add_resources(qmlbarsrowcolors "qmlbarsrowcolors" + PREFIX + "/" + FILES + ${qmlbarsrowcolors_resource_files} +) diff --git a/tests/manual/qmlbarsrowcolors/main.cpp b/tests/manual/qmlbarsrowcolors/main.cpp new file mode 100644 index 00000000..83a1a78a --- /dev/null +++ b/tests/manual/qmlbarsrowcolors/main.cpp @@ -0,0 +1,33 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include <QtGui/QGuiApplication> +#include <QtCore/QDir> +#include <QtQuick/QQuickView> +#include <QtQml/QQmlEngine> + +int main(int argc, char *argv[]) +{ + qputenv("QSG_RHI_BACKEND", "opengl"); + QGuiApplication app(argc, argv); + + QQuickView viewer; + + // The following are needed to make examples run without having to install the module + // in desktop environments. +#ifdef Q_OS_WIN + QString extraImportPath(QStringLiteral("%1/../../../../%2")); +#else + QString extraImportPath(QStringLiteral("%1/../../../%2")); +#endif + viewer.engine()->addImportPath(extraImportPath.arg(QGuiApplication::applicationDirPath(), + QString::fromLatin1("qml"))); + + viewer.setTitle(QStringLiteral("Monthly income/expenses")); + + viewer.setSource(QUrl("qrc:/qml/qmlbarsrowcolors/main.qml")); + viewer.setResizeMode(QQuickView::SizeRootObjectToView); + viewer.show(); + + return app.exec(); +} diff --git a/tests/manual/qmlbarsrowcolors/qml/qmlbarsrowcolors/Axes.qml b/tests/manual/qmlbarsrowcolors/qml/qmlbarsrowcolors/Axes.qml new file mode 100644 index 00000000..0e021c34 --- /dev/null +++ b/tests/manual/qmlbarsrowcolors/qml/qmlbarsrowcolors/Axes.qml @@ -0,0 +1,41 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +import QtQuick +import QtDataVisualization + +Item { + property alias column: columnAxis + property alias row: rowAxis + property alias value: valueAxis + property alias total: totalAxis + + // Custom labels for columns, since the data contains abbreviated month names. + //! [0] + CategoryAxis3D { + id: columnAxis + labels: ["January", "February", "March", "April", "May", "June", + "July", "August", "September", "October", "November", "December"] + labelAutoRotation: 30 + } + //! [0] + CategoryAxis3D { + id: totalAxis + labels: ["Yearly total"] + labelAutoRotation: 30 + } + CategoryAxis3D { + // For row labels we can use row labels from data proxy, no labels defined for rows. + id: rowAxis + labelAutoRotation: 30 + } + + ValueAxis3D { + id: valueAxis + min: 0 + max: 35 + labelFormat: "%.2f M\u20AC" + title: "Monthly income" + labelAutoRotation: 90 + } +} diff --git a/tests/manual/qmlbarsrowcolors/qml/qmlbarsrowcolors/Data.qml b/tests/manual/qmlbarsrowcolors/qml/qmlbarsrowcolors/Data.qml new file mode 100644 index 00000000..6eb27741 --- /dev/null +++ b/tests/manual/qmlbarsrowcolors/qml/qmlbarsrowcolors/Data.qml @@ -0,0 +1,118 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +import QtQuick +import QtQml.Models + +Item { + property alias model: dataModel + + property var modelAsJsArray: { + var arr = [] + for (var i = 0; i < dataModel.count; i++) { + var row = dataModel.get(i) + arr.push({ + timestamp: row.timestamp, + expenses: row.expenses, + income: row.income + }) + } + return arr + } + + //! [0] + ListModel { + id: dataModel + ListElement{ timestamp: "2006-01"; expenses: "-4"; income: "5" } + ListElement{ timestamp: "2006-02"; expenses: "-5"; income: "6" } + ListElement{ timestamp: "2006-03"; expenses: "-7"; income: "4" } + //! [0] + ListElement{ timestamp: "2006-04"; expenses: "-3"; income: "2" } + ListElement{ timestamp: "2006-05"; expenses: "-4"; income: "1" } + ListElement{ timestamp: "2006-06"; expenses: "-2"; income: "2" } + ListElement{ timestamp: "2006-07"; expenses: "-1"; income: "3" } + ListElement{ timestamp: "2006-08"; expenses: "-5"; income: "1" } + ListElement{ timestamp: "2006-09"; expenses: "-2"; income: "3" } + ListElement{ timestamp: "2006-10"; expenses: "-5"; income: "2" } + ListElement{ timestamp: "2006-11"; expenses: "-8"; income: "5" } + ListElement{ timestamp: "2006-12"; expenses: "-3"; income: "3" } + + ListElement{ timestamp: "2007-01"; expenses: "-3"; income: "1" } + ListElement{ timestamp: "2007-02"; expenses: "-4"; income: "2" } + ListElement{ timestamp: "2007-03"; expenses: "-12"; income: "4" } + ListElement{ timestamp: "2007-04"; expenses: "-13"; income: "6" } + ListElement{ timestamp: "2007-05"; expenses: "-14"; income: "11" } + ListElement{ timestamp: "2007-06"; expenses: "-7"; income: "7" } + ListElement{ timestamp: "2007-07"; expenses: "-6"; income: "4" } + ListElement{ timestamp: "2007-08"; expenses: "-4"; income: "15" } + ListElement{ timestamp: "2007-09"; expenses: "-2"; income: "18" } + ListElement{ timestamp: "2007-10"; expenses: "-29"; income: "25" } + ListElement{ timestamp: "2007-11"; expenses: "-23"; income: "29" } + ListElement{ timestamp: "2007-12"; expenses: "-5"; income: "9" } + + ListElement{ timestamp: "2008-01"; expenses: "-3"; income: "8" } + ListElement{ timestamp: "2008-02"; expenses: "-8"; income: "14" } + ListElement{ timestamp: "2008-03"; expenses: "-10"; income: "20" } + ListElement{ timestamp: "2008-04"; expenses: "-12"; income: "24" } + ListElement{ timestamp: "2008-05"; expenses: "-10"; income: "19" } + ListElement{ timestamp: "2008-06"; expenses: "-5"; income: "8" } + ListElement{ timestamp: "2008-07"; expenses: "-1"; income: "4" } + ListElement{ timestamp: "2008-08"; expenses: "-7"; income: "12" } + ListElement{ timestamp: "2008-09"; expenses: "-4"; income: "16" } + ListElement{ timestamp: "2008-10"; expenses: "-22"; income: "33" } + ListElement{ timestamp: "2008-11"; expenses: "-16"; income: "25" } + ListElement{ timestamp: "2008-12"; expenses: "-2"; income: "7" } + + ListElement{ timestamp: "2009-01"; expenses: "-4"; income: "5" } + ListElement{ timestamp: "2009-02"; expenses: "-4"; income: "7" } + ListElement{ timestamp: "2009-03"; expenses: "-11"; income: "14" } + ListElement{ timestamp: "2009-04"; expenses: "-16"; income: "22" } + ListElement{ timestamp: "2009-05"; expenses: "-3"; income: "5" } + ListElement{ timestamp: "2009-06"; expenses: "-4"; income: "8" } + ListElement{ timestamp: "2009-07"; expenses: "-7"; income: "9" } + ListElement{ timestamp: "2009-08"; expenses: "-9"; income: "13" } + ListElement{ timestamp: "2009-09"; expenses: "-1"; income: "6" } + ListElement{ timestamp: "2009-10"; expenses: "-14"; income: "25" } + ListElement{ timestamp: "2009-11"; expenses: "-19"; income: "29" } + ListElement{ timestamp: "2009-12"; expenses: "-5"; income: "7" } + + ListElement{ timestamp: "2010-01"; expenses: "-14"; income: "22" } + ListElement{ timestamp: "2010-02"; expenses: "-5"; income: "7" } + ListElement{ timestamp: "2010-03"; expenses: "-1"; income: "9" } + ListElement{ timestamp: "2010-04"; expenses: "-1"; income: "12" } + ListElement{ timestamp: "2010-05"; expenses: "-5"; income: "9" } + ListElement{ timestamp: "2010-06"; expenses: "-5"; income: "8" } + ListElement{ timestamp: "2010-07"; expenses: "-3"; income: "7" } + ListElement{ timestamp: "2010-08"; expenses: "-1"; income: "5" } + ListElement{ timestamp: "2010-09"; expenses: "-2"; income: "4" } + ListElement{ timestamp: "2010-10"; expenses: "-10"; income: "13" } + ListElement{ timestamp: "2010-11"; expenses: "-12"; income: "17" } + ListElement{ timestamp: "2010-12"; expenses: "-6"; income: "9" } + + ListElement{ timestamp: "2011-01"; expenses: "-2"; income: "6" } + ListElement{ timestamp: "2011-02"; expenses: "-4"; income: "8" } + ListElement{ timestamp: "2011-03"; expenses: "-7"; income: "12" } + ListElement{ timestamp: "2011-04"; expenses: "-9"; income: "15" } + ListElement{ timestamp: "2011-05"; expenses: "-7"; income: "19" } + ListElement{ timestamp: "2011-06"; expenses: "-9"; income: "18" } + ListElement{ timestamp: "2011-07"; expenses: "-13"; income: "17" } + ListElement{ timestamp: "2011-08"; expenses: "-5"; income: "9" } + ListElement{ timestamp: "2011-09"; expenses: "-3"; income: "8" } + ListElement{ timestamp: "2011-10"; expenses: "-13"; income: "15" } + ListElement{ timestamp: "2011-11"; expenses: "-8"; income: "17" } + ListElement{ timestamp: "2011-12"; expenses: "-7"; income: "10" } + + ListElement{ timestamp: "2012-01"; expenses: "-12"; income: "16" } + ListElement{ timestamp: "2012-02"; expenses: "-24"; income: "28" } + ListElement{ timestamp: "2012-03"; expenses: "-27"; income: "22" } + ListElement{ timestamp: "2012-04"; expenses: "-29"; income: "25" } + ListElement{ timestamp: "2012-05"; expenses: "-27"; income: "29" } + ListElement{ timestamp: "2012-06"; expenses: "-19"; income: "18" } + ListElement{ timestamp: "2012-07"; expenses: "-13"; income: "17" } + ListElement{ timestamp: "2012-08"; expenses: "-15"; income: "19" } + ListElement{ timestamp: "2012-09"; expenses: "-3"; income: "8" } + ListElement{ timestamp: "2012-10"; expenses: "-3"; income: "6" } + ListElement{ timestamp: "2012-11"; expenses: "-4"; income: "8" } + ListElement{ timestamp: "2012-12"; expenses: "-5"; income: "9" } + } +} diff --git a/tests/manual/qmlbarsrowcolors/qml/qmlbarsrowcolors/main.qml b/tests/manual/qmlbarsrowcolors/qml/qmlbarsrowcolors/main.qml new file mode 100644 index 00000000..2f15b453 --- /dev/null +++ b/tests/manual/qmlbarsrowcolors/qml/qmlbarsrowcolors/main.qml @@ -0,0 +1,392 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts +import QtDataVisualization +import QtQuick.Window +import Qt.labs.qmlmodels +import "." + +Item { + id: mainview + + property int buttonLayoutHeight: 180; + property int currentRow + property Bar3DSeries selectedSeries + + function toggleRowColorsForBarSeries(enable) { + if (enable) + barSeries.rowColors = [color1, color2, color3] + else + barSeries.rowColors = [] + } + + function toggleRowColorsForSecondarySeries(enable) { + if (enable) + secondarySeries.rowColors = [color4, color5, color6] + else + secondarySeries.rowColors = [] + } + + function handleSelectionChange(series, position) { + if (position !== series.invalidSelectionPosition) + selectedSeries = series + + // Set tableView current row to selected bar + var rowRole = series.dataProxy.rowLabels[position.x]; + var colRole + if (barGraph.columnAxis === graphAxes.total) + colRole = "01"; + else + colRole = series.dataProxy.columnLabels[position.y]; + var checkTimestamp = rowRole + "-" + colRole + + if (currentRow === -1 || checkTimestamp !== graphData.model.get(currentRow).timestamp) { + var totalRows = tableView.rows; + for (var i = 0; i < totalRows; i++) { + var modelTimestamp = graphData.model.get(i).timestamp + if (modelTimestamp === checkTimestamp) { + currentRow = i + break + } + } + } + } + + width: 1280 + height: 1024 + + state: Screen.width < Screen.height ? "portrait" : "landscape" + selectedSeries: barSeries + + onCurrentRowChanged: { + var timestamp = graphData.model.get(currentRow).timestamp + var pattern = /(\d\d\d\d)-(\d\d)/ + var matches = pattern.exec(timestamp) + var rowIndex = modelProxy.rowCategoryIndex(matches[1]) + var colIndex + if (barGraph.columnAxis === graphAxes.total) + colIndex = 0 // Just one column when showing yearly totals + else + colIndex = modelProxy.columnCategoryIndex(matches[2]) + if (selectedSeries.visible) + mainview.selectedSeries.selectedBar = Qt.point(rowIndex, colIndex) + else if (barSeries.visible) + barSeries.selectedBar = Qt.point(rowIndex, colIndex) + else + secondarySeries.selectedBar = Qt.point(rowIndex, colIndex) + } + + Data { + id: graphData + } + + Axes { + id: graphAxes + } + + ThemeColor { + id: color1 + color: "green" + } + + ThemeColor { + id: color2 + color: "blue" + } + + ThemeColor { + id: color3 + color: "red" + } + + ThemeColor { + id: color4 + color: "yellow" + } + + ThemeColor { + id: color5 + color: "purple" + } + + ThemeColor { + id: color6 + color: "orange" + } + + Theme3D { + id: theme1 + type: Theme3D.ThemeRetro + labelBorderEnabled: true + font.pointSize: 35 + labelBackgroundEnabled: true + colorStyle: Theme3D.ColorStyleUniform + } + + Theme3D { + id: theme2 + type: Theme3D.ThemeArmyBlue + labelBorderEnabled: true + font.pointSize: 35 + labelBackgroundEnabled: true + colorStyle: Theme3D.ColorStyleUniform + } + + Item { + id: dataView + anchors.right: mainview.right; + anchors.bottom: mainview.bottom + + Bars3D { + id: barGraph + width: dataView.width + height: dataView.height + shadowQuality: AbstractGraph3D.ShadowQualityMedium + selectionMode: AbstractGraph3D.SelectionItem + theme: theme1 + barThickness: 0.7 + barSpacing: Qt.size(0.5, 0.5) + barSpacingRelative: false + scene.activeCamera.cameraPreset: Camera3D.CameraPresetIsometricLeftHigh + columnAxis: graphAxes.column + rowAxis: graphAxes.row + valueAxis: graphAxes.value + + Bar3DSeries { + id: secondarySeries + visible: false + itemLabelFormat: "Expenses, @colLabel, @rowLabel: -@valueLabel" + rowColors: [color4 , color5, color6] + + onSelectedBarChanged: (position)=> handleSelectionChange(secondarySeries, position) + + ItemModelBarDataProxy { + id: secondaryProxy + itemModel: graphData.model + rowRole: "timestamp" + columnRole: "timestamp" + valueRole: "expenses" + rowRolePattern: /^(\d\d\d\d).*$/ + columnRolePattern: /^.*-(\d\d)$/ + valueRolePattern: /-/ + rowRoleReplace: "\\1" + columnRoleReplace: "\\1" + multiMatchBehavior: ItemModelBarDataProxy.MMBCumulative + } + } + + Bar3DSeries { + id: barSeries + itemLabelFormat: "Income, @colLabel, @rowLabel: @valueLabel" + rowColors: [color1, color2, color3] + + onSelectedBarChanged: (position)=> handleSelectionChange(barSeries, position) + + ItemModelBarDataProxy { + id: modelProxy + itemModel: graphData.model + rowRole: "timestamp" + columnRole: "timestamp" + valueRole: "income" + rowRolePattern: /^(\d\d\d\d).*$/ + columnRolePattern: /^.*-(\d\d)$/ + rowRoleReplace: "\\1" + columnRoleReplace: "\\1" + multiMatchBehavior: ItemModelBarDataProxy.MMBCumulative + } + } + } + } + + ColumnLayout { + id: tableViewLayout + + anchors.top: parent.top + anchors.left: parent.left + + HorizontalHeaderView { + id: header + property var columnNames: ["Month", "Expenses", "Income"] + + syncView: tableView + Layout.fillWidth: true + delegate: Text { + padding: 3 + text: header.columnNames[index] + } + + } + + TableView { + id: tableView + Layout.fillWidth: true + Layout.fillHeight: true + + reuseItems: false + clip: true + + model: TableModel { + id: tableModel + TableModelColumn { display: "timestamp" } + TableModelColumn { display: "expenses" } + TableModelColumn { display: "income" } + + rows: graphData.modelAsJsArray + } + + delegate: Rectangle { + implicitHeight: 30 + implicitWidth: tableView.width / 3 + color: row === currentRow ? "#e0e0e0" : "#ffffff" + MouseArea { + anchors.fill: parent + onClicked: currentRow = row + } + + Text { + id: delegateText + anchors.verticalCenter: parent.verticalCenter + width: parent.width + anchors.leftMargin: 4 + anchors.left: parent.left + anchors.right: parent.right + text: formattedText + property string formattedText: { + if (column === 0) { + if (display !== "") { + var pattern = /(\d\d\d\d)-(\d\d)/ + var matches = pattern.exec(display) + var colIndex = parseInt(matches[2], 10) - 1 + return matches[1] + " - " + graphAxes.column.labels[colIndex] + } + } else { + return display + } + } + } + } + } + } + + ColumnLayout { + id: controlLayout + spacing: 0 + + Button { + id: seriesToggle + Layout.fillWidth: true + Layout.fillHeight: true + text: "Show Expenses" + clip: true + + onClicked: { + if (text === "Show Expenses") { + barSeries.visible = false + secondarySeries.visible = true + barGraph.valueAxis.labelFormat = "-%.2f M\u20AC" + secondarySeries.itemLabelFormat = "Expenses, @colLabel, @rowLabel: @valueLabel" + text = "Show Both" + } else if (text === "Show Both") { + barSeries.visible = true + barGraph.valueAxis.labelFormat = "%.2f M\u20AC" + secondarySeries.itemLabelFormat = "Expenses, @colLabel, @rowLabel: -@valueLabel" + text = "Show Income" + } else { // text === "Show Income" + secondarySeries.visible = false + text = "Show Expenses" + } + } + } + + Button { + id: themeToggle + Layout.fillWidth: true + Layout.fillHeight: true + text: "Use theme 2" + clip: true + + onClicked: { + if (text === "Use theme 2") { + barGraph.theme = theme2 + text = "Use theme 1" + } else { + barGraph.theme = theme1 + text = "Use theme 2" + } + } + } + + Button { + id: barSeriesRowColorToggle + Layout.fillWidth: true + Layout.fillHeight: true + text: "Disable row colors" + + onClicked: { + if (text === "Disable row colors") { + toggleRowColorsForBarSeries(false) + toggleRowColorsForSecondarySeries(false) + text = "Enable row colors" + } else { + toggleRowColorsForBarSeries(true) + toggleRowColorsForSecondarySeries(true) + text = "Disable row colors" + } + } + } + } + + states: [ + State { + name: "landscape" + PropertyChanges { + target: dataView + width: mainview.width / 4 * 3 + height: mainview.height + } + PropertyChanges { + target: tableViewLayout + height: mainview.height - buttonLayoutHeight + anchors.right: dataView.left + anchors.left: mainview.left + anchors.bottom: undefined + } + PropertyChanges { + target: controlLayout + width: mainview.width / 4 + height: buttonLayoutHeight + anchors.top: tableViewLayout.bottom + anchors.bottom: mainview.bottom + anchors.left: mainview.left + anchors.right: dataView.left + } + }, + State { + name: "portrait" + PropertyChanges { + target: dataView + width: mainview.height / 4 * 3 + height: mainview.width + } + PropertyChanges { + target: tableViewLayout + height: mainview.width + anchors.right: controlLayout.left + anchors.left: mainview.left + anchors.bottom: dataView.top + } + PropertyChanges { + target: controlLayout + width: mainview.height / 4 + height: mainview.width / 4 + anchors.top: mainview.top + anchors.bottom: dataView.top + anchors.left: undefined + anchors.right: mainview.right + } + } + ] +} diff --git a/tests/manual/qmldynamicdata/CMakeLists.txt b/tests/manual/qmldynamicdata/CMakeLists.txt index 4d051b5e..739ecd15 100644 --- a/tests/manual/qmldynamicdata/CMakeLists.txt +++ b/tests/manual/qmldynamicdata/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + qt_internal_add_manual_test(qmldynamicdata GUI SOURCES @@ -5,6 +8,8 @@ qt_internal_add_manual_test(qmldynamicdata ) target_link_libraries(qmldynamicdata PUBLIC Qt::Gui + Qt::Qml + Qt::Quick Qt::DataVisualization ) diff --git a/tests/manual/qmldynamicdata/main.cpp b/tests/manual/qmldynamicdata/main.cpp index 03bc1a37..6a416829 100644 --- a/tests/manual/qmldynamicdata/main.cpp +++ b/tests/manual/qmldynamicdata/main.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 <QtGui/QGuiApplication> #include <QtCore/QDir> diff --git a/tests/manual/qmldynamicdata/qml/qmldynamicdata/main.qml b/tests/manual/qmldynamicdata/qml/qmldynamicdata/main.qml index 74ec5cb9..1d0e65bf 100644 --- a/tests/manual/qmldynamicdata/qml/qmldynamicdata/main.qml +++ b/tests/manual/qmldynamicdata/qml/qmldynamicdata/main.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 import QtDataVisualization 1.2 @@ -155,12 +129,12 @@ Item { anchors.fill: parent hoverEnabled: true acceptedButtons: Qt.LeftButton | Qt.RightButton - property int mouseX: -1 - property int mouseY: -1 + property int mouseXPos: -1 + property int mouseYPos: -1 onPositionChanged: (mouse)=> { - mouseX = mouse.x; - mouseY = mouse.y; + mouseXPos = mouse.x; + mouseYPos = mouse.y; } onWheel: (wheel)=> { @@ -187,7 +161,8 @@ Item { running: true repeat: true onTriggered: { - scatterGraph.scene.selectionQueryPosition = Qt.point(inputArea.mouseX, inputArea.mouseY); + scatterGraph.scene.selectionQueryPosition = Qt.point(inputArea.mouseXPos, + inputArea.mouseYPos); } } } diff --git a/tests/manual/qmlgradient/CMakeLists.txt b/tests/manual/qmlgradient/CMakeLists.txt index d559e261..8288e1b2 100644 --- a/tests/manual/qmlgradient/CMakeLists.txt +++ b/tests/manual/qmlgradient/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + qt_internal_add_manual_test(qmlgradient GUI SOURCES @@ -5,6 +8,8 @@ qt_internal_add_manual_test(qmlgradient ) target_link_libraries(qmlgradient PUBLIC Qt::Gui + Qt::Qml + Qt::Quick Qt::DataVisualization ) diff --git a/tests/manual/qmlgradient/main.cpp b/tests/manual/qmlgradient/main.cpp index 48210ef2..b3a65f0f 100644 --- a/tests/manual/qmlgradient/main.cpp +++ b/tests/manual/qmlgradient/main.cpp @@ -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 #include <QtGui/QGuiApplication> #include <QtCore/QDir> diff --git a/tests/manual/qmlgradient/qml/qmlgradient/main.qml b/tests/manual/qmlgradient/qml/qmlgradient/main.qml index c692a72a..650dd087 100644 --- a/tests/manual/qmlgradient/qml/qmlgradient/main.qml +++ b/tests/manual/qmlgradient/qml/qmlgradient/main.qml @@ -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 import QtQuick import QtQuick.Window diff --git a/tests/manual/qmlheightmap/CMakeLists.txt b/tests/manual/qmlheightmap/CMakeLists.txt new file mode 100644 index 00000000..17e7f3f2 --- /dev/null +++ b/tests/manual/qmlheightmap/CMakeLists.txt @@ -0,0 +1,43 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +qt_internal_add_manual_test(qmlheightmap + GUI + SOURCES + main.cpp + ) +target_link_libraries(qmlheightmap PUBLIC + Qt::Gui + Qt::Qml + Qt::Quick + Qt::DataVisualization + ) + +set_source_files_properties("gradientGRAY8.png" + PROPERTIES QT_RESOURCE_ALIAS "mapGRAY8" + ) +set_source_files_properties("gradientGRAY16.png" + PROPERTIES QT_RESOURCE_ALIAS "mapGRAY16" + ) +set_source_files_properties("gradientRGB8.png" + PROPERTIES QT_RESOURCE_ALIAS "mapRGB8" + ) +set_source_files_properties("gradientRGB16.png" + PROPERTIES QT_RESOURCE_ALIAS "mapRGB16" + ) + +set(qmlheightmap_resource_files + "qml/qmlheightmap/main.qml" + "gradientGRAY8.png" + "gradientGRAY16.png" + "gradientRGB8.png" + "gradientRGB16.png" + ) +qt_internal_add_resource(qmlheightmap "qmlheightmap" + PREFIX + "/" + FILES + ${qmlheightmap_resource_files} + ) diff --git a/tests/manual/qmlheightmap/gradientGRAY16.png b/tests/manual/qmlheightmap/gradientGRAY16.png Binary files differnew file mode 100644 index 00000000..28df3673 --- /dev/null +++ b/tests/manual/qmlheightmap/gradientGRAY16.png diff --git a/tests/manual/qmlheightmap/gradientGRAY8.png b/tests/manual/qmlheightmap/gradientGRAY8.png Binary files differnew file mode 100644 index 00000000..6696e57c --- /dev/null +++ b/tests/manual/qmlheightmap/gradientGRAY8.png diff --git a/tests/manual/qmlheightmap/gradientRGB16.png b/tests/manual/qmlheightmap/gradientRGB16.png Binary files differnew file mode 100644 index 00000000..b62e510b --- /dev/null +++ b/tests/manual/qmlheightmap/gradientRGB16.png diff --git a/tests/manual/qmlheightmap/gradientRGB8.png b/tests/manual/qmlheightmap/gradientRGB8.png Binary files differnew file mode 100644 index 00000000..79879f35 --- /dev/null +++ b/tests/manual/qmlheightmap/gradientRGB8.png diff --git a/tests/manual/qmlheightmap/main.cpp b/tests/manual/qmlheightmap/main.cpp new file mode 100644 index 00000000..371b78a8 --- /dev/null +++ b/tests/manual/qmlheightmap/main.cpp @@ -0,0 +1,37 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +#include <QtGui/QGuiApplication> +#include <QtCore/QDir> +#include <QtQuick/QQuickView> +#include <QtQml/QQmlEngine> + +int main(int argc, char *argv[]) +{ + qputenv("QSG_RHI_BACKEND", "opengl"); +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); +#endif + + QGuiApplication app(argc, argv); + + QQuickView viewer; + + const QUrl url(QStringLiteral("qrc:/qml/qmlheightmap/main.qml")); + + // The following are needed to make examples run without having to install the module + // in desktop environments. +#ifdef Q_OS_WIN + QString extraImportPath(QStringLiteral("%1/../../../%2")); +#else + QString extraImportPath(QStringLiteral("%1/../../%2")); +#endif + + viewer.engine()->addImportPath(extraImportPath.arg(QGuiApplication::applicationDirPath(), + QString::fromLatin1("qml"))); + QObject::connect( viewer.engine(), &QQmlEngine::quit, &viewer, &QWindow::close); + viewer.setSource(url); + viewer.show(); + viewer.setResizeMode(QQuickView::SizeRootObjectToView); + return app.exec(); +} diff --git a/tests/auto/cpptest/q3dsurface-heightproxy/q3dsurface-heightproxy.qrc b/tests/manual/qmlheightmap/qml.qrc index b83c7ef9..b1cbc545 100644 --- a/tests/auto/cpptest/q3dsurface-heightproxy/q3dsurface-heightproxy.qrc +++ b/tests/manual/qmlheightmap/qml.qrc @@ -1,5 +1,5 @@ <RCC> <qresource prefix="/"> - <file>customtexture.jpg</file> + <file>qml/qmlheightmap/qml/main.qml</file> </qresource> </RCC> diff --git a/tests/manual/qmlheightmap/qml/qmlheightmap/main.qml b/tests/manual/qmlheightmap/qml/qmlheightmap/main.qml new file mode 100644 index 00000000..53003b59 --- /dev/null +++ b/tests/manual/qmlheightmap/qml/qmlheightmap/main.qml @@ -0,0 +1,181 @@ +// Copyright (C) 2021 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only + +import QtQuick +import QtQuick.Window +import QtQuick.Layouts +import QtQuick.Controls +import QtDataVisualization +import "." + +Item { + id: mainwindow + + width: 1024 + height: 768 + visible: true + + Item { + id: surfaceview + width: mainwindow.width + height: mainwindow.height + + anchors.top: mainwindow.top + anchors.left: mainwindow.left + + ColorGradient { + id: surfaceGradient + ColorGradientStop { position: 0.0; color: "darkslategray" } + ColorGradientStop { id: middleGradient; position: 0.50; color: "peru" } + ColorGradientStop { position: 1.0; color: "red" } + } + + Theme3D { + id: mainTheme + type: Q3DTheme.ThemeStoneMoss + colorStyle: Q3DTheme.ColorStyleRangeGradient + baseGradients: [surfaceGradient] + } + + Surface3D { + id: surfaceGraph + width: surfaceview.width + height: surfaceview.height + theme: mainTheme + shadowQuality: AbstractGraph3D.ShadowQualityMedium + selectionMode: AbstractGraph3D.SelectionSlice | AbstractGraph3D.SelectionItemAndRow + scene.activeCamera.cameraPreset: Camera3D.CameraPresetIsometricLeft + axisY.min: 0.0 + axisY.max: 500.0 + axisX.segmentCount: 10 + axisX.subSegmentCount: 2 + axisX.labelFormat: "%i" + axisZ.segmentCount: 10 + axisZ.subSegmentCount: 2 + axisZ.labelFormat: "%i" + axisY.segmentCount: 5 + axisY.subSegmentCount: 2 + axisY.labelFormat: "%i" + axisY.title: "Y" + axisX.title: "X" + axisZ.title: "Z" + + Surface3DSeries { + id: heightSeriesRGB8 + drawMode: Surface3DSeries.DrawSurface + visible: true + flatShadingEnabled: false + + HeightMapSurfaceDataProxy { + heightMapFile: ":/mapRGB8" + minYValue: surfaceGraph.axisY.min + maxYValue: surfaceGraph.axisY.max + } + } + + Surface3DSeries { + id: heightSeriesRGB16 + drawMode: Surface3DSeries.DrawSurface + visible: false + flatShadingEnabled: false + + HeightMapSurfaceDataProxy { + heightMapFile: ":/mapRGB16" + minYValue: surfaceGraph.axisY.min + maxYValue: surfaceGraph.axisY.max + } + } + + Surface3DSeries { + id: heightSeriesGRAY8 + drawMode: Surface3DSeries.DrawSurface + visible: false + flatShadingEnabled: false + + HeightMapSurfaceDataProxy { + heightMapFile: ":/mapGRAY8" + minYValue: surfaceGraph.axisY.min + maxYValue: surfaceGraph.axisY.max + } + } + + Surface3DSeries { + id: heightSeriesGRAY16 + drawMode: Surface3DSeries.DrawSurface + visible: false + flatShadingEnabled: false + + HeightMapSurfaceDataProxy { + heightMapFile: ":/mapGRAY16" + minYValue: surfaceGraph.axisY.min + maxYValue: surfaceGraph.axisY.max + } + } + } + + RowLayout { + id: buttonLayout + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + + Button { + id: toggleHeightSeries + Layout.fillWidth: true + Layout.fillHeight: true + + text: qsTr("Use 16-bit rgb map") + onClicked: { + if (heightSeriesRGB8.visible === true) { + heightSeriesRGB8.visible = false + heightSeriesRGB16.visible = true + heightSeriesGRAY8.visible = false + heightSeriesGRAY16.visible = false + text = "Use 8-bit grayscale map" + } else if (heightSeriesRGB16.visible === true){ + heightSeriesRGB8.visible = false + heightSeriesRGB16.visible = false + heightSeriesGRAY8.visible = true + heightSeriesGRAY16.visible = false + text = "Use 16-bit grayscale map" + } else if (heightSeriesGRAY8.visible === true){ + heightSeriesRGB8.visible = false + heightSeriesRGB16.visible = false + heightSeriesGRAY8.visible = false + heightSeriesGRAY16.visible = true + text = "Use 8-bit rgb map" + } else if (heightSeriesGRAY16.visible === true){ + heightSeriesRGB8.visible = true + heightSeriesRGB16.visible = false + heightSeriesGRAY8.visible = false + heightSeriesGRAY16.visible = false + text = "Use 16-bit rgb map" + } + } + } + + Button { + id: toggleAutoScaleY + Layout.fillWidth: true + Layout.fillHeight: true + + text: qsTr("Enable autoScaleY") + onClicked: { + if (text === "Enable autoScaleY") { + heightSeriesRGB8.dataProxy.autoScaleY = true + heightSeriesRGB16.dataProxy.autoScaleY = true + heightSeriesGRAY8.dataProxy.autoScaleY = true + heightSeriesGRAY16.dataProxy.autoScaleY = true + text = "Disable autoScaleY" + } else { + heightSeriesRGB8.dataProxy.autoScaleY = false + heightSeriesRGB16.dataProxy.autoScaleY = false + heightSeriesGRAY8.dataProxy.autoScaleY = false + heightSeriesGRAY16.dataProxy.autoScaleY = false + text = "Enable autoScaleY" + } + } + } + } + } +} diff --git a/tests/manual/qmlmultitest/CMakeLists.txt b/tests/manual/qmlmultitest/CMakeLists.txt index 77b3a4a6..a92ff8db 100644 --- a/tests/manual/qmlmultitest/CMakeLists.txt +++ b/tests/manual/qmlmultitest/CMakeLists.txt @@ -1,3 +1,6 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + qt_internal_add_manual_test(qmlmultitest GUI SOURCES @@ -5,6 +8,8 @@ qt_internal_add_manual_test(qmlmultitest ) target_link_libraries(qmlmultitest PUBLIC Qt::Gui + Qt::Qml + Qt::Quick Qt::DataVisualization ) diff --git a/tests/manual/qmlmultitest/main.cpp b/tests/manual/qmlmultitest/main.cpp index 41763539..555dff63 100644 --- a/tests/manual/qmlmultitest/main.cpp +++ b/tests/manual/qmlmultitest/main.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 <QtGui/QGuiApplication> #include <QtCore/QDir> diff --git a/tests/manual/qmlmultitest/qml/qmlmultitest/Data.qml b/tests/manual/qmlmultitest/qml/qmlmultitest/Data.qml index b6d16eae..78e65575 100644 --- a/tests/manual/qmlmultitest/qml/qmlmultitest/Data.qml +++ b/tests/manual/qmlmultitest/qml/qmlmultitest/Data.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 diff --git a/tests/manual/qmlmultitest/qml/qmlmultitest/main.qml b/tests/manual/qmlmultitest/qml/qmlmultitest/main.qml index 54c85e95..493feb79 100644 --- a/tests/manual/qmlmultitest/qml/qmlmultitest/main.qml +++ b/tests/manual/qmlmultitest/qml/qmlmultitest/main.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 import QtQuick.Layouts diff --git a/tests/manual/qmlperf/CMakeLists.txt b/tests/manual/qmlperf/CMakeLists.txt index 141ba0c8..31235e32 100644 --- a/tests/manual/qmlperf/CMakeLists.txt +++ b/tests/manual/qmlperf/CMakeLists.txt @@ -1,7 +1,7 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) qt_internal_add_manual_test(qmlperf GUI @@ -11,6 +11,8 @@ qt_internal_add_manual_test(qmlperf ) target_link_libraries(qmlperf PUBLIC Qt::Gui + Qt::Qml + Qt::Quick Qt::DataVisualization ) diff --git a/tests/manual/qmlperf/datagenerator.cpp b/tests/manual/qmlperf/datagenerator.cpp index 18db9004..df00d483 100644 --- a/tests/manual/qmlperf/datagenerator.cpp +++ b/tests/manual/qmlperf/datagenerator.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 "datagenerator.h" #include <QDebug> diff --git a/tests/manual/qmlperf/datagenerator.h b/tests/manual/qmlperf/datagenerator.h index ac816b92..99a9dbf7 100644 --- a/tests/manual/qmlperf/datagenerator.h +++ b/tests/manual/qmlperf/datagenerator.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 #ifndef DATAGENERATOR_H #define DATAGENERATOR_H diff --git a/tests/manual/qmlperf/main.cpp b/tests/manual/qmlperf/main.cpp index 91ac214b..2566fc7d 100644 --- a/tests/manual/qmlperf/main.cpp +++ b/tests/manual/qmlperf/main.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 "datagenerator.h" diff --git a/tests/manual/qmlperf/qml/qmlperf/main.qml b/tests/manual/qmlperf/qml/qmlperf/main.qml index 60930606..4562e538 100644 --- a/tests/manual/qmlperf/qml/qmlperf/main.qml +++ b/tests/manual/qmlperf/qml/qmlperf/main.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 import QtQuick.Layouts diff --git a/tests/manual/qmlvolume/CMakeLists.txt b/tests/manual/qmlvolume/CMakeLists.txt index eeaa572a..5a0e446a 100644 --- a/tests/manual/qmlvolume/CMakeLists.txt +++ b/tests/manual/qmlvolume/CMakeLists.txt @@ -1,7 +1,7 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) qt_internal_add_manual_test(qmlvolume GUI @@ -11,6 +11,8 @@ qt_internal_add_manual_test(qmlvolume ) target_link_libraries(qmlvolume PUBLIC Qt::Gui + Qt::Qml + Qt::Quick Qt::DataVisualization ) diff --git a/tests/manual/qmlvolume/datasource.cpp b/tests/manual/qmlvolume/datasource.cpp index 9aa11963..6a16278e 100644 --- a/tests/manual/qmlvolume/datasource.cpp +++ b/tests/manual/qmlvolume/datasource.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 "datasource.h" #include <QtCore/qmath.h> @@ -50,7 +24,7 @@ void DataSource::fillVolume(QCustom3DVolume *volumeItem) // This can take a while if the dimensions are large, so we support incremental data generation. int index = 0; - int textureSize = 256; + int textureSize = 1024; QVector3D midPoint(float(textureSize) / 2.0f, float(textureSize) / 2.0f, float(textureSize) / 2.0f); diff --git a/tests/manual/qmlvolume/datasource.h b/tests/manual/qmlvolume/datasource.h index 37602a2c..de502337 100644 --- a/tests/manual/qmlvolume/datasource.h +++ b/tests/manual/qmlvolume/datasource.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 #ifndef DATASOURCE_H #define DATASOURCE_H diff --git a/tests/manual/qmlvolume/main.cpp b/tests/manual/qmlvolume/main.cpp index fc14a3a1..1c4e4492 100644 --- a/tests/manual/qmlvolume/main.cpp +++ b/tests/manual/qmlvolume/main.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 "datasource.h" diff --git a/tests/manual/qmlvolume/qml/qmlvolume/main.qml b/tests/manual/qmlvolume/qml/qmlvolume/main.qml index 0ce82a12..da061483 100644 --- a/tests/manual/qmlvolume/qml/qmlvolume/main.qml +++ b/tests/manual/qmlvolume/qml/qmlvolume/main.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 import QtQuick.Layouts @@ -60,7 +34,7 @@ Item { itemLabelVisible: false onItemLabelChanged: { - if (surfaceSeries.selectedPoint === surfaceSeries.invalidSelectionPosition) + if (surfaceSeries.selectedPoint == surfaceSeries.invalidSelectionPosition) selectionText.text = "No selection" else selectionText.text = surfaceSeries.itemLabel @@ -127,7 +101,7 @@ Item { text: "Slice" onClicked: { - if (volumeItem.sliceIndexZ == -1) { + if (volumeItem.sliceIndexZ === -1) { volumeItem.sliceIndexZ = 128 volumeItem.drawSlices = true volumeItem.drawSliceFrames = true @@ -149,7 +123,27 @@ Item { } } } + } + + SequentialAnimation { + running: volumeItem.drawSlices + loops: Animation.Infinite + PropertyAnimation { + target: volumeItem + property: "sliceIndexZ" + from: 0 + to: 1024 + duration: 5000 + } + + PropertyAnimation { + target: volumeItem + property: "sliceIndexZ" + from: 1024 + to: 0 + duration: 5000 + } } Custom3DVolume { diff --git a/tests/manual/scattertest/CMakeLists.txt b/tests/manual/scattertest/CMakeLists.txt index 00177653..89013c12 100644 --- a/tests/manual/scattertest/CMakeLists.txt +++ b/tests/manual/scattertest/CMakeLists.txt @@ -1,13 +1,15 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) qt_internal_add_manual_test(scattertest GUI SOURCES main.cpp scatterchart.cpp scatterchart.h + NO_PCH_SOURCES + scatterchart.cpp # undef QT_NO_FOREACH ) target_link_libraries(scattertest PUBLIC Qt::Gui diff --git a/tests/manual/scattertest/main.cpp b/tests/manual/scattertest/main.cpp index 1f872c4d..af4d477f 100644 --- a/tests/manual/scattertest/main.cpp +++ b/tests/manual/scattertest/main.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 "scatterchart.h" diff --git a/tests/manual/scattertest/scatterchart.cpp b/tests/manual/scattertest/scatterchart.cpp index ca8414ac..fce115d4 100644 --- a/tests/manual/scattertest/scatterchart.cpp +++ b/tests/manual/scattertest/scatterchart.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 "scatterchart.h" #include <QtDataVisualization/qscatterdataproxy.h> @@ -244,7 +220,7 @@ void ScatterDataModifier::massiveTestAppendAndScroll() m_chart->axisZ()->setRange(min, max); } -void ScatterDataModifier::setFpsMeasurement(bool enable) +void ScatterDataModifier::setFpsMeasurement(int enable) { m_chart->setMeasureFps(enable); } @@ -973,14 +949,14 @@ void ScatterDataModifier::changeRadialLabelOffset(int offset) m_chart->setRadialLabelOffset(float(offset) / 100.0f); } -void ScatterDataModifier::toggleAxisTitleVisibility(bool enabled) +void ScatterDataModifier::toggleAxisTitleVisibility(int enabled) { m_chart->axisX()->setTitleVisible(enabled); m_chart->axisY()->setTitleVisible(enabled); m_chart->axisZ()->setTitleVisible(enabled); } -void ScatterDataModifier::toggleAxisTitleFixed(bool enabled) +void ScatterDataModifier::toggleAxisTitleFixed(int enabled) { m_chart->axisX()->setTitleFixed(enabled); m_chart->axisY()->setTitleFixed(enabled); @@ -1009,12 +985,12 @@ void ScatterDataModifier::renderToImage() } } -void ScatterDataModifier::togglePolar(bool enable) +void ScatterDataModifier::togglePolar(int enable) { m_chart->setPolar(enable); } -void ScatterDataModifier::toggleStatic(bool enable) +void ScatterDataModifier::toggleStatic(int enable) { if (enable) m_chart->setOptimizationHints(QAbstract3DGraph::OptimizationStatic); @@ -1022,7 +998,7 @@ void ScatterDataModifier::toggleStatic(bool enable) m_chart->setOptimizationHints(QAbstract3DGraph::OptimizationDefault); } -void ScatterDataModifier::toggleOrtho(bool enable) +void ScatterDataModifier::toggleOrtho(int enable) { m_chart->setOrthoProjection(enable); } diff --git a/tests/manual/scattertest/scatterchart.h b/tests/manual/scattertest/scatterchart.h index 43fabeac..2771a9a4 100644 --- a/tests/manual/scattertest/scatterchart.h +++ b/tests/manual/scattertest/scatterchart.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 #ifndef SCATTERDATAMODIFIER_H #define SCATTERDATAMODIFIER_H @@ -67,7 +41,7 @@ public: void massiveDataTest(); void massiveTestScroll(); void massiveTestAppendAndScroll(); - void setFpsMeasurement(bool enable); + void setFpsMeasurement(int enable); void setFpsLabel(QLabel *fpsLabel) { m_fpsLabel = fpsLabel; } void testItemChanges(); void testAxisReverse(); @@ -101,12 +75,12 @@ public Q_SLOTS: void handleFpsChange(qreal fps); void changeLabelRotation(int rotation); void changeRadialLabelOffset(int offset); - void toggleAxisTitleVisibility(bool enabled); - void toggleAxisTitleFixed(bool enabled); + void toggleAxisTitleVisibility(int enabled); + void toggleAxisTitleFixed(int enabled); void renderToImage(); - void togglePolar(bool enable); - void toggleStatic(bool enable); - void toggleOrtho(bool enable); + void togglePolar(int enable); + void toggleStatic(int enable); + void toggleOrtho(int enable); void setCameraTargetX(int value); void setCameraTargetY(int value); void setCameraTargetZ(int value); diff --git a/tests/manual/surfacetest/CMakeLists.txt b/tests/manual/surfacetest/CMakeLists.txt index c59f9488..bb3f0500 100644 --- a/tests/manual/surfacetest/CMakeLists.txt +++ b/tests/manual/surfacetest/CMakeLists.txt @@ -1,13 +1,17 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) qt_internal_add_manual_test(surfacetest GUI SOURCES + buttonwrapper.cpp buttonwrapper.h + checkboxwrapper.cpp checkboxwrapper.h graphmodifier.cpp graphmodifier.h main.cpp + NO_PCH_SOURCES + graphmodifier.cpp # undef QT_NO_FOREACH ) target_link_libraries(surfacetest PUBLIC Qt::Gui diff --git a/tests/manual/surfacetest/buttonwrapper.cpp b/tests/manual/surfacetest/buttonwrapper.cpp new file mode 100644 index 00000000..c8eef0c7 --- /dev/null +++ b/tests/manual/surfacetest/buttonwrapper.cpp @@ -0,0 +1,14 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only +#include "buttonwrapper.h" +#include <QPushButton> + +ButtonWrapper::ButtonWrapper(QPushButton *button) +{ + m_button = button; +} + +void ButtonWrapper::setEnabled(int state) +{ + m_button->setEnabled(state); +} diff --git a/tests/manual/surfacetest/buttonwrapper.h b/tests/manual/surfacetest/buttonwrapper.h new file mode 100644 index 00000000..d0112117 --- /dev/null +++ b/tests/manual/surfacetest/buttonwrapper.h @@ -0,0 +1,22 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only +#ifndef BUTTONWRAPPER_H +#define BUTTONWRAPPER_H + +#include <QObject> +class QPushButton; + +class ButtonWrapper : public QObject +{ + Q_OBJECT +public: + ButtonWrapper(QPushButton *button); + +public Q_SLOTS: + void setEnabled(int state); + +private: + QPushButton *m_button; +}; + +#endif // BUTTONWRAPPER_H diff --git a/tests/manual/surfacetest/checkboxwrapper.cpp b/tests/manual/surfacetest/checkboxwrapper.cpp new file mode 100644 index 00000000..37bd3ded --- /dev/null +++ b/tests/manual/surfacetest/checkboxwrapper.cpp @@ -0,0 +1,14 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only +#include "checkboxwrapper.h" +#include <QCheckBox> + +CheckBoxWrapper::CheckBoxWrapper(QCheckBox *cb) +{ + m_checkbox = cb; +} + +void CheckBoxWrapper::setEnabled(int enabled) +{ + m_checkbox->setEnabled(enabled); +} diff --git a/tests/manual/surfacetest/checkboxwrapper.h b/tests/manual/surfacetest/checkboxwrapper.h new file mode 100644 index 00000000..37e72346 --- /dev/null +++ b/tests/manual/surfacetest/checkboxwrapper.h @@ -0,0 +1,23 @@ +// Copyright (C) 2022 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only +#ifndef CHECKBOXWRAPPER_H +#define CHECKBOXWRAPPER_H + +#include <QObject> + +class QCheckBox; + +class CheckBoxWrapper : public QObject +{ + Q_OBJECT +public: + explicit CheckBoxWrapper(QCheckBox *cb); + +public Q_SLOTS: + void setEnabled(int enabled); + +private: + QCheckBox *m_checkbox; +}; + +#endif // CHECKBOXWRAPPER_H diff --git a/tests/manual/surfacetest/graphmodifier.cpp b/tests/manual/surfacetest/graphmodifier.cpp index 76c5afb9..f406513d 100644 --- a/tests/manual/surfacetest/graphmodifier.cpp +++ b/tests/manual/surfacetest/graphmodifier.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 "graphmodifier.h" #include <QtDataVisualization/QValue3DAxis> @@ -193,7 +169,7 @@ void GraphModifier::fillSeries() m_multiseries[3]->dataProxy()->resetArray(dataArray4); } -void GraphModifier::toggleSeries1(bool enabled) +void GraphModifier::toggleSeries1(int enabled) { qDebug() << __FUNCTION__ << " enabled = " << enabled; @@ -204,7 +180,7 @@ void GraphModifier::toggleSeries1(bool enabled) } } -void GraphModifier::toggleSeries2(bool enabled) +void GraphModifier::toggleSeries2(int enabled) { qDebug() << __FUNCTION__ << " enabled = " << enabled; @@ -215,7 +191,7 @@ void GraphModifier::toggleSeries2(bool enabled) } } -void GraphModifier::toggleSeries3(bool enabled) +void GraphModifier::toggleSeries3(int enabled) { qDebug() << __FUNCTION__ << " enabled = " << enabled; @@ -226,7 +202,7 @@ void GraphModifier::toggleSeries3(bool enabled) } } -void GraphModifier::toggleSeries4(bool enabled) +void GraphModifier::toggleSeries4(int enabled) { qDebug() << __FUNCTION__ << " enabled = " << enabled; @@ -237,7 +213,7 @@ void GraphModifier::toggleSeries4(bool enabled) } } -void GraphModifier::toggleSmooth(bool enabled) +void GraphModifier::toggleSmooth(int enabled) { qDebug() << "GraphModifier::toggleSmooth " << enabled; m_theSeries->setFlatShadingEnabled(enabled); @@ -246,7 +222,7 @@ void GraphModifier::toggleSmooth(bool enabled) #endif } -void GraphModifier::toggleSurfaceGrid(bool enable) +void GraphModifier::toggleSurfaceGrid(int enable) { qDebug() << "GraphModifier::toggleSurfaceGrid" << enable; if (enable) @@ -260,7 +236,7 @@ void GraphModifier::toggleSurfaceGrid(bool enable) #endif } -void GraphModifier::toggleSurface(bool enable) +void GraphModifier::toggleSurface(int enable) { qDebug() << "GraphModifier::toggleSurface" << enable; if (enable) @@ -274,7 +250,7 @@ void GraphModifier::toggleSurface(bool enable) #endif } -void GraphModifier::toggleSeriesVisible(bool enable) +void GraphModifier::toggleSeriesVisible(int enable) { m_theSeries->setVisible(enable); #ifdef MULTI_SERIES @@ -282,13 +258,13 @@ void GraphModifier::toggleSeriesVisible(bool enable) #endif } -void GraphModifier::toggleSmoothS2(bool enabled) +void GraphModifier::toggleSmoothS2(int enabled) { qDebug() << __FUNCTION__ << enabled; m_multiseries[1]->setFlatShadingEnabled(enabled); } -void GraphModifier::toggleSurfaceGridS2(bool enable) +void GraphModifier::toggleSurfaceGridS2(int enable) { qDebug() << __FUNCTION__ << enable; if (enable) @@ -299,7 +275,7 @@ void GraphModifier::toggleSurfaceGridS2(bool enable) m_multiseries[1]->setDrawMode(m_drawMode2); } -void GraphModifier::toggleSurfaceS2(bool enable) +void GraphModifier::toggleSurfaceS2(int enable) { qDebug() << __FUNCTION__ << enable; if (enable) @@ -310,19 +286,19 @@ void GraphModifier::toggleSurfaceS2(bool enable) m_multiseries[1]->setDrawMode(m_drawMode2); } -void GraphModifier::toggleSeries2Visible(bool enable) +void GraphModifier::toggleSeries2Visible(int enable) { qDebug() << __FUNCTION__ << enable; m_multiseries[1]->setVisible(enable); } -void GraphModifier::toggleSmoothS3(bool enabled) +void GraphModifier::toggleSmoothS3(int enabled) { qDebug() << __FUNCTION__ << enabled; m_multiseries[2]->setFlatShadingEnabled(enabled); } -void GraphModifier::toggleSurfaceGridS3(bool enable) +void GraphModifier::toggleSurfaceGridS3(int enable) { qDebug() << __FUNCTION__ << enable; if (enable) @@ -333,7 +309,7 @@ void GraphModifier::toggleSurfaceGridS3(bool enable) m_multiseries[2]->setDrawMode(m_drawMode3); } -void GraphModifier::toggleSurfaceS3(bool enable) +void GraphModifier::toggleSurfaceS3(int enable) { qDebug() << __FUNCTION__ << enable; if (enable) @@ -344,19 +320,19 @@ void GraphModifier::toggleSurfaceS3(bool enable) m_multiseries[2]->setDrawMode(m_drawMode3); } -void GraphModifier::toggleSeries3Visible(bool enable) +void GraphModifier::toggleSeries3Visible(int enable) { qDebug() << __FUNCTION__ << enable; m_multiseries[2]->setVisible(enable); } -void GraphModifier::toggleSmoothS4(bool enabled) +void GraphModifier::toggleSmoothS4(int enabled) { qDebug() << __FUNCTION__ << enabled; m_multiseries[3]->setFlatShadingEnabled(enabled); } -void GraphModifier::toggleSurfaceGridS4(bool enable) +void GraphModifier::toggleSurfaceGridS4(int enable) { qDebug() << __FUNCTION__ << enable; if (enable) @@ -367,7 +343,7 @@ void GraphModifier::toggleSurfaceGridS4(bool enable) m_multiseries[3]->setDrawMode(m_drawMode4); } -void GraphModifier::toggleSurfaceS4(bool enable) +void GraphModifier::toggleSurfaceS4(int enable) { qDebug() << __FUNCTION__ << enable; if (enable) @@ -378,13 +354,13 @@ void GraphModifier::toggleSurfaceS4(bool enable) m_multiseries[3]->setDrawMode(m_drawMode4); } -void GraphModifier::toggleSeries4Visible(bool enable) +void GraphModifier::toggleSeries4Visible(int enable) { qDebug() << __FUNCTION__ << enable; m_multiseries[3]->setVisible(enable); } -void GraphModifier::toggleSqrtSin(bool enable) +void GraphModifier::toggleSqrtSin(int enable) { if (enable) { qDebug() << "Create Sqrt&Sin surface, (" << m_xCount << ", " << m_zCount << ")"; @@ -426,7 +402,7 @@ void GraphModifier::toggleSqrtSin(bool enable) } } -void GraphModifier::togglePlane(bool enable) +void GraphModifier::togglePlane(int enable) { qDebug() << "GraphModifier::togglePlane " << enable; @@ -749,21 +725,21 @@ void GraphModifier::changeLabelRotation(int rotation) m_graph->axisZ()->setLabelAutoRotation(float(rotation)); } -void GraphModifier::toggleAxisTitleVisibility(bool enabled) +void GraphModifier::toggleAxisTitleVisibility(int enabled) { m_graph->axisX()->setTitleVisible(enabled); m_graph->axisY()->setTitleVisible(enabled); m_graph->axisZ()->setTitleVisible(enabled); } -void GraphModifier::toggleAxisTitleFixed(bool enabled) +void GraphModifier::toggleAxisTitleFixed(int enabled) { m_graph->axisX()->setTitleFixed(enabled); m_graph->axisY()->setTitleFixed(enabled); m_graph->axisZ()->setTitleFixed(enabled); } -void GraphModifier::toggleXAscending(bool enabled) +void GraphModifier::toggleXAscending(int enabled) { m_ascendingX = enabled; @@ -793,7 +769,7 @@ void GraphModifier::toggleXAscending(bool enabled) } } -void GraphModifier::toggleZAscending(bool enabled) +void GraphModifier::toggleZAscending(int enabled) { m_ascendingZ = enabled; @@ -823,7 +799,7 @@ void GraphModifier::toggleZAscending(bool enabled) } } -void GraphModifier::togglePolar(bool enabled) +void GraphModifier::togglePolar(int enabled) { m_graph->setPolar(enabled); } @@ -1681,7 +1657,7 @@ void GraphModifier::setHorizontalAspectRatio(int ratio) m_graph->setHorizontalAspectRatio(aspectRatio); } -void GraphModifier::setSurfaceTexture(bool enabled) +void GraphModifier::setSurfaceTexture(int enabled) { if (enabled) m_multiseries[3]->setTexture(QImage(":/maps/mapimage")); diff --git a/tests/manual/surfacetest/graphmodifier.h b/tests/manual/surfacetest/graphmodifier.h index e535021a..fe839976 100644 --- a/tests/manual/surfacetest/graphmodifier.h +++ b/tests/manual/surfacetest/graphmodifier.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 #ifndef GRAPHMODIFIER_H #define GRAPHMODIFIER_H @@ -53,29 +27,29 @@ public: explicit GraphModifier(Q3DSurface *graph, QWidget *parentWidget); ~GraphModifier(); - void toggleSeries1(bool enabled); - void toggleSeries2(bool enabled); - void toggleSeries3(bool enabled); - void toggleSeries4(bool enabled); - void toggleSmooth(bool enabled); - void toggleSurfaceGrid(bool enable); - void toggleSurface(bool enable); - void toggleSeriesVisible(bool enable); - void toggleSmoothS2(bool enabled); - void toggleSurfaceGridS2(bool enable); - void toggleSurfaceS2(bool enable); - void toggleSeries2Visible(bool enable); - void toggleSmoothS3(bool enabled); - void toggleSurfaceGridS3(bool enable); - void toggleSurfaceS3(bool enable); - void toggleSeries3Visible(bool enable); - void toggleSmoothS4(bool enabled); - void toggleSurfaceGridS4(bool enable); - void toggleSurfaceS4(bool enable); - void toggleSeries4Visible(bool enable); + void toggleSeries1(int enabled); + void toggleSeries2(int enabled); + void toggleSeries3(int enabled); + void toggleSeries4(int enabled); + void toggleSmooth(int enabled); + void toggleSurfaceGrid(int enable); + void toggleSurface(int enable); + void toggleSeriesVisible(int enable); + void toggleSmoothS2(int enabled); + void toggleSurfaceGridS2(int enable); + void toggleSurfaceS2(int enable); + void toggleSeries2Visible(int enable); + void toggleSmoothS3(int enabled); + void toggleSurfaceGridS3(int enable); + void toggleSurfaceS3(int enable); + void toggleSeries3Visible(int enable); + void toggleSmoothS4(int enabled); + void toggleSurfaceGridS4(int enable); + void toggleSurfaceS4(int enable); + void toggleSeries4Visible(int enable); - void toggleSqrtSin(bool enable); - void togglePlane(bool enable); + void toggleSqrtSin(int enable); + void togglePlane(int enable); void setHeightMapData(bool enable); void toggleGridSliderLock(bool enable); void setGridSliderX(QSlider *slider) { m_gridSliderX = slider; } @@ -123,7 +97,7 @@ public: void testDataOrdering(); void setAspectRatio(int ratio); void setHorizontalAspectRatio(int ratio); - void setSurfaceTexture(bool enabled); + void setSurfaceTexture(int enabled); public Q_SLOTS: void changeShadowQuality(int quality); @@ -138,11 +112,11 @@ public Q_SLOTS: void handleAxisZChanged(QValue3DAxis *axis); void handleFpsChange(qreal fps); void changeLabelRotation(int rotation); - void toggleAxisTitleVisibility(bool enabled); - void toggleAxisTitleFixed(bool enabled); - void toggleXAscending(bool enabled); - void toggleZAscending(bool enabled); - void togglePolar(bool enabled); + void toggleAxisTitleVisibility(int enabled); + void toggleAxisTitleFixed(int enabled); + void toggleXAscending(int enabled); + void toggleZAscending(int enabled); + void togglePolar(int enabled); void setCameraTargetX(int value); void setCameraTargetY(int value); void setCameraTargetZ(int value); diff --git a/tests/manual/surfacetest/main.cpp b/tests/manual/surfacetest/main.cpp index 239a6eba..7b90a0c2 100644 --- a/tests/manual/surfacetest/main.cpp +++ b/tests/manual/surfacetest/main.cpp @@ -1,33 +1,9 @@ -/**************************************************************************** -** -** 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 "graphmodifier.h" +#include "buttonwrapper.h" +#include "checkboxwrapper.h" #include <QtDataVisualization/q3dtheme.h> #include <QApplication> @@ -580,49 +556,66 @@ int main(int argc, char *argv[]) QObject::connect(series4VisibleCB, &QCheckBox::stateChanged, modifier, &GraphModifier::toggleSeries4Visible); + CheckBoxWrapper *series1SmoothCBWrapper = new CheckBoxWrapper(smoothCB); + CheckBoxWrapper *series1SurfaceGridCBWrapper = new CheckBoxWrapper(surfaceGridCB); + CheckBoxWrapper *series1surfaceCBWrapper = new CheckBoxWrapper(surfaceCB); + CheckBoxWrapper *series1VisibleCBWrapper = new CheckBoxWrapper(seriesVisibleCB); QObject::connect(series1CB, &QCheckBox::stateChanged, modifier, &GraphModifier::toggleSeries1); QObject::connect(series1CB, &QCheckBox::stateChanged, - smoothCB, &QPushButton::setEnabled); + series1SmoothCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series1CB, &QCheckBox::stateChanged, - surfaceGridCB, &QPushButton::setEnabled); + series1SurfaceGridCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series1CB, &QCheckBox::stateChanged, - surfaceCB, &QPushButton::setEnabled); + series1surfaceCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series1CB, &QCheckBox::stateChanged, - seriesVisibleCB, &QPushButton::setEnabled); + series1VisibleCBWrapper, &CheckBoxWrapper::setEnabled); + + CheckBoxWrapper *series2SmoothCBWrapper = new CheckBoxWrapper(smoothS2CB); + CheckBoxWrapper *series2SurfaceGridCBWrapper = new CheckBoxWrapper(surfaceGridS2CB); + CheckBoxWrapper *series2surfaceCBWrapper = new CheckBoxWrapper(surfaceS2CB); + CheckBoxWrapper *series2VisibleCBWrapper = new CheckBoxWrapper(series2VisibleCB); QObject::connect(series2CB, &QCheckBox::stateChanged, modifier, &GraphModifier::toggleSeries2); QObject::connect(series2CB, &QCheckBox::stateChanged, - smoothS2CB, &QPushButton::setEnabled); + series2SmoothCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series2CB, &QCheckBox::stateChanged, - surfaceGridS2CB, &QPushButton::setEnabled); + series2SurfaceGridCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series2CB, &QCheckBox::stateChanged, - surfaceS2CB, &QPushButton::setEnabled); + series2surfaceCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series2CB, &QCheckBox::stateChanged, - series2VisibleCB, &QPushButton::setEnabled); + series2VisibleCBWrapper, &CheckBoxWrapper::setEnabled); + CheckBoxWrapper *series3SmoothCBWrapper = new CheckBoxWrapper(smoothS3CB); + CheckBoxWrapper *series3SurfaceGridCBWrapper = new CheckBoxWrapper(surfaceGridS3CB); + CheckBoxWrapper *series3surfaceCBWrapper = new CheckBoxWrapper(surfaceS3CB); + CheckBoxWrapper *series3VisibleCBWrapper = new CheckBoxWrapper(series3VisibleCB); QObject::connect(series3CB, &QCheckBox::stateChanged, modifier, &GraphModifier::toggleSeries3); QObject::connect(series3CB, &QCheckBox::stateChanged, - smoothS3CB, &QPushButton::setEnabled); + series3SmoothCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series3CB, &QCheckBox::stateChanged, - surfaceGridS3CB, &QPushButton::setEnabled); + series3SurfaceGridCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series3CB, &QCheckBox::stateChanged, - surfaceS3CB, &QPushButton::setEnabled); + series3surfaceCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series3CB, &QCheckBox::stateChanged, - series3VisibleCB, &QPushButton::setEnabled); + series3VisibleCBWrapper, &CheckBoxWrapper::setEnabled); + CheckBoxWrapper *series4SmoothCBWrapper = new CheckBoxWrapper(smoothS4CB); + CheckBoxWrapper *series4SurfaceGridCBWrapper = new CheckBoxWrapper(surfaceGridS4CB); + CheckBoxWrapper *series4surfaceCBWrapper = new CheckBoxWrapper(surfaceS4CB); + CheckBoxWrapper *series4VisibleCBWrapper = new CheckBoxWrapper(series4VisibleCB); QObject::connect(series4CB, &QCheckBox::stateChanged, modifier, &GraphModifier::toggleSeries4); QObject::connect(series4CB, &QCheckBox::stateChanged, - smoothS4CB, &QPushButton::setEnabled); + series4SmoothCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series4CB, &QCheckBox::stateChanged, - surfaceGridS4CB, &QPushButton::setEnabled); + series4SurfaceGridCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series4CB, &QCheckBox::stateChanged, - surfaceS4CB, &QPushButton::setEnabled); + series4surfaceCBWrapper, &CheckBoxWrapper::setEnabled); QObject::connect(series4CB, &QCheckBox::stateChanged, - series4VisibleCB, &QPushButton::setEnabled); + series4VisibleCBWrapper, &CheckBoxWrapper::setEnabled); #else QObject::connect(sqrtSinCB, &QRadioButton::toggled, modifier, &GraphModifier::toggleSqrtSin); diff --git a/tests/manual/volumetrictest/CMakeLists.txt b/tests/manual/volumetrictest/CMakeLists.txt index c0f698f1..7e39bdf5 100644 --- a/tests/manual/volumetrictest/CMakeLists.txt +++ b/tests/manual/volumetrictest/CMakeLists.txt @@ -1,7 +1,7 @@ +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + set(CMAKE_INCLUDE_CURRENT_DIR ON) -set(CMAKE_AUTOMOC ON) -set(CMAKE_AUTORCC ON) -set(CMAKE_AUTOUIC ON) qt_internal_add_manual_test(volumetrictest GUI diff --git a/tests/manual/volumetrictest/main.cpp b/tests/manual/volumetrictest/main.cpp index a3fb999e..d9d322be 100644 --- a/tests/manual/volumetrictest/main.cpp +++ b/tests/manual/volumetrictest/main.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 "volumetrictest.h" #include <QtWidgets/QApplication> diff --git a/tests/manual/volumetrictest/volumetrictest.cpp b/tests/manual/volumetrictest/volumetrictest.cpp index 7b6e3821..49293873 100644 --- a/tests/manual/volumetrictest/volumetrictest.cpp +++ b/tests/manual/volumetrictest/volumetrictest.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 "volumetrictest.h" #include <QtDataVisualization/qbar3dseries.h> diff --git a/tests/manual/volumetrictest/volumetrictest.h b/tests/manual/volumetrictest/volumetrictest.h index b100b827..20b197d0 100644 --- a/tests/manual/volumetrictest/volumetrictest.h +++ b/tests/manual/volumetrictest/volumetrictest.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 #ifndef VOLUMETRICMODIFIER_H #define VOLUMETRICMODIFIER_H |