summaryrefslogtreecommitdiffstats
path: root/tests/auto/cpptest
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/cpptest')
-rw-r--r--tests/auto/cpptest/CMakeLists.txt29
-rw-r--r--tests/auto/cpptest/common/cpptestutil.h29
-rw-r--r--tests/auto/cpptest/common/cpptestutil.pri2
-rw-r--r--tests/auto/cpptest/cpptest.pro26
-rw-r--r--tests/auto/cpptest/q3daxis-category/CMakeLists.txt10
-rw-r--r--tests/auto/cpptest/q3daxis-category/q3daxis-category.pro8
-rw-r--r--tests/auto/cpptest/q3daxis-category/tst_axis.cpp36
-rw-r--r--tests/auto/cpptest/q3daxis-logvalue/CMakeLists.txt10
-rw-r--r--tests/auto/cpptest/q3daxis-logvalue/q3daxis-logvalue.pro8
-rw-r--r--tests/auto/cpptest/q3daxis-logvalue/tst_axis.cpp32
-rw-r--r--tests/auto/cpptest/q3daxis-value/CMakeLists.txt10
-rw-r--r--tests/auto/cpptest/q3daxis-value/q3daxis-value.pro8
-rw-r--r--tests/auto/cpptest/q3daxis-value/tst_axis.cpp36
-rw-r--r--tests/auto/cpptest/q3dbars-modelproxy/CMakeLists.txt14
-rw-r--r--tests/auto/cpptest/q3dbars-modelproxy/q3dbars-modelproxy.pro9
-rw-r--r--tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp95
-rw-r--r--tests/auto/cpptest/q3dbars-proxy/CMakeLists.txt10
-rw-r--r--tests/auto/cpptest/q3dbars-proxy/q3dbars-proxy.pro8
-rw-r--r--tests/auto/cpptest/q3dbars-proxy/tst_proxy.cpp40
-rw-r--r--tests/auto/cpptest/q3dbars-series/CMakeLists.txt10
-rw-r--r--tests/auto/cpptest/q3dbars-series/q3dbars-series.pro8
-rw-r--r--tests/auto/cpptest/q3dbars-series/tst_series.cpp45
-rw-r--r--tests/auto/cpptest/q3dbars/CMakeLists.txt13
-rw-r--r--tests/auto/cpptest/q3dbars/q3dbars.pro10
-rw-r--r--tests/auto/cpptest/q3dbars/tst_bars.cpp95
-rw-r--r--tests/auto/cpptest/q3dcustom-label/CMakeLists.txt13
-rw-r--r--tests/auto/cpptest/q3dcustom-label/q3dcustom-label.pro9
-rw-r--r--tests/auto/cpptest/q3dcustom-label/tst_custom.cpp54
-rw-r--r--tests/auto/cpptest/q3dcustom-volume/CMakeLists.txt10
-rw-r--r--tests/auto/cpptest/q3dcustom-volume/q3dcustom-volume.pro8
-rw-r--r--tests/auto/cpptest/q3dcustom-volume/tst_custom.cpp56
-rw-r--r--tests/auto/cpptest/q3dcustom/CMakeLists.txt10
-rw-r--r--tests/auto/cpptest/q3dcustom/q3dcustom.pro8
-rw-r--r--tests/auto/cpptest/q3dcustom/tst_custom.cpp54
-rw-r--r--tests/auto/cpptest/q3dinput-touch/CMakeLists.txt10
-rw-r--r--tests/auto/cpptest/q3dinput-touch/q3dinput-touch.pro8
-rw-r--r--tests/auto/cpptest/q3dinput-touch/tst_input.cpp32
-rw-r--r--tests/auto/cpptest/q3dinput/CMakeLists.txt10
-rw-r--r--tests/auto/cpptest/q3dinput/q3dinput.pro8
-rw-r--r--tests/auto/cpptest/q3dinput/tst_input.cpp32
-rw-r--r--tests/auto/cpptest/q3dscatter-modelproxy/CMakeLists.txt11
-rw-r--r--tests/auto/cpptest/q3dscatter-modelproxy/q3dscatter-modelproxy.pro8
-rw-r--r--tests/auto/cpptest/q3dscatter-modelproxy/tst_proxy.cpp63
-rw-r--r--tests/auto/cpptest/q3dscatter-proxy/CMakeLists.txt10
-rw-r--r--tests/auto/cpptest/q3dscatter-proxy/q3dscatter-proxy.pro8
-rw-r--r--tests/auto/cpptest/q3dscatter-proxy/tst_proxy.cpp32
-rw-r--r--tests/auto/cpptest/q3dscatter-series/CMakeLists.txt10
-rw-r--r--tests/auto/cpptest/q3dscatter-series/q3dscatter-series.pro8
-rw-r--r--tests/auto/cpptest/q3dscatter-series/tst_series.cpp32
-rw-r--r--tests/auto/cpptest/q3dscatter/CMakeLists.txt13
-rw-r--r--tests/auto/cpptest/q3dscatter/q3dscatter.pro9
-rw-r--r--tests/auto/cpptest/q3dscatter/tst_scatter.cpp64
-rw-r--r--tests/auto/cpptest/q3dscene-camera/CMakeLists.txt10
-rw-r--r--tests/auto/cpptest/q3dscene-camera/q3dscene-camera.pro8
-rw-r--r--tests/auto/cpptest/q3dscene-camera/tst_camera.cpp58
-rw-r--r--tests/auto/cpptest/q3dscene-light/CMakeLists.txt10
-rw-r--r--tests/auto/cpptest/q3dscene-light/q3dscene-light.pro8
-rw-r--r--tests/auto/cpptest/q3dscene-light/tst_light.cpp36
-rw-r--r--tests/auto/cpptest/q3dscene/CMakeLists.txt13
-rw-r--r--tests/auto/cpptest/q3dscene/q3dscene.pro9
-rw-r--r--tests/auto/cpptest/q3dscene/tst_scene.cpp32
-rw-r--r--tests/auto/cpptest/q3dsurface-heightproxy/CMakeLists.txt21
-rw-r--r--tests/auto/cpptest/q3dsurface-heightproxy/q3dsurface-heightproxy.pro11
-rw-r--r--tests/auto/cpptest/q3dsurface-heightproxy/q3dsurface-heightproxy.qrc5
-rw-r--r--tests/auto/cpptest/q3dsurface-heightproxy/tst_proxy.cpp34
-rw-r--r--tests/auto/cpptest/q3dsurface-modelproxy-nan/CMakeLists.txt14
-rw-r--r--tests/auto/cpptest/q3dsurface-modelproxy-nan/tst_proxy.cpp266
-rw-r--r--tests/auto/cpptest/q3dsurface-modelproxy/CMakeLists.txt14
-rw-r--r--tests/auto/cpptest/q3dsurface-modelproxy/q3dsurface-modelproxy.pro9
-rw-r--r--tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp93
-rw-r--r--tests/auto/cpptest/q3dsurface-proxy/CMakeLists.txt10
-rw-r--r--tests/auto/cpptest/q3dsurface-proxy/q3dsurface-proxy.pro8
-rw-r--r--tests/auto/cpptest/q3dsurface-proxy/tst_proxy.cpp42
-rw-r--r--tests/auto/cpptest/q3dsurface-series/CMakeLists.txt10
-rw-r--r--tests/auto/cpptest/q3dsurface-series/q3dsurface-series.pro8
-rw-r--r--tests/auto/cpptest/q3dsurface-series/tst_series.cpp36
-rw-r--r--tests/auto/cpptest/q3dsurface/CMakeLists.txt13
-rw-r--r--tests/auto/cpptest/q3dsurface/q3dsurface.pro9
-rw-r--r--tests/auto/cpptest/q3dsurface/tst_surface.cpp64
-rw-r--r--tests/auto/cpptest/q3dtheme/CMakeLists.txt10
-rw-r--r--tests/auto/cpptest/q3dtheme/q3dtheme.pro8
-rw-r--r--tests/auto/cpptest/q3dtheme/tst_theme.cpp44
82 files changed, 896 insertions, 1208 deletions
diff --git a/tests/auto/cpptest/CMakeLists.txt b/tests/auto/cpptest/CMakeLists.txt
new file mode 100644
index 00000000..939b32c9
--- /dev/null
+++ b/tests/auto/cpptest/CMakeLists.txt
@@ -0,0 +1,29 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+add_subdirectory(q3dbars)
+add_subdirectory(q3dbars-proxy)
+add_subdirectory(q3dbars-modelproxy)
+add_subdirectory(q3dbars-series)
+add_subdirectory(q3dscatter)
+add_subdirectory(q3dscatter-proxy)
+add_subdirectory(q3dscatter-modelproxy)
+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)
+add_subdirectory(q3daxis-logvalue)
+add_subdirectory(q3daxis-value)
+add_subdirectory(q3dscene)
+add_subdirectory(q3dscene-camera)
+add_subdirectory(q3dscene-light)
+add_subdirectory(q3dtheme)
+add_subdirectory(q3dinput)
+add_subdirectory(q3dinput-touch)
+add_subdirectory(q3dcustom)
+add_subdirectory(q3dcustom-label)
+add_subdirectory(q3dcustom-volume)
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/common/cpptestutil.pri b/tests/auto/cpptest/common/cpptestutil.pri
deleted file mode 100644
index 0bac2856..00000000
--- a/tests/auto/cpptest/common/cpptestutil.pri
+++ /dev/null
@@ -1,2 +0,0 @@
-QT += gui-private
-INCLUDEPATH += $$PWD/
diff --git a/tests/auto/cpptest/cpptest.pro b/tests/auto/cpptest/cpptest.pro
deleted file mode 100644
index abd8f38e..00000000
--- a/tests/auto/cpptest/cpptest.pro
+++ /dev/null
@@ -1,26 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = q3dbars \
- q3dbars-proxy \
- q3dbars-modelproxy \
- q3dbars-series \
- q3dscatter \
- q3dscatter-proxy \
- q3dscatter-modelproxy \
- q3dscatter-series \
- q3dsurface \
- q3dsurface-proxy \
- q3dsurface-modelproxy \
- q3dsurface-heightproxy \
- q3dsurface-series \
- q3daxis-category \
- q3daxis-logvalue \
- q3daxis-value \
- q3dscene \
- q3dscene-camera \
- q3dscene-light \
- q3dtheme \
- q3dinput \
- q3dinput-touch \
- q3dcustom \
- q3dcustom-label \
- q3dcustom-volume
diff --git a/tests/auto/cpptest/q3daxis-category/CMakeLists.txt b/tests/auto/cpptest/q3daxis-category/CMakeLists.txt
new file mode 100644
index 00000000..f148b184
--- /dev/null
+++ b/tests/auto/cpptest/q3daxis-category/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(q3daxis-category_datavis
+ SOURCES
+ tst_axis.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3daxis-category/q3daxis-category.pro b/tests/auto/cpptest/q3daxis-category/q3daxis-category.pro
deleted file mode 100644
index 74415397..00000000
--- a/tests/auto/cpptest/q3daxis-category/q3daxis-category.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_axis.cpp
diff --git a/tests/auto/cpptest/q3daxis-category/tst_axis.cpp b/tests/auto/cpptest/q3daxis-category/tst_axis.cpp
index 789ace17..d1440d6a 100644
--- a/tests/auto/cpptest/q3daxis-category/tst_axis.cpp
+++ b/tests/auto/cpptest/q3daxis-category/tst_axis.cpp
@@ -1,38 +1,10 @@
-/****************************************************************************
-**
-** 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>
#include <QtDataVisualization/QCategory3DAxis>
-using namespace QtDataVisualization;
-
class tst_axis: public QObject
{
Q_OBJECT
@@ -82,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);
@@ -102,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
new file mode 100644
index 00000000..0bba27a9
--- /dev/null
+++ b/tests/auto/cpptest/q3daxis-logvalue/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(q3daxis-logvalue_datavis
+ SOURCES
+ tst_axis.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3daxis-logvalue/q3daxis-logvalue.pro b/tests/auto/cpptest/q3daxis-logvalue/q3daxis-logvalue.pro
deleted file mode 100644
index 74415397..00000000
--- a/tests/auto/cpptest/q3daxis-logvalue/q3daxis-logvalue.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_axis.cpp
diff --git a/tests/auto/cpptest/q3daxis-logvalue/tst_axis.cpp b/tests/auto/cpptest/q3daxis-logvalue/tst_axis.cpp
index 450059ea..cf2b055c 100644
--- a/tests/auto/cpptest/q3daxis-logvalue/tst_axis.cpp
+++ b/tests/auto/cpptest/q3daxis-logvalue/tst_axis.cpp
@@ -1,38 +1,10 @@
-/****************************************************************************
-**
-** 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>
#include <QtDataVisualization/QLogValue3DAxisFormatter>
-using namespace QtDataVisualization;
-
class tst_axis: public QObject
{
Q_OBJECT
diff --git a/tests/auto/cpptest/q3daxis-value/CMakeLists.txt b/tests/auto/cpptest/q3daxis-value/CMakeLists.txt
new file mode 100644
index 00000000..5c412106
--- /dev/null
+++ b/tests/auto/cpptest/q3daxis-value/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(q3daxis-value_datavis
+ SOURCES
+ tst_axis.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3daxis-value/q3daxis-value.pro b/tests/auto/cpptest/q3daxis-value/q3daxis-value.pro
deleted file mode 100644
index 74415397..00000000
--- a/tests/auto/cpptest/q3daxis-value/q3daxis-value.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_axis.cpp
diff --git a/tests/auto/cpptest/q3daxis-value/tst_axis.cpp b/tests/auto/cpptest/q3daxis-value/tst_axis.cpp
index ae178edd..54d36d3d 100644
--- a/tests/auto/cpptest/q3daxis-value/tst_axis.cpp
+++ b/tests/auto/cpptest/q3daxis-value/tst_axis.cpp
@@ -1,38 +1,10 @@
-/****************************************************************************
-**
-** 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>
#include <QtDataVisualization/QValue3DAxis>
-using namespace QtDataVisualization;
-
class tst_axis: public QObject
{
Q_OBJECT
@@ -90,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"));
@@ -131,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
new file mode 100644
index 00000000..f9b05902
--- /dev/null
+++ b/tests/auto/cpptest/q3dbars-modelproxy/CMakeLists.txt
@@ -0,0 +1,14 @@
+# 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
+ LIBRARIES
+ Qt::Gui
+ Qt::GuiPrivate
+ Qt::Widgets
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dbars-modelproxy/q3dbars-modelproxy.pro b/tests/auto/cpptest/q3dbars-modelproxy/q3dbars-modelproxy.pro
deleted file mode 100644
index ad1fe0cc..00000000
--- a/tests/auto/cpptest/q3dbars-modelproxy/q3dbars-modelproxy.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-include(../common/cpptestutil.pri)
-QT += testlib datavisualization widgets
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_proxy.cpp
diff --git a/tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp b/tests/auto/cpptest/q3dbars-modelproxy/tst_proxy.cpp
index dfeee506..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>
@@ -35,8 +9,6 @@
#include "cpptestutil.h"
-using namespace QtDataVisualization;
-
class tst_proxy: public QObject
{
Q_OBJECT
@@ -94,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");
@@ -104,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");
@@ -114,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",
@@ -125,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",
@@ -136,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;
}
@@ -149,25 +121,25 @@ void tst_proxy::initialProperties()
QCOMPARE(m_proxy->autoRowCategories(), true);
QCOMPARE(m_proxy->columnCategories(), QStringList());
QCOMPARE(m_proxy->columnRole(), QString());
- QCOMPARE(m_proxy->columnRolePattern(), QRegExp());
+ QCOMPARE(m_proxy->columnRolePattern(), QRegularExpression());
QCOMPARE(m_proxy->columnRoleReplace(), QString());
QVERIFY(!m_proxy->itemModel());
QCOMPARE(m_proxy->multiMatchBehavior(), QItemModelBarDataProxy::MMBLast);
QCOMPARE(m_proxy->rotationRole(), QString());
- QCOMPARE(m_proxy->rotationRolePattern(), QRegExp());
+ QCOMPARE(m_proxy->rotationRolePattern(), QRegularExpression());
QCOMPARE(m_proxy->rotationRoleReplace(), QString());
QCOMPARE(m_proxy->rowCategories(), QStringList());
QCOMPARE(m_proxy->rowRole(), QString());
- QCOMPARE(m_proxy->rowRolePattern(), QRegExp());
+ QCOMPARE(m_proxy->rowRolePattern(), QRegularExpression());
QCOMPARE(m_proxy->rowRoleReplace(), QString());
QCOMPARE(m_proxy->useModelCategories(), false);
QCOMPARE(m_proxy->valueRole(), QString());
- QCOMPARE(m_proxy->valueRolePattern(), QRegExp());
+ 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);
@@ -183,40 +155,40 @@ void tst_proxy::initializeProperties()
m_proxy->setAutoRowCategories(false);
m_proxy->setColumnCategories(QStringList() << "col1" << "col2");
m_proxy->setColumnRole("column");
- m_proxy->setColumnRolePattern(QRegExp("/^.*-(\\d\\d)$/"));
+ m_proxy->setColumnRolePattern(QRegularExpression("/^.*-(\\d\\d)$/"));
m_proxy->setColumnRoleReplace("\\\\1");
m_proxy->setItemModel(table.model());
m_proxy->setMultiMatchBehavior(QItemModelBarDataProxy::MMBAverage);
m_proxy->setRotationRole("rotation");
- m_proxy->setRotationRolePattern(QRegExp("/-/"));
+ m_proxy->setRotationRolePattern(QRegularExpression("/-/"));
m_proxy->setRotationRoleReplace("\\\\1");
m_proxy->setRowCategories(QStringList() << "row1" << "row2");
m_proxy->setRowRole("row");
- m_proxy->setRowRolePattern(QRegExp("/^(\\d\\d\\d\\d).*$/"));
+ m_proxy->setRowRolePattern(QRegularExpression("/^(\\d\\d\\d\\d).*$/"));
m_proxy->setRowRoleReplace("\\\\1");
m_proxy->setUseModelCategories(true);
m_proxy->setValueRole("value");
- m_proxy->setValueRolePattern(QRegExp("/-/"));
+ m_proxy->setValueRolePattern(QRegularExpression("/-/"));
m_proxy->setValueRoleReplace("\\\\1");
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(), QRegExp("/^.*-(\\d\\d)$/"));
+ QCOMPARE(m_proxy->columnRolePattern(), QRegularExpression("/^.*-(\\d\\d)$/"));
QCOMPARE(m_proxy->columnRoleReplace(), QString("\\\\1"));
QVERIFY(m_proxy->itemModel());
QCOMPARE(m_proxy->multiMatchBehavior(), QItemModelBarDataProxy::MMBAverage);
QCOMPARE(m_proxy->rotationRole(), QString("rotation"));
- QCOMPARE(m_proxy->rotationRolePattern(), QRegExp("/-/"));
+ 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(), QRegExp("/^(\\d\\d\\d\\d).*$/"));
+ QCOMPARE(m_proxy->rowRolePattern(), QRegularExpression("/^(\\d\\d\\d\\d).*$/"));
QCOMPARE(m_proxy->rowRoleReplace(), QString("\\\\1"));
QCOMPARE(m_proxy->useModelCategories(), true);
QCOMPARE(m_proxy->valueRole(), QString("value"));
- QCOMPARE(m_proxy->valueRolePattern(), QRegExp("/-/"));
+ QCOMPARE(m_proxy->valueRolePattern(), QRegularExpression("/-/"));
QCOMPARE(m_proxy->valueRoleReplace(), QString("\\\\1"));
}
@@ -247,12 +219,13 @@ void tst_proxy::multiMatch()
m_proxy->setItemModel(table.model());
m_proxy->setRowRole(table.model()->roleNames().value(Qt::DisplayRole));
m_proxy->setColumnRole(table.model()->roleNames().value(Qt::DisplayRole));
- m_proxy->setRowRolePattern(QRegExp(QStringLiteral("^(\\d*)\\/(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$")));
+ m_proxy->setRowRolePattern(QRegularExpression(QStringLiteral("^(\\d*)\\/(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$")));
m_proxy->setRowRoleReplace(QStringLiteral("\\2"));
- m_proxy->setValueRolePattern(QRegExp(QStringLiteral("^\\d*(\\/)(\\d*)\\/(\\d*[\\.\\,]?\\d*)\\/\\d*[\\.\\,]?\\d*$")));
+ m_proxy->setValueRolePattern(QRegularExpression(QStringLiteral("^\\d*(\\/)(\\d*)\\/(\\d*[\\.\\,]?\\d*)\\/\\d*[\\.\\,]?\\d*$")));
m_proxy->setValueRoleReplace(QStringLiteral("\\3"));
- m_proxy->setColumnRolePattern(QRegExp(QStringLiteral("^(\\d*)(\\/)(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$")));
+ m_proxy->setColumnRolePattern(QRegularExpression(QStringLiteral("^(\\d*)(\\/)(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$")));
m_proxy->setColumnRoleReplace(QStringLiteral("\\1"));
+ QCoreApplication::processEvents();
QBar3DSeries *series = new QBar3DSeries(m_proxy);
@@ -273,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
new file mode 100644
index 00000000..23c6997d
--- /dev/null
+++ b/tests/auto/cpptest/q3dbars-proxy/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(q3dbars-proxy_datavis
+ SOURCES
+ tst_proxy.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dbars-proxy/q3dbars-proxy.pro b/tests/auto/cpptest/q3dbars-proxy/q3dbars-proxy.pro
deleted file mode 100644
index b0b5d361..00000000
--- a/tests/auto/cpptest/q3dbars-proxy/q3dbars-proxy.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_proxy.cpp
diff --git a/tests/auto/cpptest/q3dbars-proxy/tst_proxy.cpp b/tests/auto/cpptest/q3dbars-proxy/tst_proxy.cpp
index a04c594f..4c343cb4 100644
--- a/tests/auto/cpptest/q3dbars-proxy/tst_proxy.cpp
+++ b/tests/auto/cpptest/q3dbars-proxy/tst_proxy.cpp
@@ -1,38 +1,10 @@
-/****************************************************************************
-**
-** 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>
#include <QtDataVisualization/QBarDataProxy>
-using namespace QtDataVisualization;
-
class tst_proxy: public QObject
{
Q_OBJECT
@@ -81,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);
@@ -99,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
new file mode 100644
index 00000000..f160c81c
--- /dev/null
+++ b/tests/auto/cpptest/q3dbars-series/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(q3dbars-series_datavis
+ SOURCES
+ tst_series.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dbars-series/q3dbars-series.pro b/tests/auto/cpptest/q3dbars-series/q3dbars-series.pro
deleted file mode 100644
index 481653ef..00000000
--- a/tests/auto/cpptest/q3dbars-series/q3dbars-series.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_series.cpp
diff --git a/tests/auto/cpptest/q3dbars-series/tst_series.cpp b/tests/auto/cpptest/q3dbars-series/tst_series.cpp
index a52ce9ef..6e0272ac 100644
--- a/tests/auto/cpptest/q3dbars-series/tst_series.cpp
+++ b/tests/auto/cpptest/q3dbars-series/tst_series.cpp
@@ -1,38 +1,10 @@
-/****************************************************************************
-**
-** 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>
#include <QtDataVisualization/QBar3DSeries>
-using namespace QtDataVisualization;
-
class tst_series: public QObject
{
Q_OBJECT
@@ -92,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));
@@ -134,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);
@@ -167,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
new file mode 100644
index 00000000..c2f05908
--- /dev/null
+++ b/tests/auto/cpptest/q3dbars/CMakeLists.txt
@@ -0,0 +1,13 @@
+# 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
+ LIBRARIES
+ Qt::Gui
+ Qt::GuiPrivate
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dbars/q3dbars.pro b/tests/auto/cpptest/q3dbars/q3dbars.pro
deleted file mode 100644
index bba500fa..00000000
--- a/tests/auto/cpptest/q3dbars/q3dbars.pro
+++ /dev/null
@@ -1,10 +0,0 @@
-include(../common/cpptestutil.pri)
-
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_bars.cpp
diff --git a/tests/auto/cpptest/q3dbars/tst_bars.cpp b/tests/auto/cpptest/q3dbars/tst_bars.cpp
index 0d128c36..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>
@@ -36,8 +10,6 @@
#include "cpptestutil.h"
-using namespace QtDataVisualization;
-
class tst_bars: public QObject
{
Q_OBJECT
@@ -59,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();
@@ -123,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);
@@ -159,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);
@@ -210,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"));
}
@@ -222,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);
}
@@ -237,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);
@@ -252,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();
@@ -265,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;
}
@@ -283,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()
{
@@ -309,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()
@@ -328,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;
@@ -347,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);
@@ -363,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;
@@ -377,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()
@@ -394,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
new file mode 100644
index 00000000..3baea7fa
--- /dev/null
+++ b/tests/auto/cpptest/q3dcustom-label/CMakeLists.txt
@@ -0,0 +1,13 @@
+# 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
+ LIBRARIES
+ Qt::Gui
+ Qt::GuiPrivate
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dcustom-label/q3dcustom-label.pro b/tests/auto/cpptest/q3dcustom-label/q3dcustom-label.pro
deleted file mode 100644
index c47e018a..00000000
--- a/tests/auto/cpptest/q3dcustom-label/q3dcustom-label.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-include(../common/cpptestutil.pri)
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_custom.cpp
diff --git a/tests/auto/cpptest/q3dcustom-label/tst_custom.cpp b/tests/auto/cpptest/q3dcustom-label/tst_custom.cpp
index 44c9d2b2..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>
@@ -33,8 +7,6 @@
#include "cpptestutil.h"
-using namespace QtDataVisualization;
-
class tst_custom: public QObject
{
Q_OBJECT
@@ -81,8 +53,8 @@ void tst_custom::construct()
QVERIFY(custom);
delete custom;
- custom = new QCustom3DLabel("label", QFont("Times New Roman", 10.0), QVector3D(1.0, 1.0, 1.0),
- QVector3D(1.0, 1.0, 1.0), QQuaternion(1.0, 1.0, 10.0, 100.0));
+ custom = new QCustom3DLabel("label", QFont("Times New Roman", 10.0), QVector3D(1.0f, 1.0f, 1.0f),
+ QVector3D(1.0f, 1.0f, 1.0f), QQuaternion(1.0f, 1.0f, 10.0f, 100.0f));
QVERIFY(custom);
QCOMPARE(custom->backgroundColor(), QColor(Qt::gray));
QCOMPARE(custom->isBackgroundEnabled(), true);
@@ -92,10 +64,10 @@ void tst_custom::construct()
QCOMPARE(custom->text(), QString("label"));
QCOMPARE(custom->textColor(), QColor(Qt::white));
QCOMPARE(custom->meshFile(), QString(":/defaultMeshes/plane"));
- QCOMPARE(custom->position(), QVector3D(1.0, 1.0, 1.0));
+ QCOMPARE(custom->position(), QVector3D(1.0f, 1.0f, 1.0f));
QCOMPARE(custom->isPositionAbsolute(), false);
- QCOMPARE(custom->rotation(), QQuaternion(1.0, 1.0, 10.0, 100.0));
- QCOMPARE(custom->scaling(), QVector3D(1.0, 1.0, 1.0));
+ QCOMPARE(custom->rotation(), QQuaternion(1.0f, 1.0f, 10.0f, 100.0f));
+ QCOMPARE(custom->scaling(), QVector3D(1.0f, 1.0f, 1.0f));
QCOMPARE(custom->isScalingAbsolute(), true);
QCOMPARE(custom->isShadowCasting(), false);
QCOMPARE(custom->textureFile(), QString());
@@ -148,17 +120,17 @@ void tst_custom::initializeProperties()
QCOMPARE(m_custom->textColor(), QColor(Qt::blue));
// Common (from QCustom3DItem)
- m_custom->setPosition(QVector3D(1.0, 1.0, 1.0));
+ m_custom->setPosition(QVector3D(1.0f, 1.0f, 1.0f));
m_custom->setPositionAbsolute(true);
- m_custom->setRotation(QQuaternion(1.0, 1.0, 10.0, 100.0));
- m_custom->setScaling(QVector3D(1.0, 1.0, 1.0));
+ m_custom->setRotation(QQuaternion(1.0f, 1.0f, 10.0f, 100.0f));
+ m_custom->setScaling(QVector3D(1.0f, 1.0f, 1.0f));
m_custom->setShadowCasting(true);
m_custom->setVisible(false);
- QCOMPARE(m_custom->position(), QVector3D(1.0, 1.0, 1.0));
+ QCOMPARE(m_custom->position(), QVector3D(1.0f, 1.0f, 1.0f));
QCOMPARE(m_custom->isPositionAbsolute(), true);
- QCOMPARE(m_custom->rotation(), QQuaternion(1.0, 1.0, 10.0, 100.0));
- QCOMPARE(m_custom->scaling(), QVector3D(1.0, 1.0, 1.0));
+ QCOMPARE(m_custom->rotation(), QQuaternion(1.0f, 1.0f, 10.0f, 100.0f));
+ QCOMPARE(m_custom->scaling(), QVector3D(1.0f, 1.0f, 1.0f));
QCOMPARE(m_custom->isShadowCasting(), true);
QCOMPARE(m_custom->isVisible(), false);
}
diff --git a/tests/auto/cpptest/q3dcustom-volume/CMakeLists.txt b/tests/auto/cpptest/q3dcustom-volume/CMakeLists.txt
new file mode 100644
index 00000000..858f2dfc
--- /dev/null
+++ b/tests/auto/cpptest/q3dcustom-volume/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(q3dcustom-volume_datavis
+ SOURCES
+ tst_custom.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dcustom-volume/q3dcustom-volume.pro b/tests/auto/cpptest/q3dcustom-volume/q3dcustom-volume.pro
deleted file mode 100644
index af584baa..00000000
--- a/tests/auto/cpptest/q3dcustom-volume/q3dcustom-volume.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_custom.cpp
diff --git a/tests/auto/cpptest/q3dcustom-volume/tst_custom.cpp b/tests/auto/cpptest/q3dcustom-volume/tst_custom.cpp
index 982353ac..21040df3 100644
--- a/tests/auto/cpptest/q3dcustom-volume/tst_custom.cpp
+++ b/tests/auto/cpptest/q3dcustom-volume/tst_custom.cpp
@@ -1,38 +1,10 @@
-/****************************************************************************
-**
-** 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>
#include <QtDataVisualization/QCustom3DVolume>
-using namespace QtDataVisualization;
-
class tst_custom: public QObject
{
Q_OBJECT
@@ -82,8 +54,8 @@ void tst_custom::construct()
QList<QRgb> table;
table << QRgb(0xff00ff) << QRgb(0x00ff00);
- custom = new QCustom3DVolume(QVector3D(1.0, 1.0, 1.0), QVector3D(1.0, 1.0, 1.0),
- QQuaternion(1.0, 1.0, 10.0, 100.0), 10, 10, 10,
+ custom = new QCustom3DVolume(QVector3D(1.0f, 1.0f, 1.0f), QVector3D(1.0f, 1.0f, 1.0f),
+ QQuaternion(1.0f, 1.0f, 10.0f, 100.0f), 10, 10, 10,
tdata, QImage::Format_ARGB32, table);
QVERIFY(custom);
QCOMPARE(custom->alphaMultiplier(), 1.0f);
@@ -98,17 +70,17 @@ 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);
QCOMPARE(custom->textureWidth(), 10);
QCOMPARE(custom->textureDepth(), 10);
QCOMPARE(custom->meshFile(), QString(":/defaultMeshes/barFull"));
- QCOMPARE(custom->position(), QVector3D(1.0, 1.0, 1.0));
+ QCOMPARE(custom->position(), QVector3D(1.0f, 1.0f, 1.0f));
QCOMPARE(custom->isPositionAbsolute(), false);
- QCOMPARE(custom->rotation(), QQuaternion(1.0, 1.0, 10.0, 100.0));
- QCOMPARE(custom->scaling(), QVector3D(1.0, 1.0, 1.0));
+ QCOMPARE(custom->rotation(), QQuaternion(1.0f, 1.0f, 10.0f, 100.0f));
+ QCOMPARE(custom->scaling(), QVector3D(1.0f, 1.0f, 1.0f));
QCOMPARE(custom->isScalingAbsolute(), true);
QCOMPARE(custom->isShadowCasting(), false);
QCOMPARE(custom->textureFile(), QString());
@@ -176,18 +148,18 @@ void tst_custom::initializeProperties()
QCOMPARE(m_custom->useHighDefShader(), false);
// Common (from QCustom3DVolume)
- m_custom->setPosition(QVector3D(1.0, 1.0, 1.0));
+ m_custom->setPosition(QVector3D(1.0f, 1.0f, 1.0f));
m_custom->setPositionAbsolute(true);
- m_custom->setRotation(QQuaternion(1.0, 1.0, 10.0, 100.0));
- m_custom->setScaling(QVector3D(1.0, 1.0, 1.0));
+ m_custom->setRotation(QQuaternion(1.0f, 1.0f, 10.0f, 100.0f));
+ m_custom->setScaling(QVector3D(1.0f, 1.0f, 1.0f));
m_custom->setScalingAbsolute(false);
m_custom->setShadowCasting(false);
m_custom->setVisible(false);
- QCOMPARE(m_custom->position(), QVector3D(1.0, 1.0, 1.0));
+ QCOMPARE(m_custom->position(), QVector3D(1.0f, 1.0f, 1.0f));
QCOMPARE(m_custom->isPositionAbsolute(), true);
- QCOMPARE(m_custom->rotation(), QQuaternion(1.0, 1.0, 10.0, 100.0));
- QCOMPARE(m_custom->scaling(), QVector3D(1.0, 1.0, 1.0));
+ QCOMPARE(m_custom->rotation(), QQuaternion(1.0f, 1.0f, 10.0f, 100.0f));
+ QCOMPARE(m_custom->scaling(), QVector3D(1.0f, 1.0f, 1.0f));
QCOMPARE(m_custom->isScalingAbsolute(), false);
QCOMPARE(m_custom->isShadowCasting(), false);
QCOMPARE(m_custom->isVisible(), false);
diff --git a/tests/auto/cpptest/q3dcustom/CMakeLists.txt b/tests/auto/cpptest/q3dcustom/CMakeLists.txt
new file mode 100644
index 00000000..4126a884
--- /dev/null
+++ b/tests/auto/cpptest/q3dcustom/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(q3dcustom_datavis
+ SOURCES
+ tst_custom.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dcustom/q3dcustom.pro b/tests/auto/cpptest/q3dcustom/q3dcustom.pro
deleted file mode 100644
index af584baa..00000000
--- a/tests/auto/cpptest/q3dcustom/q3dcustom.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_custom.cpp
diff --git a/tests/auto/cpptest/q3dcustom/tst_custom.cpp b/tests/auto/cpptest/q3dcustom/tst_custom.cpp
index 94e32c62..05e09f98 100644
--- a/tests/auto/cpptest/q3dcustom/tst_custom.cpp
+++ b/tests/auto/cpptest/q3dcustom/tst_custom.cpp
@@ -1,38 +1,10 @@
-/****************************************************************************
-**
-** 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>
#include <QtDataVisualization/QCustom3DItem>
-using namespace QtDataVisualization;
-
class tst_custom: public QObject
{
Q_OBJECT
@@ -76,15 +48,15 @@ void tst_custom::construct()
QVERIFY(custom);
delete custom;
- custom = new QCustom3DItem(":/customitem.obj", QVector3D(1.0, 1.0, 1.0),
- QVector3D(1.0, 1.0, 1.0), QQuaternion(1.0, 1.0, 10.0, 100.0),
+ custom = new QCustom3DItem(":/customitem.obj", QVector3D(1.0f, 1.0f, 1.0f),
+ QVector3D(1.0f, 1.0f, 1.0f), QQuaternion(1.0f, 1.0f, 10.0f, 100.0f),
QImage(":/customtexture.jpg"));
QVERIFY(custom);
QCOMPARE(custom->meshFile(), QString(":/customitem.obj"));
- QCOMPARE(custom->position(), QVector3D(1.0, 1.0, 1.0));
+ QCOMPARE(custom->position(), QVector3D(1.0f, 1.0f, 1.0f));
QCOMPARE(custom->isPositionAbsolute(), false);
- QCOMPARE(custom->rotation(), QQuaternion(1.0, 1.0, 10.0, 100.0));
- QCOMPARE(custom->scaling(), QVector3D(1.0, 1.0, 1.0));
+ QCOMPARE(custom->rotation(), QQuaternion(1.0f, 1.0f, 10.0f, 100.0f));
+ QCOMPARE(custom->scaling(), QVector3D(1.0f, 1.0f, 1.0f));
QCOMPARE(custom->isScalingAbsolute(), true);
QCOMPARE(custom->isShadowCasting(), true);
QCOMPARE(custom->textureFile(), QString());
@@ -112,20 +84,20 @@ void tst_custom::initializeProperties()
QVERIFY(m_custom);
m_custom->setMeshFile(":/customitem.obj");
- m_custom->setPosition(QVector3D(1.0, 1.0, 1.0));
+ m_custom->setPosition(QVector3D(1.0f, 1.0f, 1.0f));
m_custom->setPositionAbsolute(true);
- m_custom->setRotation(QQuaternion(1.0, 1.0, 10.0, 100.0));
- m_custom->setScaling(QVector3D(1.0, 1.0, 1.0));
+ m_custom->setRotation(QQuaternion(1.0f, 1.0f, 10.0f, 100.0f));
+ m_custom->setScaling(QVector3D(1.0f, 1.0f, 1.0f));
m_custom->setScalingAbsolute(false);
m_custom->setShadowCasting(false);
m_custom->setTextureFile(":/customtexture.jpg");
m_custom->setVisible(false);
QCOMPARE(m_custom->meshFile(), QString(":/customitem.obj"));
- QCOMPARE(m_custom->position(), QVector3D(1.0, 1.0, 1.0));
+ QCOMPARE(m_custom->position(), QVector3D(1.0f, 1.0f, 1.0f));
QCOMPARE(m_custom->isPositionAbsolute(), true);
- QCOMPARE(m_custom->rotation(), QQuaternion(1.0, 1.0, 10.0, 100.0));
- QCOMPARE(m_custom->scaling(), QVector3D(1.0, 1.0, 1.0));
+ QCOMPARE(m_custom->rotation(), QQuaternion(1.0f, 1.0f, 10.0f, 100.0f));
+ QCOMPARE(m_custom->scaling(), QVector3D(1.0f, 1.0f, 1.0f));
QCOMPARE(m_custom->isScalingAbsolute(), false);
QCOMPARE(m_custom->isShadowCasting(), false);
QCOMPARE(m_custom->textureFile(), QString(":/customtexture.jpg"));
diff --git a/tests/auto/cpptest/q3dinput-touch/CMakeLists.txt b/tests/auto/cpptest/q3dinput-touch/CMakeLists.txt
new file mode 100644
index 00000000..7550bf2b
--- /dev/null
+++ b/tests/auto/cpptest/q3dinput-touch/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(q3dinput-touch_datavis
+ SOURCES
+ tst_input.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dinput-touch/q3dinput-touch.pro b/tests/auto/cpptest/q3dinput-touch/q3dinput-touch.pro
deleted file mode 100644
index 2de48158..00000000
--- a/tests/auto/cpptest/q3dinput-touch/q3dinput-touch.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_input.cpp
diff --git a/tests/auto/cpptest/q3dinput-touch/tst_input.cpp b/tests/auto/cpptest/q3dinput-touch/tst_input.cpp
index f33b20da..6a11741c 100644
--- a/tests/auto/cpptest/q3dinput-touch/tst_input.cpp
+++ b/tests/auto/cpptest/q3dinput-touch/tst_input.cpp
@@ -1,38 +1,10 @@
-/****************************************************************************
-**
-** 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>
#include <QtDataVisualization/QTouch3DInputHandler>
-using namespace QtDataVisualization;
-
class tst_input: public QObject
{
Q_OBJECT
diff --git a/tests/auto/cpptest/q3dinput/CMakeLists.txt b/tests/auto/cpptest/q3dinput/CMakeLists.txt
new file mode 100644
index 00000000..ac0fe9a9
--- /dev/null
+++ b/tests/auto/cpptest/q3dinput/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(q3dinput_datavis
+ SOURCES
+ tst_input.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dinput/q3dinput.pro b/tests/auto/cpptest/q3dinput/q3dinput.pro
deleted file mode 100644
index 2de48158..00000000
--- a/tests/auto/cpptest/q3dinput/q3dinput.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_input.cpp
diff --git a/tests/auto/cpptest/q3dinput/tst_input.cpp b/tests/auto/cpptest/q3dinput/tst_input.cpp
index 16861a91..95912b8a 100644
--- a/tests/auto/cpptest/q3dinput/tst_input.cpp
+++ b/tests/auto/cpptest/q3dinput/tst_input.cpp
@@ -1,38 +1,10 @@
-/****************************************************************************
-**
-** 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>
#include <QtDataVisualization/Q3DInputHandler>
-using namespace QtDataVisualization;
-
class tst_input: public QObject
{
Q_OBJECT
diff --git a/tests/auto/cpptest/q3dscatter-modelproxy/CMakeLists.txt b/tests/auto/cpptest/q3dscatter-modelproxy/CMakeLists.txt
new file mode 100644
index 00000000..438c05f8
--- /dev/null
+++ b/tests/auto/cpptest/q3dscatter-modelproxy/CMakeLists.txt
@@ -0,0 +1,11 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(q3dscatter-modelproxy_datavis
+ SOURCES
+ tst_proxy.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::Widgets
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dscatter-modelproxy/q3dscatter-modelproxy.pro b/tests/auto/cpptest/q3dscatter-modelproxy/q3dscatter-modelproxy.pro
deleted file mode 100644
index c383ec25..00000000
--- a/tests/auto/cpptest/q3dscatter-modelproxy/q3dscatter-modelproxy.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-QT += testlib datavisualization widgets
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_proxy.cpp
diff --git a/tests/auto/cpptest/q3dscatter-modelproxy/tst_proxy.cpp b/tests/auto/cpptest/q3dscatter-modelproxy/tst_proxy.cpp
index 55fb2333..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>
@@ -33,8 +7,6 @@
#include <QtDataVisualization/Q3DScatter>
#include <QtWidgets/QTableWidget>
-using namespace QtDataVisualization;
-
class tst_proxy: public QObject
{
Q_OBJECT
@@ -109,16 +81,16 @@ void tst_proxy::initialProperties()
QVERIFY(!m_proxy->itemModel());
QCOMPARE(m_proxy->rotationRole(), QString());
- QCOMPARE(m_proxy->rotationRolePattern(), QRegExp());
+ QCOMPARE(m_proxy->rotationRolePattern(), QRegularExpression());
QCOMPARE(m_proxy->rotationRoleReplace(), QString());
QCOMPARE(m_proxy->xPosRole(), QString());
- QCOMPARE(m_proxy->xPosRolePattern(), QRegExp());
+ QCOMPARE(m_proxy->xPosRolePattern(), QRegularExpression());
QCOMPARE(m_proxy->xPosRoleReplace(), QString());
QCOMPARE(m_proxy->yPosRole(), QString());
- QCOMPARE(m_proxy->yPosRolePattern(), QRegExp());
+ QCOMPARE(m_proxy->yPosRolePattern(), QRegularExpression());
QCOMPARE(m_proxy->yPosRoleReplace(), QString());
QCOMPARE(m_proxy->zPosRole(), QString());
- QCOMPARE(m_proxy->zPosRolePattern(), QRegExp());
+ QCOMPARE(m_proxy->zPosRolePattern(), QRegularExpression());
QCOMPARE(m_proxy->zPosRoleReplace(), QString());
QCOMPARE(m_proxy->itemCount(), 0);
@@ -135,30 +107,30 @@ void tst_proxy::initializeProperties()
m_proxy->setItemModel(table.model());
m_proxy->setRotationRole("rotation");
- m_proxy->setRotationRolePattern(QRegExp("/-/"));
+ m_proxy->setRotationRolePattern(QRegularExpression("/-/"));
m_proxy->setRotationRoleReplace("\\\\1");
m_proxy->setXPosRole("X");
- m_proxy->setXPosRolePattern(QRegExp("/-/"));
+ m_proxy->setXPosRolePattern(QRegularExpression("/-/"));
m_proxy->setXPosRoleReplace("\\\\1");
m_proxy->setYPosRole("Y");
- m_proxy->setYPosRolePattern(QRegExp("/-/"));
+ m_proxy->setYPosRolePattern(QRegularExpression("/-/"));
m_proxy->setYPosRoleReplace("\\\\1");
m_proxy->setZPosRole("Z");
- m_proxy->setZPosRolePattern(QRegExp("/-/"));
+ m_proxy->setZPosRolePattern(QRegularExpression("/-/"));
m_proxy->setZPosRoleReplace("\\\\1");
QVERIFY(m_proxy->itemModel());
QCOMPARE(m_proxy->rotationRole(), QString("rotation"));
- QCOMPARE(m_proxy->rotationRolePattern(), QRegExp("/-/"));
+ QCOMPARE(m_proxy->rotationRolePattern(), QRegularExpression("/-/"));
QCOMPARE(m_proxy->rotationRoleReplace(), QString("\\\\1"));
QCOMPARE(m_proxy->xPosRole(), QString("X"));
- QCOMPARE(m_proxy->xPosRolePattern(), QRegExp("/-/"));
+ QCOMPARE(m_proxy->xPosRolePattern(), QRegularExpression("/-/"));
QCOMPARE(m_proxy->xPosRoleReplace(), QString("\\\\1"));
QCOMPARE(m_proxy->yPosRole(), QString("Y"));
- QCOMPARE(m_proxy->yPosRolePattern(), QRegExp("/-/"));
+ QCOMPARE(m_proxy->yPosRolePattern(), QRegularExpression("/-/"));
QCOMPARE(m_proxy->yPosRoleReplace(), QString("\\\\1"));
QCOMPARE(m_proxy->zPosRole(), QString("Z"));
- QCOMPARE(m_proxy->zPosRolePattern(), QRegExp("/-/"));
+ QCOMPARE(m_proxy->zPosRolePattern(), QRegularExpression("/-/"));
QCOMPARE(m_proxy->zPosRoleReplace(), QString("\\\\1"));
}
@@ -184,12 +156,13 @@ void tst_proxy::addModel()
m_proxy->setItemModel(table.model());
m_proxy->setXPosRole(table.model()->roleNames().value(Qt::DisplayRole));
m_proxy->setZPosRole(table.model()->roleNames().value(Qt::DisplayRole));
- m_proxy->setXPosRolePattern(QRegExp(QStringLiteral("^(\\d*)\\/(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$")));
+ m_proxy->setXPosRolePattern(QRegularExpression(QStringLiteral("^(\\d*)\\/(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$")));
m_proxy->setXPosRoleReplace(QStringLiteral("\\2"));
- m_proxy->setYPosRolePattern(QRegExp(QStringLiteral("^\\d*(\\/)(\\d*)\\/(\\d*[\\.\\,]?\\d*)\\/\\d*[\\.\\,]?\\d*$")));
+ m_proxy->setYPosRolePattern(QRegularExpression(QStringLiteral("^\\d*(\\/)(\\d*)\\/(\\d*[\\.\\,]?\\d*)\\/\\d*[\\.\\,]?\\d*$")));
m_proxy->setYPosRoleReplace(QStringLiteral("\\3"));
- m_proxy->setZPosRolePattern(QRegExp(QStringLiteral("^(\\d*)(\\/)(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$")));
+ m_proxy->setZPosRolePattern(QRegularExpression(QStringLiteral("^(\\d*)(\\/)(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$")));
m_proxy->setZPosRoleReplace(QStringLiteral("\\1"));
+ QCoreApplication::processEvents();
QScatter3DSeries *series = new QScatter3DSeries(m_proxy);
Q_UNUSED(series);
diff --git a/tests/auto/cpptest/q3dscatter-proxy/CMakeLists.txt b/tests/auto/cpptest/q3dscatter-proxy/CMakeLists.txt
new file mode 100644
index 00000000..c813e9fb
--- /dev/null
+++ b/tests/auto/cpptest/q3dscatter-proxy/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(q3dscatter-proxy_datavis
+ SOURCES
+ tst_proxy.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dscatter-proxy/q3dscatter-proxy.pro b/tests/auto/cpptest/q3dscatter-proxy/q3dscatter-proxy.pro
deleted file mode 100644
index b0b5d361..00000000
--- a/tests/auto/cpptest/q3dscatter-proxy/q3dscatter-proxy.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_proxy.cpp
diff --git a/tests/auto/cpptest/q3dscatter-proxy/tst_proxy.cpp b/tests/auto/cpptest/q3dscatter-proxy/tst_proxy.cpp
index 3ca07aa2..e2633225 100644
--- a/tests/auto/cpptest/q3dscatter-proxy/tst_proxy.cpp
+++ b/tests/auto/cpptest/q3dscatter-proxy/tst_proxy.cpp
@@ -1,38 +1,10 @@
-/****************************************************************************
-**
-** 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>
#include <QtDataVisualization/QScatterDataProxy>
-using namespace QtDataVisualization;
-
class tst_proxy: public QObject
{
Q_OBJECT
diff --git a/tests/auto/cpptest/q3dscatter-series/CMakeLists.txt b/tests/auto/cpptest/q3dscatter-series/CMakeLists.txt
new file mode 100644
index 00000000..c2eb2c4a
--- /dev/null
+++ b/tests/auto/cpptest/q3dscatter-series/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(q3dscatter-series_datavis
+ SOURCES
+ tst_series.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dscatter-series/q3dscatter-series.pro b/tests/auto/cpptest/q3dscatter-series/q3dscatter-series.pro
deleted file mode 100644
index 481653ef..00000000
--- a/tests/auto/cpptest/q3dscatter-series/q3dscatter-series.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_series.cpp
diff --git a/tests/auto/cpptest/q3dscatter-series/tst_series.cpp b/tests/auto/cpptest/q3dscatter-series/tst_series.cpp
index eef9f908..c0c23b07 100644
--- a/tests/auto/cpptest/q3dscatter-series/tst_series.cpp
+++ b/tests/auto/cpptest/q3dscatter-series/tst_series.cpp
@@ -1,38 +1,10 @@
-/****************************************************************************
-**
-** 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>
#include <QtDataVisualization/QScatter3DSeries>
-using namespace QtDataVisualization;
-
class tst_series: public QObject
{
Q_OBJECT
diff --git a/tests/auto/cpptest/q3dscatter/CMakeLists.txt b/tests/auto/cpptest/q3dscatter/CMakeLists.txt
new file mode 100644
index 00000000..176fb66e
--- /dev/null
+++ b/tests/auto/cpptest/q3dscatter/CMakeLists.txt
@@ -0,0 +1,13 @@
+# 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
+ LIBRARIES
+ Qt::Gui
+ Qt::GuiPrivate
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dscatter/q3dscatter.pro b/tests/auto/cpptest/q3dscatter/q3dscatter.pro
deleted file mode 100644
index 6c94fe64..00000000
--- a/tests/auto/cpptest/q3dscatter/q3dscatter.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-include(../common/cpptestutil.pri)
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_scatter.cpp
diff --git a/tests/auto/cpptest/q3dscatter/tst_scatter.cpp b/tests/auto/cpptest/q3dscatter/tst_scatter.cpp
index 64561340..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>
@@ -33,8 +7,6 @@
#include "cpptestutil.h"
-using namespace QtDataVisualization;
-
class tst_scatter: public QObject
{
Q_OBJECT
@@ -56,6 +28,7 @@ private slots:
void selectSeries();
void removeSeries();
void removeMultipleSeries();
+ void hasSeries();
private:
Q3DScatter *m_graph;
@@ -105,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);
@@ -175,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"));
}
@@ -185,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());
}
@@ -199,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()
@@ -209,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();
@@ -222,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;
}
@@ -241,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
new file mode 100644
index 00000000..63cd964c
--- /dev/null
+++ b/tests/auto/cpptest/q3dscene-camera/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(q3dscene-camera_datavis
+ SOURCES
+ tst_camera.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dscene-camera/q3dscene-camera.pro b/tests/auto/cpptest/q3dscene-camera/q3dscene-camera.pro
deleted file mode 100644
index c575a55e..00000000
--- a/tests/auto/cpptest/q3dscene-camera/q3dscene-camera.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_camera.cpp
diff --git a/tests/auto/cpptest/q3dscene-camera/tst_camera.cpp b/tests/auto/cpptest/q3dscene-camera/tst_camera.cpp
index 0c92581d..8c8f4b45 100644
--- a/tests/auto/cpptest/q3dscene-camera/tst_camera.cpp
+++ b/tests/auto/cpptest/q3dscene-camera/tst_camera.cpp
@@ -1,38 +1,10 @@
-/****************************************************************************
-**
-** 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>
#include <QtDataVisualization/Q3DCamera>
-using namespace QtDataVisualization;
-
class tst_camera: public QObject
{
Q_OBJECT
@@ -87,7 +59,7 @@ void tst_camera::initialProperties()
QCOMPARE(m_camera->cameraPreset(), Q3DCamera::CameraPresetNone);
QCOMPARE(m_camera->maxZoomLevel(), 500.0f);
QCOMPARE(m_camera->minZoomLevel(), 10.0f);
- QCOMPARE(m_camera->target(), QVector3D(0.0, 0.0, 0.0));
+ QCOMPARE(m_camera->target(), QVector3D(0.0f, 0.0f, 0.0f));
QCOMPARE(m_camera->wrapXRotation(), true);
QCOMPARE(m_camera->wrapYRotation(), false);
QCOMPARE(m_camera->xRotation(), 0.0f);
@@ -105,7 +77,7 @@ void tst_camera::initializeProperties()
m_camera->setMaxZoomLevel(1000.0f);
m_camera->setMinZoomLevel(100.0f);
- m_camera->setTarget(QVector3D(1.0, -1.0, 1.0));
+ m_camera->setTarget(QVector3D(1.0f, -1.0f, 1.0f));
m_camera->setWrapXRotation(false);
m_camera->setWrapYRotation(true);
m_camera->setXRotation(30.0f);
@@ -114,26 +86,26 @@ void tst_camera::initializeProperties()
QCOMPARE(m_camera->maxZoomLevel(), 1000.0f);
QCOMPARE(m_camera->minZoomLevel(), 100.0f);
- QCOMPARE(m_camera->target(), QVector3D(1.0, -1.0, 1.0));
+ QCOMPARE(m_camera->target(), QVector3D(1.0f, -1.0f, 1.0f));
QCOMPARE(m_camera->wrapXRotation(), false);
QCOMPARE(m_camera->wrapYRotation(), true);
QCOMPARE(m_camera->xRotation(), 30.0f);
QCOMPARE(m_camera->yRotation(), 30.0f);
QCOMPARE(m_camera->zoomLevel(), 500.0f);
- m_camera->setPosition(QVector3D(1.0, 1.0, 1.0));
+ m_camera->setPosition(QVector3D(1.0f, 1.0f, 1.0f));
// Common (from Q3DObject)
- QCOMPARE(m_camera->position(), QVector3D(1.0, 1.0, 1.0));
+ QCOMPARE(m_camera->position(), QVector3D(1.0f, 1.0f, 1.0f));
}
void tst_camera::invalidProperties()
{
- m_camera->setTarget(QVector3D(-1.5, -1.5, -1.5));
- QCOMPARE(m_camera->target(), QVector3D(-1.0, -1.0, -1.0));
+ m_camera->setTarget(QVector3D(-1.5f, -1.5f, -1.5f));
+ QCOMPARE(m_camera->target(), QVector3D(-1.0f, -1.0f, -1.0f));
- m_camera->setTarget(QVector3D(1.5, 1.5, 1.5));
- QCOMPARE(m_camera->target(), QVector3D(1.0, 1.0, 1.0));
+ m_camera->setTarget(QVector3D(1.5f, 1.5f, 1.5f));
+ QCOMPARE(m_camera->target(), QVector3D(1.0f, 1.0f, 1.0f));
m_camera->setMinZoomLevel(0.1f);
QCOMPARE(m_camera->minZoomLevel(), 1.0f);
@@ -144,7 +116,7 @@ void tst_camera::changePresets()
m_camera->setCameraPreset(Q3DCamera::CameraPresetBehind); // Will be overridden by the the following sets
m_camera->setMaxZoomLevel(1000.0f);
m_camera->setMinZoomLevel(100.0f);
- m_camera->setTarget(QVector3D(1.0, -1.0, 1.0));
+ m_camera->setTarget(QVector3D(1.0f, -1.0f, 1.0f));
m_camera->setWrapXRotation(false);
m_camera->setWrapYRotation(true);
m_camera->setXRotation(30.0f);
@@ -154,7 +126,7 @@ void tst_camera::changePresets()
QCOMPARE(m_camera->cameraPreset(), Q3DCamera::CameraPresetNone);
QCOMPARE(m_camera->maxZoomLevel(), 1000.0f);
QCOMPARE(m_camera->minZoomLevel(), 100.0f);
- QCOMPARE(m_camera->target(), QVector3D(1.0, -1.0, 1.0));
+ QCOMPARE(m_camera->target(), QVector3D(1.0f, -1.0f, 1.0f));
QCOMPARE(m_camera->wrapXRotation(), false);
QCOMPARE(m_camera->wrapYRotation(), true);
QCOMPARE(m_camera->xRotation(), 30.0f);
@@ -166,7 +138,7 @@ void tst_camera::changePresets()
QCOMPARE(m_camera->cameraPreset(), Q3DCamera::CameraPresetBehind);
QCOMPARE(m_camera->maxZoomLevel(), 1000.0f);
QCOMPARE(m_camera->minZoomLevel(), 100.0f);
- QCOMPARE(m_camera->target(), QVector3D(0.0, 0.0, 0.0));
+ QCOMPARE(m_camera->target(), QVector3D(0.0f, 0.0f, 0.0f));
QCOMPARE(m_camera->wrapXRotation(), false);
QCOMPARE(m_camera->wrapYRotation(), true);
QCOMPARE(m_camera->xRotation(), 180.0f);
@@ -178,7 +150,7 @@ void tst_camera::changePresets()
QCOMPARE(m_camera->cameraPreset(), Q3DCamera::CameraPresetNone);
QCOMPARE(m_camera->maxZoomLevel(), 1000.0f);
QCOMPARE(m_camera->minZoomLevel(), 100.0f);
- QCOMPARE(m_camera->target(), QVector3D(0.0, 0.0, 0.0));
+ QCOMPARE(m_camera->target(), QVector3D(0.0f, 0.0f, 0.0f));
QCOMPARE(m_camera->wrapXRotation(), false);
QCOMPARE(m_camera->wrapYRotation(), true);
QCOMPARE(m_camera->xRotation(), 10.0f);
diff --git a/tests/auto/cpptest/q3dscene-light/CMakeLists.txt b/tests/auto/cpptest/q3dscene-light/CMakeLists.txt
new file mode 100644
index 00000000..fc70b804
--- /dev/null
+++ b/tests/auto/cpptest/q3dscene-light/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(q3dscene-light_datavis
+ SOURCES
+ tst_light.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dscene-light/q3dscene-light.pro b/tests/auto/cpptest/q3dscene-light/q3dscene-light.pro
deleted file mode 100644
index 21a3c934..00000000
--- a/tests/auto/cpptest/q3dscene-light/q3dscene-light.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_light.cpp
diff --git a/tests/auto/cpptest/q3dscene-light/tst_light.cpp b/tests/auto/cpptest/q3dscene-light/tst_light.cpp
index d5eb4507..fb5ba325 100644
--- a/tests/auto/cpptest/q3dscene-light/tst_light.cpp
+++ b/tests/auto/cpptest/q3dscene-light/tst_light.cpp
@@ -1,38 +1,10 @@
-/****************************************************************************
-**
-** 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>
#include <QtDataVisualization/Q3DLight>
-using namespace QtDataVisualization;
-
class tst_light: public QObject
{
Q_OBJECT
@@ -96,8 +68,8 @@ void tst_light::initializeProperties()
QCOMPARE(m_light->isAutoPosition(), true);
// Common (from Q3DObject)
- m_light->setPosition(QVector3D(1.0, 1.0, 1.0));
- QCOMPARE(m_light->position(), QVector3D(1.0, 1.0, 1.0));
+ m_light->setPosition(QVector3D(1.0f, 1.0f, 1.0f));
+ QCOMPARE(m_light->position(), QVector3D(1.0f, 1.0f, 1.0f));
}
QTEST_MAIN(tst_light)
diff --git a/tests/auto/cpptest/q3dscene/CMakeLists.txt b/tests/auto/cpptest/q3dscene/CMakeLists.txt
new file mode 100644
index 00000000..a7c25ff2
--- /dev/null
+++ b/tests/auto/cpptest/q3dscene/CMakeLists.txt
@@ -0,0 +1,13 @@
+# 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
+ LIBRARIES
+ Qt::Gui
+ Qt::GuiPrivate
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dscene/q3dscene.pro b/tests/auto/cpptest/q3dscene/q3dscene.pro
deleted file mode 100644
index b7a0110c..00000000
--- a/tests/auto/cpptest/q3dscene/q3dscene.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-include(../common/cpptestutil.pri)
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_scene.cpp
diff --git a/tests/auto/cpptest/q3dscene/tst_scene.cpp b/tests/auto/cpptest/q3dscene/tst_scene.cpp
index 2b450f64..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>
@@ -34,8 +8,6 @@
#include "cpptestutil.h"
-using namespace QtDataVisualization;
-
class tst_scene: public QObject
{
Q_OBJECT
diff --git a/tests/auto/cpptest/q3dsurface-heightproxy/CMakeLists.txt b/tests/auto/cpptest/q3dsurface-heightproxy/CMakeLists.txt
new file mode 100644
index 00000000..b7285b3a
--- /dev/null
+++ b/tests/auto/cpptest/q3dsurface-heightproxy/CMakeLists.txt
@@ -0,0 +1,21 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(q3dsurface-heightproxy_datavis
+ SOURCES
+ tst_proxy.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::DataVisualization
+)
+
+set(q3dsurface-heightproxy_resource_files
+ "customtexture.jpg"
+)
+
+qt_internal_add_resource(q3dsurface-heightproxy_datavis "q3dsurface-heightproxy"
+ PREFIX
+ "/"
+ FILES
+ ${q3dsurface-heightproxy_resource_files}
+)
diff --git a/tests/auto/cpptest/q3dsurface-heightproxy/q3dsurface-heightproxy.pro b/tests/auto/cpptest/q3dsurface-heightproxy/q3dsurface-heightproxy.pro
deleted file mode 100644
index 56a964d0..00000000
--- a/tests/auto/cpptest/q3dsurface-heightproxy/q3dsurface-heightproxy.pro
+++ /dev/null
@@ -1,11 +0,0 @@
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_proxy.cpp
-
-RESOURCES += \
- q3dsurface-heightproxy.qrc
diff --git a/tests/auto/cpptest/q3dsurface-heightproxy/q3dsurface-heightproxy.qrc b/tests/auto/cpptest/q3dsurface-heightproxy/q3dsurface-heightproxy.qrc
deleted file mode 100644
index b83c7ef9..00000000
--- a/tests/auto/cpptest/q3dsurface-heightproxy/q3dsurface-heightproxy.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<RCC>
- <qresource prefix="/">
- <file>customtexture.jpg</file>
- </qresource>
-</RCC>
diff --git a/tests/auto/cpptest/q3dsurface-heightproxy/tst_proxy.cpp b/tests/auto/cpptest/q3dsurface-heightproxy/tst_proxy.cpp
index e031688c..2d28398a 100644
--- a/tests/auto/cpptest/q3dsurface-heightproxy/tst_proxy.cpp
+++ b/tests/auto/cpptest/q3dsurface-heightproxy/tst_proxy.cpp
@@ -1,38 +1,10 @@
-/****************************************************************************
-**
-** 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>
#include <QtDataVisualization/QHeightMapSurfaceDataProxy>
-using namespace QtDataVisualization;
-
class tst_proxy: public QObject
{
Q_OBJECT
@@ -80,6 +52,7 @@ void tst_proxy::construct()
QImage image(QSize(10, 10), QImage::Format_ARGB32);
image.fill(0);
proxy = new QHeightMapSurfaceDataProxy(image);
+ QCoreApplication::processEvents();
QVERIFY(proxy);
QCoreApplication::processEvents();
QCOMPARE(proxy->columnCount(), 10);
@@ -87,6 +60,7 @@ void tst_proxy::construct()
delete proxy;
proxy = new QHeightMapSurfaceDataProxy(":/customtexture.jpg");
+ QCoreApplication::processEvents();
QVERIFY(proxy);
QCoreApplication::processEvents();
QCOMPARE(proxy->columnCount(), 24);
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
new file mode 100644
index 00000000..4b42431a
--- /dev/null
+++ b/tests/auto/cpptest/q3dsurface-modelproxy/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_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/q3dsurface-modelproxy.pro b/tests/auto/cpptest/q3dsurface-modelproxy/q3dsurface-modelproxy.pro
deleted file mode 100644
index ad1fe0cc..00000000
--- a/tests/auto/cpptest/q3dsurface-modelproxy/q3dsurface-modelproxy.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-include(../common/cpptestutil.pri)
-QT += testlib datavisualization widgets
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_proxy.cpp
diff --git a/tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp b/tests/auto/cpptest/q3dsurface-modelproxy/tst_proxy.cpp
index eb984c1a..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>
@@ -35,8 +9,6 @@
#include "cpptestutil.h"
-using namespace QtDataVisualization;
-
class tst_proxy: public QObject
{
Q_OBJECT
@@ -96,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");
@@ -107,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");
@@ -118,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",
@@ -130,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",
@@ -142,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;
}
@@ -155,23 +127,23 @@ void tst_proxy::initialProperties()
QCOMPARE(m_proxy->autoRowCategories(), true);
QCOMPARE(m_proxy->columnCategories(), QStringList());
QCOMPARE(m_proxy->columnRole(), QString());
- QCOMPARE(m_proxy->columnRolePattern(), QRegExp());
+ QCOMPARE(m_proxy->columnRolePattern(), QRegularExpression());
QCOMPARE(m_proxy->columnRoleReplace(), QString());
QVERIFY(!m_proxy->itemModel());
QCOMPARE(m_proxy->multiMatchBehavior(), QItemModelSurfaceDataProxy::MMBLast);
QCOMPARE(m_proxy->rowCategories(), QStringList());
QCOMPARE(m_proxy->rowRole(), QString());
- QCOMPARE(m_proxy->rowRolePattern(), QRegExp());
+ QCOMPARE(m_proxy->rowRolePattern(), QRegularExpression());
QCOMPARE(m_proxy->rowRoleReplace(), QString());
QCOMPARE(m_proxy->useModelCategories(), false);
QCOMPARE(m_proxy->xPosRole(), QString());
- QCOMPARE(m_proxy->xPosRolePattern(), QRegExp());
+ QCOMPARE(m_proxy->xPosRolePattern(), QRegularExpression());
QCOMPARE(m_proxy->xPosRoleReplace(), QString());
QCOMPARE(m_proxy->yPosRole(), QString());
- QCOMPARE(m_proxy->yPosRolePattern(), QRegExp());
+ QCOMPARE(m_proxy->yPosRolePattern(), QRegularExpression());
QCOMPARE(m_proxy->yPosRoleReplace(), QString());
QCOMPARE(m_proxy->zPosRole(), QString());
- QCOMPARE(m_proxy->zPosRolePattern(), QRegExp());
+ QCOMPARE(m_proxy->zPosRolePattern(), QRegularExpression());
QCOMPARE(m_proxy->zPosRoleReplace(), QString());
QCOMPARE(m_proxy->columnCount(), 0);
@@ -191,46 +163,46 @@ void tst_proxy::initializeProperties()
m_proxy->setAutoRowCategories(false);
m_proxy->setColumnCategories(QStringList() << "col1" << "col2");
m_proxy->setColumnRole("column");
- m_proxy->setColumnRolePattern(QRegExp("/^.*-(\\d\\d)$/"));
+ m_proxy->setColumnRolePattern(QRegularExpression("/^.*-(\\d\\d)$/"));
m_proxy->setColumnRoleReplace("\\\\1");
m_proxy->setItemModel(table.model());
m_proxy->setMultiMatchBehavior(QItemModelSurfaceDataProxy::MMBAverage);
m_proxy->setRowCategories(QStringList() << "row1" << "row2");
m_proxy->setRowRole("row");
- m_proxy->setRowRolePattern(QRegExp("/^(\\d\\d\\d\\d).*$/"));
+ m_proxy->setRowRolePattern(QRegularExpression("/^(\\d\\d\\d\\d).*$/"));
m_proxy->setRowRoleReplace("\\\\1");
m_proxy->setUseModelCategories(true);
m_proxy->setXPosRole("X");
- m_proxy->setXPosRolePattern(QRegExp("/-/"));
+ m_proxy->setXPosRolePattern(QRegularExpression("/-/"));
m_proxy->setXPosRoleReplace("\\\\1");
m_proxy->setYPosRole("Y");
- m_proxy->setYPosRolePattern(QRegExp("/-/"));
+ m_proxy->setYPosRolePattern(QRegularExpression("/-/"));
m_proxy->setYPosRoleReplace("\\\\1");
m_proxy->setZPosRole("Z");
- m_proxy->setZPosRolePattern(QRegExp("/-/"));
+ m_proxy->setZPosRolePattern(QRegularExpression("/-/"));
m_proxy->setZPosRoleReplace("\\\\1");
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(), QRegExp("/^.*-(\\d\\d)$/"));
+ 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(), QRegExp("/^(\\d\\d\\d\\d).*$/"));
+ QCOMPARE(m_proxy->rowRolePattern(), QRegularExpression("/^(\\d\\d\\d\\d).*$/"));
QCOMPARE(m_proxy->rowRoleReplace(), QString("\\\\1"));
QCOMPARE(m_proxy->useModelCategories(), true);
QCOMPARE(m_proxy->xPosRole(), QString("X"));
- QCOMPARE(m_proxy->xPosRolePattern(), QRegExp("/-/"));
+ QCOMPARE(m_proxy->xPosRolePattern(), QRegularExpression("/-/"));
QCOMPARE(m_proxy->xPosRoleReplace(), QString("\\\\1"));
QCOMPARE(m_proxy->yPosRole(), QString("Y"));
- QCOMPARE(m_proxy->yPosRolePattern(), QRegExp("/-/"));
+ QCOMPARE(m_proxy->yPosRolePattern(), QRegularExpression("/-/"));
QCOMPARE(m_proxy->yPosRoleReplace(), QString("\\\\1"));
QCOMPARE(m_proxy->zPosRole(), QString("Z"));
- QCOMPARE(m_proxy->zPosRolePattern(), QRegExp("/-/"));
+ QCOMPARE(m_proxy->zPosRolePattern(), QRegularExpression("/-/"));
QCOMPARE(m_proxy->zPosRoleReplace(), QString("\\\\1"));
}
@@ -264,12 +236,13 @@ void tst_proxy::multiMatch()
m_proxy->setItemModel(table.model());
m_proxy->setRowRole(table.model()->roleNames().value(Qt::DisplayRole));
m_proxy->setColumnRole(table.model()->roleNames().value(Qt::DisplayRole));
- m_proxy->setRowRolePattern(QRegExp(QStringLiteral("^(\\d*)\\/(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$")));
+ m_proxy->setRowRolePattern(QRegularExpression(QStringLiteral("^(\\d*)\\/(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$")));
m_proxy->setRowRoleReplace(QStringLiteral("\\2"));
- m_proxy->setYPosRolePattern(QRegExp(QStringLiteral("^\\d*(\\/)(\\d*)\\/(\\d*[\\.\\,]?\\d*)\\/\\d*[\\.\\,]?\\d*$")));
+ m_proxy->setYPosRolePattern(QRegularExpression(QStringLiteral("^\\d*(\\/)(\\d*)\\/(\\d*[\\.\\,]?\\d*)\\/\\d*[\\.\\,]?\\d*$")));
m_proxy->setYPosRoleReplace(QStringLiteral("\\3"));
- m_proxy->setColumnRolePattern(QRegExp(QStringLiteral("^(\\d*)(\\/)(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$")));
+ m_proxy->setColumnRolePattern(QRegularExpression(QStringLiteral("^(\\d*)(\\/)(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$")));
m_proxy->setColumnRoleReplace(QStringLiteral("\\1"));
+ QCoreApplication::processEvents();
QSurface3DSeries *series = new QSurface3DSeries(m_proxy);
diff --git a/tests/auto/cpptest/q3dsurface-proxy/CMakeLists.txt b/tests/auto/cpptest/q3dsurface-proxy/CMakeLists.txt
new file mode 100644
index 00000000..5553d635
--- /dev/null
+++ b/tests/auto/cpptest/q3dsurface-proxy/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(q3dsurface-proxy_datavis
+ SOURCES
+ tst_proxy.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dsurface-proxy/q3dsurface-proxy.pro b/tests/auto/cpptest/q3dsurface-proxy/q3dsurface-proxy.pro
deleted file mode 100644
index b0b5d361..00000000
--- a/tests/auto/cpptest/q3dsurface-proxy/q3dsurface-proxy.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_proxy.cpp
diff --git a/tests/auto/cpptest/q3dsurface-proxy/tst_proxy.cpp b/tests/auto/cpptest/q3dsurface-proxy/tst_proxy.cpp
index cda6bcce..bc5d9edc 100644
--- a/tests/auto/cpptest/q3dsurface-proxy/tst_proxy.cpp
+++ b/tests/auto/cpptest/q3dsurface-proxy/tst_proxy.cpp
@@ -1,38 +1,10 @@
-/****************************************************************************
-**
-** 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>
#include <QtDataVisualization/QSurfaceDataProxy>
-using namespace QtDataVisualization;
-
class tst_proxy: public QObject
{
Q_OBJECT
@@ -47,6 +19,7 @@ private slots:
void initialProperties();
void initializeProperties();
+ void initialRow();
private:
QSurfaceDataProxy *m_proxy;
@@ -105,5 +78,14 @@ void tst_proxy::initializeProperties()
QCOMPARE(m_proxy->rowCount(), 2);
}
+void tst_proxy::initialRow()
+{
+ QSurfaceDataProxy proxy;
+ QSurfaceDataRow row{QSurfaceDataItem{QVector3D{0, 0, 0}},
+ QSurfaceDataItem{QVector3D{1, 1, 1}}};
+ proxy.addRow(new QSurfaceDataRow(row));
+ proxy.addRow(new QSurfaceDataRow(row));
+}
+
QTEST_MAIN(tst_proxy)
#include "tst_proxy.moc"
diff --git a/tests/auto/cpptest/q3dsurface-series/CMakeLists.txt b/tests/auto/cpptest/q3dsurface-series/CMakeLists.txt
new file mode 100644
index 00000000..283829bd
--- /dev/null
+++ b/tests/auto/cpptest/q3dsurface-series/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(q3dsurface-series_datavis
+ SOURCES
+ tst_series.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dsurface-series/q3dsurface-series.pro b/tests/auto/cpptest/q3dsurface-series/q3dsurface-series.pro
deleted file mode 100644
index 481653ef..00000000
--- a/tests/auto/cpptest/q3dsurface-series/q3dsurface-series.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_series.cpp
diff --git a/tests/auto/cpptest/q3dsurface-series/tst_series.cpp b/tests/auto/cpptest/q3dsurface-series/tst_series.cpp
index 97119f63..59befddc 100644
--- a/tests/auto/cpptest/q3dsurface-series/tst_series.cpp
+++ b/tests/auto/cpptest/q3dsurface-series/tst_series.cpp
@@ -1,38 +1,10 @@
-/****************************************************************************
-**
-** 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>
#include <QtDataVisualization/QSurface3DSeries>
-using namespace QtDataVisualization;
-
class tst_series: public QObject
{
Q_OBJECT
@@ -94,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);
@@ -109,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
new file mode 100644
index 00000000..71f78da8
--- /dev/null
+++ b/tests/auto/cpptest/q3dsurface/CMakeLists.txt
@@ -0,0 +1,13 @@
+# 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
+ LIBRARIES
+ Qt::Gui
+ Qt::GuiPrivate
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dsurface/q3dsurface.pro b/tests/auto/cpptest/q3dsurface/q3dsurface.pro
deleted file mode 100644
index 9ed3c7f5..00000000
--- a/tests/auto/cpptest/q3dsurface/q3dsurface.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-include(../common/cpptestutil.pri)
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_surface.cpp
diff --git a/tests/auto/cpptest/q3dsurface/tst_surface.cpp b/tests/auto/cpptest/q3dsurface/tst_surface.cpp
index 04fe5d21..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>
@@ -33,8 +7,6 @@
#include "cpptestutil.h"
-using namespace QtDataVisualization;
-
class tst_surface: public QObject
{
Q_OBJECT
@@ -56,6 +28,7 @@ private slots:
void selectSeries();
void removeSeries();
void removeMultipleSeries();
+ void hasSeries();
private:
Q3DSurface *m_graph;
@@ -110,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);
@@ -185,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"));
}
@@ -195,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());
}
@@ -209,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()
@@ -219,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();
@@ -232,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;
}
@@ -251,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
new file mode 100644
index 00000000..0b59ed6e
--- /dev/null
+++ b/tests/auto/cpptest/q3dtheme/CMakeLists.txt
@@ -0,0 +1,10 @@
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
+
+qt_internal_add_test(q3dtheme_datavis
+ SOURCES
+ tst_theme.cpp
+ LIBRARIES
+ Qt::Gui
+ Qt::DataVisualization
+)
diff --git a/tests/auto/cpptest/q3dtheme/q3dtheme.pro b/tests/auto/cpptest/q3dtheme/q3dtheme.pro
deleted file mode 100644
index 30a4802c..00000000
--- a/tests/auto/cpptest/q3dtheme/q3dtheme.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-QT += testlib datavisualization
-
-TARGET = tst_cpptest
-CONFIG += console testcase
-
-TEMPLATE = app
-
-SOURCES += tst_theme.cpp
diff --git a/tests/auto/cpptest/q3dtheme/tst_theme.cpp b/tests/auto/cpptest/q3dtheme/tst_theme.cpp
index 63635b48..24503d95 100644
--- a/tests/auto/cpptest/q3dtheme/tst_theme.cpp
+++ b/tests/auto/cpptest/q3dtheme/tst_theme.cpp
@@ -1,38 +1,10 @@
-/****************************************************************************
-**
-** 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>
#include <QtDataVisualization/Q3DTheme>
-using namespace QtDataVisualization;
-
class tst_theme: public QObject
{
Q_OBJECT
@@ -82,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);
@@ -115,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);
@@ -180,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);