diff options
Diffstat (limited to 'tests/auto/widgets/widgets/qframe')
-rw-r--r-- | tests/auto/widgets/widgets/qframe/BLACKLIST | 3 | ||||
-rw-r--r-- | tests/auto/widgets/widgets/qframe/CMakeLists.txt | 13 | ||||
-rw-r--r-- | tests/auto/widgets/widgets/qframe/tst_qframe.cpp | 42 |
3 files changed, 23 insertions, 35 deletions
diff --git a/tests/auto/widgets/widgets/qframe/BLACKLIST b/tests/auto/widgets/widgets/qframe/BLACKLIST deleted file mode 100644 index 3a28dd1239..0000000000 --- a/tests/auto/widgets/widgets/qframe/BLACKLIST +++ /dev/null @@ -1,3 +0,0 @@ -# QTBUG-69064 -[testPainting] -android diff --git a/tests/auto/widgets/widgets/qframe/CMakeLists.txt b/tests/auto/widgets/widgets/qframe/CMakeLists.txt index 968f9ac3f3..2213f4a7d9 100644 --- a/tests/auto/widgets/widgets/qframe/CMakeLists.txt +++ b/tests/auto/widgets/widgets/qframe/CMakeLists.txt @@ -1,9 +1,16 @@ -# Generated from qframe.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## tst_qframe Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qframe LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} @@ -11,10 +18,10 @@ file(GLOB_RECURSE test_data_glob list(APPEND test_data ${test_data_glob}) qt_internal_add_test(tst_qframe - LOWDPI # special case + LOWDPI SOURCES tst_qframe.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::Gui Qt::Widgets TESTDATA ${test_data} diff --git a/tests/auto/widgets/widgets/qframe/tst_qframe.cpp b/tests/auto/widgets/widgets/qframe/tst_qframe.cpp index b5272f6b1a..324c512219 100644 --- a/tests/auto/widgets/widgets/qframe/tst_qframe.cpp +++ b/tests/auto/widgets/widgets/qframe/tst_qframe.cpp @@ -1,31 +1,6 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@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 The Qt Company Ltd. +// Copyright (C) 2014 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> +// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #include <QTest> #include <QFrame> @@ -173,7 +148,16 @@ void tst_QFrame::testPainting() frame.setMidLineWidth(midLineWidth); frame.resize(16, 16); - const QPixmap pixmap = frame.grab(); + QPixmap pixmap = frame.grab(); +#ifdef Q_OS_ANDROID + // QPixmap is created with system's default format, which is + // ARGB32_Premultiplied for Android. For desktop systems the format is + // RGB32, so that's also the format of the images in resources. So on + // Android we need to explicitly convert the pixmap to a proper format. + QImage img = pixmap.toImage(); + QVERIFY(img.reinterpretAsFormat(QImage::Format_RGB32)); + pixmap = QPixmap::fromImage(img); +#endif const QString fileName = QLatin1String("images/") + basename + QLatin1Char('_') + QString::number(lineWidth) + QLatin1Char('_') + QString::number(midLineWidth) |