summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets/qframe/tst_qframe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/widgets/qframe/tst_qframe.cpp')
-rw-r--r--tests/auto/widgets/widgets/qframe/tst_qframe.cpp42
1 files changed, 13 insertions, 29 deletions
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)