diff options
Diffstat (limited to 'tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp')
-rw-r--r-- | tests/benchmarks/gui/painting/qtbench/tst_qtbench.cpp | 38 |
1 files changed, 9 insertions, 29 deletions
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)); |