summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/gui
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/gui')
-rw-r--r--tests/benchmarks/gui/CMakeLists.txt3
-rw-r--r--tests/benchmarks/gui/animation/CMakeLists.txt3
-rw-r--r--tests/benchmarks/gui/animation/animation.pro2
-rw-r--r--tests/benchmarks/gui/animation/qanimation/CMakeLists.txt7
-rw-r--r--tests/benchmarks/gui/animation/qanimation/dummyanimation.cpp29
-rw-r--r--tests/benchmarks/gui/animation/qanimation/dummyanimation.h33
-rw-r--r--tests/benchmarks/gui/animation/qanimation/dummyobject.cpp29
-rw-r--r--tests/benchmarks/gui/animation/qanimation/dummyobject.h29
-rw-r--r--tests/benchmarks/gui/animation/qanimation/main.cpp29
-rw-r--r--tests/benchmarks/gui/animation/qanimation/qanimation.pro16
-rw-r--r--tests/benchmarks/gui/animation/qanimation/rectanimation.cpp29
-rw-r--r--tests/benchmarks/gui/animation/qanimation/rectanimation.h33
-rw-r--r--tests/benchmarks/gui/gui.pro13
-rw-r--r--tests/benchmarks/gui/image/CMakeLists.txt3
-rw-r--r--tests/benchmarks/gui/image/blendbench/CMakeLists.txt10
-rw-r--r--tests/benchmarks/gui/image/blendbench/blendbench.pro5
-rw-r--r--tests/benchmarks/gui/image/blendbench/main.cpp29
-rw-r--r--tests/benchmarks/gui/image/image.pro8
-rw-r--r--tests/benchmarks/gui/image/qimageconversion/CMakeLists.txt15
-rw-r--r--tests/benchmarks/gui/image/qimageconversion/qimageconversion.pro9
-rw-r--r--tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp34
-rw-r--r--tests/benchmarks/gui/image/qimagereader/CMakeLists.txt19
-rw-r--r--tests/benchmarks/gui/image/qimagereader/qimagereader.pro12
-rw-r--r--tests/benchmarks/gui/image/qimagereader/tst_bench_qimagereader.cpp (renamed from tests/benchmarks/gui/image/qimagereader/tst_qimagereader.cpp)91
-rw-r--r--tests/benchmarks/gui/image/qimagescale/CMakeLists.txt10
-rw-r--r--tests/benchmarks/gui/image/qimagescale/qimagescale.pro4
-rw-r--r--tests/benchmarks/gui/image/qimagescale/tst_qimagescale.cpp29
-rw-r--r--tests/benchmarks/gui/image/qpixmap/CMakeLists.txt10
-rw-r--r--tests/benchmarks/gui/image/qpixmap/qpixmap.pro6
-rw-r--r--tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp29
-rw-r--r--tests/benchmarks/gui/image/qpixmapcache/CMakeLists.txt10
-rw-r--r--tests/benchmarks/gui/image/qpixmapcache/qpixmapcache.pro5
-rw-r--r--tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp45
-rw-r--r--tests/benchmarks/gui/kernel/CMakeLists.txt3
-rw-r--r--tests/benchmarks/gui/kernel/kernel.pro4
-rw-r--r--tests/benchmarks/gui/kernel/qguimetatype/CMakeLists.txt10
-rw-r--r--tests/benchmarks/gui/kernel/qguimetatype/qguimetatype.pro5
-rw-r--r--tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp70
-rw-r--r--tests/benchmarks/gui/kernel/qguivariant/CMakeLists.txt10
-rw-r--r--tests/benchmarks/gui/kernel/qguivariant/qguivariant.pro5
-rw-r--r--tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp35
-rw-r--r--tests/benchmarks/gui/math3d/CMakeLists.txt3
-rw-r--r--tests/benchmarks/gui/math3d/math3d.pro4
-rw-r--r--tests/benchmarks/gui/math3d/qmatrix4x4/CMakeLists.txt10
-rw-r--r--tests/benchmarks/gui/math3d/qmatrix4x4/qmatrix4x4.pro5
-rw-r--r--tests/benchmarks/gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp39
-rw-r--r--tests/benchmarks/gui/math3d/qquaternion/CMakeLists.txt10
-rw-r--r--tests/benchmarks/gui/math3d/qquaternion/qquaternion.pro5
-rw-r--r--tests/benchmarks/gui/math3d/qquaternion/tst_qquaternion.cpp30
-rw-r--r--tests/benchmarks/gui/painting/CMakeLists.txt3
-rw-r--r--tests/benchmarks/gui/painting/drawtexture/CMakeLists.txt10
-rw-r--r--tests/benchmarks/gui/painting/drawtexture/drawtexture.pro7
-rw-r--r--tests/benchmarks/gui/painting/drawtexture/tst_drawtexture.cpp29
-rw-r--r--tests/benchmarks/gui/painting/lancebench/CMakeLists.txt113
-rw-r--r--tests/benchmarks/gui/painting/lancebench/lancebench.pro13
-rw-r--r--tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp41
-rw-r--r--tests/benchmarks/gui/painting/painting.pro13
-rw-r--r--tests/benchmarks/gui/painting/qcolor/CMakeLists.txt10
-rw-r--r--tests/benchmarks/gui/painting/qcolor/qcolor.pro7
-rw-r--r--tests/benchmarks/gui/painting/qcolor/tst_qcolor.cpp29
-rw-r--r--tests/benchmarks/gui/painting/qpainter/CMakeLists.txt10
-rw-r--r--tests/benchmarks/gui/painting/qpainter/qpainter.pro7
-rw-r--r--tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp90
-rw-r--r--tests/benchmarks/gui/painting/qregion/CMakeLists.txt10
-rw-r--r--tests/benchmarks/gui/painting/qregion/main.cpp29
-rw-r--r--tests/benchmarks/gui/painting/qregion/qregion.pro6
-rw-r--r--tests/benchmarks/gui/painting/qtbench/CMakeLists.txt10
-rw-r--r--tests/benchmarks/gui/painting/qtbench/benchmarktests.h150
-rw-r--r--tests/benchmarks/gui/painting/qtbench/qtbench.pro6
-rw-r--r--tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp38
-rw-r--r--tests/benchmarks/gui/painting/qtransform/CMakeLists.txt10
-rw-r--r--tests/benchmarks/gui/painting/qtransform/qtransform.pro5
-rw-r--r--tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp77
-rw-r--r--tests/benchmarks/gui/text/CMakeLists.txt3
-rw-r--r--tests/benchmarks/gui/text/qfontmetrics/CMakeLists.txt10
-rw-r--r--tests/benchmarks/gui/text/qfontmetrics/main.cpp29
-rw-r--r--tests/benchmarks/gui/text/qfontmetrics/qfontmetrics.pro4
-rw-r--r--tests/benchmarks/gui/text/qtext/CMakeLists.txt11
-rw-r--r--tests/benchmarks/gui/text/qtext/main.cpp43
-rw-r--r--tests/benchmarks/gui/text/qtext/qtext.pro9
-rw-r--r--tests/benchmarks/gui/text/qtextdocument/CMakeLists.txt10
-rw-r--r--tests/benchmarks/gui/text/qtextdocument/main.cpp29
-rw-r--r--tests/benchmarks/gui/text/qtextdocument/qtextdocument.pro7
-rw-r--r--tests/benchmarks/gui/text/text.pro5
84 files changed, 434 insertions, 1335 deletions
diff --git a/tests/benchmarks/gui/CMakeLists.txt b/tests/benchmarks/gui/CMakeLists.txt
index 6af9d8e224..c8c805a2a7 100644
--- a/tests/benchmarks/gui/CMakeLists.txt
+++ b/tests/benchmarks/gui/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from gui.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(animation)
add_subdirectory(image)
diff --git a/tests/benchmarks/gui/animation/CMakeLists.txt b/tests/benchmarks/gui/animation/CMakeLists.txt
index 6190f29a65..7a014c2a7a 100644
--- a/tests/benchmarks/gui/animation/CMakeLists.txt
+++ b/tests/benchmarks/gui/animation/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from animation.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
if(TARGET Qt::Widgets)
add_subdirectory(qanimation)
diff --git a/tests/benchmarks/gui/animation/animation.pro b/tests/benchmarks/gui/animation/animation.pro
deleted file mode 100644
index 76c1a49e5c..0000000000
--- a/tests/benchmarks/gui/animation/animation.pro
+++ /dev/null
@@ -1,2 +0,0 @@
-TEMPLATE = subdirs
-qtHaveModule(widgets): SUBDIRS = qanimation
diff --git a/tests/benchmarks/gui/animation/qanimation/CMakeLists.txt b/tests/benchmarks/gui/animation/qanimation/CMakeLists.txt
index 30022b270f..0193551ee1 100644
--- a/tests/benchmarks/gui/animation/qanimation/CMakeLists.txt
+++ b/tests/benchmarks/gui/animation/qanimation/CMakeLists.txt
@@ -1,16 +1,17 @@
-# Generated from qanimation.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qanimation Binary:
#####################################################################
-qt_add_benchmark(tst_bench_qanimation
+qt_internal_add_benchmark(tst_bench_qanimation
SOURCES
dummyanimation.cpp dummyanimation.h
dummyobject.cpp dummyobject.h
main.cpp
rectanimation.cpp rectanimation.h
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
Qt::Widgets
diff --git a/tests/benchmarks/gui/animation/qanimation/dummyanimation.cpp b/tests/benchmarks/gui/animation/qanimation/dummyanimation.cpp
index 71d628fda0..a877cca838 100644
--- a/tests/benchmarks/gui/animation/qanimation/dummyanimation.cpp
+++ b/tests/benchmarks/gui/animation/qanimation/dummyanimation.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "dummyanimation.h"
#include "dummyobject.h"
diff --git a/tests/benchmarks/gui/animation/qanimation/dummyanimation.h b/tests/benchmarks/gui/animation/qanimation/dummyanimation.h
index 9183506440..5ac0e6431b 100644
--- a/tests/benchmarks/gui/animation/qanimation/dummyanimation.h
+++ b/tests/benchmarks/gui/animation/qanimation/dummyanimation.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QtGui>
@@ -37,8 +12,8 @@ class DummyAnimation : public QVariantAnimation
public:
DummyAnimation(DummyObject *d);
- void updateCurrentValue(const QVariant &value);
- void updateState(State newstate, State oldstate);
+ void updateCurrentValue(const QVariant &value) override;
+ void updateState(State newstate, State oldstate) override;
private:
DummyObject *m_dummy;
diff --git a/tests/benchmarks/gui/animation/qanimation/dummyobject.cpp b/tests/benchmarks/gui/animation/qanimation/dummyobject.cpp
index 9c691eaf57..a69c73a90b 100644
--- a/tests/benchmarks/gui/animation/qanimation/dummyobject.cpp
+++ b/tests/benchmarks/gui/animation/qanimation/dummyobject.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtGui 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "dummyobject.h"
diff --git a/tests/benchmarks/gui/animation/qanimation/dummyobject.h b/tests/benchmarks/gui/animation/qanimation/dummyobject.h
index 980508598b..3bae6407ba 100644
--- a/tests/benchmarks/gui/animation/qanimation/dummyobject.h
+++ b/tests/benchmarks/gui/animation/qanimation/dummyobject.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QtGui>
diff --git a/tests/benchmarks/gui/animation/qanimation/main.cpp b/tests/benchmarks/gui/animation/qanimation/main.cpp
index afe3bcfd5e..26c188bb4a 100644
--- a/tests/benchmarks/gui/animation/qanimation/main.cpp
+++ b/tests/benchmarks/gui/animation/qanimation/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QtWidgets>
#include <qtest.h>
diff --git a/tests/benchmarks/gui/animation/qanimation/qanimation.pro b/tests/benchmarks/gui/animation/qanimation/qanimation.pro
deleted file mode 100644
index a5859468f7..0000000000
--- a/tests/benchmarks/gui/animation/qanimation/qanimation.pro
+++ /dev/null
@@ -1,16 +0,0 @@
-QT += widgets testlib
-
-TARGET = tst_bench_qanimation
-
-CONFIG += release
-#CONFIG += debug
-
-
-SOURCES += main.cpp \
- dummyobject.cpp \
- dummyanimation.cpp \
- rectanimation.cpp
-
-HEADERS += dummyobject.h \
- dummyanimation.h \
- rectanimation.h
diff --git a/tests/benchmarks/gui/animation/qanimation/rectanimation.cpp b/tests/benchmarks/gui/animation/qanimation/rectanimation.cpp
index 48ad64b0d9..ec2fc340cf 100644
--- a/tests/benchmarks/gui/animation/qanimation/rectanimation.cpp
+++ b/tests/benchmarks/gui/animation/qanimation/rectanimation.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "rectanimation.h"
#include "dummyobject.h"
diff --git a/tests/benchmarks/gui/animation/qanimation/rectanimation.h b/tests/benchmarks/gui/animation/qanimation/rectanimation.h
index 8d7de89eaa..359c9a8a9b 100644
--- a/tests/benchmarks/gui/animation/qanimation/rectanimation.h
+++ b/tests/benchmarks/gui/animation/qanimation/rectanimation.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QtGui>
@@ -43,9 +18,9 @@ public:
void setStartValue(const QRect &rect);
void setDuration(int d);
- int duration() const;
+ int duration() const override;
- virtual void updateCurrentTime(int currentTime);
+ void updateCurrentTime(int currentTime) override;
private:
DummyObject *m_object;
diff --git a/tests/benchmarks/gui/gui.pro b/tests/benchmarks/gui/gui.pro
deleted file mode 100644
index b5853c9e81..0000000000
--- a/tests/benchmarks/gui/gui.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = \
- animation \
- image \
- kernel \
- math3d \
- painting \
- text
-
-TRUSTED_BENCHMARKS += \
- painting/qtracebench
-
-include(../trusted-benchmarks.pri)
diff --git a/tests/benchmarks/gui/image/CMakeLists.txt b/tests/benchmarks/gui/image/CMakeLists.txt
index 77cfeedc3e..53768eda4c 100644
--- a/tests/benchmarks/gui/image/CMakeLists.txt
+++ b/tests/benchmarks/gui/image/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from image.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(blendbench)
add_subdirectory(qimageconversion)
diff --git a/tests/benchmarks/gui/image/blendbench/CMakeLists.txt b/tests/benchmarks/gui/image/blendbench/CMakeLists.txt
index 1569e8f8b1..88a47c894b 100644
--- a/tests/benchmarks/gui/image/blendbench/CMakeLists.txt
+++ b/tests/benchmarks/gui/image/blendbench/CMakeLists.txt
@@ -1,16 +1,14 @@
-# Generated from blendbench.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_blendbench Binary:
#####################################################################
-qt_add_benchmark(tst_bench_blendbench
+qt_internal_add_benchmark(tst_bench_blendbench
SOURCES
main.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:blendbench.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/image/blendbench/blendbench.pro b/tests/benchmarks/gui/image/blendbench/blendbench.pro
deleted file mode 100644
index 17c18301bb..0000000000
--- a/tests/benchmarks/gui/image/blendbench/blendbench.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-TEMPLATE = app
-TARGET = tst_bench_blendbench
-QT += testlib
-
-SOURCES += main.cpp
diff --git a/tests/benchmarks/gui/image/blendbench/main.cpp b/tests/benchmarks/gui/image/blendbench/main.cpp
index 039d822a39..4aaf89d029 100644
--- a/tests/benchmarks/gui/image/blendbench/main.cpp
+++ b/tests/benchmarks/gui/image/blendbench/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QtGui>
#include <QString>
diff --git a/tests/benchmarks/gui/image/image.pro b/tests/benchmarks/gui/image/image.pro
deleted file mode 100644
index 8dfb4d0ae9..0000000000
--- a/tests/benchmarks/gui/image/image.pro
+++ /dev/null
@@ -1,8 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = \
- blendbench \
- qimageconversion \
- qimagereader \
- qimagescale \
- qpixmap \
- qpixmapcache
diff --git a/tests/benchmarks/gui/image/qimageconversion/CMakeLists.txt b/tests/benchmarks/gui/image/qimageconversion/CMakeLists.txt
index 5b0bb33018..034ed28fcd 100644
--- a/tests/benchmarks/gui/image/qimageconversion/CMakeLists.txt
+++ b/tests/benchmarks/gui/image/qimageconversion/CMakeLists.txt
@@ -1,30 +1,27 @@
-# Generated from qimageconversion.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_imageConversion Binary:
#####################################################################
-qt_add_benchmark(tst_bench_imageConversion
+qt_internal_add_benchmark(tst_bench_imageConversion
SOURCES
tst_qimageconversion.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
)
-#### Keys ignored in scope 1:.:.:qimageconversion.pro:<TRUE>:
-# QT_FOR_CONFIG = "gui-private"
-# TEMPLATE = "app"
-
## Scopes:
#####################################################################
-qt_extend_target(tst_bench_imageConversion CONDITION QT_FEATURE_gif
+qt_internal_extend_target(tst_bench_imageConversion CONDITION QT_FEATURE_gif
DEFINES
QTEST_HAVE_GIF
)
-qt_extend_target(tst_bench_imageConversion CONDITION QT_FEATURE_jpeg
+qt_internal_extend_target(tst_bench_imageConversion CONDITION QT_FEATURE_jpeg
DEFINES
QTEST_HAVE_JPEG
)
diff --git a/tests/benchmarks/gui/image/qimageconversion/qimageconversion.pro b/tests/benchmarks/gui/image/qimageconversion/qimageconversion.pro
deleted file mode 100644
index e152ac8200..0000000000
--- a/tests/benchmarks/gui/image/qimageconversion/qimageconversion.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-TEMPLATE = app
-TARGET = tst_bench_imageConversion
-QT += testlib
-QT_FOR_CONFIG += gui-private
-SOURCES += tst_qimageconversion.cpp
-
-qtConfig(gif): DEFINES += QTEST_HAVE_GIF
-qtConfig(jpeg): DEFINES += QTEST_HAVE_JPEG
-qtConfig(c++11): CONFIG += c++11
diff --git a/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp b/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp
index b8afb3bc05..0c4243637c 100644
--- a/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp
+++ b/tests/benchmarks/gui/image/qimageconversion/tst_qimageconversion.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qtest.h>
#include <QImage>
@@ -244,6 +219,7 @@ void tst_QImageConversion::convertGeneric_data()
QImage a2rgb30 = argb32.convertToFormat(QImage::Format_A2RGB30_Premultiplied);
QImage rgb666 = rgb32.convertToFormat(QImage::Format_RGB666);
QImage argb4444 = argb32.convertToFormat(QImage::Format_ARGB4444_Premultiplied);
+ QImage rgba64 = argb32.convertToFormat(QImage::Format_RGBA64);
QImage rgba64pm = argb32.convertToFormat(QImage::Format_RGBA64_Premultiplied);
QImage rgb888 = rgb32.convertToFormat(QImage::Format_RGB888);
QImage bgr888 = rgb32.convertToFormat(QImage::Format_BGR888);
@@ -298,6 +274,10 @@ void tst_QImageConversion::convertGeneric_data()
QTest::newRow("argb4444pm -> rgb30") << argb4444 << QImage::Format_RGB30;
QTest::newRow("argb4444pm -> a2bgr30") << argb4444 << QImage::Format_A2BGR30_Premultiplied;
+ QTest::newRow("rgba64 -> argb32") << rgba64 << QImage::Format_ARGB32;
+ QTest::newRow("rgba64 -> argb32pm") << rgba64 << QImage::Format_ARGB32_Premultiplied;
+ QTest::newRow("rgba64 -> rgba64pm") << rgba64 << QImage::Format_RGBA64_Premultiplied;
+
QTest::newRow("rgba64pm -> argb32") << rgba64pm << QImage::Format_ARGB32;
QTest::newRow("rgba64pm -> rgbx8888") << rgba64pm << QImage::Format_RGBX8888;
QTest::newRow("rgba64pm -> rgba8888pm") << rgba64pm << QImage::Format_RGBA8888_Premultiplied;
diff --git a/tests/benchmarks/gui/image/qimagereader/CMakeLists.txt b/tests/benchmarks/gui/image/qimagereader/CMakeLists.txt
index d652247877..ba3c2a7ec4 100644
--- a/tests/benchmarks/gui/image/qimagereader/CMakeLists.txt
+++ b/tests/benchmarks/gui/image/qimagereader/CMakeLists.txt
@@ -1,31 +1,28 @@
-# Generated from qimagereader.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qimagereader Binary:
#####################################################################
-qt_add_benchmark(tst_bench_qimagereader
+qt_internal_add_benchmark(tst_bench_qimagereader
SOURCES
- tst_qimagereader.cpp
- PUBLIC_LIBRARIES
+ tst_bench_qimagereader.cpp
+ LIBRARIES
+ Qt::CorePrivate
Qt::Gui
Qt::Test
)
-#### Keys ignored in scope 1:.:.:qimagereader.pro:<TRUE>:
-# QT_FOR_CONFIG = "gui-private"
-# TEMPLATE = "app"
-# TESTDATA = "images/*"
-
## Scopes:
#####################################################################
-qt_extend_target(tst_bench_qimagereader CONDITION QT_FEATURE_gif
+qt_internal_extend_target(tst_bench_qimagereader CONDITION QT_FEATURE_gif
DEFINES
QTEST_HAVE_GIF
)
-qt_extend_target(tst_bench_qimagereader CONDITION QT_FEATURE_jpeg
+qt_internal_extend_target(tst_bench_qimagereader CONDITION QT_FEATURE_jpeg
DEFINES
QTEST_HAVE_JPEG
)
diff --git a/tests/benchmarks/gui/image/qimagereader/qimagereader.pro b/tests/benchmarks/gui/image/qimagereader/qimagereader.pro
deleted file mode 100644
index 3454cf1474..0000000000
--- a/tests/benchmarks/gui/image/qimagereader/qimagereader.pro
+++ /dev/null
@@ -1,12 +0,0 @@
-QT += testlib
-QT_FOR_CONFIG += gui-private
-
-TEMPLATE = app
-TARGET = tst_bench_qimagereader
-
-SOURCES += tst_qimagereader.cpp
-
-qtConfig(gif): DEFINES += QTEST_HAVE_GIF
-qtConfig(jpeg): DEFINES += QTEST_HAVE_JPEG
-
-TESTDATA += images/*
diff --git a/tests/benchmarks/gui/image/qimagereader/tst_qimagereader.cpp b/tests/benchmarks/gui/image/qimagereader/tst_bench_qimagereader.cpp
index 48e838148f..9b23741405 100644
--- a/tests/benchmarks/gui/image/qimagereader/tst_qimagereader.cpp
+++ b/tests/benchmarks/gui/image/qimagereader/tst_bench_qimagereader.cpp
@@ -1,32 +1,8 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qtest.h>
+
#include <QBuffer>
#include <QDebug>
#include <QFile>
@@ -34,6 +10,8 @@
#include <QImageReader>
#include <QImageWriter>
#include <QPixmap>
+
+#include <QtCore/private/qfactoryloader_p.h>
#include <QSet>
#include <QTimer>
@@ -42,20 +20,20 @@ typedef QList<int> QIntList;
Q_DECLARE_METATYPE(QStringMap)
Q_DECLARE_METATYPE(QIntList)
-class tst_QImageReader : public QObject
+class tst_bench_QImageReader : public QObject
{
Q_OBJECT
public:
- tst_QImageReader();
- virtual ~tst_QImageReader();
+ tst_bench_QImageReader();
public slots:
void initTestCase();
- void init();
- void cleanup();
private slots:
+ void rawFactoryLoader_keyMap();
+ void rawFactoryLoader_instance();
+
void readImage_data();
void readImage();
@@ -71,9 +49,10 @@ private slots:
private:
QList< QPair<QString, QByteArray> > images; // filename, format
QString prefix;
+ QFactoryLoader m_loader{QImageIOHandlerFactoryInterface_iid, "/imageformats"};
};
-tst_QImageReader::tst_QImageReader()
+tst_bench_QImageReader::tst_bench_QImageReader()
{
images << QPair<QString, QByteArray>(QLatin1String("colorful.bmp"), QByteArray("bmp"));
images << QPair<QString, QByteArray>(QLatin1String("font.bmp"), QByteArray("bmp"));
@@ -100,26 +79,38 @@ tst_QImageReader::tst_QImageReader()
#endif
}
-tst_QImageReader::~tst_QImageReader()
-{
-}
-
-void tst_QImageReader::initTestCase()
+void tst_bench_QImageReader::initTestCase()
{
prefix = QFINDTESTDATA("images/");
if (prefix.isEmpty())
QFAIL("Can't find images directory!");
}
-void tst_QImageReader::init()
+void tst_bench_QImageReader::rawFactoryLoader_keyMap()
{
+ if (m_loader.keyMap().isEmpty())
+ QSKIP("No image plugins found.");
+
+ QBENCHMARK {
+ [[maybe_unused]] auto r = m_loader.keyMap();
+ }
}
-void tst_QImageReader::cleanup()
+void tst_bench_QImageReader::rawFactoryLoader_instance()
{
+ if (m_loader.keyMap().isEmpty())
+ QSKIP("No image plugins found.");
+
+ const auto numInstances = m_loader.keyMap().uniqueKeys().size();
+
+ QBENCHMARK {
+ for (int i = 0; i < numInstances; ++i)
+ delete m_loader.instance(i);
+ }
}
-void tst_QImageReader::readImage_data()
+
+void tst_bench_QImageReader::readImage_data()
{
QTest::addColumn<QString>("fileName");
QTest::addColumn<QByteArray>("format");
@@ -131,7 +122,7 @@ void tst_QImageReader::readImage_data()
}
}
-void tst_QImageReader::readImage()
+void tst_bench_QImageReader::readImage()
{
QFETCH(QString, fileName);
QFETCH(QByteArray, format);
@@ -143,7 +134,7 @@ void tst_QImageReader::readImage()
}
}
-void tst_QImageReader::setScaledSize_data()
+void tst_bench_QImageReader::setScaledSize_data()
{
QTest::addColumn<QString>("fileName");
QTest::addColumn<QByteArray>("format");
@@ -161,7 +152,7 @@ void tst_QImageReader::setScaledSize_data()
}
}
-void tst_QImageReader::setScaledSize()
+void tst_bench_QImageReader::setScaledSize()
{
QFETCH(QString, fileName);
QFETCH(QSize, newSize);
@@ -175,7 +166,7 @@ void tst_QImageReader::setScaledSize()
}
}
-void tst_QImageReader::setClipRect_data()
+void tst_bench_QImageReader::setClipRect_data()
{
QTest::addColumn<QString>("fileName");
QTest::addColumn<QByteArray>("format");
@@ -188,7 +179,7 @@ void tst_QImageReader::setClipRect_data()
}
}
-void tst_QImageReader::setClipRect()
+void tst_bench_QImageReader::setClipRect()
{
QFETCH(QString, fileName);
QFETCH(QRect, newRect);
@@ -202,12 +193,12 @@ void tst_QImageReader::setClipRect()
}
}
-void tst_QImageReader::setScaledClipRect_data()
+void tst_bench_QImageReader::setScaledClipRect_data()
{
setClipRect_data();
}
-void tst_QImageReader::setScaledClipRect()
+void tst_bench_QImageReader::setScaledClipRect()
{
QFETCH(QString, fileName);
QFETCH(QRect, newRect);
@@ -222,5 +213,5 @@ void tst_QImageReader::setScaledClipRect()
}
}
-QTEST_MAIN(tst_QImageReader)
-#include "tst_qimagereader.moc"
+QTEST_MAIN(tst_bench_QImageReader)
+#include "tst_bench_qimagereader.moc"
diff --git a/tests/benchmarks/gui/image/qimagescale/CMakeLists.txt b/tests/benchmarks/gui/image/qimagescale/CMakeLists.txt
index 84011be1bd..74d5c8e470 100644
--- a/tests/benchmarks/gui/image/qimagescale/CMakeLists.txt
+++ b/tests/benchmarks/gui/image/qimagescale/CMakeLists.txt
@@ -1,16 +1,14 @@
-# Generated from qimagescale.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_imageScale Binary:
#####################################################################
-qt_add_benchmark(tst_bench_imageScale
+qt_internal_add_benchmark(tst_bench_imageScale
SOURCES
tst_qimagescale.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qimagescale.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/image/qimagescale/qimagescale.pro b/tests/benchmarks/gui/image/qimagescale/qimagescale.pro
deleted file mode 100644
index a576e2c9aa..0000000000
--- a/tests/benchmarks/gui/image/qimagescale/qimagescale.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-TEMPLATE = app
-TARGET = tst_bench_imageScale
-QT += testlib
-SOURCES += tst_qimagescale.cpp
diff --git a/tests/benchmarks/gui/image/qimagescale/tst_qimagescale.cpp b/tests/benchmarks/gui/image/qimagescale/tst_qimagescale.cpp
index 2ba3731e9b..2819dc1c11 100644
--- a/tests/benchmarks/gui/image/qimagescale/tst_qimagescale.cpp
+++ b/tests/benchmarks/gui/image/qimagescale/tst_qimagescale.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qtest.h>
#include <QImage>
diff --git a/tests/benchmarks/gui/image/qpixmap/CMakeLists.txt b/tests/benchmarks/gui/image/qpixmap/CMakeLists.txt
index 5413cc700e..db0546390a 100644
--- a/tests/benchmarks/gui/image/qpixmap/CMakeLists.txt
+++ b/tests/benchmarks/gui/image/qpixmap/CMakeLists.txt
@@ -1,17 +1,15 @@
-# Generated from qpixmap.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qpixmap Binary:
#####################################################################
-qt_add_benchmark(tst_bench_qpixmap
+qt_internal_add_benchmark(tst_bench_qpixmap
SOURCES
tst_qpixmap.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qpixmap.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/image/qpixmap/qpixmap.pro b/tests/benchmarks/gui/image/qpixmap/qpixmap.pro
deleted file mode 100644
index 7ba53857cb..0000000000
--- a/tests/benchmarks/gui/image/qpixmap/qpixmap.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-QT += gui-private testlib
-
-TEMPLATE = app
-TARGET = tst_bench_qpixmap
-
-SOURCES += tst_qpixmap.cpp
diff --git a/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp b/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp
index 36f555ba61..7a6e4a2b3f 100644
--- a/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/benchmarks/gui/image/qpixmap/tst_qpixmap.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qtest.h>
#include <QBitmap>
diff --git a/tests/benchmarks/gui/image/qpixmapcache/CMakeLists.txt b/tests/benchmarks/gui/image/qpixmapcache/CMakeLists.txt
index b8d72d7659..f2939ab470 100644
--- a/tests/benchmarks/gui/image/qpixmapcache/CMakeLists.txt
+++ b/tests/benchmarks/gui/image/qpixmapcache/CMakeLists.txt
@@ -1,16 +1,14 @@
-# Generated from qpixmapcache.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qpixmapcache Binary:
#####################################################################
-qt_add_benchmark(tst_bench_qpixmapcache
+qt_internal_add_benchmark(tst_bench_qpixmapcache
SOURCES
tst_qpixmapcache.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qpixmapcache.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/image/qpixmapcache/qpixmapcache.pro b/tests/benchmarks/gui/image/qpixmapcache/qpixmapcache.pro
deleted file mode 100644
index 074c764e50..0000000000
--- a/tests/benchmarks/gui/image/qpixmapcache/qpixmapcache.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-TARGET = tst_bench_qpixmapcache
-TEMPLATE = app
-QT += testlib
-
-SOURCES += tst_qpixmapcache.cpp
diff --git a/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp b/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp
index 2ded426cdd..0c93e6d2ec 100644
--- a/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp
+++ b/tests/benchmarks/gui/image/qpixmapcache/tst_qpixmapcache.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qtest.h>
#include <QPixmapCache>
@@ -164,12 +139,12 @@ void tst_QPixmapCache::styleUseCaseComplexKey()
{
styleStruct myStruct;
myStruct.key = QString("my-progressbar-%1").arg(i);
- myStruct.key = 5;
- myStruct.key = 4;
- myStruct.key = 3;
+ myStruct.key = QChar(5);
+ myStruct.key = QChar(4);
+ myStruct.key = QChar(3);
myStruct.palette = 358;
myStruct.width = 100;
- myStruct.key = 200;
+ myStruct.key = QChar(200);
QPixmapCache::Key key = QPixmapCache::insert(p);
hash.insert(myStruct, key);
}
@@ -177,12 +152,12 @@ void tst_QPixmapCache::styleUseCaseComplexKey()
{
styleStruct myStruct;
myStruct.key = QString("my-progressbar-%1").arg(i);
- myStruct.key = 5;
- myStruct.key = 4;
- myStruct.key = 3;
+ myStruct.key = QChar(5);
+ myStruct.key = QChar(4);
+ myStruct.key = QChar(3);
myStruct.palette = 358;
myStruct.width = 100;
- myStruct.key = 200;
+ myStruct.key = QChar(200);
QPixmapCache::Key key = hash.value(myStruct);
QPixmapCache::find(key, &p);
}
diff --git a/tests/benchmarks/gui/kernel/CMakeLists.txt b/tests/benchmarks/gui/kernel/CMakeLists.txt
index 451b12388d..1f79c7d99b 100644
--- a/tests/benchmarks/gui/kernel/CMakeLists.txt
+++ b/tests/benchmarks/gui/kernel/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from kernel.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(qguimetatype)
add_subdirectory(qguivariant)
diff --git a/tests/benchmarks/gui/kernel/kernel.pro b/tests/benchmarks/gui/kernel/kernel.pro
deleted file mode 100644
index acc6dc402d..0000000000
--- a/tests/benchmarks/gui/kernel/kernel.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = \
- qguimetatype \
- qguivariant
diff --git a/tests/benchmarks/gui/kernel/qguimetatype/CMakeLists.txt b/tests/benchmarks/gui/kernel/qguimetatype/CMakeLists.txt
index ac0e5f3566..394706b078 100644
--- a/tests/benchmarks/gui/kernel/qguimetatype/CMakeLists.txt
+++ b/tests/benchmarks/gui/kernel/qguimetatype/CMakeLists.txt
@@ -1,16 +1,14 @@
-# Generated from qguimetatype.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qguimetatype Binary:
#####################################################################
-qt_add_benchmark(tst_bench_qguimetatype
+qt_internal_add_benchmark(tst_bench_qguimetatype
SOURCES
tst_qguimetatype.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qguimetatype.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/kernel/qguimetatype/qguimetatype.pro b/tests/benchmarks/gui/kernel/qguimetatype/qguimetatype.pro
deleted file mode 100644
index be9cf4b38b..0000000000
--- a/tests/benchmarks/gui/kernel/qguimetatype/qguimetatype.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-TEMPLATE = app
-TARGET = tst_bench_qguimetatype
-QT += testlib
-SOURCES += tst_qguimetatype.cpp
-
diff --git a/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp b/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp
index 7d6c1ef86d..2f7d278e87 100644
--- a/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp
+++ b/tests/benchmarks/gui/kernel/qguimetatype/tst_qguimetatype.cpp
@@ -1,33 +1,9 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qtest.h>
#include <QtCore/qmetatype.h>
+#include <QScopeGuard>
class tst_QGuiMetaType : public QObject
{
@@ -46,8 +22,10 @@ private:
void tst_QGuiMetaType::constructableGuiTypes()
{
QTest::addColumn<int>("typeId");
- for (int i = QMetaType::FirstGuiType; i <= QMetaType::LastGuiType; ++i)
- QTest::newRow(QMetaType::typeName(i)) << i;
+ for (int i = QMetaType::FirstGuiType; i <= QMetaType::LastGuiType; ++i) {
+ if (QMetaType metaType(i); metaType.isValid())
+ QTest::newRow(metaType.name()) << i;
+ }
}
@@ -59,17 +37,20 @@ void tst_QGuiMetaType::constructInPlace_data()
void tst_QGuiMetaType::constructInPlace()
{
QFETCH(int, typeId);
- int size = QMetaType::sizeOf(typeId);
+ QMetaType type(typeId);
+ int size = type.sizeOf();
void *storage = qMallocAligned(size, 2 * sizeof(qlonglong));
- QCOMPARE(QMetaType::construct(typeId, storage, /*copy=*/0), storage);
- QMetaType::destruct(typeId, storage);
+ auto cleanUp = qScopeGuard([&]() {
+ qFreeAligned(storage);
+ });
+ QCOMPARE(type.construct(storage, /*copy=*/0), storage);
+ type.destruct(storage);
QBENCHMARK {
for (int i = 0; i < 100000; ++i) {
- QMetaType::construct(typeId, storage, /*copy=*/0);
- QMetaType::destruct(typeId, storage);
+ type.construct(storage, /*copy=*/0);
+ type.destruct(storage);
}
}
- qFreeAligned(storage);
}
void tst_QGuiMetaType::constructInPlaceCopy_data()
@@ -80,19 +61,22 @@ void tst_QGuiMetaType::constructInPlaceCopy_data()
void tst_QGuiMetaType::constructInPlaceCopy()
{
QFETCH(int, typeId);
- int size = QMetaType::sizeOf(typeId);
+ QMetaType type(typeId);
+ int size = type.sizeOf();
void *storage = qMallocAligned(size, 2 * sizeof(qlonglong));
- void *other = QMetaType::create(typeId);
- QCOMPARE(QMetaType::construct(typeId, storage, other), storage);
- QMetaType::destruct(typeId, storage);
+ void *other = type.create();
+ auto cleanUp = qScopeGuard([&]() {
+ type.destroy(other);
+ qFreeAligned(storage);
+ });
+ QCOMPARE(type.construct(storage, other), storage);
+ type.destruct(storage);
QBENCHMARK {
for (int i = 0; i < 100000; ++i) {
- QMetaType::construct(typeId, storage, other);
- QMetaType::destruct(typeId, storage);
+ type.construct(storage, other);
+ type.destruct(storage);
}
}
- QMetaType::destroy(typeId, other);
- qFreeAligned(storage);
}
QTEST_MAIN(tst_QGuiMetaType)
diff --git a/tests/benchmarks/gui/kernel/qguivariant/CMakeLists.txt b/tests/benchmarks/gui/kernel/qguivariant/CMakeLists.txt
index 0d2c99f3ec..a8e3ec8ec6 100644
--- a/tests/benchmarks/gui/kernel/qguivariant/CMakeLists.txt
+++ b/tests/benchmarks/gui/kernel/qguivariant/CMakeLists.txt
@@ -1,16 +1,14 @@
-# Generated from qguivariant.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qguivariant Binary:
#####################################################################
-qt_add_benchmark(tst_bench_qguivariant
+qt_internal_add_benchmark(tst_bench_qguivariant
SOURCES
tst_qguivariant.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qguivariant.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/kernel/qguivariant/qguivariant.pro b/tests/benchmarks/gui/kernel/qguivariant/qguivariant.pro
deleted file mode 100644
index 63886c21d4..0000000000
--- a/tests/benchmarks/gui/kernel/qguivariant/qguivariant.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-TEMPLATE = app
-TARGET = tst_bench_qguivariant
-QT += testlib
-SOURCES += tst_qguivariant.cpp
-
diff --git a/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp b/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp
index 64aa08371d..9c49e467ce 100644
--- a/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp
+++ b/tests/benchmarks/gui/kernel/qguivariant/tst_qguivariant.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qtest.h>
#include <QtCore/qvariant.h>
@@ -57,8 +32,10 @@ tst_QGuiVariant::~tst_QGuiVariant()
void tst_QGuiVariant::createGuiType_data()
{
QTest::addColumn<int>("typeId");
- for (int i = QMetaType::FirstGuiType; i <= QMetaType::LastGuiType; ++i)
- QTest::newRow(QMetaType::typeName(i)) << i;
+ for (int i = QMetaType::FirstGuiType; i <= QMetaType::LastGuiType; ++i) {
+ if (QMetaType metaType(i); metaType.isValid())
+ QTest::newRow(metaType.name()) << i;
+ }
}
// Tests how fast a Qt GUI type can be default-constructed by a
diff --git a/tests/benchmarks/gui/math3d/CMakeLists.txt b/tests/benchmarks/gui/math3d/CMakeLists.txt
index 53e56a83a3..f8e6f7b16c 100644
--- a/tests/benchmarks/gui/math3d/CMakeLists.txt
+++ b/tests/benchmarks/gui/math3d/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from math3d.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(qmatrix4x4)
add_subdirectory(qquaternion)
diff --git a/tests/benchmarks/gui/math3d/math3d.pro b/tests/benchmarks/gui/math3d/math3d.pro
deleted file mode 100644
index c511d9a904..0000000000
--- a/tests/benchmarks/gui/math3d/math3d.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = \
- qmatrix4x4 \
- qquaternion
diff --git a/tests/benchmarks/gui/math3d/qmatrix4x4/CMakeLists.txt b/tests/benchmarks/gui/math3d/qmatrix4x4/CMakeLists.txt
index 4d7162a678..2929d2d46f 100644
--- a/tests/benchmarks/gui/math3d/qmatrix4x4/CMakeLists.txt
+++ b/tests/benchmarks/gui/math3d/qmatrix4x4/CMakeLists.txt
@@ -1,16 +1,14 @@
-# Generated from qmatrix4x4.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qmatrix4x4 Binary:
#####################################################################
-qt_add_benchmark(tst_bench_qmatrix4x4
+qt_internal_add_benchmark(tst_bench_qmatrix4x4
SOURCES
tst_qmatrix4x4.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qmatrix4x4.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/math3d/qmatrix4x4/qmatrix4x4.pro b/tests/benchmarks/gui/math3d/qmatrix4x4/qmatrix4x4.pro
deleted file mode 100644
index fe5c23840f..0000000000
--- a/tests/benchmarks/gui/math3d/qmatrix4x4/qmatrix4x4.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-TEMPLATE = app
-TARGET = tst_bench_qmatrix4x4
-QT += testlib
-SOURCES += tst_qmatrix4x4.cpp
-
diff --git a/tests/benchmarks/gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp b/tests/benchmarks/gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp
index 563c05db15..ebc61495dd 100644
--- a/tests/benchmarks/gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp
+++ b/tests/benchmarks/gui/math3d/qmatrix4x4/tst_qmatrix4x4.cpp
@@ -1,32 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtOpenGL 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$
-**
-****************************************************************************/
-
-#include <QtTest/QtTest>
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include <QTest>
#include <QtGui/qmatrix4x4.h>
class tst_QMatrix4x4 : public QObject
@@ -210,7 +185,8 @@ void tst_QMatrix4x4::mapVector3D()
m1.optimize();
QBENCHMARK {
- result = m1 * v;
+ result = m1.map(v);
+ Q_UNUSED(result)
}
// Force the result to be stored so the compiler doesn't
@@ -234,7 +210,8 @@ void tst_QMatrix4x4::mapVector2D()
m1.optimize();
QBENCHMARK {
- result = m1 * v;
+ result = m1.map(v);
+ Q_UNUSED(result)
}
// Force the result to be stored so the compiler doesn't
diff --git a/tests/benchmarks/gui/math3d/qquaternion/CMakeLists.txt b/tests/benchmarks/gui/math3d/qquaternion/CMakeLists.txt
index 863179b171..e5880c0916 100644
--- a/tests/benchmarks/gui/math3d/qquaternion/CMakeLists.txt
+++ b/tests/benchmarks/gui/math3d/qquaternion/CMakeLists.txt
@@ -1,16 +1,14 @@
-# Generated from qquaternion.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qquaternion Binary:
#####################################################################
-qt_add_benchmark(tst_bench_qquaternion
+qt_internal_add_benchmark(tst_bench_qquaternion
SOURCES
tst_qquaternion.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qquaternion.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/math3d/qquaternion/qquaternion.pro b/tests/benchmarks/gui/math3d/qquaternion/qquaternion.pro
deleted file mode 100644
index e57a3e6a38..0000000000
--- a/tests/benchmarks/gui/math3d/qquaternion/qquaternion.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-TEMPLATE = app
-TARGET = tst_bench_qquaternion
-QT += testlib
-SOURCES += tst_qquaternion.cpp
-
diff --git a/tests/benchmarks/gui/math3d/qquaternion/tst_qquaternion.cpp b/tests/benchmarks/gui/math3d/qquaternion/tst_qquaternion.cpp
index 05c09712cd..07b47d6401 100644
--- a/tests/benchmarks/gui/math3d/qquaternion/tst_qquaternion.cpp
+++ b/tests/benchmarks/gui/math3d/qquaternion/tst_qquaternion.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qtest.h>
#include <QQuaternion>
@@ -102,6 +77,7 @@ void tst_QQuaternion::multiply()
QBENCHMARK {
QQuaternion q3 = q1 * q2;
+ Q_UNUSED(q3)
}
}
diff --git a/tests/benchmarks/gui/painting/CMakeLists.txt b/tests/benchmarks/gui/painting/CMakeLists.txt
index 080fe582f2..2313688038 100644
--- a/tests/benchmarks/gui/painting/CMakeLists.txt
+++ b/tests/benchmarks/gui/painting/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from painting.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(drawtexture)
add_subdirectory(qcolor)
diff --git a/tests/benchmarks/gui/painting/drawtexture/CMakeLists.txt b/tests/benchmarks/gui/painting/drawtexture/CMakeLists.txt
index 843c84e050..1e9af29d7f 100644
--- a/tests/benchmarks/gui/painting/drawtexture/CMakeLists.txt
+++ b/tests/benchmarks/gui/painting/drawtexture/CMakeLists.txt
@@ -1,17 +1,15 @@
-# Generated from drawtexture.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_drawtexture Binary:
#####################################################################
-qt_add_benchmark(tst_bench_drawtexture
+qt_internal_add_benchmark(tst_bench_drawtexture
SOURCES
tst_drawtexture.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:drawtexture.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/painting/drawtexture/drawtexture.pro b/tests/benchmarks/gui/painting/drawtexture/drawtexture.pro
deleted file mode 100644
index aa4aee5bba..0000000000
--- a/tests/benchmarks/gui/painting/drawtexture/drawtexture.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-QT += testlib
-QT += gui-private
-
-TEMPLATE = app
-TARGET = tst_bench_drawtexture
-
-SOURCES += tst_drawtexture.cpp
diff --git a/tests/benchmarks/gui/painting/drawtexture/tst_drawtexture.cpp b/tests/benchmarks/gui/painting/drawtexture/tst_drawtexture.cpp
index c16e68a0b1..4ab0a2db1e 100644
--- a/tests/benchmarks/gui/painting/drawtexture/tst_drawtexture.cpp
+++ b/tests/benchmarks/gui/painting/drawtexture/tst_drawtexture.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2017 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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
#include <qtest.h>
#include <QPainter>
diff --git a/tests/benchmarks/gui/painting/lancebench/CMakeLists.txt b/tests/benchmarks/gui/painting/lancebench/CMakeLists.txt
index b272dcac73..bfdd4df1c9 100644
--- a/tests/benchmarks/gui/painting/lancebench/CMakeLists.txt
+++ b/tests/benchmarks/gui/painting/lancebench/CMakeLists.txt
@@ -1,107 +1,23 @@
-# Generated from lancebench.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_lancebench Binary:
#####################################################################
-qt_add_benchmark(tst_bench_lancebench
+qt_internal_add_benchmark(tst_bench_lancebench
SOURCES
- ../../../../auto/other/lancelot/paintcommands.cpp ../../../../auto/other/lancelot/paintcommands.h
+ ../../../../baseline/shared/paintcommands.cpp ../../../../baseline/shared/paintcommands.h
tst_lancebench.cpp
- PUBLIC_LIBRARIES
+ INCLUDE_DIRECTORIES
+ ../../../../baseline/shared
+ LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::Test
)
# Resources:
-set_source_files_properties("../../../../auto/other/lancelot/images/alpha.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/alpha.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/alpha2x2.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/alpha2x2.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/bitmap.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/bitmap.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/border.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/border.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/borderimage.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/borderimage.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/dome_argb32.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/dome_argb32.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/dome_indexed.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/dome_indexed.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/dome_indexed_mask.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/dome_indexed_mask.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/dome_mono.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/dome_mono.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/dome_mono_128.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/dome_mono_128.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/dome_mono_palette.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/dome_mono_palette.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/dome_rgb32.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/dome_rgb32.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/dot.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/dot.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/face.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/face.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/gam030.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/gam030.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/gam045.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/gam045.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/gam056.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/gam056.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/gam100.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/gam100.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/gam200.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/gam200.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/image.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/image.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/mask.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/mask.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/mask_100.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/mask_100.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/masked.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/masked.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/sign.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/sign.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/solid.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/solid.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/solid2x2.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/solid2x2.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/struct-image-01.jpg"
- PROPERTIES QT_RESOURCE_ALIAS "images/struct-image-01.jpg"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/struct-image-01.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/struct-image-01.png"
-)
-set_source_files_properties("../../../../auto/other/lancelot/images/zebra.png"
- PROPERTIES QT_RESOURCE_ALIAS "images/zebra.png"
-)
set(images_resource_files
"images/alpha.png"
"images/alpha2x2.png"
@@ -134,24 +50,21 @@ set(images_resource_files
"images/zebra.png"
)
-qt_add_resource(tst_bench_lancebench "images"
+list(TRANSFORM images_resource_files PREPEND "../../../../baseline/painting/")
+
+qt_internal_add_resource(tst_bench_lancebench "images"
PREFIX
"/"
BASE
- "../../../../auto/other/lancelot"
+ "../../../../baseline/painting"
FILES
${images_resource_files}
)
-
-#### Keys ignored in scope 1:.:.:lancebench.pro:<TRUE>:
-# TEMPLATE = "app"
-# TESTDATA = "../../../../auto/other/lancelot/scripts/*"
-
## Scopes:
#####################################################################
-qt_extend_target(tst_bench_lancebench CONDITION QT_FEATURE_opengl
- PUBLIC_LIBRARIES
+qt_internal_extend_target(tst_bench_lancebench CONDITION QT_FEATURE_opengl
+ LIBRARIES
Qt::OpenGL
)
diff --git a/tests/benchmarks/gui/painting/lancebench/lancebench.pro b/tests/benchmarks/gui/painting/lancebench/lancebench.pro
deleted file mode 100644
index 5647d26de3..0000000000
--- a/tests/benchmarks/gui/painting/lancebench/lancebench.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = app
-TARGET = tst_bench_lancebench
-
-QT += testlib gui-private
-qtConfig(opengl): QT += opengl
-
-SOURCES += tst_lancebench.cpp
-
-SOURCES += ../../../../auto/other/lancelot/paintcommands.cpp
-HEADERS += ../../../../auto/other/lancelot/paintcommands.h
-RESOURCES += ../../../../auto/other/lancelot/images.qrc
-
-TESTDATA += ../../../../auto/other/lancelot/scripts/*
diff --git a/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp b/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp
index 1c17f86cf9..67bef8ebfe 100644
--- a/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp
+++ b/tests/benchmarks/gui/painting/lancebench/tst_lancebench.cpp
@@ -1,32 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2018 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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$
-**
-****************************************************************************/
-
-#include "../../../../auto/other/lancelot/paintcommands.h"
+// Copyright (C) 2018 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include "paintcommands.h"
#include <qtest.h>
#include <QDir>
@@ -96,17 +71,17 @@ tst_LanceBench::tst_LanceBench()
void tst_LanceBench::initTestCase()
{
- QString baseDir = QFINDTESTDATA("../../../../auto/other/lancelot/scripts/text.qps");
+ QString baseDir = QFINDTESTDATA("../../../../baseline/painting/scripts/text.qps");
scriptsDir = baseDir.left(baseDir.lastIndexOf('/')) + '/';
QDir qpsDir(scriptsDir);
qpsFiles = qpsDir.entryList(QStringList() << QLatin1String("*.qps"), QDir::Files | QDir::Readable);
if (qpsFiles.isEmpty()) {
- QWARN("No qps script files found in " + qpsDir.path().toLatin1());
+ qWarning() << "No qps script files found in" << qpsDir.path();
QSKIP("Aborted due to errors.");
}
std::sort(qpsFiles.begin(), qpsFiles.end());
- for (const QString& fileName : qAsConst(qpsFiles)) {
+ for (const QString& fileName : std::as_const(qpsFiles)) {
QFile file(scriptsDir + fileName);
file.open(QFile::ReadOnly);
QByteArray cont = file.readAll();
@@ -262,7 +237,7 @@ void tst_LanceBench::testCoreOpenGL()
void tst_LanceBench::setupTestSuite(const QStringList& blacklist)
{
QTest::addColumn<QString>("qpsFile");
- for (const QString &fileName : qAsConst(qpsFiles)) {
+ for (const QString &fileName : std::as_const(qpsFiles)) {
if (blacklist.contains(fileName))
continue;
QTest::newRow(fileName.toLatin1()) << fileName;
diff --git a/tests/benchmarks/gui/painting/painting.pro b/tests/benchmarks/gui/painting/painting.pro
deleted file mode 100644
index 400c2994a6..0000000000
--- a/tests/benchmarks/gui/painting/painting.pro
+++ /dev/null
@@ -1,13 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = \
- drawtexture \
- qcolor \
- qpainter \
- qregion \
- qtransform \
- qtbench \
- lancebench
-
-!qtHaveModule(widgets): SUBDIRS -= \
- qpainter \
- qtbench
diff --git a/tests/benchmarks/gui/painting/qcolor/CMakeLists.txt b/tests/benchmarks/gui/painting/qcolor/CMakeLists.txt
index 423047f906..a450c698bf 100644
--- a/tests/benchmarks/gui/painting/qcolor/CMakeLists.txt
+++ b/tests/benchmarks/gui/painting/qcolor/CMakeLists.txt
@@ -1,17 +1,15 @@
-# Generated from qcolor.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qcolor Binary:
#####################################################################
-qt_add_benchmark(tst_bench_qcolor
+qt_internal_add_benchmark(tst_bench_qcolor
SOURCES
tst_qcolor.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qcolor.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/painting/qcolor/qcolor.pro b/tests/benchmarks/gui/painting/qcolor/qcolor.pro
deleted file mode 100644
index 5ceb702323..0000000000
--- a/tests/benchmarks/gui/painting/qcolor/qcolor.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-QT += testlib
-QT += gui-private
-
-TEMPLATE = app
-TARGET = tst_bench_qcolor
-
-SOURCES += tst_qcolor.cpp
diff --git a/tests/benchmarks/gui/painting/qcolor/tst_qcolor.cpp b/tests/benchmarks/gui/painting/qcolor/tst_qcolor.cpp
index 52a7673c0c..02fe3f986e 100644
--- a/tests/benchmarks/gui/painting/qcolor/tst_qcolor.cpp
+++ b/tests/benchmarks/gui/painting/qcolor/tst_qcolor.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author David Faure <david.faure@kdab.com>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qtest.h>
#include <QColor>
diff --git a/tests/benchmarks/gui/painting/qpainter/CMakeLists.txt b/tests/benchmarks/gui/painting/qpainter/CMakeLists.txt
index 590d85b1b6..13a99ecc1d 100644
--- a/tests/benchmarks/gui/painting/qpainter/CMakeLists.txt
+++ b/tests/benchmarks/gui/painting/qpainter/CMakeLists.txt
@@ -1,19 +1,17 @@
-# Generated from qpainter.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qpainter Binary:
#####################################################################
-qt_add_benchmark(tst_bench_qpainter
+qt_internal_add_benchmark(tst_bench_qpainter
SOURCES
tst_qpainter.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::Test
Qt::Widgets
Qt::WidgetsPrivate
)
-
-#### Keys ignored in scope 1:.:.:qpainter.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/painting/qpainter/qpainter.pro b/tests/benchmarks/gui/painting/qpainter/qpainter.pro
deleted file mode 100644
index 1a1f218033..0000000000
--- a/tests/benchmarks/gui/painting/qpainter/qpainter.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-QT += widgets testlib
-QT += gui-private widgets-private
-
-TEMPLATE = app
-TARGET = tst_bench_qpainter
-
-SOURCES += tst_qpainter.cpp
diff --git a/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp b/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp
index 055ecff6bf..7954e964b3 100644
--- a/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp
+++ b/tests/benchmarks/gui/painting/qpainter/tst_qpainter.cpp
@@ -1,30 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include <qtest.h>
#include <QPainter>
@@ -220,6 +197,9 @@ private slots:
void drawTransformedSemiTransparentImage();
void drawTransformedFilledImage();
+ void drawPathExceedingDevice_data();
+ void drawPathExceedingDevice();
+
private:
void setupBrushes();
void createPrimitives();
@@ -554,7 +534,7 @@ void tst_QPainter::drawLine_clipped()
qMin(line.y1(), line.y2())
+ 2*offset + qAbs(line.dy()));
- const QRect clip = QRect(line.p1(), line.p2()).normalized();
+ const QRect clip = QRect::span(line.p1(), line.p2());
pixmapClipped.fill(Qt::white);
QPainter p(&pixmapClipped);
@@ -589,7 +569,7 @@ void tst_QPainter::drawLine_antialiased_clipped()
qMin(line.y1(), line.y2())
+ 2*offset + qAbs(line.dy()));
- const QRect clip = QRect(line.p1(), line.p2()).normalized();
+ const QRect clip = QRect::span(line.p1(), line.p2());
pixmapClipped.fill(Qt::white);
QPainter p(&pixmapClipped);
@@ -695,7 +675,7 @@ void tst_QPainter::drawPixmapImage_data_helper(bool pixmaps)
for (; *targetFormats != QImage::Format_Invalid; ++targetFormats) {
const QImage::Format *sourceFormats = pixmaps ? pixmapFormats : sourceImageFormats;
for (; *sourceFormats != QImage::Format_Invalid; ++sourceFormats) {
- for (const QSize &s : qAsConst(sizes)) {
+ for (const QSize &s : std::as_const(sizes)) {
for (int type=0; type<=3; ++type) {
QString name = QString::fromLatin1("%1 on %2, (%3x%4), %5")
.arg(formatNames[*sourceFormats])
@@ -1684,6 +1664,56 @@ void tst_QPainter::drawTransformedFilledImage()
}
}
+void tst_QPainter::drawPathExceedingDevice_data()
+{
+ QTest::addColumn<int>("dim");
+ QTest::addColumn<QPainterPath>("path");
+
+ const int dim = 512;
+ QPainterPath p;
+ const int ext = 10 * dim;
+ for (int i = 0; i < ext; i += (ext / 50)) {
+ p.lineTo(ext, i);
+ p.lineTo(0, dim);
+ p.moveTo(0, 0);
+ }
+
+ {
+ QPainterPath preClip;
+ preClip.addRect(0, 0, dim, dim);
+ QTest::newRow("devicesize") << dim << p.intersected(preClip);
+ }
+
+ {
+ QPainterPath preClip;
+ preClip.addRect(0, 0, 2*dim, 2*dim);
+ QTest::newRow("devicesizex2") << dim << p.intersected(preClip);
+ }
+
+ {
+ QPainterPath preClip;
+ preClip.addRect(0, 0, 5*dim, 5*dim);
+ QTest::newRow("devicesizex5") << dim << p.intersected(preClip);
+ }
+
+ QTest::newRow("devicesizex10") << dim << p;
+}
+
+void tst_QPainter::drawPathExceedingDevice()
+{
+ QFETCH(int, dim);
+ QFETCH(QPainterPath, path);
+
+ QImage img(dim, dim, QImage::Format_RGB32);
+ QPainter p(&img);
+ p.setRenderHint(QPainter::Antialiasing);
+ p.setPen(QPen(Qt::black, 3));
+ p.setBrush(Qt::NoBrush);
+
+ QBENCHMARK {
+ p.drawPath(path);
+ }
+}
QTEST_MAIN(tst_QPainter)
diff --git a/tests/benchmarks/gui/painting/qregion/CMakeLists.txt b/tests/benchmarks/gui/painting/qregion/CMakeLists.txt
index 1cb2a8b24c..c242a2f588 100644
--- a/tests/benchmarks/gui/painting/qregion/CMakeLists.txt
+++ b/tests/benchmarks/gui/painting/qregion/CMakeLists.txt
@@ -1,16 +1,14 @@
-# Generated from qregion.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qregion Binary:
#####################################################################
-qt_add_benchmark(tst_bench_qregion
+qt_internal_add_benchmark(tst_bench_qregion
SOURCES
main.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qregion.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/painting/qregion/main.cpp b/tests/benchmarks/gui/painting/qregion/main.cpp
index 9e926780ab..696972c140 100644
--- a/tests/benchmarks/gui/painting/qregion/main.cpp
+++ b/tests/benchmarks/gui/painting/qregion/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
// This file contains benchmarks for QRegion functions.
#include <QDebug>
diff --git a/tests/benchmarks/gui/painting/qregion/qregion.pro b/tests/benchmarks/gui/painting/qregion/qregion.pro
deleted file mode 100644
index 1ff55080c5..0000000000
--- a/tests/benchmarks/gui/painting/qregion/qregion.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-TEMPLATE = app
-TARGET = tst_bench_qregion
-QT += testlib
-CONFIG += release
-
-SOURCES += main.cpp
diff --git a/tests/benchmarks/gui/painting/qtbench/CMakeLists.txt b/tests/benchmarks/gui/painting/qtbench/CMakeLists.txt
index ce065d070c..68fbf0984f 100644
--- a/tests/benchmarks/gui/painting/qtbench/CMakeLists.txt
+++ b/tests/benchmarks/gui/painting/qtbench/CMakeLists.txt
@@ -1,17 +1,15 @@
-# Generated from qtbench.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qtbench Binary:
#####################################################################
-qt_add_benchmark(tst_bench_qtbench
+qt_internal_add_benchmark(tst_bench_qtbench
SOURCES
tst_qtbench.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
Qt::Widgets
)
-
-#### Keys ignored in scope 1:.:.:qtbench.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/painting/qtbench/benchmarktests.h b/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
index ed03182597..9d890f1577 100644
--- a/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
+++ b/tests/benchmarks/gui/painting/qtbench/benchmarktests.h
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the FOO 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#ifndef BENCHMARKTESTS_H
#define BENCHMARKTESTS_H
@@ -128,13 +103,15 @@ public:
{
}
- virtual void draw(QPainter *p, const QRect &rect, int iterationCount) {
+ void draw(QPainter *p, const QRect &rect, int iterationCount) override
+ {
p->fillRect(rect, randomColor(iterationCount));
}
- virtual QString name() const {
+ QString name() const override
+ {
return QString::fromLatin1("fillRect(%1)").arg(m_size.width());
- }
+ }
};
class ImageFillRectBenchmark : public Benchmark
@@ -154,13 +131,12 @@ public:
m_brush = QBrush(m_content);
}
- virtual void draw(QPainter *p, const QRect &rect, int) {
- p->fillRect(rect, m_brush);
- }
+ void draw(QPainter *p, const QRect &rect, int) override { p->fillRect(rect, m_brush); }
- virtual QString name() const {
+ QString name() const override
+ {
return QString::fromLatin1("fillRect with image(%1)").arg(m_size.width());
- }
+ }
private:
QImage m_content;
@@ -176,19 +152,18 @@ public:
{
}
- virtual void begin(QPainter *p, int) {
+ void begin(QPainter *p, int) override
+ {
p->setPen(Qt::NoPen);
p->setBrush(randomColor(m_size.width()));
}
+ void draw(QPainter *p, const QRect &rect, int) override { p->drawRect(rect); }
- virtual void draw(QPainter *p, const QRect &rect, int) {
- p->drawRect(rect);
- }
-
- virtual QString name() const {
+ QString name() const override
+ {
return QString::fromLatin1("drawRect(%1)").arg(m_size.width());
- }
+ }
};
@@ -200,19 +175,18 @@ public:
{
}
- virtual void begin(QPainter *p, int) {
- p->setPen(Qt::NoPen);
- }
-
+ void begin(QPainter *p, int) override { p->setPen(Qt::NoPen); }
- virtual void draw(QPainter *p, const QRect &rect, int i) {
+ void draw(QPainter *p, const QRect &rect, int i) override
+ {
p->setBrush(randomColor(i));
p->drawRect(rect);
}
- virtual QString name() const {
+ QString name() const override
+ {
return QString::fromLatin1("drawRect with brushchange(%1)").arg(m_size.width());
- }
+ }
};
class RoundRectBenchmark : public Benchmark
@@ -224,16 +198,19 @@ public:
m_roundness = size / 4.;
}
- virtual void begin(QPainter *p, int) {
+ void begin(QPainter *p, int) override
+ {
p->setPen(Qt::NoPen);
p->setBrush(Qt::red);
}
- virtual void draw(QPainter *p, const QRect &rect, int) {
+ void draw(QPainter *p, const QRect &rect, int) override
+ {
p->drawRoundedRect(rect, m_roundness, m_roundness);
}
- virtual QString name() const {
+ QString name() const override
+ {
return QString::fromLatin1("drawRoundedRect(%1)").arg(m_size.width());
}
@@ -262,7 +239,8 @@ public:
{
}
- virtual void begin(QPainter *p, int) {
+ void begin(QPainter *p, int) override
+ {
if (m_type & Stroked)
p->setPen(Qt::black);
else
@@ -274,7 +252,8 @@ public:
p->setBrush(Qt::NoBrush);
}
- virtual void draw(QPainter *p, const QRect &rect, int) {
+ void draw(QPainter *p, const QRect &rect, int) override
+ {
switch (m_type & Shapes) {
case ArcShape:
p->drawArc(rect, 45*16, 120*16);
@@ -291,7 +270,8 @@ public:
}
}
- virtual QString name() const {
+ QString name() const override
+ {
QString fillStroke;
if ((m_type & (Stroked|Filled)) == (Stroked|Filled)) {
@@ -336,24 +316,24 @@ public:
{
}
- virtual void begin(QPainter *p, int) {
- p->scale(m_scale, m_scale);
- }
+ void begin(QPainter *p, int) override { p->scale(m_scale, m_scale); }
- virtual void draw(QPainter *p, const QRect &rect, int) {
+ void draw(QPainter *p, const QRect &rect, int) override
+ {
if (m_as_pixmap)
p->drawPixmap(rect.topLeft(), m_pixmap);
else
p->drawImage(rect.topLeft(), m_image);
}
- virtual QString name() const {
+ QString name() const override
+ {
return QString::fromLatin1("draw%4(%1) at scale=%2, depth=%3")
.arg(m_size.width())
.arg(m_scale)
.arg(m_as_pixmap ? m_pixmap.depth() : m_image.depth())
.arg(m_type);
- }
+ }
private:
QImage m_image;
@@ -382,7 +362,8 @@ public:
{
}
- virtual void draw(QPainter *p, const QRect &rect, int) {
+ void draw(QPainter *p, const QRect &rect, int) override
+ {
QTransform oldTransform = p->transform();
p->translate(0.5 * rect.width() + rect.left(), 0.5 * rect.height() + rect.top());
p->shear(0.25, 0.0);
@@ -394,12 +375,13 @@ public:
p->setTransform(oldTransform);
}
- virtual QString name() const {
+ QString name() const override
+ {
return QString::fromLatin1("draw%3(%1) w/transform, depth=%2")
.arg(m_size.width())
.arg(m_as_pixmap ? m_pixmap.depth() : m_image.depth())
.arg(m_type);
- }
+ }
private:
QImage m_image;
@@ -428,19 +410,21 @@ public:
{
}
- virtual void draw(QPainter *p, const QRect &rect, int) {
+ void draw(QPainter *p, const QRect &rect, int) override
+ {
if (m_as_pixmap)
p->drawPixmap(rect.topLeft(), m_pixmap);
else
p->drawImage(rect.topLeft(), m_image);
}
- virtual QString name() const {
+ QString name() const override
+ {
return QString::fromLatin1("draw%2(%1), depth=%3")
.arg(m_size.width())
.arg(m_type)
.arg(m_as_pixmap ? m_pixmap.depth() : m_image.depth());
- }
+ }
private:
QImage m_image;
@@ -469,7 +453,8 @@ public:
{
}
- virtual void begin(QPainter *p, int iterations) {
+ void begin(QPainter *p, int iterations) override
+ {
m_staticTexts.clear();
m_currentStaticText = 0;
m_pixmaps.clear();
@@ -544,20 +529,20 @@ public:
m_staticTexts.append(staticText);
QFontMetrics fm(p->font());
- m_size = QSize(fm.horizontalAdvance(m_text, m_text.length()), fm.height());
+ m_size = QSize(fm.horizontalAdvance(m_text, m_text.size()), fm.height());
break;
}
case PainterQPointMode: {
QFontMetrics fm(p->font());
- m_size = QSize(fm.horizontalAdvance(m_text, m_text.length()), fm.height());
+ m_size = QSize(fm.horizontalAdvance(m_text, m_text.size()), fm.height());
break;
}
}
}
- virtual void draw(QPainter *p, const QRect &rect, int)
+ void draw(QPainter *p, const QRect &rect, int) override
{
switch (m_mode) {
case PainterMode:
@@ -589,8 +574,9 @@ public:
}
}
- virtual QString name() const {
- int letters = m_text.length();
+ QString name() const override
+ {
+ int letters = m_text.size();
int lines = m_text.count('\n');
if (lines == 0)
lines = 1;
@@ -644,7 +630,8 @@ public:
{
}
- virtual void begin(QPainter *p, int) {
+ void begin(QPainter *p, int) override
+ {
QRect m_bounds = QRect(0,0,p->device()->width(), p->device()->height());
p->setPen(Qt::NoPen);
p->setBrush(Qt::red);
@@ -706,11 +693,10 @@ public:
}
}
- virtual void draw(QPainter *p, const QRect &rect, int) {
- p->drawRect(rect);
- }
+ void draw(QPainter *p, const QRect &rect, int) override { p->drawRect(rect); }
- virtual QString name() const {
+ QString name() const override
+ {
QString namedType;
switch (m_type) {
case RectClip:
@@ -739,7 +725,7 @@ public:
break;
}
return QString::fromLatin1("%1-clipped-drawRect(%2)").arg(namedType).arg(m_size.width());
- }
+ }
ClipType m_type;
};
@@ -764,7 +750,8 @@ public:
}
- virtual void draw(QPainter *p, const QRect &rect, int) {
+ void draw(QPainter *p, const QRect &rect, int) override
+ {
switch (m_type) {
case Horizontal_Integer:
p->drawLine(QLine(rect.x(), rect.y(), rect.x() + m_length, rect.y()));
@@ -787,7 +774,8 @@ public:
}
}
- virtual QString name() const {
+ QString name() const override
+ {
const char *names[] = {
"Hor_I",
"Diag_I",
diff --git a/tests/benchmarks/gui/painting/qtbench/qtbench.pro b/tests/benchmarks/gui/painting/qtbench/qtbench.pro
deleted file mode 100644
index a4c7273b47..0000000000
--- a/tests/benchmarks/gui/painting/qtbench/qtbench.pro
+++ /dev/null
@@ -1,6 +0,0 @@
-QT += widgets testlib
-
-TEMPLATE = app
-TARGET = tst_bench_qtbench
-
-SOURCES += tst_qtbench.cpp
diff --git a/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp
index 40485e303f..45b7045f94 100644
--- a/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp
+++ b/tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp
@@ -1,30 +1,7 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2020 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#undef QT_NO_FOREACH // this file contains unported legacy Q_FOREACH uses
#include <qtest.h>
@@ -39,7 +16,7 @@ class BenchWidget : public QWidget
public:
BenchWidget(Benchmark *benchmark);
- void paintEvent(QPaintEvent *event);
+ void paintEvent(QPaintEvent *event) override;
bool done() const { return m_done; }
qreal result() const { return m_result; }
@@ -132,9 +109,13 @@ class tst_QtBench : public QObject
{
Q_OBJECT
+ QList<Benchmark *> benchmarks;
+
private slots:
void qtBench();
void qtBench_data();
+
+ void cleanupTestCase() { qDeleteAll(benchmarks); }
};
QString makeString(int length)
@@ -184,7 +165,6 @@ void tst_QtBench::qtBench_data()
"i erat, sed pellentesque\n"
"mi. Curabitur sed.";
- QList<Benchmark *> benchmarks;
benchmarks << (new DrawText(shortString, DrawText::PainterMode));
benchmarks << (new DrawText(middleString, DrawText::PainterMode));
benchmarks << (new DrawText(longString, DrawText::PainterMode));
diff --git a/tests/benchmarks/gui/painting/qtransform/CMakeLists.txt b/tests/benchmarks/gui/painting/qtransform/CMakeLists.txt
index 33df9646c7..8915ca3eb7 100644
--- a/tests/benchmarks/gui/painting/qtransform/CMakeLists.txt
+++ b/tests/benchmarks/gui/painting/qtransform/CMakeLists.txt
@@ -1,16 +1,14 @@
-# Generated from qtransform.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_qtransform Binary:
#####################################################################
-qt_add_benchmark(tst_bench_qtransform
+qt_internal_add_benchmark(tst_bench_qtransform
SOURCES
tst_qtransform.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qtransform.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/painting/qtransform/qtransform.pro b/tests/benchmarks/gui/painting/qtransform/qtransform.pro
deleted file mode 100644
index e8de3fcbd4..0000000000
--- a/tests/benchmarks/gui/painting/qtransform/qtransform.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-TEMPLATE = app
-TARGET = tst_bench_qtransform
-QT += testlib
-SOURCES += tst_qtransform.cpp
-
diff --git a/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp b/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp
index d28f9502d7..e6442d0dff 100644
--- a/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp
+++ b/tests/benchmarks/gui/painting/qtransform/tst_qtransform.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <qtest.h>
#include <QTransform>
@@ -266,7 +241,7 @@ void tst_QTransform::operatorEqual()
QFETCH(QTransform, x2);
QTransform x = x1;
QBENCHMARK {
- x == x2;
+ [[maybe_unused]] auto r = x == x2;
}
}
@@ -278,7 +253,7 @@ void tst_QTransform::operatorNotEqual()
QFETCH(QTransform, x2);
QTransform x = x1;
QBENCHMARK {
- x != x2;
+ [[maybe_unused]] auto r = x != x2;
}
}
@@ -290,7 +265,7 @@ void tst_QTransform::operatorMultiply()
QFETCH(QTransform, x2);
QTransform x = x1;
QBENCHMARK {
- x * x2;
+ [[maybe_unused]] auto r = x * x2;
}
}
@@ -335,7 +310,7 @@ void tst_QTransform::operatorMultiplyEqualScalar()
QFETCH(QTransform, transform);
QTransform x = transform;
QBENCHMARK {
- x * 3;
+ x *= 3;
}
}
@@ -357,7 +332,7 @@ void tst_QTransform::mapQPoint()
QFETCH(QTransform, transform);
QTransform x = transform;
QBENCHMARK {
- x.map(QPoint(3, 3));
+ [[maybe_unused]] auto r = x.map(QPoint(3, 3));
}
}
@@ -368,7 +343,7 @@ void tst_QTransform::mapQPointF()
QFETCH(QTransform, transform);
QTransform x = transform;
QBENCHMARK {
- x.map(QPointF(3, 3));
+ [[maybe_unused]] auto r = x.map(QPointF(3, 3));
}
}
@@ -379,7 +354,7 @@ void tst_QTransform::mapRect()
QFETCH(QTransform, transform);
QTransform x = transform;
QBENCHMARK {
- x.mapRect(QRect(0, 0, 100, 100));
+ [[maybe_unused]] auto r = x.mapRect(QRect(0, 0, 100, 100));
}
}
@@ -390,7 +365,7 @@ void tst_QTransform::mapRectF()
QFETCH(QTransform, transform);
QTransform x = transform;
QBENCHMARK {
- x.mapRect(QRectF(0, 0, 100, 100));
+ [[maybe_unused]] auto r = x.mapRect(QRectF(0, 0, 100, 100));
}
}
@@ -402,7 +377,7 @@ void tst_QTransform::mapQPolygon()
QTransform x = transform;
QPolygon poly = QPolygon(QRect(0, 0, 100, 100));
QBENCHMARK {
- x.map(poly);
+ [[maybe_unused]] auto r = x.map(poly);
}
}
@@ -414,7 +389,7 @@ void tst_QTransform::mapQPolygonF()
QTransform x = transform;
QPolygonF poly = QPolygonF(QRectF(0, 0, 100, 100));
QBENCHMARK {
- x.map(poly);
+ [[maybe_unused]] auto r = x.map(poly);
}
}
@@ -428,7 +403,7 @@ void tst_QTransform::mapQRegion()
for (int i = 0; i < 10; ++i)
region += QRect(i * 10, i * 10, 100, 100);
QBENCHMARK {
- x.map(region);
+ [[maybe_unused]] auto r = x.map(region);
}
}
@@ -439,7 +414,7 @@ void tst_QTransform::mapToPolygon()
QFETCH(QTransform, transform);
QTransform x = transform;
QBENCHMARK {
- x.mapToPolygon(QRect(0, 0, 100, 100));
+ [[maybe_unused]] auto r = x.mapToPolygon(QRect(0, 0, 100, 100));
}
}
@@ -454,7 +429,7 @@ void tst_QTransform::mapQPainterPath()
for (int i = 0; i < 10; ++i)
path.addEllipse(i * 10, i * 10, 100, 100);
QBENCHMARK {
- x.map(path);
+ [[maybe_unused]] auto r = x.map(path);
}
}
@@ -464,7 +439,7 @@ void tst_QTransform::isIdentity()
{
QFETCH(QTransform, transform);
QBENCHMARK {
- transform.isIdentity();
+ [[maybe_unused]] auto r = transform.isIdentity();
}
}
@@ -474,7 +449,7 @@ void tst_QTransform::isAffine()
{
QFETCH(QTransform, transform);
QBENCHMARK {
- transform.isAffine();
+ [[maybe_unused]] auto r = transform.isAffine();
}
}
@@ -484,7 +459,7 @@ void tst_QTransform::isInvertible()
{
QFETCH(QTransform, transform);
QBENCHMARK {
- transform.isInvertible();
+ [[maybe_unused]] auto r = transform.isInvertible();
}
}
@@ -494,7 +469,7 @@ void tst_QTransform::isRotating()
{
QFETCH(QTransform, transform);
QBENCHMARK {
- transform.isRotating();
+ [[maybe_unused]] auto r = transform.isRotating();
}
}
@@ -504,7 +479,7 @@ void tst_QTransform::isScaling()
{
QFETCH(QTransform, transform);
QBENCHMARK {
- transform.isScaling();
+ [[maybe_unused]] auto r = transform.isScaling();
}
}
@@ -514,7 +489,7 @@ void tst_QTransform::isTranslating()
{
QFETCH(QTransform, transform);
QBENCHMARK {
- transform.isTranslating();
+ [[maybe_unused]] auto r = transform.isTranslating();
}
}
@@ -524,7 +499,7 @@ void tst_QTransform::type()
{
QFETCH(QTransform, transform);
QBENCHMARK {
- transform.type();
+ [[maybe_unused]] auto r = transform.type();
}
}
@@ -534,7 +509,7 @@ void tst_QTransform::determinant()
{
QFETCH(QTransform, transform);
QBENCHMARK {
- transform.determinant();
+ [[maybe_unused]] auto r = transform.determinant();
}
}
@@ -544,7 +519,7 @@ void tst_QTransform::adjoint()
{
QFETCH(QTransform, transform);
QBENCHMARK {
- transform.adjoint();
+ Q_UNUSED(transform.adjoint())
}
}
@@ -554,7 +529,7 @@ void tst_QTransform::transposed()
{
QFETCH(QTransform, transform);
QBENCHMARK {
- transform.transposed();
+ Q_UNUSED(transform.transposed())
}
}
@@ -564,7 +539,7 @@ void tst_QTransform::inverted()
{
QFETCH(QTransform, transform);
QBENCHMARK {
- transform.inverted();
+ Q_UNUSED(transform.inverted())
}
}
diff --git a/tests/benchmarks/gui/text/CMakeLists.txt b/tests/benchmarks/gui/text/CMakeLists.txt
index 630f01091d..052d49e03c 100644
--- a/tests/benchmarks/gui/text/CMakeLists.txt
+++ b/tests/benchmarks/gui/text/CMakeLists.txt
@@ -1,4 +1,5 @@
-# Generated from text.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
add_subdirectory(qfontmetrics)
add_subdirectory(qtext)
diff --git a/tests/benchmarks/gui/text/qfontmetrics/CMakeLists.txt b/tests/benchmarks/gui/text/qfontmetrics/CMakeLists.txt
index fff90a7172..4b9ae1e4c8 100644
--- a/tests/benchmarks/gui/text/qfontmetrics/CMakeLists.txt
+++ b/tests/benchmarks/gui/text/qfontmetrics/CMakeLists.txt
@@ -1,16 +1,14 @@
-# Generated from qfontmetrics.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_QFontMetrics Binary:
#####################################################################
-qt_add_benchmark(tst_bench_QFontMetrics
+qt_internal_add_benchmark(tst_bench_QFontMetrics
SOURCES
main.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qfontmetrics.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/text/qfontmetrics/main.cpp b/tests/benchmarks/gui/text/qfontmetrics/main.cpp
index 86c7cebfd4..8aafa809f8 100644
--- a/tests/benchmarks/gui/text/qfontmetrics/main.cpp
+++ b/tests/benchmarks/gui/text/qfontmetrics/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QObject>
#include <QFont>
diff --git a/tests/benchmarks/gui/text/qfontmetrics/qfontmetrics.pro b/tests/benchmarks/gui/text/qfontmetrics/qfontmetrics.pro
deleted file mode 100644
index bcaff3de1e..0000000000
--- a/tests/benchmarks/gui/text/qfontmetrics/qfontmetrics.pro
+++ /dev/null
@@ -1,4 +0,0 @@
-TEMPLATE = app
-TARGET = tst_bench_QFontMetrics
-QT += testlib
-SOURCES += main.cpp
diff --git a/tests/benchmarks/gui/text/qtext/CMakeLists.txt b/tests/benchmarks/gui/text/qtext/CMakeLists.txt
index abf152a326..13cd6a2c3a 100644
--- a/tests/benchmarks/gui/text/qtext/CMakeLists.txt
+++ b/tests/benchmarks/gui/text/qtext/CMakeLists.txt
@@ -1,18 +1,15 @@
-# Generated from qtext.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_QText Binary:
#####################################################################
-qt_add_benchmark(tst_bench_QText
+qt_internal_add_benchmark(tst_bench_QText
SOURCES
main.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qtext.pro:<TRUE>:
-# TEMPLATE = "app"
-# TESTDATA = "bidi.txt"
diff --git a/tests/benchmarks/gui/text/qtext/main.cpp b/tests/benchmarks/gui/text/qtext/main.cpp
index ef88f64d8f..9a2740253c 100644
--- a/tests/benchmarks/gui/text/qtext/main.cpp
+++ b/tests/benchmarks/gui/text/qtext/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QDebug>
#include <QTextDocument>
@@ -50,7 +25,9 @@ public:
private slots:
void loadHtml_data();
+#ifndef QT_NO_TEXTHTMLPARSER
void loadHtml();
+#endif
void shaping_data();
void shaping();
@@ -72,9 +49,11 @@ private slots:
void paintLayoutToPixmap();
void paintLayoutToPixmap_painterFill();
+#ifndef QT_NO_TEXTHTMLPARSER
void document();
void paintDocToPixmap();
void paintDocToPixmap_painterFill();
+#endif
private:
QSize setupTextLayout(QTextLayout *layout, bool wrap = true, int wrapWidth = 100);
@@ -101,6 +80,7 @@ void tst_QText::loadHtml_data()
+ parag;
}
+#ifndef QT_NO_TEXTHTMLPARSER
void tst_QText::loadHtml()
{
QFETCH(QString, source);
@@ -109,6 +89,7 @@ void tst_QText::loadHtml()
doc.setHtml(source);
}
}
+#endif
void tst_QText::shaping_data()
{
@@ -122,10 +103,10 @@ void tst_QText::shaping_data()
QFile file(testFile);
QVERIFY(file.open(QFile::ReadOnly));
QByteArray data = file.readAll();
- QVERIFY(data.count() > 1000);
+ QVERIFY(data.size() > 1000);
QStringList list = QString::fromUtf8(data.data()).split(QLatin1Char('\n'), Qt::SkipEmptyParts);
- QVERIFY(list.count() %2 == 0); // even amount as we have title and then content.
- for (int i=0; i < list.count(); i+=2) {
+ QVERIFY(list.size() % 2 == 0); // even amount as we have title and then content.
+ for (int i = 0; i < list.size(); i += 2) {
QTest::newRow(list.at(i).toLatin1()) << list.at(i+1);
}
}
@@ -396,6 +377,7 @@ void tst_QText::paintLayoutToPixmap_painterFill()
}
}
+#ifndef QT_NO_TEXTHTMLPARSER
void tst_QText::document()
{
QTextDocument *doc = new QTextDocument;
@@ -438,6 +420,7 @@ void tst_QText::paintDocToPixmap_painterFill()
doc->drawContents(&p);
}
}
+#endif
QTEST_MAIN(tst_QText)
diff --git a/tests/benchmarks/gui/text/qtext/qtext.pro b/tests/benchmarks/gui/text/qtext/qtext.pro
deleted file mode 100644
index d5597fb097..0000000000
--- a/tests/benchmarks/gui/text/qtext/qtext.pro
+++ /dev/null
@@ -1,9 +0,0 @@
-QT += testlib
-QT += gui-private
-
-TEMPLATE = app
-TARGET = tst_bench_QText
-
-SOURCES += main.cpp
-
-TESTDATA = bidi.txt
diff --git a/tests/benchmarks/gui/text/qtextdocument/CMakeLists.txt b/tests/benchmarks/gui/text/qtextdocument/CMakeLists.txt
index 4cfda68a1b..2a95411335 100644
--- a/tests/benchmarks/gui/text/qtextdocument/CMakeLists.txt
+++ b/tests/benchmarks/gui/text/qtextdocument/CMakeLists.txt
@@ -1,17 +1,15 @@
-# Generated from qtextdocument.pro.
+# Copyright (C) 2022 The Qt Company Ltd.
+# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## tst_bench_QTextDocument Binary:
#####################################################################
-qt_add_benchmark(tst_bench_QTextDocument
+qt_internal_add_benchmark(tst_bench_QTextDocument
SOURCES
main.cpp
- PUBLIC_LIBRARIES
+ LIBRARIES
Qt::Gui
Qt::GuiPrivate
Qt::Test
)
-
-#### Keys ignored in scope 1:.:.:qtextdocument.pro:<TRUE>:
-# TEMPLATE = "app"
diff --git a/tests/benchmarks/gui/text/qtextdocument/main.cpp b/tests/benchmarks/gui/text/qtextdocument/main.cpp
index 17fee3b2eb..7bdff95235 100644
--- a/tests/benchmarks/gui/text/qtextdocument/main.cpp
+++ b/tests/benchmarks/gui/text/qtextdocument/main.cpp
@@ -1,30 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Robin Burchell <robin.burchell@viroteck.net>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the test suite 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) 2016 Robin Burchell <robin.burchell@viroteck.net>
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include <QDebug>
#include <QTextDocument>
diff --git a/tests/benchmarks/gui/text/qtextdocument/qtextdocument.pro b/tests/benchmarks/gui/text/qtextdocument/qtextdocument.pro
deleted file mode 100644
index 67cef8b25c..0000000000
--- a/tests/benchmarks/gui/text/qtextdocument/qtextdocument.pro
+++ /dev/null
@@ -1,7 +0,0 @@
-QT += testlib
-QT += gui-private
-
-TEMPLATE = app
-TARGET = tst_bench_QTextDocument
-
-SOURCES += main.cpp
diff --git a/tests/benchmarks/gui/text/text.pro b/tests/benchmarks/gui/text/text.pro
deleted file mode 100644
index 6dc4f5d16e..0000000000
--- a/tests/benchmarks/gui/text/text.pro
+++ /dev/null
@@ -1,5 +0,0 @@
-TEMPLATE = subdirs
-SUBDIRS = \
- qfontmetrics \
- qtext \
- qtextdocument