summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp')
-rw-r--r--tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp43
1 files changed, 20 insertions, 23 deletions
diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
index 8a5250aad4..515ddf480f 100644
--- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
+++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp
@@ -1,31 +1,26 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** 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:LGPL21$
+** $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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 or version 3 as published by the Free
-** Software Foundation and appearing in the file LICENSE.LGPLv21 and
-** LICENSE.LGPLv3 included in the packaging of this file. Please review the
-** following information to ensure the GNU Lesser General Public License
-** requirements will be met: https://www.gnu.org/licenses/lgpl.html and
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** 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$
**
@@ -1509,7 +1504,7 @@ void tst_QWidget::mapFromAndTo()
subWindow2->setGeometry(75, 75, 100, 100);
subSubWindow->setGeometry(10, 10, 10, 10);
-#if !defined(Q_OS_WINCE) && !defined(Q_OS_QNX) || defined(Q_OS_BLACKBERRY)
+#if !defined(Q_OS_WINCE) && !defined(Q_OS_QNX)
//update visibility
if (windowMinimized) {
if (!windowHidden) {
@@ -4979,7 +4974,9 @@ static inline QByteArray msgRgbMismatch(unsigned actual, unsigned expected)
static QPixmap grabWindow(QWindow *window, int x, int y, int width, int height)
{
QScreen *screen = window->screen();
- return screen ? screen->grabWindow(window->winId(), x, y, width, height) : QPixmap();
+ Q_ASSERT(screen);
+ QPixmap result = screen->grabWindow(window->winId(), x, y, width, height);
+ return result.devicePixelRatio() > 1 ? result.scaled(width, height) : result;
}
#define VERIFY_COLOR(child, region, color) verifyColor(child, region, color, __LINE__)
@@ -5651,7 +5648,7 @@ void tst_QWidget::setToolTip()
for (int pass = 0; pass < 2; ++pass) {
QCursor::setPos(0, 0);
QScopedPointer<QWidget> popup(new QWidget(0, Qt::Popup));
- popup->setObjectName(QString::fromLatin1("tst_qwidget setToolTip #%1").arg(pass));
+ popup->setObjectName(QLatin1String("tst_qwidget setToolTip #") + QString::number(pass));
popup->setWindowTitle(popup->objectName());
popup->setGeometry(50, 50, 150, 50);
QFrame *frame = new QFrame(popup.data());
@@ -7357,7 +7354,7 @@ void tst_QWidget::updateWhileMinimized()
{
if (m_platform == QStringLiteral("wayland"))
QSKIP("Wayland: This fails. Figure out why.");
-#if defined(Q_OS_QNX) && !defined(Q_OS_BLACKBERRY)
+#if defined(Q_OS_QNX)
QSKIP("Platform does not support showMinimized()");
#endif
UpdateWidget widget;
@@ -7909,7 +7906,7 @@ void tst_QWidget::doubleRepaint()
// Minmize: Should not trigger a repaint.
widget.showMinimized();
QTest::qWait(10);
-#if defined(Q_OS_QNX) && !defined(Q_OS_BLACKBERRY)
+#if defined(Q_OS_QNX)
QEXPECT_FAIL("", "Platform does not support showMinimized()", Continue);
#endif
QCOMPARE(widget.numPaintEvents, 0);
@@ -8505,7 +8502,7 @@ void tst_QWidget::translucentWidget()
#ifdef Q_OS_WIN
QWidget *desktopWidget = QApplication::desktop()->screen(0);
if (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA)
- widgetSnapshot = qApp->primaryScreen()->grabWindow(desktopWidget->winId(), labelPos.x(), labelPos.y(), label.width(), label.height());
+ widgetSnapshot = grabWindow(desktopWidget->windowHandle(), labelPos.x(), labelPos.y(), label.width(), label.height());
else
#endif
widgetSnapshot = label.grab(QRect(QPoint(0, 0), label.size()));