diff options
Diffstat (limited to 'tests/manual')
-rw-r--r-- | tests/manual/nodetypes_ng/nodetypes_ng.cpp | 7 | ||||
-rw-r--r-- | tests/manual/pointer/pointerDrag.qml | 65 | ||||
-rw-r--r-- | tests/manual/pointer/tapWithModifiers.qml | 14 | ||||
-rw-r--r-- | tests/manual/scenegraph_lancelot/hostinfo.sh | 76 | ||||
-rw-r--r-- | tests/manual/scenegraph_lancelot/scenegrabber/main.cpp | 9 | ||||
-rw-r--r-- | tests/manual/scenegraph_lancelot/scenegraph/scenegraph.pro | 4 | ||||
-rw-r--r-- | tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp | 24 |
7 files changed, 105 insertions, 94 deletions
diff --git a/tests/manual/nodetypes_ng/nodetypes_ng.cpp b/tests/manual/nodetypes_ng/nodetypes_ng.cpp index 829002b538..8fe0e0dc98 100644 --- a/tests/manual/nodetypes_ng/nodetypes_ng.cpp +++ b/tests/manual/nodetypes_ng/nodetypes_ng.cpp @@ -301,6 +301,13 @@ int main(int argc, char **argv) fmt.setProfile(QSurfaceFormat::CoreProfile); view.setFormat(fmt); } + if (app.arguments().contains(QLatin1String("--transparent"))) { + qDebug("Requesting alpha channel for the window and using Qt::transparent as background"); + QSurfaceFormat fmt = view.format(); + fmt.setAlphaBufferSize(8); + view.setFormat(fmt); + view.setColor(Qt::transparent); + } view.engine()->rootContext()->setContextProperty(QLatin1String("helper"), &helper); diff --git a/tests/manual/pointer/pointerDrag.qml b/tests/manual/pointer/pointerDrag.qml index 79044eb0b4..2063d8fae2 100644 --- a/tests/manual/pointer/pointerDrag.qml +++ b/tests/manual/pointer/pointerDrag.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2018 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the manual tests of the Qt Toolkit. @@ -26,7 +26,7 @@ ** ****************************************************************************/ -import QtQuick 2.12 +import QtQuick 2.15 import "content" Rectangle { @@ -74,7 +74,14 @@ Rectangle { label: "DragHandler" objectName: "dragSquircle1" DragHandler { - + dragThreshold: ckZeroDragThreshold1.checked ? 0 : undefined + } + CheckBox { + id: ckZeroDragThreshold1 + label: " Zero threshold" + anchors.horizontalCenter: parent.horizontalCenter + y: 20 + checked: false } } @@ -99,7 +106,16 @@ Rectangle { id: tap2 gesturePolicy: root.globalGesturePolicy } - DragHandler { } + DragHandler { + dragThreshold: ckZeroDragThreshold2.checked ? 0 : undefined + } + CheckBox { + id: ckZeroDragThreshold2 + label: " Zero threshold" + anchors.horizontalCenter: parent.horizontalCenter + y: 32 + checked: false + } } TextBox { @@ -107,7 +123,16 @@ Rectangle { width: 100; height: 100 label: "DragHandler\nTapHandler" color: queryColor(tap3.pressed) - DragHandler { } + DragHandler { + dragThreshold: ckZeroDragThreshold3.checked ? 0 : undefined + } + CheckBox { + id: ckZeroDragThreshold3 + label: " Zero threshold" + anchors.horizontalCenter: parent.horizontalCenter + y: 32 + checked: false + } TapHandler { id: tap3 gesturePolicy: root.globalGesturePolicy @@ -118,7 +143,16 @@ Rectangle { x: 400; y: 0 width: 100; height: 100 label: "DragHandler" - DragHandler { } + DragHandler { + dragThreshold: ckZeroDragThreshold4.checked ? 0 : undefined + } + CheckBox { + id: ckZeroDragThreshold4 + label: " Zero threshold" + anchors.horizontalCenter: parent.horizontalCenter + y: 20 + checked: false + } TextBox { label: "TapHandler" @@ -145,6 +179,13 @@ Rectangle { label: " Greedy ↓" checked: true } + CheckBox { + id: ckZeroDragThreshold5 + label: " Zero threshold" + x: 10 + anchors.bottom: ckGreedyDrag.top + checked: false + } TapHandler { id: tap5 gesturePolicy: root.globalGesturePolicy @@ -159,6 +200,7 @@ Rectangle { DragHandler { grabPermissions: ckGreedyDrag ? DragHandler.CanTakeOverFromAnything : DragHandler.CanTakeOverFromItems | DragHandler.CanTakeOverFromHandlersOfDifferentType | DragHandler.ApprovesTakeOverByAnything + dragThreshold: ckZeroDragThreshold5.checked ? 0 : undefined } } } @@ -174,7 +216,16 @@ Rectangle { label: "DragHandler" x: (parent.width - width)/2 y: 60 - DragHandler { } + DragHandler { + dragThreshold: ckZeroDragThreshold6.checked ? 0 : undefined + } + } + CheckBox { + id: ckZeroDragThreshold6 + label: " Zero threshold" + anchors.horizontalCenter: parent.horizontalCenter + y: 20 + checked: false } } diff --git a/tests/manual/pointer/tapWithModifiers.qml b/tests/manual/pointer/tapWithModifiers.qml index 8ca1c1bd63..da3c0cb30a 100644 --- a/tests/manual/pointer/tapWithModifiers.qml +++ b/tests/manual/pointer/tapWithModifiers.qml @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 The Qt Company Ltd. +** Copyright (C) 2019 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the manual tests of the Qt Toolkit. @@ -40,6 +40,16 @@ Item { onTapped: console.log("tapped with no modifiers") } TapHandler { - onTapped: console.log("tapped with modifiers " + point.event.modifiers) + onTapped: + switch (point.modifiers) { + case Qt.ControlModifier | Qt.AltModifier: + console.log("CTRL+ALT"); + break; + case Qt.ControlModifier | Qt.AltModifier | Qt.MetaModifier: + console.log("CTRL+META+ALT"); + break; + default: + console.log("other modifiers", point.modifiers) + } } } diff --git a/tests/manual/scenegraph_lancelot/hostinfo.sh b/tests/manual/scenegraph_lancelot/hostinfo.sh deleted file mode 100644 index 6bad2ba467..0000000000 --- a/tests/manual/scenegraph_lancelot/hostinfo.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/bin/sh -############################################################################# -## -## Copyright (C) 2016 The Qt Company Ltd. -## Contact: https://www.qt.io/licensing/ -## -## This file is part of the QtQml module 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$ -## -############################################################################# - -# printProperty(): prints a key-value pair from given key and cmd list. -# If running cmd fails, or does not produce any stdout, nothing is printed. -# Arguments: $1: key, $2: cmd, $3: optional, field specification as to cut(1) -f -printProperty () -{ - key=$1 - val=`{ eval $2 ; } 2>/dev/null` - [ -n "$3" ] && val=`echo $val | tr -s '[:blank:]' '\t' | cut -f$3` - [ -n "$val" ] && echo $key: $val -} - -# printEnvVar(): prints a key-value pair from given environment variable name. -# key is printed as "Env_<varname>". -# If the variable is undefined, nothing is printed. -# Arguments: $1: varname - -printEnvVar () -{ - key=Env_$1 - val=`eval 'echo $'$1` - [ -n "$val" ] && echo $key: $val -} - - -# printOnOff(): prints a key-value pair from given environment variable name. -# If variable is defined, value is printed as "<key>-On"; otherwise "<key>-Off". -# Arguments: $1: key $2: varname - -printOnOff () -{ - key=$1 - val=`eval 'echo $'$2` - if [ -z "$val" ] ; then - val=Off - else - val=On - fi - echo $key: $key-$val -} - -# ------------ - -printProperty Uname "uname -a" - -printProperty WlanMAC "ifconfig wlan0 | grep HWaddr" 5 - -printEnvVar QMLSCENE_DEVICE diff --git a/tests/manual/scenegraph_lancelot/scenegrabber/main.cpp b/tests/manual/scenegraph_lancelot/scenegrabber/main.cpp index 6da0799bbc..23c678380c 100644 --- a/tests/manual/scenegraph_lancelot/scenegrabber/main.cpp +++ b/tests/manual/scenegraph_lancelot/scenegrabber/main.cpp @@ -36,6 +36,11 @@ #include <QtQuick/QQuickView> #include <QtQuick/QQuickItem> +#ifdef Q_OS_WIN +# include <fcntl.h> +# include <io.h> +#endif // Q_OS_WIN + // Timeout values: // A valid screen grab requires the scene to not change @@ -101,6 +106,10 @@ private slots: #endif if (ofile == "-") { // Write to stdout QFile of; +#ifdef Q_OS_WIN + // Make sure write to stdout doesn't do LF->CRLF + _setmode(_fileno(stdout), _O_BINARY); +#endif // Q_OS_WIN if (!of.open(1, QIODevice::WriteOnly) || !lastGrab.save(&of, "ppm")) { qWarning() << "Error: failed to write grabbed image to stdout."; QGuiApplication::exit(2); diff --git a/tests/manual/scenegraph_lancelot/scenegraph/scenegraph.pro b/tests/manual/scenegraph_lancelot/scenegraph/scenegraph.pro index 65819ab5bf..dd0ef268b1 100644 --- a/tests/manual/scenegraph_lancelot/scenegraph/scenegraph.pro +++ b/tests/manual/scenegraph_lancelot/scenegraph/scenegraph.pro @@ -9,3 +9,7 @@ SOURCES += tst_scenegraph.cpp # Include Lancelot protocol code to communicate with baseline server. # Assuming that we are in a normal Qt5 source code tree include(../../../../../qtbase/tests/baselineserver/shared/qbaselinetest.pri) + +TEST_HELPER_INSTALLS += .././qmlscenegrabber + +TESTDATA += ../data diff --git a/tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp b/tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp index 3f28d90e7b..40b17ec2a2 100644 --- a/tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp +++ b/tests/manual/scenegraph_lancelot/scenegraph/tst_scenegraph.cpp @@ -68,6 +68,7 @@ private: bool renderAndGrab(const QString& qmlFile, const QStringList& extraArgs, QImage *screenshot, QString *errMsg); quint16 checksumFileOrDir(const QString &path); + QString testSuitePath; int consecutiveErrors; // Not test failures (image mismatches), but system failures (so no image at all) bool aborted; // This run given up because of too many system failures }; @@ -81,6 +82,18 @@ tst_Scenegraph::tst_Scenegraph() void tst_Scenegraph::initTestCase() { + QString dataDir = QFINDTESTDATA("../data/."); + if (dataDir.isEmpty()) + dataDir = QStringLiteral("data"); + QFileInfo fi(dataDir); + if (!fi.exists() || !fi.isDir() || !fi.isReadable()) + QSKIP("Test suite data directory missing or unreadable: " + fi.canonicalFilePath().toLatin1()); + testSuitePath = fi.canonicalFilePath(); + + const char *backendVarName = "QT_QUICK_BACKEND"; + const QString backend = qEnvironmentVariable(backendVarName, QString::fromLatin1("default")); + QBaselineTest::addClientProperty(QString::fromLatin1(backendVarName), backend); + QByteArray msg; if (!QBaselineTest::connectToBaselineServer(&msg)) QSKIP(msg); @@ -91,7 +104,7 @@ void tst_Scenegraph::cleanup() { // Allow subsystems time to settle if (!aborted) - QTest::qWait(200); + QTest::qWait(20); } void tst_Scenegraph::testNoTextRendering_data() @@ -127,13 +140,6 @@ void tst_Scenegraph::setupTestSuite(const QByteArray& filter) QTest::addColumn<QString>("qmlFile"); int numItems = 0; - QString testSuiteDir = QLatin1String("data"); - QString testSuiteLocation = QCoreApplication::applicationDirPath(); - QString testSuitePath = testSuiteLocation + QDir::separator() + testSuiteDir; - QFileInfo fi(testSuitePath); - if (!fi.exists() || !fi.isDir() || !fi.isReadable()) - QSKIP("Test suite data directory missing or unreadable: " + testSuitePath.toLatin1()); - QStringList ignoreItems; QFile ignoreFile(testSuitePath + "/Ignore"); if (ignoreFile.open(QIODevice::ReadOnly)) { @@ -233,7 +239,7 @@ quint16 tst_Scenegraph::checksumFileOrDir(const QString &path) QFile f(path); f.open(QIODevice::ReadOnly); QByteArray contents = f.readAll(); - return qChecksum(contents.constData(), contents.size()); + return qChecksum(contents.constData(), uint(contents.size())); } if (fi.isDir()) { static const QStringList nameFilters = QStringList() << "*.qml" << "*.cpp" << "*.png" << "*.jpg"; |