diff options
Diffstat (limited to 'tests/auto/gui/image/qpixmap')
-rw-r--r-- | tests/auto/gui/image/qpixmap/CMakeLists.txt | 15 | ||||
-rw-r--r-- | tests/auto/gui/image/qpixmap/qpixmap.qrc | 51 | ||||
-rw-r--r-- | tests/auto/gui/image/qpixmap/tst_qpixmap.cpp | 35 |
3 files changed, 17 insertions, 84 deletions
diff --git a/tests/auto/gui/image/qpixmap/CMakeLists.txt b/tests/auto/gui/image/qpixmap/CMakeLists.txt index 1946715047..8531ef5b7b 100644 --- a/tests/auto/gui/image/qpixmap/CMakeLists.txt +++ b/tests/auto/gui/image/qpixmap/CMakeLists.txt @@ -1,9 +1,16 @@ -# Generated from qpixmap.pro. +# Copyright (C) 2022 The Qt Company Ltd. +# SPDX-License-Identifier: BSD-3-Clause ##################################################################### ## tst_qpixmap Test: ##################################################################### +if(NOT QT_BUILD_STANDALONE_TESTS AND NOT QT_BUILDING_QT) + cmake_minimum_required(VERSION 3.16) + project(tst_qpixmap LANGUAGES CXX) + find_package(Qt6BuildInternals REQUIRED COMPONENTS STANDALONE_TEST) +endif() + # Collect test data file(GLOB_RECURSE test_data_glob RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} @@ -25,7 +32,7 @@ list(APPEND test_data ${test_data_glob}) qt_internal_add_test(tst_qpixmap SOURCES tst_qpixmap.cpp - PUBLIC_LIBRARIES + LIBRARIES Qt::CorePrivate Qt::Gui Qt::GuiPrivate @@ -95,13 +102,13 @@ qt_internal_add_resource(tst_qpixmap "qpixmap" ##################################################################### qt_internal_extend_target(tst_qpixmap CONDITION TARGET Qt::Widgets - PUBLIC_LIBRARIES + LIBRARIES Qt::Widgets Qt::WidgetsPrivate ) qt_internal_extend_target(tst_qpixmap CONDITION WIN32 - PUBLIC_LIBRARIES + LIBRARIES gdi32 user32 ) diff --git a/tests/auto/gui/image/qpixmap/qpixmap.qrc b/tests/auto/gui/image/qpixmap/qpixmap.qrc deleted file mode 100644 index 3965622dba..0000000000 --- a/tests/auto/gui/image/qpixmap/qpixmap.qrc +++ /dev/null @@ -1,51 +0,0 @@ -<RCC> - <qresource> - <file>loadFromData/designer_argb32.png</file> - <file>loadFromData/designer_indexed8_no_alpha_animated.gif</file> - <file>loadFromData/designer_indexed8_no_alpha.gif</file> - <file>loadFromData/designer_indexed8_no_alpha.png</file> - <file>loadFromData/designer_indexed8_with_alpha_animated.gif</file> - <file>loadFromData/designer_indexed8_with_alpha.gif</file> - <file>loadFromData/designer_indexed8_with_alpha.png</file> - <file>loadFromData/designer_rgb32.jpg</file> - <file>loadFromData/designer_rgb32.png</file> - <file>convertFromImage/task31722_1/img1.png</file> - <file>convertFromImage/task31722_1/img2.png</file> - <file>convertFromToHICON/icon_8bpp_16x16.png</file> - <file>convertFromToHICON/icon_8bpp_32x32.png</file> - <file>convertFromToHICON/icon_8bpp_48x48.png</file> - <file>convertFromToHICON/icon_8bpp.ico</file> - <file>convertFromToHICON/icon_32bpp_16x16.png</file> - <file>convertFromToHICON/icon_32bpp_32x32.png</file> - <file>convertFromToHICON/icon_32bpp_48x48.png</file> - <file>convertFromToHICON/icon_32bpp_256x256.png</file> - <file>convertFromToHICON/icon_32bpp.ico</file> - <file>convertFromImage/task31722_0/img1.png</file> - <file>convertFromImage/task31722_0/img2.png</file> - <file>images/designer.png</file> - <file>images/dx_0_dy_0_50_50_100_100.png</file> - <file>images/dx_0_dy_0_null.png</file> - <file>images/dx_0_dy_0_x_y_w_h.png</file> - <file>images/dx_0_dy_-10_50_50_100_100.png</file> - <file>images/dx_0_dy_10_50_50_100_100.png</file> - <file>images/dx_0_dy_-10_x_y_w_h.png</file> - <file>images/dx_0_dy_10_x_y_w_h.png</file> - <file>images/dx_0_dy_-128_x_y_w_h.png</file> - <file>images/dx_0_dy_128_x_y_w_h.png</file> - <file>images/dx_0_dy_1_null.png</file> - <file>images/dx_-10_dy_0_50_50_100_100.png</file> - <file>images/dx_10_dy_0_50_50_100_100.png</file> - <file>images/dx_-10_dy_0_x_y_w_h.png</file> - <file>images/dx_10_dy_0_x_y_w_h.png</file> - <file>images/dx_-10_dy_-10_50_50_100_100.png</file> - <file>images/dx_10_dy_10_50_50_100_100.png</file> - <file>images/dx_-10_dy_-10_x_y_w_h.png</file> - <file>images/dx_10_dy_10_x_y_w_h.png</file> - <file>images/dx_-128_dy_0_x_y_w_h.png</file> - <file>images/dx_128_dy_0_x_y_w_h.png</file> - <file>images/dx_128_dy_128_64_64_128_128.png</file> - <file>images/dx_-128_dy_-128_x_y_w_h.png</file> - <file>images/dx_128_dy_128_x_y_w_h.png</file> - <file>images/dx_1_dy_0_null.png</file> - </qresource> -</RCC> diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp index 6c6c282af4..d8c553b521 100644 --- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp +++ b/tests/auto/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 <QSet> #include <QTemporaryFile> @@ -46,7 +21,7 @@ #include <private/qdrawhelper_p.h> #ifdef Q_OS_WIN -#include <windows.h> +#include <qt_windows.h> #endif @@ -1201,8 +1176,10 @@ void tst_QPixmap::dprPassthrough() pm.convertFromImage(img); QCOMPARE(pm.devicePixelRatio(), dpr); +#ifndef QT_NO_IMAGE_HEURISTIC_MASK QBitmap heuristicMask = src.createHeuristicMask(); QCOMPARE(heuristicMask.devicePixelRatio(), dpr); +#endif QBitmap maskFromColor = src.createMaskFromColor(Qt::white); QCOMPARE(maskFromColor.devicePixelRatio(), dpr); @@ -1448,7 +1425,7 @@ void tst_QPixmap::loadFromDataImage() QPixmap pixmapWithCopy = QPixmap::fromImage(imageRef); QFile file(imagePath); - file.open(QIODevice::ReadOnly); + QVERIFY(file.open(QIODevice::ReadOnly)); QByteArray rawData = file.readAll(); QPixmap directLoadingPixmap; |