diff options
Diffstat (limited to 'tests/auto/qmltest')
30 files changed, 221 insertions, 923 deletions
diff --git a/tests/auto/qmltest/CMakeLists.txt b/tests/auto/qmltest/CMakeLists.txt index 8ab433b4..3f891438 100644 --- a/tests/auto/qmltest/CMakeLists.txt +++ b/tests/auto/qmltest/CMakeLists.txt @@ -1,9 +1,18 @@ -qt_internal_add_test(tst_qmltest +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause + +file(GLOB_RECURSE test_data_glob + RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} + *) +list(APPEND test_data ${test_data_glob}) + +qt_internal_add_test(tst_qmltest_datavis QMLTEST SOURCES tst_qmltest.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui + TESTDATA ${test_data} ) set(qmltest_resource_files @@ -11,7 +20,7 @@ set(qmltest_resource_files "customtexture.jpg" ) -qt_internal_add_resource(tst_qmltest "qmltest" +qt_internal_add_resource(tst_qmltest_datavis "qmltest" PREFIX "/" FILES diff --git a/tests/auto/qmltest/axis3d/tst_category.qml b/tests/auto/qmltest/axis3d/tst_category.qml index 0792ad8f..7400177e 100644 --- a/tests/auto/qmltest/axis3d/tst_category.qml +++ b/tests/auto/qmltest/axis3d/tst_category.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 diff --git a/tests/auto/qmltest/axis3d/tst_logvalue.qml b/tests/auto/qmltest/axis3d/tst_logvalue.qml index d92f98d7..323bc194 100644 --- a/tests/auto/qmltest/axis3d/tst_logvalue.qml +++ b/tests/auto/qmltest/axis3d/tst_logvalue.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 diff --git a/tests/auto/qmltest/axis3d/tst_value.qml b/tests/auto/qmltest/axis3d/tst_value.qml index 6e15cb85..d284a874 100644 --- a/tests/auto/qmltest/axis3d/tst_value.qml +++ b/tests/auto/qmltest/axis3d/tst_value.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 diff --git a/tests/auto/qmltest/bars3d/tst_bars.qml b/tests/auto/qmltest/bars3d/tst_bars.qml index 80c1d9e4..03638501 100644 --- a/tests/auto/qmltest/bars3d/tst_bars.qml +++ b/tests/auto/qmltest/bars3d/tst_bars.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization @@ -40,7 +14,7 @@ Item { function constructBars() { bars3d = Qt.createQmlObject(" - import QtQuick 2.2 + import QtQuick import QtDataVisualization Bars3D { anchors.fill: parent @@ -111,7 +85,7 @@ Item { function constructBarsWithCustomItemList() { bars3d = Qt.createQmlObject(" - import QtQuick 2.2 + import QtQuick import QtDataVisualization Bars3D { anchors.fill: parent diff --git a/tests/auto/qmltest/bars3d/tst_barseries.qml b/tests/auto/qmltest/bars3d/tst_barseries.qml index 77dd0895..7ee38d29 100644 --- a/tests/auto/qmltest/bars3d/tst_barseries.qml +++ b/tests/auto/qmltest/bars3d/tst_barseries.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization diff --git a/tests/auto/qmltest/bars3d/tst_basic.qml b/tests/auto/qmltest/bars3d/tst_basic.qml index ea303356..881d629e 100644 --- a/tests/auto/qmltest/bars3d/tst_basic.qml +++ b/tests/auto/qmltest/bars3d/tst_basic.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization @@ -43,7 +17,7 @@ Item { function constructEmpty() { empty = Qt.createQmlObject(" - import QtQuick 2.2 + import QtQuick import QtDataVisualization Bars3D { }", top) @@ -51,7 +25,7 @@ Item { function constructBasic() { basic = Qt.createQmlObject(" - import QtQuick 2.2 + import QtQuick import QtDataVisualization Bars3D { anchors.fill: parent @@ -69,7 +43,7 @@ Item { function constructCommon() { common = Qt.createQmlObject(" - import QtQuick 2.2 + import QtQuick import QtDataVisualization Bars3D { anchors.fill: parent @@ -79,7 +53,7 @@ Item { function constructCommonInit() { common_init = Qt.createQmlObject(" - import QtQuick 2.2 + import QtQuick import QtDataVisualization Bars3D { anchors.fill: parent @@ -127,8 +101,6 @@ Item { compare(empty.rowAxis.type, AbstractAxis3D.AxisTypeCategory) compare(empty.valueAxis.type, AbstractAxis3D.AxisTypeValue) waitForRendering(top) - empty.destroy() - waitForRendering(top) } } @@ -173,8 +145,6 @@ Item { compare(basic.barSpacing, Qt.size(-1.0, -1.0), "barSpacing") compare(basic.barSeriesMargin, Qt.size(-1.0, -1.0), "barSeriesMargin") waitForRendering(top) - basic.destroy() - waitForRendering(top) } } @@ -183,13 +153,16 @@ Item { when: windowShown function test_1_common() { + if (Qt.platform.os === "android") + return; + constructCommon() + if (common.shadowsSupported === false) + return; + compare(common.selectionMode, AbstractGraph3D.SelectionItem, "selectionMode") compare(common.shadowQuality, AbstractGraph3D.ShadowQualityMedium, "shadowQuality") - if (common.shadowsSupported === true) - compare(common.msaaSamples, 4, "msaaSamples") - else - compare(common.msaaSamples, 0, "msaaSamples") + compare(common.msaaSamples, 4, "msaaSamples") compare(common.theme.type, Theme3D.ThemeQt, "theme") compare(common.renderingMode, AbstractGraph3D.RenderIndirect, "renderingMode") compare(common.measureFps, false, "measureFps") @@ -210,14 +183,14 @@ Item { } function test_2_change_common() { + if (Qt.platform.os === "android" || common.shadowsSupported === false) + return; + common.selectionMode = AbstractGraph3D.SelectionItem | AbstractGraph3D.SelectionRow | AbstractGraph3D.SelectionSlice common.shadowQuality = AbstractGraph3D.ShadowQualitySoftHigh - compare(common.shadowQuality, AbstractGraph3D.ShadowQualitySoftHigh, "shadowQuality") common.msaaSamples = 8 - if (common.shadowsSupported === true) - compare(common.msaaSamples, 8, "msaaSamples") - else - compare(common.msaaSamples, 0, "msaaSamples") + compare(common.shadowQuality, AbstractGraph3D.ShadowQualitySoftHigh, "shadowQuality") + compare(common.msaaSamples, 8, "msaaSamples") common.theme.type = Theme3D.ThemeRetro common.renderingMode = AbstractGraph3D.RenderDirectToBackground_NoClear common.measureFps = true @@ -251,6 +224,9 @@ Item { } function test_3_change_invalid_common() { + if (Qt.platform.os === "android" || common.shadowsSupported === false) + return; + common.selectionMode = AbstractGraph3D.SelectionRow | AbstractGraph3D.SelectionColumn | AbstractGraph3D.SelectionSlice common.theme.type = -2 common.renderingMode = -1 @@ -262,28 +238,30 @@ Item { common.reflection = false common.reflectivity = -1.0 compare(common.selectionMode, AbstractGraph3D.SelectionItem | AbstractGraph3D.SelectionRow | AbstractGraph3D.SelectionSlice, "selectionMode") - compare(common.theme.type, -2/*Theme3D.ThemeRetro*/, "theme") // TODO: Fix once QTRD-3367 is done - compare(common.renderingMode, -1/*AbstractGraph3D.RenderDirectToBackground_NoClear*/, "renderingMode") // TODO: Fix once QTRD-3367 is done - compare(common.aspectRatio, -1.0/*1.0*/, "aspectRatio") // TODO: Fix once QTRD-3367 is done - compare(common.horizontalAspectRatio, -2/*1*/, "horizontalAspectRatio") // TODO: Fix once QTRD-3367 is done - compare(common.reflectivity, -1.0/*1.0*/, "reflectivity") // TODO: Fix once QTRD-3367 is done - - waitForRendering(top) - common.destroy() + compare(common.theme.type, Theme3D.ThemeRetro, "theme") + compare(common.renderingMode, AbstractGraph3D.RenderDirectToBackground_NoClear, "renderingMode") + compare(common.aspectRatio, 1.0, "aspectRatio") + compare(common.horizontalAspectRatio, 1.0, "horizontalAspectRatio") + compare(common.reflectivity, 1.0, "reflectivity") waitForRendering(top) } + } + + TestCase { + name: "Bars3D Common Initialized" + when: windowShown + + function test_1_common_initialized() { + if (Qt.platform.os === "android") + return; - function test_4_common_initialized() { constructCommonInit() + if (common_init.shadowsSupported === false) // This test is flaky on VM, use shadowsSupported to detect being run in VM + return; compare(common_init.selectionMode, AbstractGraph3D.SelectionNone, "selectionMode") - if (common_init.shadowsSupported === true) { - tryCompare(common_init, "shadowQuality", AbstractGraph3D.ShadowQualityLow) - compare(common_init.msaaSamples, 2, "msaaSamples") - } else { - tryCompare(common_init, "shadowQuality", AbstractGraph3D.ShadowQualityNone) - compare(common_init.msaaSamples, 0, "msaaSamples") - } + tryCompare(common_init, "shadowQuality", AbstractGraph3D.ShadowQualityLow) + compare(common_init.msaaSamples, 2, "msaaSamples") compare(common_init.theme.type, Theme3D.ThemeUserDefined, "theme") compare(common_init.renderingMode, AbstractGraph3D.RenderIndirect, "renderingMode") compare(common_init.measureFps, true, "measureFps") @@ -298,9 +276,6 @@ Item { compare(common_init.reflectivity, 0.1, "reflectivity") compare(common_init.locale, Qt.locale("UK"), "locale") compare(common_init.margin, 0.2, "margin") - - waitForRendering(top) - common_init.destroy(); waitForRendering(top) } } diff --git a/tests/auto/qmltest/bars3d/tst_proxy.qml b/tests/auto/qmltest/bars3d/tst_proxy.qml index 428000ac..bd337017 100644 --- a/tests/auto/qmltest/bars3d/tst_proxy.qml +++ b/tests/auto/qmltest/bars3d/tst_proxy.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization diff --git a/tests/auto/qmltest/custom3d/tst_customitem.qml b/tests/auto/qmltest/custom3d/tst_customitem.qml index 862aa67a..eebfaac1 100644 --- a/tests/auto/qmltest/custom3d/tst_customitem.qml +++ b/tests/auto/qmltest/custom3d/tst_customitem.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 diff --git a/tests/auto/qmltest/custom3d/tst_customlabel.qml b/tests/auto/qmltest/custom3d/tst_customlabel.qml index f4094efd..28f062ab 100644 --- a/tests/auto/qmltest/custom3d/tst_customlabel.qml +++ b/tests/auto/qmltest/custom3d/tst_customlabel.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 diff --git a/tests/auto/qmltest/custom3d/tst_customvolume.qml b/tests/auto/qmltest/custom3d/tst_customvolume.qml index aa97a7e2..21630394 100644 --- a/tests/auto/qmltest/custom3d/tst_customvolume.qml +++ b/tests/auto/qmltest/custom3d/tst_customvolume.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 diff --git a/tests/auto/qmltest/input3d/tst_input.qml b/tests/auto/qmltest/input3d/tst_input.qml index 44b06b65..a2904c53 100644 --- a/tests/auto/qmltest/input3d/tst_input.qml +++ b/tests/auto/qmltest/input3d/tst_input.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 diff --git a/tests/auto/qmltest/input3d/tst_touch.qml b/tests/auto/qmltest/input3d/tst_touch.qml index 13af8afd..047abb97 100644 --- a/tests/auto/qmltest/input3d/tst_touch.qml +++ b/tests/auto/qmltest/input3d/tst_touch.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 diff --git a/tests/auto/qmltest/qmltest.qrc b/tests/auto/qmltest/qmltest.qrc deleted file mode 100644 index 61f19086..00000000 --- a/tests/auto/qmltest/qmltest.qrc +++ /dev/null @@ -1,6 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>customitem.obj</file> - <file>customtexture.jpg</file> - </qresource> -</RCC> diff --git a/tests/auto/qmltest/scatter3d/tst_basic.qml b/tests/auto/qmltest/scatter3d/tst_basic.qml index a5f20d01..7320ac49 100644 --- a/tests/auto/qmltest/scatter3d/tst_basic.qml +++ b/tests/auto/qmltest/scatter3d/tst_basic.qml @@ -1,34 +1,8 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 -import QtDataVisualization 1.2 +import QtDataVisualization import QtTest 1.0 Item { @@ -43,16 +17,16 @@ Item { function constructEmpty() { empty = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Scatter3D { }", top) } function constructBasic() { basic = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Scatter3D { anchors.fill: parent }", top) @@ -61,8 +35,8 @@ Item { function constructCommon() { common = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Scatter3D { anchors.fill: parent }", top) @@ -71,8 +45,8 @@ Item { function constructCommonInit() { common_init = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Scatter3D { anchors.fill: parent selectionMode: AbstractGraph3D.SelectionNone @@ -112,8 +86,6 @@ Item { compare(empty.axisZ.type, AbstractAxis3D.AxisTypeValue) compare(empty.axisY.type, AbstractAxis3D.AxisTypeValue) waitForRendering(top) - empty.destroy() - waitForRendering(top) } } @@ -126,8 +98,6 @@ Item { compare(basic.width, 150, "width") compare(basic.height, 150, "height") waitForRendering(top) - basic.destroy() - waitForRendering(top) } } @@ -136,13 +106,16 @@ Item { when: windowShown function test_1_common() { + if (Qt.platform.os === "android") + return; + constructCommon() + if (common.shadowsSupported === false) + return; + compare(common.selectionMode, AbstractGraph3D.SelectionItem, "selectionMode") compare(common.shadowQuality, AbstractGraph3D.ShadowQualityMedium, "shadowQuality") - if (common.shadowsSupported === true) - compare(common.msaaSamples, 4, "msaaSamples") - else - compare(common.msaaSamples, 0, "msaaSamples") + compare(common.msaaSamples, 4, "msaaSamples") compare(common.theme.type, Theme3D.ThemeQt, "theme") compare(common.renderingMode, AbstractGraph3D.RenderIndirect, "renderingMode") compare(common.measureFps, false, "measureFps") @@ -163,14 +136,14 @@ Item { } function test_2_change_common() { + if (Qt.platform.os === "android" || common.shadowsSupported === false) + return; + common.selectionMode = AbstractGraph3D.SelectionNone common.shadowQuality = AbstractGraph3D.ShadowQualitySoftHigh - compare(common.shadowQuality, AbstractGraph3D.ShadowQualitySoftHigh, "shadowQuality") common.msaaSamples = 8 - if (common.shadowsSupported === true) - compare(common.msaaSamples, 8, "msaaSamples") - else - compare(common.msaaSamples, 0, "msaaSamples") + compare(common.shadowQuality, AbstractGraph3D.ShadowQualitySoftHigh, "shadowQuality") + compare(common.msaaSamples, 8, "msaaSamples") common.theme.type = Theme3D.ThemeRetro common.renderingMode = AbstractGraph3D.RenderDirectToBackground_NoClear common.measureFps = true @@ -204,6 +177,9 @@ Item { } function test_3_change_invalid_common() { + if (Qt.platform.os === "android" || common.shadowsSupported === false) + return; + common.selectionMode = AbstractGraph3D.SelectionRow | AbstractGraph3D.SelectionColumn | AbstractGraph3D.SelectionSlice common.theme.type = -2 common.renderingMode = -1 @@ -215,28 +191,30 @@ Item { common.reflection = false common.reflectivity = -1.0 compare(common.selectionMode, AbstractGraph3D.SelectionNone, "selectionMode") - compare(common.theme.type, -2/*Theme3D.ThemeRetro*/, "theme") // TODO: Fix once QTRD-3367 is done - compare(common.renderingMode, -1/*AbstractGraph3D.RenderDirectToBackground_NoClear*/, "renderingMode") // TODO: Fix once QTRD-3367 is done - compare(common.aspectRatio, -1.0/*1.0*/, "aspectRatio") // TODO: Fix once QTRD-3367 is done - compare(common.horizontalAspectRatio, -2/*1*/, "horizontalAspectRatio") // TODO: Fix once QTRD-3367 is done - compare(common.reflectivity, -1.0/*1.0*/, "reflectivity") // TODO: Fix once QTRD-3367 is done - - waitForRendering(top) - common.destroy() + compare(common.theme.type, Theme3D.ThemeRetro, "theme") + compare(common.renderingMode, AbstractGraph3D.RenderDirectToBackground_NoClear, "renderingMode") + compare(common.aspectRatio, 1.0, "aspectRatio") + compare(common.horizontalAspectRatio, 1.0, "horizontalAspectRatio") + compare(common.reflectivity, 1.0, "reflectivity") waitForRendering(top) - } + } + } + + TestCase { + name: "Scatter3D Common Initialized" + when: windowShown + + function test_1_common_initialized() { + if (Qt.platform.os === "android") + return; - function test_4_common_initialized() { constructCommonInit() + if (common_init.shadowsSupported === false) + return; compare(common_init.selectionMode, AbstractGraph3D.SelectionNone, "selectionMode") - if (common_init.shadowsSupported === true) { - tryCompare(common_init, "shadowQuality", AbstractGraph3D.ShadowQualityLow) - compare(common_init.msaaSamples, 2, "msaaSamples") - } else { - tryCompare(common_init, "shadowQuality", AbstractGraph3D.ShadowQualityNone) - compare(common_init.msaaSamples, 0, "msaaSamples") - } + tryCompare(common_init, "shadowQuality", AbstractGraph3D.ShadowQualityLow) + compare(common_init.msaaSamples, 2, "msaaSamples") compare(common_init.theme.type, Theme3D.ThemeUserDefined, "theme") compare(common_init.renderingMode, AbstractGraph3D.RenderIndirect, "renderingMode") compare(common_init.measureFps, true, "measureFps") @@ -251,9 +229,6 @@ Item { compare(common_init.reflectivity, 0.1, "reflectivity") compare(common_init.locale, Qt.locale("UK"), "locale") compare(common_init.margin, 0.2, "margin") - - waitForRendering(top) - common_init.destroy(); waitForRendering(top) } } diff --git a/tests/auto/qmltest/scatter3d/tst_proxy.qml b/tests/auto/qmltest/scatter3d/tst_proxy.qml index bd8c0c74..c970b82a 100644 --- a/tests/auto/qmltest/scatter3d/tst_proxy.qml +++ b/tests/auto/qmltest/scatter3d/tst_proxy.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 diff --git a/tests/auto/qmltest/scatter3d/tst_scatter.qml b/tests/auto/qmltest/scatter3d/tst_scatter.qml index d871f891..c8c8f93a 100644 --- a/tests/auto/qmltest/scatter3d/tst_scatter.qml +++ b/tests/auto/qmltest/scatter3d/tst_scatter.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization diff --git a/tests/auto/qmltest/scatter3d/tst_scatterseries.qml b/tests/auto/qmltest/scatter3d/tst_scatterseries.qml index 7d84e83c..9e6cc80e 100644 --- a/tests/auto/qmltest/scatter3d/tst_scatterseries.qml +++ b/tests/auto/qmltest/scatter3d/tst_scatterseries.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 diff --git a/tests/auto/qmltest/scene3d/tst_camera.qml b/tests/auto/qmltest/scene3d/tst_camera.qml index 96418ae3..c6aa446a 100644 --- a/tests/auto/qmltest/scene3d/tst_camera.qml +++ b/tests/auto/qmltest/scene3d/tst_camera.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 diff --git a/tests/auto/qmltest/scene3d/tst_light.qml b/tests/auto/qmltest/scene3d/tst_light.qml index 68602316..faf3bce2 100644 --- a/tests/auto/qmltest/scene3d/tst_light.qml +++ b/tests/auto/qmltest/scene3d/tst_light.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.3 diff --git a/tests/auto/qmltest/scene3d/tst_scene.qml b/tests/auto/qmltest/scene3d/tst_scene.qml index 08a55662..b9f84202 100644 --- a/tests/auto/qmltest/scene3d/tst_scene.qml +++ b/tests/auto/qmltest/scene3d/tst_scene.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 @@ -44,7 +18,7 @@ Item { Bars3D { id: initialized scene.activeCamera: Camera3D { zoomLevel: 200 } - scene.devicePixelRatio: 2.0 + scene.devicePixelRatio: 2 // Will work only if actual pixel ratio is 2.0 scene.graphPositionQuery: Qt.point(0, 0) scene.primarySubViewport: Qt.rect(0, 0, 50, 50) scene.secondarySubViewport: Qt.rect(50, 50, 100, 100) @@ -67,7 +41,7 @@ Item { function test_initial() { verify(initial.scene.activeCamera) verify(initial.scene.activeLight) - compare(initial.scene.devicePixelRatio, 1.0) + compare(initial.scene.devicePixelRatio, Screen.devicePixelRatio) compare(initial.scene.graphPositionQuery, Qt.point(-1, -1)) compare(initial.scene.invalidSelectionPoint, Qt.point(-1, -1)) compare(initial.scene.primarySubViewport.x, 0) @@ -93,7 +67,7 @@ Item { function test_initialized() { compare(initialized.scene.activeCamera.zoomLevel, 200) - compare(initialized.scene.devicePixelRatio, 2.0) + compare(initialized.scene.devicePixelRatio, Screen.devicePixelRatio) compare(initialized.scene.graphPositionQuery, Qt.point(0, 0)) compare(initialized.scene.primarySubViewport.x, 0) compare(initialized.scene.primarySubViewport.y, 0) diff --git a/tests/auto/qmltest/surface3d/tst_basic.qml b/tests/auto/qmltest/surface3d/tst_basic.qml index a0a0bd19..2979d6d5 100644 --- a/tests/auto/qmltest/surface3d/tst_basic.qml +++ b/tests/auto/qmltest/surface3d/tst_basic.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 @@ -43,16 +17,16 @@ Item { function constructEmpty() { empty = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Surface3D { }", top) } function constructBasic() { basic = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Surface3D { anchors.fill: parent flipHorizontalGrid: true @@ -62,8 +36,8 @@ Item { function constructCommon() { common = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Surface3D { anchors.fill: parent }", top) @@ -72,8 +46,8 @@ Item { function constructCommonInit() { common_init = Qt.createQmlObject(" - import QtQuick 2.2 - import QtDataVisualization 1.2 + import QtQuick + import QtDataVisualization Surface3D { anchors.fill: parent selectionMode: AbstractGraph3D.SelectionNone @@ -114,8 +88,6 @@ Item { compare(empty.axisZ.type, AbstractAxis3D.AxisTypeValue) compare(empty.axisY.type, AbstractAxis3D.AxisTypeValue) waitForRendering(top) - empty.destroy() - waitForRendering(top) } } @@ -134,8 +106,6 @@ Item { basic.flipHorizontalGrid = false compare(basic.flipHorizontalGrid, false, "flipHorizontalGrid") waitForRendering(top) - basic.destroy() - waitForRendering(top) } } @@ -144,13 +114,16 @@ Item { when: windowShown function test_1_common() { + if (Qt.platform.os === "android") + return; + constructCommon() + if (common.shadowsSupported === false) + return; + compare(common.selectionMode, AbstractGraph3D.SelectionItem, "selectionMode") compare(common.shadowQuality, AbstractGraph3D.ShadowQualityMedium, "shadowQuality") - if (common.shadowsSupported === true) - compare(common.msaaSamples, 4, "msaaSamples") - else - compare(common.msaaSamples, 0, "msaaSamples") + compare(common.msaaSamples, 4, "msaaSamples") compare(common.theme.type, Theme3D.ThemeQt, "theme") compare(common.renderingMode, AbstractGraph3D.RenderIndirect, "renderingMode") compare(common.measureFps, false, "measureFps") @@ -171,14 +144,14 @@ Item { } function test_2_change_common() { + if (Qt.platform.os === "android" || common.shadowsSupported === false) + return; + common.selectionMode = AbstractGraph3D.SelectionItem | AbstractGraph3D.SelectionRow | AbstractGraph3D.SelectionSlice common.shadowQuality = AbstractGraph3D.ShadowQualitySoftHigh - compare(common.shadowQuality, AbstractGraph3D.ShadowQualitySoftHigh, "shadowQuality") common.msaaSamples = 8 - if (common.shadowsSupported === true) - compare(common.msaaSamples, 8, "msaaSamples") - else - compare(common.msaaSamples, 0, "msaaSamples") + compare(common.shadowQuality, AbstractGraph3D.ShadowQualitySoftHigh, "shadowQuality") + compare(common.msaaSamples, 8, "msaaSamples") common.theme.type = Theme3D.ThemeRetro common.renderingMode = AbstractGraph3D.RenderDirectToBackground_NoClear common.measureFps = true @@ -212,6 +185,9 @@ Item { } function test_3_change_invalid_common() { + if (Qt.platform.os === "android" || common.shadowsSupported === false) + return; + common.selectionMode = AbstractGraph3D.SelectionRow | AbstractGraph3D.SelectionColumn | AbstractGraph3D.SelectionSlice common.theme.type = -2 common.renderingMode = -1 @@ -223,28 +199,30 @@ Item { common.reflection = false common.reflectivity = -1.0 compare(common.selectionMode, AbstractGraph3D.SelectionItem | AbstractGraph3D.SelectionRow | AbstractGraph3D.SelectionSlice, "selectionMode") - compare(common.theme.type, -2/*Theme3D.ThemeRetro*/, "theme") // TODO: Fix once QTRD-3367 is done - compare(common.renderingMode, -1/*AbstractGraph3D.RenderDirectToBackground_NoClear*/, "renderingMode") // TODO: Fix once QTRD-3367 is done - compare(common.aspectRatio, -1.0/*1.0*/, "aspectRatio") // TODO: Fix once QTRD-3367 is done - compare(common.horizontalAspectRatio, -2/*1*/, "horizontalAspectRatio") // TODO: Fix once QTRD-3367 is done - compare(common.reflectivity, -1.0/*1.0*/, "reflectivity") // TODO: Fix once QTRD-3367 is done - - waitForRendering(top) - common.destroy() + compare(common.theme.type, Theme3D.ThemeRetro, "theme") + compare(common.renderingMode, AbstractGraph3D.RenderDirectToBackground_NoClear, "renderingMode") + compare(common.aspectRatio, 1.0, "aspectRatio") + compare(common.horizontalAspectRatio, 1.0, "horizontalAspectRatio") + compare(common.reflectivity, 1.0, "reflectivity") waitForRendering(top) } + } + + TestCase { + name: "Surface3D Common Initialized" + when: windowShown + + function test_1_common_initialized() { + if (Qt.platform.os === "android") + return; - function test_4_common_initialized() { constructCommonInit() + if (common_init.shadowsSupported === false) + return; compare(common_init.selectionMode, AbstractGraph3D.SelectionNone, "selectionMode") - if (common_init.shadowsSupported === true) { - tryCompare(common_init, "shadowQuality", AbstractGraph3D.ShadowQualityLow) - compare(common_init.msaaSamples, 2, "msaaSamples") - } else { - tryCompare(common_init, "shadowQuality", AbstractGraph3D.ShadowQualityNone) - compare(common_init.msaaSamples, 0, "msaaSamples") - } + tryCompare(common_init, "shadowQuality", AbstractGraph3D.ShadowQualityLow) + compare(common_init.msaaSamples, 2, "msaaSamples") compare(common_init.theme.type, Theme3D.ThemeUserDefined, "theme") compare(common_init.renderingMode, AbstractGraph3D.RenderIndirect, "renderingMode") compare(common_init.measureFps, true, "measureFps") @@ -259,9 +237,6 @@ Item { compare(common_init.reflectivity, 0.1, "reflectivity") compare(common_init.locale, Qt.locale("UK"), "locale") compare(common_init.margin, 0.2, "margin") - - waitForRendering(top) - common_init.destroy(); waitForRendering(top) } } diff --git a/tests/auto/qmltest/surface3d/tst_heightproxy.qml b/tests/auto/qmltest/surface3d/tst_heightproxy.qml index f92d8198..c3c5b71d 100644 --- a/tests/auto/qmltest/surface3d/tst_heightproxy.qml +++ b/tests/auto/qmltest/surface3d/tst_heightproxy.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 diff --git a/tests/auto/qmltest/surface3d/tst_proxy.qml b/tests/auto/qmltest/surface3d/tst_proxy.qml index eddad5a2..57058f36 100644 --- a/tests/auto/qmltest/surface3d/tst_proxy.qml +++ b/tests/auto/qmltest/surface3d/tst_proxy.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 diff --git a/tests/auto/qmltest/surface3d/tst_surface.qml b/tests/auto/qmltest/surface3d/tst_surface.qml index e112295f..4c52d184 100644 --- a/tests/auto/qmltest/surface3d/tst_surface.qml +++ b/tests/auto/qmltest/surface3d/tst_surface.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization diff --git a/tests/auto/qmltest/surface3d/tst_surfaceseries.qml b/tests/auto/qmltest/surface3d/tst_surfaceseries.qml index e4707f60..7d681021 100644 --- a/tests/auto/qmltest/surface3d/tst_surfaceseries.qml +++ b/tests/auto/qmltest/surface3d/tst_surfaceseries.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization @@ -79,7 +53,7 @@ Item { flatShadingEnabled: false selectedPoint: Qt.point(0, 0) textureFile: ":\customtexture.jpg" - wireFrameColor: "red" + wireframeColor: "red" baseColor: "blue" baseGradient: gradient1 @@ -124,7 +98,7 @@ Item { compare(initial.flatShadingEnabled, true) compare(initial.flatShadingSupported, true) compare(initial.selectedPoint, Qt.point(-1, -1)) - compare(initial.wireFrameColor, "#000000") + compare(initial.wireframeColor, "#000000") } function test_2_initial_common() { @@ -158,7 +132,7 @@ Item { compare(initialized.flatShadingEnabled, false) compare(initialized.selectedPoint, Qt.point(0, 0)) compare(initialized.textureFile, ":\customtexture.jpg") - compare(initialized.wireFrameColor, "#ff0000") + compare(initialized.wireframeColor, "#ff0000") } function test_2_initialized_common() { @@ -190,7 +164,7 @@ Item { change.flatShadingEnabled = false change.selectedPoint = Qt.point(0, 0) change.textureFile = ":\customtexture.jpg" - change.wireFrameColor = "green" + change.wireframeColor = "green" } function test_2_test_change() { @@ -200,7 +174,7 @@ Item { compare(change.flatShadingEnabled, false) compare(change.selectedPoint, Qt.point(0, 0)) compare(change.textureFile, ":\customtexture.jpg") - compare(change.wireFrameColor, "#008000") + compare(change.wireframeColor, "#008000") } function test_3_change_common() { diff --git a/tests/auto/qmltest/theme3d/tst_colorgradient.qml b/tests/auto/qmltest/theme3d/tst_colorgradient.qml index e1a25400..6d2cdf35 100644 --- a/tests/auto/qmltest/theme3d/tst_colorgradient.qml +++ b/tests/auto/qmltest/theme3d/tst_colorgradient.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 diff --git a/tests/auto/qmltest/theme3d/tst_theme.qml b/tests/auto/qmltest/theme3d/tst_theme.qml index 880ff87b..3b44a5c8 100644 --- a/tests/auto/qmltest/theme3d/tst_theme.qml +++ b/tests/auto/qmltest/theme3d/tst_theme.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 diff --git a/tests/auto/qmltest/theme3d/tst_themecolor.qml b/tests/auto/qmltest/theme3d/tst_themecolor.qml index e7b4c1ca..6e662deb 100644 --- a/tests/auto/qmltest/theme3d/tst_themecolor.qml +++ b/tests/auto/qmltest/theme3d/tst_themecolor.qml @@ -1,31 +1,5 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only import QtQuick 2.0 import QtDataVisualization 1.2 diff --git a/tests/auto/qmltest/tst_qmltest.cpp b/tests/auto/qmltest/tst_qmltest.cpp index 746430c5..86482f65 100644 --- a/tests/auto/qmltest/tst_qmltest.cpp +++ b/tests/auto/qmltest/tst_qmltest.cpp @@ -1,40 +1,34 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Data Visualization module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 or (at your option) any later version -** approved by the KDE Free Qt Foundation. The licenses are as published by -** the Free Software Foundation and appearing in the file LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ +// Copyright (C) 2016 The Qt Company Ltd. +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QtQuickTest/quicktest.h> + +class tst_qmltest: public QObject +{ + Q_OBJECT +private slots: + void skiptest() { QSKIP("This test will fail, skipping."); }; +}; + int main(int argc, char **argv) { if (!qEnvironmentVariableIsEmpty("QEMU_LD_PREFIX")) { - qWarning("This test will fail due to QEMU emulation shortcomings."); - return 0; + qWarning("This test would fail due to QEMU emulation shortcomings, so it will be skipped."); + tst_qmltest skip; + return QTest::qExec(&skip, argc, argv); } +#ifdef Q_OS_QNX + if (qEnvironmentVariable("QTEST_ENVIRONMENT").split(' ').contains("ci") && + qEnvironmentVariable("QT_QPA_PLATFORM").split(' ').contains("offscreen") + ) { + qWarning("This test would fail on CI QNX QEMU without OpenGL support, so it will be skipped."); + tst_qmltest skip; + return QTest::qExec(&skip, argc, argv); + } +#endif qputenv("QSG_RHI_BACKEND", "opengl"); QTEST_SET_MAIN_SOURCE_PATH return quick_test_main(argc, argv, "qmltest", QUICK_TEST_SOURCE_DIR); } + +#include "tst_qmltest.moc" |