diff options
Diffstat (limited to 'tests')
39 files changed, 155 insertions, 1874 deletions
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp index ec0db16114..a05933d071 100644 --- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp +++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp @@ -5740,7 +5740,7 @@ void tst_qqmlecmascript::sequenceConversionRead() QVERIFY(seq != nullptr); // we haven't registered QList<NonRegisteredType> as a sequence type. - QString warningOne = QLatin1String("QMetaProperty::read: Unable to handle unregistered datatype 'QList<NonRegisteredType>' for property 'MySequenceConversionObject::typeListProperty'"); + QString warningOne = QLatin1String("QMetaProperty::read: Unable to handle unregistered datatype 'QVector<NonRegisteredType>' for property 'MySequenceConversionObject::typeListProperty'"); QString warningTwo = qmlFile.toString() + QLatin1String(":18: TypeError: Cannot read property 'length' of undefined"); QTest::ignoreMessage(QtWarningMsg, warningOne.toLatin1().constData()); QTest::ignoreMessage(QtWarningMsg, warningTwo.toLatin1().constData()); @@ -5750,7 +5750,7 @@ void tst_qqmlecmascript::sequenceConversionRead() // QList<NonRegisteredType> has not been registered as a sequence type. QCOMPARE(object->property("pointListLength").toInt(), 0); QVERIFY(!object->property("pointList").isValid()); - QTest::ignoreMessage(QtWarningMsg, "QMetaProperty::read: Unable to handle unregistered datatype 'QList<NonRegisteredType>' for property 'MySequenceConversionObject::typeListProperty'"); + QTest::ignoreMessage(QtWarningMsg, "QMetaProperty::read: Unable to handle unregistered datatype 'QVector<NonRegisteredType>' for property 'MySequenceConversionObject::typeListProperty'"); QQmlProperty seqProp(seq, "typeListProperty", &engine); QVERIFY(!seqProp.read().isValid()); // not a valid/known sequence type @@ -5793,7 +5793,7 @@ void tst_qqmlecmascript::sequenceConversionWrite() QVERIFY(seq != nullptr); // we haven't registered QList<QPoint> as a sequence type, so writing shouldn't work. - QString warningOne = qmlFile.toString() + QLatin1String(":16: Error: Cannot assign QJSValue to QList<QPoint>"); + QString warningOne = qmlFile.toString() + QLatin1String(":16: Error: Cannot assign QJSValue to QVector<QPoint>"); QTest::ignoreMessage(QtWarningMsg, warningOne.toLatin1().constData()); QMetaObject::invokeMethod(object, "performTest"); @@ -5907,7 +5907,7 @@ void tst_qqmlecmascript::sequenceConversionBindings() { QUrl qmlFile = testFileUrl("sequenceConversion.bindings.error.qml"); - QString warning = QString(QLatin1String("%1:17:9: Unable to assign QList<int> to QList<bool>")).arg(qmlFile.toString()); + QString warning = QString(QLatin1String("%1:17:9: Unable to assign QVector<int> to QVector<bool>")).arg(qmlFile.toString()); QTest::ignoreMessage(QtWarningMsg, warning.toLatin1().constData()); QQmlComponent component(&engine, qmlFile); QObject *object = component.create(); diff --git a/tests/auto/qml/qqmlitemmodels/qtestmodel.h b/tests/auto/qml/qqmlitemmodels/qtestmodel.h index 6a022b3135..de42253708 100644 --- a/tests/auto/qml/qqmlitemmodels/qtestmodel.h +++ b/tests/auto/qml/qqmlitemmodels/qtestmodel.h @@ -31,6 +31,8 @@ #include <QtCore/qabstractitemmodel.h> +#include <limits.h> + class TestModel: public QAbstractItemModel { Q_OBJECT diff --git a/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.2.qml b/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.2.qml index b13b2004c2..ba6bb3d7ac 100644 --- a/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.2.qml +++ b/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.2.qml @@ -1,5 +1,6 @@ import org.qtproject.AutoTestQmlMixedPluginType 1.5 import QtQuick 2.0 +import QtQml 2.0 Item { property bool test: false diff --git a/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.qml b/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.qml index 563c0b28e3..f1268075c1 100644 --- a/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.qml +++ b/tests/auto/qml/qqmlmoduleplugin/data/importsMixedQmlCppPlugin.qml @@ -1,5 +1,6 @@ import org.qtproject.AutoTestQmlMixedPluginType 1.0 import QtQuick 2.0 +import QtQml 2.0 Item { property bool test: false diff --git a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp index 75885bc84a..f15d53d022 100644 --- a/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp +++ b/tests/auto/qml/qqmlmoduleplugin/tst_qqmlmoduleplugin.cpp @@ -34,6 +34,10 @@ #include <QtCore/qjsondocument.h> #include <QtCore/qjsonarray.h> #include <QDebug> +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include <QCborMap> +#include <QCborValue> +#endif #if defined(Q_OS_MAC) // For _PC_CASE_SENSITIVE @@ -131,8 +135,7 @@ QByteArray SecondStaticPlugin::metaData; template <typename PluginType> void registerStaticPlugin(const char *uri) { - QStaticPlugin plugin; - plugin.instance = []() { + auto instanceFunctor = []() { static PluginType plugin; return static_cast<QObject*>(&plugin); }; @@ -143,12 +146,28 @@ void registerStaticPlugin(const char *uri) uris.append(uri); md.insert(QStringLiteral("uri"), uris); +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) + PluginType::metaData.append(QLatin1String("QTMETADATA !")); + PluginType::metaData.append(char(0)); // current version + PluginType::metaData.append(char(QT_VERSION_MAJOR)); + PluginType::metaData.append(char(QT_VERSION_MINOR)); + PluginType::metaData.append(char(qPluginArchRequirements())); + PluginType::metaData.append(QCborValue(QCborMap::fromJsonObject(md)).toCbor()); + + auto rawMetaDataFunctor = []() -> QPluginMetaData { + return {reinterpret_cast<const uchar *>(PluginType::metaData.constData()), size_t(PluginType::metaData.length())}; + }; + QStaticPlugin plugin(instanceFunctor, rawMetaDataFunctor); +#else PluginType::metaData.append(QLatin1String("QTMETADATA ")); PluginType::metaData.append(QJsonDocument(md).toBinaryData()); + QStaticPlugin plugin; + plugin.instance = instanceFunctor; plugin.rawMetaData = []() { return PluginType::metaData.constData(); }; +#endif qRegisterStaticPluginFunction(plugin); }; diff --git a/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp b/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp index c9e92cd3c9..c79fdc57b4 100644 --- a/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp +++ b/tests/auto/qml/qqmlpropertycache/tst_qqmlpropertycache.cpp @@ -114,7 +114,8 @@ void tst_qqmlpropertycache::properties() DerivedObject object; const QMetaObject *metaObject = object.metaObject(); - QQmlRefPointer<QQmlPropertyCache> cache(new QQmlPropertyCache(metaObject)); + QQmlRefPointer<QQmlPropertyCache> cache(new QQmlPropertyCache(metaObject), + QQmlRefPointer<QQmlPropertyCache>::Adopt); QQmlPropertyData *data; QVERIFY((data = cacheProperty(cache, "propertyA"))); @@ -136,8 +137,11 @@ void tst_qqmlpropertycache::propertiesDerived() DerivedObject object; const QMetaObject *metaObject = object.metaObject(); - QQmlRefPointer<QQmlPropertyCache> parentCache(new QQmlPropertyCache(&BaseObject::staticMetaObject)); - QQmlRefPointer<QQmlPropertyCache> cache(parentCache->copyAndAppend(object.metaObject())); + QQmlRefPointer<QQmlPropertyCache> parentCache( + new QQmlPropertyCache(&BaseObject::staticMetaObject), + QQmlRefPointer<QQmlPropertyCache>::Adopt); + QQmlRefPointer<QQmlPropertyCache> cache(parentCache->copyAndAppend(object.metaObject()), + QQmlRefPointer<QQmlPropertyCache>::Adopt); QQmlPropertyData *data; QVERIFY((data = cacheProperty(cache, "propertyA"))); @@ -161,8 +165,10 @@ void tst_qqmlpropertycache::revisionedProperties() DerivedObject object; const QMetaObject *metaObject = object.metaObject(); - QQmlRefPointer<QQmlPropertyCache> cacheWithoutVersion(new QQmlPropertyCache(metaObject)); - QQmlRefPointer<QQmlPropertyCache> cacheWithVersion(new QQmlPropertyCache(metaObject, 1)); + QQmlRefPointer<QQmlPropertyCache> cacheWithoutVersion(new QQmlPropertyCache(metaObject), + QQmlRefPointer<QQmlPropertyCache>::Adopt); + QQmlRefPointer<QQmlPropertyCache> cacheWithVersion(new QQmlPropertyCache(metaObject, 1), + QQmlRefPointer<QQmlPropertyCache>::Adopt); QQmlPropertyData *data; QVERIFY((data = cacheProperty(cacheWithoutVersion, "propertyE"))); @@ -176,7 +182,8 @@ void tst_qqmlpropertycache::methods() DerivedObject object; const QMetaObject *metaObject = object.metaObject(); - QQmlRefPointer<QQmlPropertyCache> cache(new QQmlPropertyCache(metaObject)); + QQmlRefPointer<QQmlPropertyCache> cache(new QQmlPropertyCache(metaObject), + QQmlRefPointer<QQmlPropertyCache>::Adopt); QQmlPropertyData *data; QVERIFY((data = cacheProperty(cache, "slotA"))); @@ -210,8 +217,11 @@ void tst_qqmlpropertycache::methodsDerived() DerivedObject object; const QMetaObject *metaObject = object.metaObject(); - QQmlRefPointer<QQmlPropertyCache> parentCache(new QQmlPropertyCache(&BaseObject::staticMetaObject)); - QQmlRefPointer<QQmlPropertyCache> cache(parentCache->copyAndAppend(object.metaObject())); + QQmlRefPointer<QQmlPropertyCache> parentCache( + new QQmlPropertyCache(&BaseObject::staticMetaObject), + QQmlRefPointer<QQmlPropertyCache>::Adopt); + QQmlRefPointer<QQmlPropertyCache> cache(parentCache->copyAndAppend(object.metaObject()), + QQmlRefPointer<QQmlPropertyCache>::Adopt); QQmlPropertyData *data; QVERIFY((data = cacheProperty(cache, "slotA"))); @@ -245,7 +255,8 @@ void tst_qqmlpropertycache::signalHandlers() DerivedObject object; const QMetaObject *metaObject = object.metaObject(); - QQmlRefPointer<QQmlPropertyCache> cache(new QQmlPropertyCache(metaObject)); + QQmlRefPointer<QQmlPropertyCache> cache(new QQmlPropertyCache(metaObject), + QQmlRefPointer<QQmlPropertyCache>::Adopt); QQmlPropertyData *data; QVERIFY((data = cacheProperty(cache, "onSignalA"))); @@ -273,8 +284,11 @@ void tst_qqmlpropertycache::signalHandlersDerived() DerivedObject object; const QMetaObject *metaObject = object.metaObject(); - QQmlRefPointer<QQmlPropertyCache> parentCache(new QQmlPropertyCache(&BaseObject::staticMetaObject)); - QQmlRefPointer<QQmlPropertyCache> cache(parentCache->copyAndAppend(object.metaObject())); + QQmlRefPointer<QQmlPropertyCache> parentCache( + new QQmlPropertyCache(&BaseObject::staticMetaObject), + QQmlRefPointer<QQmlPropertyCache>::Adopt); + QQmlRefPointer<QQmlPropertyCache> cache(parentCache->copyAndAppend(object.metaObject()), + QQmlRefPointer<QQmlPropertyCache>::Adopt); QQmlPropertyData *data; QVERIFY((data = cacheProperty(cache, "onSignalA"))); @@ -478,7 +492,9 @@ class TestClassWithClassInfo : public QObject int(sizeof(arr) / sizeof(arr[0])) #define TEST_CLASS(Class) \ - QTest::newRow(#Class) << &Class::staticMetaObject << ARRAY_SIZE(qt_meta_data_##Class) << ARRAY_SIZE(qt_meta_stringdata_##Class.data) + QTest::newRow(#Class) \ + << &Class::staticMetaObject << ARRAY_SIZE(qt_meta_data_##Class) \ + << int(sizeof(qt_meta_stringdata_##Class.offsetsAndSize) / (sizeof(uint) * 2)) Q_DECLARE_METATYPE(const QMetaObject*); diff --git a/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp b/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp index 15ef31464b..8fa18c9860 100644 --- a/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp +++ b/tests/auto/qml/qqmlqt/tst_qqmlqt.cpp @@ -167,15 +167,13 @@ void tst_qqmlqt::initTestCase() void tst_qqmlqt::enums() { QQmlComponent component(&engine, testFileUrl("enums.qml")); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(object->property("test1").toInt(), (int)Qt::Key_Escape); QCOMPARE(object->property("test2").toInt(), (int)Qt::DescendingOrder); QCOMPARE(object->property("test3").toInt(), (int)Qt::ElideMiddle); QCOMPARE(object->property("test4").toInt(), (int)Qt::AlignRight); - - delete object; } void tst_qqmlqt::rgba() @@ -187,7 +185,7 @@ void tst_qqmlqt::rgba() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); @@ -197,8 +195,6 @@ void tst_qqmlqt::rgba() QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor()); QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor::fromRgbF(1, 1, 1, 1)); QCOMPARE(qvariant_cast<QColor>(object->property("test6")), QColor::fromRgbF(0, 0, 0, 0)); - - delete object; } void tst_qqmlqt::hsla() @@ -210,7 +206,7 @@ void tst_qqmlqt::hsla() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromHslF(1, 0, 0, 0.8)); @@ -219,8 +215,6 @@ void tst_qqmlqt::hsla() QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor()); QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor::fromHslF(1, 1, 1, 1)); QCOMPARE(qvariant_cast<QColor>(object->property("test6")), QColor::fromHslF(0, 0, 0, 0)); - - delete object; } void tst_qqmlqt::hsva() @@ -232,7 +226,7 @@ void tst_qqmlqt::hsva() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromHsvF(1, 0, 0, 0.8)); @@ -241,8 +235,6 @@ void tst_qqmlqt::hsva() QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor()); QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor::fromHsvF(1, 1, 1, 1)); QCOMPARE(qvariant_cast<QColor>(object->property("test6")), QColor::fromHsvF(0, 0, 0, 0)); - - delete object; } void tst_qqmlqt::colorEqual() @@ -260,7 +252,7 @@ void tst_qqmlqt::colorEqual() QTest::ignoreMessage(QtWarningMsg, qPrintable(component.url().toString() + ":34: Error: Qt.colorEqual(): Invalid color name")); QTest::ignoreMessage(QtWarningMsg, qPrintable(component.url().toString() + ":35: Error: Qt.colorEqual(): Invalid color name")); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(object->property("test1a").toBool(), false); @@ -324,8 +316,6 @@ void tst_qqmlqt::colorEqual() QCOMPARE(object->property("test6c").toBool(), true); QCOMPARE(object->property("test6d").toBool(), false); QCOMPARE(object->property("test6e").toBool(), false); - - delete object; } void tst_qqmlqt::rect() @@ -337,7 +327,7 @@ void tst_qqmlqt::rect() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QRectF>(object->property("test1")), QRectF(10, 13, 100, 109)); @@ -345,8 +335,6 @@ void tst_qqmlqt::rect() QCOMPARE(qvariant_cast<QRectF>(object->property("test3")), QRectF()); QCOMPARE(qvariant_cast<QRectF>(object->property("test4")), QRectF()); QCOMPARE(qvariant_cast<QRectF>(object->property("test5")), QRectF(10, 13, 100, -109)); - - delete object; } void tst_qqmlqt::point() @@ -358,15 +346,13 @@ void tst_qqmlqt::point() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QPointF>(object->property("test1")), QPointF(19, 34)); QCOMPARE(qvariant_cast<QPointF>(object->property("test2")), QPointF(-3, 109.2)); QCOMPARE(qvariant_cast<QPointF>(object->property("test3")), QPointF()); QCOMPARE(qvariant_cast<QPointF>(object->property("test4")), QPointF()); - - delete object; } void tst_qqmlqt::size() @@ -378,7 +364,7 @@ void tst_qqmlqt::size() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QSizeF>(object->property("test1")), QSizeF(19, 34)); @@ -386,8 +372,6 @@ void tst_qqmlqt::size() QCOMPARE(qvariant_cast<QSizeF>(object->property("test3")), QSizeF(-3, 10)); QCOMPARE(qvariant_cast<QSizeF>(object->property("test4")), QSizeF()); QCOMPARE(qvariant_cast<QSizeF>(object->property("test5")), QSizeF()); - - delete object; } void tst_qqmlqt::vector2d() @@ -399,15 +383,13 @@ void tst_qqmlqt::vector2d() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QVector2D>(object->property("test1")), QVector2D(1, 0.9f)); QCOMPARE(qvariant_cast<QVector2D>(object->property("test2")), QVector2D(102, -982.1f)); QCOMPARE(qvariant_cast<QVector2D>(object->property("test3")), QVector2D()); QCOMPARE(qvariant_cast<QVector2D>(object->property("test4")), QVector2D()); - - delete object; } void tst_qqmlqt::vector3d() @@ -419,15 +401,13 @@ void tst_qqmlqt::vector3d() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QVector3D>(object->property("test1")), QVector3D(1, 0, 0.9f)); QCOMPARE(qvariant_cast<QVector3D>(object->property("test2")), QVector3D(102, -10, -982.1f)); QCOMPARE(qvariant_cast<QVector3D>(object->property("test3")), QVector3D()); QCOMPARE(qvariant_cast<QVector3D>(object->property("test4")), QVector3D()); - - delete object; } void tst_qqmlqt::vector4d() @@ -439,15 +419,13 @@ void tst_qqmlqt::vector4d() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QVector4D>(object->property("test1")), QVector4D(1, 0, 0.9f, 0.6f)); QCOMPARE(qvariant_cast<QVector4D>(object->property("test2")), QVector4D(102, -10, -982.1f, 10)); QCOMPARE(qvariant_cast<QVector4D>(object->property("test3")), QVector4D()); QCOMPARE(qvariant_cast<QVector4D>(object->property("test4")), QVector4D()); - - delete object; } void tst_qqmlqt::quaternion() @@ -459,15 +437,13 @@ void tst_qqmlqt::quaternion() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QQuaternion>(object->property("test1")), QQuaternion(2, 17, 0.9f, 0.6f)); QCOMPARE(qvariant_cast<QQuaternion>(object->property("test2")), QQuaternion(102, -10, -982.1f, 10)); QCOMPARE(qvariant_cast<QQuaternion>(object->property("test3")), QQuaternion()); QCOMPARE(qvariant_cast<QQuaternion>(object->property("test4")), QQuaternion()); - - delete object; } void tst_qqmlqt::matrix4x4() @@ -481,7 +457,7 @@ void tst_qqmlqt::matrix4x4() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning3)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QMatrix4x4>(object->property("test1")), QMatrix4x4(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16)); @@ -489,8 +465,6 @@ void tst_qqmlqt::matrix4x4() QCOMPARE(qvariant_cast<QMatrix4x4>(object->property("test3")), QMatrix4x4()); QCOMPARE(qvariant_cast<QMatrix4x4>(object->property("test4")), QMatrix4x4()); QCOMPARE(qvariant_cast<QMatrix4x4>(object->property("test5")), QMatrix4x4()); - - delete object; } void tst_qqmlqt::font() @@ -502,7 +476,7 @@ void tst_qqmlqt::font() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QFont f; @@ -515,8 +489,6 @@ void tst_qqmlqt::font() QCOMPARE(qvariant_cast<QFont>(object->property("test2")), f); QCOMPARE(qvariant_cast<QFont>(object->property("test3")), QFont()); QCOMPARE(qvariant_cast<QFont>(object->property("test4")), QFont()); - - delete object; } void tst_qqmlqt::lighter() @@ -528,7 +500,7 @@ void tst_qqmlqt::lighter() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromRgbF(1, 0.8, 0.3).lighter()); @@ -537,8 +509,6 @@ void tst_qqmlqt::lighter() QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor("red").lighter()); QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor()); QCOMPARE(qvariant_cast<QColor>(object->property("test6")), QColor()); - - delete object; } void tst_qqmlqt::darker() @@ -550,7 +520,7 @@ void tst_qqmlqt::darker() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromRgbF(1, 0.8, 0.3).darker()); @@ -559,8 +529,6 @@ void tst_qqmlqt::darker() QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor("red").darker()); QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor()); QCOMPARE(qvariant_cast<QColor>(object->property("test6")), QColor()); - - delete object; } void tst_qqmlqt::tint() @@ -573,7 +541,7 @@ void tst_qqmlqt::tint() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(qvariant_cast<QColor>(object->property("test1")), QColor::fromRgbF(0, 0, 1)); @@ -582,8 +550,6 @@ void tst_qqmlqt::tint() QCOMPARE(test3.rgba(), 0xFF7F0080); QCOMPARE(qvariant_cast<QColor>(object->property("test4")), QColor()); QCOMPARE(qvariant_cast<QColor>(object->property("test5")), QColor()); - - delete object; } class MyUrlHandler : public QObject @@ -606,7 +572,7 @@ void tst_qqmlqt::openUrlExternally() QDesktopServices::setUrlHandler("file", &handler, "noteCall"); QQmlComponent component(&engine, testFileUrl("openUrlExternally.qml")); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(handler.called,1); QCOMPARE(handler.last, QUrl("test:url")); @@ -628,7 +594,7 @@ void tst_qqmlqt::openUrlExternally_pragmaLibrary() QDesktopServices::setUrlHandler("file", &handler, "noteCall"); QQmlComponent component(&engine, testFileUrl("openUrlExternally_lib.qml")); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(handler.called,1); QCOMPARE(handler.last, QUrl("test:url")); @@ -649,42 +615,37 @@ void tst_qqmlqt::md5() QString warning1 = component.url().toString() + ":4: Error: Qt.md5(): Invalid arguments"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(object->property("test2").toString(), QLatin1String(QCryptographicHash::hash("Hello World", QCryptographicHash::Md5).toHex())); - - delete object; } void tst_qqmlqt::createComponent() { { - QQmlComponent component(&engine, testFileUrl("createComponent.qml")); - - QString warning1 = component.url().toString() + ":9: Error: Qt.createComponent(): Invalid arguments"; - QString warning2 = component.url().toString() + ":10: Error: Qt.createComponent(): Invalid arguments"; - QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); - QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); + QQmlComponent component(&engine, testFileUrl("createComponent.qml")); - QObject *object = component.create(); - QVERIFY(object != nullptr); + QString warning1 = component.url().toString() + ":9: Error: Qt.createComponent(): Invalid arguments"; + QString warning2 = component.url().toString() + ":10: Error: Qt.createComponent(): Invalid arguments"; + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); + QTest::ignoreMessage(QtWarningMsg, qPrintable(warning2)); - QCOMPARE(object->property("absoluteUrl").toString(), QString("http://www.example.com/test.qml")); - QCOMPARE(object->property("relativeUrl").toString(), testFileUrl("createComponentData.qml").toString()); + QScopedPointer<QObject> object(component.create()); + QVERIFY(object != nullptr); - QTRY_VERIFY(object->property("asyncResult").toBool()); + QCOMPARE(object->property("absoluteUrl").toString(), QString("http://www.example.com/test.qml")); + QCOMPARE(object->property("relativeUrl").toString(), testFileUrl("createComponentData.qml").toString()); - delete object; + QTRY_VERIFY(object->property("asyncResult").toBool()); } // simultaneous sync and async compilation { - QQmlComponent component(&engine, testFileUrl("createComponent.2.qml")); - QObject *object = component.create(); - QVERIFY(object != nullptr); - QTRY_VERIFY(object->property("success").toBool()); - delete object; + QQmlComponent component(&engine, testFileUrl("createComponent.2.qml")); + QScopedPointer<QObject> object(component.create()); + QVERIFY(object != nullptr); + QTRY_VERIFY(object->property("success").toBool()); } } @@ -692,11 +653,10 @@ void tst_qqmlqt::createComponent_pragmaLibrary() { // Currently, just loading createComponent_lib.qml causes crash on some platforms QQmlComponent component(&engine, testFileUrl("createComponent_lib.qml")); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(object->property("status").toInt(), int(QQmlComponent::Ready)); QCOMPARE(object->property("readValue").toInt(), int(1913)); - delete object; } void tst_qqmlqt::createQmlObject() @@ -716,17 +676,15 @@ void tst_qqmlqt::createQmlObject() QTest::ignoreMessage(QtWarningMsg, qPrintable(warning5)); QTest::ignoreMessage(QtDebugMsg, qPrintable(warning6)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(object->property("emptyArg").toBool(), true); QCOMPARE(object->property("success").toBool(), true); - QQuickItem *item = qobject_cast<QQuickItem *>(object); + QQuickItem *item = qobject_cast<QQuickItem *>(object.data()); QVERIFY(item != nullptr); QCOMPARE(item->childItems().count(), 1); - - delete object; } @@ -749,7 +707,7 @@ void tst_qqmlqt::dateTimeConversion() QQmlEngine eng; QQmlComponent component(&eng, testFileUrl("dateTimeConversion.qml")); - QObject *obj = component.create(); + QScopedPointer<QObject> obj(component.create()); QCOMPARE(obj->property("qdate").toDate(), date); QCOMPARE(obj->property("qtime").toTime(), time); @@ -927,7 +885,7 @@ void tst_qqmlqt::dateTimeFormattingVariants_data() void tst_qqmlqt::isQtObject() { QQmlComponent component(&engine, testFileUrl("isQtObject.qml")); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(object->property("test1").toBool(), true); @@ -935,8 +893,6 @@ void tst_qqmlqt::isQtObject() QCOMPARE(object->property("test3").toBool(), false); QCOMPARE(object->property("test4").toBool(), false); QCOMPARE(object->property("test5").toBool(), false); - - delete object; } void tst_qqmlqt::btoa() @@ -946,12 +902,10 @@ void tst_qqmlqt::btoa() QString warning1 = component.url().toString() + ":4: Error: Qt.btoa(): Invalid arguments"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(object->property("test2").toString(), QString("SGVsbG8gd29ybGQh")); - - delete object; } void tst_qqmlqt::atob() @@ -961,12 +915,10 @@ void tst_qqmlqt::atob() QString warning1 = component.url().toString() + ":4: Error: Qt.atob(): Invalid arguments"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(object->property("test2").toString(), QString("Hello world!")); - - delete object; } void tst_qqmlqt::fontFamilies() @@ -976,13 +928,11 @@ void tst_qqmlqt::fontFamilies() QString warning1 = component.url().toString() + ":4: Error: Qt.fontFamilies(): Invalid arguments"; QTest::ignoreMessage(QtWarningMsg, qPrintable(warning1)); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QFontDatabase database; QCOMPARE(object->property("test2"), QVariant::fromValue(database.families())); - - delete object; } void tst_qqmlqt::quit() @@ -990,11 +940,9 @@ void tst_qqmlqt::quit() QQmlComponent component(&engine, testFileUrl("quit.qml")); QSignalSpy spy(&engine, SIGNAL(quit())); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(spy.count(), 1); - - delete object; } void tst_qqmlqt::exit() @@ -1002,26 +950,22 @@ void tst_qqmlqt::exit() QQmlComponent component(&engine, testFileUrl("exit.qml")); QSignalSpy spy(&engine, &QQmlEngine::exit); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(spy.count(), 1); QList<QVariant> arguments = spy.takeFirst(); QVERIFY(arguments.at(0).toInt() == object->property("returnCode").toInt()); - - delete object; } void tst_qqmlqt::resolvedUrl() { QQmlComponent component(&engine, testFileUrl("resolvedUrl.qml")); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QCOMPARE(object->property("result").toString(), component.url().toString()); QCOMPARE(object->property("isString").toBool(), true); - - delete object; } void tst_qqmlqt::later_data() @@ -1105,11 +1049,11 @@ void tst_qqmlqt::later() QTest::ignoreMessage(QtWarningMsg, qPrintable(w)); QQmlComponent component(&engine, testFileUrl("later.qml")); - QObject *root = component.create(); + QScopedPointer<QObject> root(component.create()); QVERIFY(root != nullptr); if (!function.isEmpty()) - QMetaObject::invokeMethod(root, qPrintable(function)); + QMetaObject::invokeMethod(root.data(), qPrintable(function)); for (int i = 0; i < propNames.size(); ++i) { if (propNames.at(i) == QLatin1String("processEvents")) { @@ -1121,21 +1065,13 @@ void tst_qqmlqt::later() QCOMPARE(root->property(qPrintable(propNames.at(i))), values.at(i)); } } - - delete root; } void tst_qqmlqt::qtObjectContents() { - struct StaticQtMetaObject : public QObject - { - static const QMetaObject *get() - { return &staticQtMetaObject; } - }; - QQmlComponent component(&engine, testFileUrl("qtObjectContents.qml")); - QObject *object = component.create(); + QScopedPointer<QObject> object(component.create()); QVERIFY(object != nullptr); QVERIFY(object->property("values").canConvert<QJSValue>()); @@ -1143,7 +1079,7 @@ void tst_qqmlqt::qtObjectContents() QSet<const char *> keys; int uniqueKeys = 0; - const QMetaObject *qtMetaObject = StaticQtMetaObject::get(); + const QMetaObject *qtMetaObject = &Qt::staticMetaObject; for (int ii = 0; ii < qtMetaObject->enumeratorCount(); ++ii) { QMetaEnum enumerator = qtMetaObject->enumerator(ii); for (int jj = 0; jj < enumerator.keyCount(); ++jj) { @@ -1166,8 +1102,6 @@ void tst_qqmlqt::qtObjectContents() QCOMPARE(values.value("Synchronous").toInt(), 1); ++uniqueKeys; QCOMPARE(values.count(), uniqueKeys); - - delete object; } class TimeProvider: public QObject @@ -1261,7 +1195,8 @@ void tst_qqmlqt::timeRoundtrip() QQmlEngine eng; //qmlRegisterSingletonInstance("Test", 1, 0, "TimeProvider", &tp); QQmlComponent component(&eng, testFileUrl("timeRoundtrip.qml")); - QObject *obj = component.createWithInitialProperties({{"tp", QVariant::fromValue(&tp)}}); + QScopedPointer<QObject> obj(component.createWithInitialProperties( + {{"tp", QVariant::fromValue(&tp)}})); QVERIFY(obj != nullptr); // QML reads m_getTime and saves the result as m_putTime; this should come out the same, without diff --git a/tests/auto/qml/qqmltypeloader/dummy_imports.qml b/tests/auto/qml/qqmltypeloader/dummy_imports.qml new file mode 100644 index 0000000000..a4684b2007 --- /dev/null +++ b/tests/auto/qml/qqmltypeloader/dummy_imports.qml @@ -0,0 +1,9 @@ +// This file exists for the sole purpose for qmlimportscanner to find +// which modules it needs to extract for deployment. +// Otherwise, it fails to find the imports that are expressed in the +// C++ code belonging to the test. + +import QtQml 2.0 +import QtQuick 2.6 + +QtObject { } // This is needed in order to keep importscanner happy diff --git a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp index 266a4e97d6..9ec3e9557b 100644 --- a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp +++ b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.cpp @@ -63,10 +63,15 @@ private slots: void implicitImport(); void compositeSingletonCycle(); void declarativeCppType(); +private: + void checkSingleton(const QString & dataDirectory); }; void tst_QQMLTypeLoader::testLoadComplete() { +#ifdef Q_OS_ANDROID + QSKIP("Loading dynamic plugins does not work on Android"); +#endif QQuickView *window = new QQuickView(); window->engine()->addImportPath(QT_TESTCASE_BUILDDIR); qDebug() << window->engine()->importPathList(); @@ -170,7 +175,7 @@ void tst_QQMLTypeLoader::trimCache3() QCOMPARE(loader.isTypeLoaded(testFileUrl("ComponentWithIncubator.qml")), false); } -static void checkSingleton(const QString &dataDirectory) +void tst_QQMLTypeLoader::checkSingleton(const QString &dataDirectory) { QQmlEngine engine; engine.addImportPath(dataDirectory); @@ -179,8 +184,8 @@ static void checkSingleton(const QString &dataDirectory) "import QtQuick 2.6\n" "import \"..\"\n" "Item { property int t: ValueSource.something }", - QUrl::fromLocalFile(dataDirectory + "/abc/Xyz.qml")); - QCOMPARE(component.status(), QQmlComponent::Ready); + testFileUrl("abc/Xyz.qml")); + QVERIFY2(component.status() == QQmlComponent::Ready, qPrintable(component.errorString())); QScopedPointer<QObject> o(component.create()); QVERIFY(o.data()); QCOMPARE(o->property("t").toInt(), 10); @@ -402,6 +407,9 @@ public: void tst_QQMLTypeLoader::intercept() { +#ifdef Q_OS_ANDROID + QSKIP("Loading dynamic plugins does not work on Android"); +#endif qmlClearTypeRegistrations(); QQmlEngine engine; @@ -491,6 +499,9 @@ static void checkCleanCacheLoad(const QString &testCase) void tst_QQMLTypeLoader::multiSingletonModule() { +#ifdef Q_OS_ANDROID + QSKIP("Android seems to have problems with QProcess"); +#endif qmlClearTypeRegistrations(); QQmlEngine engine; engine.addImportPath(testFile("imports")); @@ -511,6 +522,9 @@ void tst_QQMLTypeLoader::multiSingletonModule() void tst_QQMLTypeLoader::implicitComponentModule() { +#ifdef Q_OS_ANDROID + QSKIP("Android seems to have problems with QProcess"); +#endif QQmlEngine engine; QQmlComponent component(&engine, testFileUrl("implicitcomponent.qml")); QCOMPARE(component.status(), QQmlComponent::Ready); diff --git a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.pro b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.pro index 19834ff537..c868474b5b 100644 --- a/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.pro +++ b/tests/auto/qml/qqmltypeloader/tst_qqmltypeloader.pro @@ -15,3 +15,5 @@ QML_IMPORT_VERSION = 3.2 QML_IMPORT_NAME = "declarative.import.for.typeloader.test" include (../../shared/util.pri) + +TESTDATA = data/* diff --git a/tests/auto/quick/qquicktext/BLACKLIST b/tests/auto/quick/qquicktext/BLACKLIST index 6c3c3af154..594f9af3b3 100644 --- a/tests/auto/quick/qquicktext/BLACKLIST +++ b/tests/auto/quick/qquicktext/BLACKLIST @@ -4,3 +4,5 @@ qemu osx-10.12 [fontSizeMode] opensuse-42.1 +[contentSize] +windows gcc diff --git a/tests/auto/quick/rendernode/tst_rendernode.cpp b/tests/auto/quick/rendernode/tst_rendernode.cpp index 6ca5231343..e75e9e30b9 100644 --- a/tests/auto/quick/rendernode/tst_rendernode.cpp +++ b/tests/auto/quick/rendernode/tst_rendernode.cpp @@ -194,7 +194,7 @@ static bool fuzzyCompareColor(QRgb x, QRgb y, QByteArray *errorMessage) enum { fuzz = 4 }; if (qAbs(qRed(x) - qRed(y)) >= fuzz || qAbs(qGreen(x) - qGreen(y)) >= fuzz || qAbs(qBlue(x) - qBlue(y)) >= fuzz) { QString s; - QDebug(&s).nospace() << hex << "Color mismatch 0x" << x << " 0x" << y << dec << " (fuzz=" << fuzz << ")."; + QDebug(&s).nospace() << Qt::hex << "Color mismatch 0x" << x << " 0x" << y << Qt::dec << " (fuzz=" << fuzz << ")."; *errorMessage = s.toLocal8Bit(); return false; } diff --git a/tests/auto/quick/shared/visualtestutil.cpp b/tests/auto/quick/shared/visualtestutil.cpp index de2cf2bd5b..06f7386902 100644 --- a/tests/auto/quick/shared/visualtestutil.cpp +++ b/tests/auto/quick/shared/visualtestutil.cpp @@ -95,7 +95,7 @@ bool QQuickVisualTestUtil::compareImages(const QImage &ia, const QImage &ib, QSt || qAbs(qRed(a) - qRed(b)) > tolerance || qAbs(qRed(a) - qRed(b)) > tolerance) { QDebug(errorMessage) << "Mismatch at:" << x << y << ':' - << hex << showbase << a << b; + << Qt::hex << Qt::showbase << a << b; return false; } } diff --git a/tests/auto/toolsupport/tst_toolsupport.cpp b/tests/auto/toolsupport/tst_toolsupport.cpp index f743a6f5c6..0c87d1a00c 100644 --- a/tests/auto/toolsupport/tst_toolsupport.cpp +++ b/tests/auto/toolsupport/tst_toolsupport.cpp @@ -87,7 +87,7 @@ void tst_toolsupport::offsets_data() { QTestData &data = QTest::newRow("sizeof(QObjectData)") << sizeof(QObjectData); - data << 28 << 48; // vptr + 3 ptr + 2 int + ptr + data << 36 << 64; // vptr + 4 ptr + 3 int + (padding) + ptr } { @@ -115,8 +115,8 @@ void tst_toolsupport::offsets_data() { QTestData &data - = QTest::newRow("Heap::String::text") - << pmm_to_offsetof(&QV4::Heap::String::text); + = QTest::newRow("Heap::String::textStorage") + << pmm_to_offsetof(&QV4::Heap::String::textStorage); data << 4 << 8; } diff --git a/tests/benchmarks/qml/painting/paintbenchmark.cpp b/tests/benchmarks/qml/painting/paintbenchmark.cpp index 1500f39c9a..e1659d6837 100644 --- a/tests/benchmarks/qml/painting/paintbenchmark.cpp +++ b/tests/benchmarks/qml/painting/paintbenchmark.cpp @@ -31,7 +31,7 @@ #include <QImage> #include <QPainter> #include <QPainterPath> -#include <QGLWidget> +#include <QOpenGLWidget> #include <QTextLayout> #include <QVBoxLayout> #include <QElapsedTimer> @@ -46,7 +46,7 @@ const int spacing = 36; QSizeF size(1000, 800); const qreal lineWidth = 1000; QString strings[lines]; -QGLWidget *testWidget = 0; +QOpenGLWidget *testWidget = 0; void paint_QTextLayout(QPainter &p, bool useCache) { @@ -151,8 +151,8 @@ void paint_RoundedRect(QPainter &p) static bool first = true; if (first) { if (testWidget) { - QGLFormat format = testWidget->format(); - if (!format.sampleBuffers()) + QSurfaceFormat format = testWidget->format(); + if (format.samples() == -1) qWarning() << "Cannot paint antialiased rounded rect without sampleBuffers"; } first = false; @@ -314,10 +314,11 @@ struct { PaintFunc testFunc = 0; -class MyGLWidget : public QGLWidget +class MyGLWidget : public QOpenGLWidget { public: - MyGLWidget(const QGLFormat &format) : QGLWidget(format), frames(0) { + MyGLWidget(const QSurfaceFormat &format) : frames(0) { + setFormat(format); const char chars[] = "abcd efgh ijkl mnop qrst uvwx yz!$. ABCD 1234"; int len = strlen(chars); for (int i = 0; i < lines; ++i) { @@ -394,8 +395,11 @@ int main(int argc, char *argv[]) } QWidget w; - QGLFormat format = QGLFormat::defaultFormat(); - format.setSampleBuffers(sampleBuffers); + QSurfaceFormat format = QSurfaceFormat::defaultFormat(); + if (!sampleBuffers) + format.setSamples(-1); + else if (format.samples() == -1) + format.setSamples(4); testWidget = new MyGLWidget(format); testWidget->setAutoFillBackground(false); QVBoxLayout *layout = new QVBoxLayout(&w); diff --git a/tests/manual/nodetypes/Animators.qml b/tests/manual/nodetypes/Animators.qml deleted file mode 100644 index c582106c5d..0000000000 --- a/tests/manual/nodetypes/Animators.qml +++ /dev/null @@ -1,190 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.5 - -Item { - id: window - - Rectangle { - anchors.fill: parent - gradient: Gradient { - GradientStop { position: 0.0; color: "#14148c" } - GradientStop { position: 0.499; color: "#14aaff" } - GradientStop { position: 0.5; color: "#80c342" } - GradientStop { position: 1.0; color: "#006325" } - } - } - - SequentialAnimation { - id: plainAnim - SequentialAnimation { - ParallelAnimation { - PropertyAnimation { - property: "y" - target: smiley - from: smiley.minHeight - to: smiley.maxHeight - easing.type: Easing.OutExpo - duration: 300 - } - PropertyAnimation { - property: "scale" - target: shadow - from: 1 - to: 0.5 - easing.type: Easing.OutExpo - duration: 300 - } - } - ParallelAnimation { - PropertyAnimation { - property: "y" - target: smiley - from: smiley.maxHeight - to: smiley.minHeight - easing.type: Easing.OutBounce - duration: 1000 - } - PropertyAnimation { - property: "scale" - target: shadow - from: 0.5 - to: 1 - easing.type: Easing.OutBounce - duration: 1000 - } - } - } - running: false - } - - SequentialAnimation { - id: renderThreadAnim - SequentialAnimation { - ParallelAnimation { - YAnimator { - target: smiley - from: smiley.minHeight - to: smiley.maxHeight - easing.type: Easing.OutExpo - duration: 300 - } - ScaleAnimator { - target: shadow - from: 1 - to: 0.5 - easing.type: Easing.OutExpo - duration: 300 - } - } - ParallelAnimation { - YAnimator { - target: smiley - from: smiley.maxHeight - to: smiley.minHeight - easing.type: Easing.OutBounce - duration: 1000 - } - ScaleAnimator { - target: shadow - from: 0.5 - to: 1 - easing.type: Easing.OutBounce - duration: 1000 - } - } - } - running: false - } - - Image { - id: shadow - anchors.horizontalCenter: parent.horizontalCenter - y: smiley.minHeight + smiley.height - source: "qrc:/shadow.png" - } - - Image { - id: smiley - property int maxHeight: window.height / 3 - property int minHeight: 2 * window.height / 3 - - anchors.horizontalCenter: parent.horizontalCenter - y: minHeight - source: "qrc:/face-smile.png" - } - - Text { - text: "click left for plain animation, right for render thread Animators, middle to sleep for 2 sec on the main (gui) thread" - color: "white" - } - - Text { - text: plainAnim.running ? "NORMAL ANIMATION" : (renderThreadAnim.running ? "RENDER THREAD ANIMATION" : "NO ANIMATION") - color: "red" - font.pointSize: 20 - anchors.bottom: parent.bottom - } - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.AllButtons - onClicked: if (mouse.button === Qt.LeftButton) { - renderThreadAnim.running = false; - plainAnim.running = true; - } else if (mouse.button === Qt.RightButton) { - plainAnim.running = false; - renderThreadAnim.running = true; - } else if (mouse.button === Qt.MiddleButton) { - helper.sleep(2000); - } - } -} diff --git a/tests/manual/nodetypes/Effects.qml b/tests/manual/nodetypes/Effects.qml deleted file mode 100644 index 90a30c40d3..0000000000 --- a/tests/manual/nodetypes/Effects.qml +++ /dev/null @@ -1,231 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -// Use QtQuick 2.8 to get GraphicsInfo and the other new properties -import QtQuick 2.8 - -Item { - Rectangle { - color: "gray" - anchors.margins: 10 - anchors.fill: parent - Image { - id: image1 - source: "qrc:/qt.png" - } - ShaderEffectSource { - id: effectSource1 - sourceItem: image1 - hideSource: true - } - ShaderEffect { // wobble - id: eff - width: image1.width - height: image1.height - anchors.centerIn: parent - - property variant source: effectSource1 - property real amplitude: 0.04 * 0.2 - property real frequency: 20 - property real time: 0 - - NumberAnimation on time { loops: Animation.Infinite; from: 0; to: Math.PI * 2; duration: 600 } - - property bool customVertexShader: false // the effect is fine with the default vs, but toggle this to test - property bool useHLSLSourceString: false // toggle to provide HLSL shaders as strings instead of bytecode in files - - property string glslVertexShader: - "uniform highp mat4 qt_Matrix;" + - "attribute highp vec4 qt_Vertex;" + - "attribute highp vec2 qt_MultiTexCoord0;" + - "varying highp vec2 qt_TexCoord0;" + - "void main() {" + - " qt_TexCoord0 = qt_MultiTexCoord0;" + - " gl_Position = qt_Matrix * qt_Vertex;" + - "}" - - property string glslFragmentShader: - "uniform sampler2D source;" + - "uniform highp float amplitude;" + - "uniform highp float frequency;" + - "uniform highp float time;" + - "uniform lowp float qt_Opacity;" + - "varying highp vec2 qt_TexCoord0;" + - "void main() {" + - " highp vec2 p = sin(time + frequency * qt_TexCoord0);" + - " gl_FragColor = texture2D(source, qt_TexCoord0 + amplitude * vec2(p.y, -p.x)) * qt_Opacity;" + - "}" - - property string hlslVertexShader: "cbuffer ConstantBuffer : register(b0) {" + - " float4x4 qt_Matrix;" + - " float qt_Opacity; }" + - "struct PSInput {" + - " float4 position : SV_POSITION;" + - " float2 coord : TEXCOORD0; };" + - "PSInput main(float4 position : POSITION, float2 coord : TEXCOORD0) {" + - " PSInput result;" + - " result.position = mul(qt_Matrix, position);" + - " result.coord = coord;" + - " return result;" + - "}"; - - property string hlslPixelShader:"cbuffer ConstantBuffer : register(b0) {" + - " float4x4 qt_Matrix;" + - " float qt_Opacity;" + - " float amplitude;" + - " float frequency;" + - " float time; }" + - "Texture2D source : register(t0);" + - "SamplerState sourceSampler : register(s0);" + - "float4 main(float4 position : SV_POSITION, float2 coord : TEXCOORD0) : SV_TARGET" + - "{" + - " float2 p = sin(time + frequency * coord);" + - " return source.Sample(sourceSampler, coord + amplitude * float2(p.y, -p.x)) * qt_Opacity;" + - "}"; - - property string hlslVertexShaderByteCode: "qrc:/vs_wobble.cso" - property string hlslPixelShaderByteCode: "qrc:/ps_wobble.cso" - - vertexShader: customVertexShader ? (GraphicsInfo.shaderType === GraphicsInfo.HLSL - ? (useHLSLSourceString ? hlslVertexShader : hlslVertexShaderByteCode) - : (GraphicsInfo.shaderType === GraphicsInfo.GLSL ? glslVertexShader : "")) : "" - - fragmentShader: GraphicsInfo.shaderType === GraphicsInfo.HLSL - ? (useHLSLSourceString ? hlslPixelShader : hlslPixelShaderByteCode) - : (GraphicsInfo.shaderType === GraphicsInfo.GLSL ? glslFragmentShader : "") - } - - Image { - id: image2 - source: "qrc:/face-smile.png" - } - ShaderEffectSource { - id: effectSource2 - sourceItem: image2 - hideSource: true - } - ShaderEffect { // dropshadow - id: eff2 - width: image2.width - height: image2.height - scale: 2 - x: 40 - y: 40 - - property variant source: effectSource2 - - property string glslShaderPass1: " - uniform lowp float qt_Opacity; - uniform sampler2D source; - uniform highp vec2 delta; - varying highp vec2 qt_TexCoord0; - void main() { - gl_FragColor = (0.0538 * texture2D(source, qt_TexCoord0 - 3.182 * delta) - + 0.3229 * texture2D(source, qt_TexCoord0 - 1.364 * delta) - + 0.2466 * texture2D(source, qt_TexCoord0) - + 0.3229 * texture2D(source, qt_TexCoord0 + 1.364 * delta) - + 0.0538 * texture2D(source, qt_TexCoord0 + 3.182 * delta)) * qt_Opacity; - }" - property string glslShaderPass2: " - uniform lowp float qt_Opacity; - uniform highp vec2 offset; - uniform sampler2D source; - uniform sampler2D shadow; - uniform highp float darkness; - uniform highp vec2 delta; - varying highp vec2 qt_TexCoord0; - void main() { - lowp vec4 fg = texture2D(source, qt_TexCoord0); - lowp vec4 bg = texture2D(shadow, qt_TexCoord0 + delta); - gl_FragColor = (fg + vec4(0., 0., 0., darkness * bg.a) * (1. - fg.a)) * qt_Opacity; - }" - - property variant shadow: ShaderEffectSource { - sourceItem: ShaderEffect { - width: eff2.width - height: eff2.height - property variant delta: Qt.size(0.0, 1.0 / height) - property variant source: ShaderEffectSource { - sourceItem: ShaderEffect { - id: innerEff - width: eff2.width - height: eff2.height - property variant delta: Qt.size(1.0 / width, 0.0) - property variant source: effectSource2 - fragmentShader: GraphicsInfo.shaderType === GraphicsInfo.HLSL ? "qrc:/ps_shadow1.cso" : (GraphicsInfo.shaderType === GraphicsInfo.GLSL ? eff2.glslShaderPass1 : "") - } - } - fragmentShader: GraphicsInfo.shaderType === GraphicsInfo.HLSL ? "qrc:/ps_shadow1.cso" : (GraphicsInfo.shaderType === GraphicsInfo.GLSL ? eff2.glslShaderPass1: "") - } - } - property real angle: 0 - property variant offset: Qt.point(5.0 * Math.cos(angle), 5.0 * Math.sin(angle)) - NumberAnimation on angle { loops: Animation.Infinite; from: 0; to: Math.PI * 2; duration: 6000 } - property variant delta: Qt.size(offset.x / width, offset.y / height) - property real darkness: 0.5 - fragmentShader: GraphicsInfo.shaderType === GraphicsInfo.HLSL ? "qrc:/ps_shadow2.cso" : (GraphicsInfo.shaderType === GraphicsInfo.GLSL ? glslShaderPass2 : "") - } - - Column { - anchors.bottom: parent.bottom - Text { - color: "yellow" - font.pointSize: 24 - text: "Shader effect is " + (GraphicsInfo.shaderType === GraphicsInfo.HLSL ? "HLSL" : (GraphicsInfo.shaderType === GraphicsInfo.GLSL ? "GLSL" : "UNKNOWN")) + " based"; - } - Text { - text: GraphicsInfo.shaderType + " " + GraphicsInfo.shaderCompilationType + " " + GraphicsInfo.shaderSourceType - } - Text { - text: eff.status + " " + eff.log - } - } - } -} diff --git a/tests/manual/nodetypes/Images.qml b/tests/manual/nodetypes/Images.qml deleted file mode 100644 index 95e8442690..0000000000 --- a/tests/manual/nodetypes/Images.qml +++ /dev/null @@ -1,107 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.3 - -Item { - Rectangle { - width: 100 - height: 100 - anchors.centerIn: parent - color: "red" - NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; } - } - - Image { - id: im - source: "qrc:/qt.png" - mipmap: true - - // changing the mipmap property results in the creation of a brand new - // texture resource. enable the following to test. -// Timer { -// interval: 2000 -// onTriggered: im.mipmap = false -// running: true -// } - - SequentialAnimation on scale { - loops: Animation.Infinite - NumberAnimation { - from: 1.0 - to: 4.0 - duration: 2000 - } - NumberAnimation { - from: 4.0 - to: 0.1 - duration: 3000 - } - NumberAnimation { - from: 0.1 - to: 1.0 - duration: 1000 - } - } - - Image { - anchors.centerIn: parent - source: "qrc:/face-smile.png" - } - } - - Image { - source: "qrc:/face-smile.png" - anchors.bottom: parent.bottom - anchors.right: parent.right - antialiasing: true - NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; } - } -} diff --git a/tests/manual/nodetypes/Layers.qml b/tests/manual/nodetypes/Layers.qml deleted file mode 100644 index 755d00d41a..0000000000 --- a/tests/manual/nodetypes/Layers.qml +++ /dev/null @@ -1,116 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Item { - Rectangle { - color: "lightGray" - anchors.fill: parent - anchors.margins: 10 - - Row { - anchors.fill: parent - anchors.margins: 10 - Rectangle { - color: "red" -// ColorAnimation on color { -// from: "black" -// to: "white" -// duration: 2000 -// loops: Animation.Infinite -// } - width: 300 - height: 100 - layer.enabled: true - Text { text: "this is in a layer, going through an offscreen render target" } - clip: true - Rectangle { - color: "lightGreen" - width: 50 - height: 50 - x: 275 - y: 75 - } - } - Rectangle { - color: "white" - width: 300 - height: 100 - Text { text: "this is not a layer" } - } - Rectangle { - color: "green" - width: 300 - height: 100 - layer.enabled: true - Text { text: "this is another layer" } - Rectangle { - border.width: 4 - border.color: "black" - anchors.centerIn: parent - width: 150 - height: 50 - layer.enabled: true - Text { - anchors.centerIn: parent - text: "layer in a layer" - } - } - Image { - source: "qrc:/face-smile.png" - anchors.bottom: parent.bottom - anchors.right: parent.right - NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; } - } - } - } - } -} diff --git a/tests/manual/nodetypes/LotsOfImages.qml b/tests/manual/nodetypes/LotsOfImages.qml deleted file mode 100644 index 72c36aba01..0000000000 --- a/tests/manual/nodetypes/LotsOfImages.qml +++ /dev/null @@ -1,83 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.3 - -Item { - Grid { - columns: 20 - spacing: 4 - anchors.centerIn: parent - - Repeater { - model: 500 - - Image { - source: "qrc:/qt.png" - - // async true, cache false -> there is a separate, new texture for each and every image - // and the pixel data reading is done over and over again on a separate thread. - asynchronous: true - cache: false - - width: 20 - height: 20 - } - } - } - - Rectangle { - width: 100 - height: 100 - anchors.centerIn: parent - color: "red" - NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; } - } -} diff --git a/tests/manual/nodetypes/LotsOfRects.qml b/tests/manual/nodetypes/LotsOfRects.qml deleted file mode 100644 index e54174f10c..0000000000 --- a/tests/manual/nodetypes/LotsOfRects.qml +++ /dev/null @@ -1,260 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Item { - Rectangle { - anchors.margins: 4 - anchors.fill: parent - - // Background - gradient: Gradient { - GradientStop { position: 0; color: "steelblue" } - GradientStop { position: 1; color: "black" } - } - - // Animated gradient stops. - // NB! Causes a full buffer rebuild on every animated change due to the geometry change! - Row { - spacing: 10 - Repeater { - model: 20 - Rectangle { - width: 20 - height: 20 - gradient: Gradient { - GradientStop { position: 0.0; color: "red" } - GradientStop { NumberAnimation on position { from: 0.01; to: 0.99; duration: 5000; loops: Animation.Infinite } color: "yellow" } - GradientStop { position: 1.0; color: "green" } - } - } - } - } - - // Rounded rects with border (smooth material) - Row { - spacing: 10 - Repeater { - model: 5 - Rectangle { - color: "blue" - width: 100 - height: 50 - y: 50 - radius: 16 - border.color: "red" - border.width: 4 - - SequentialAnimation on y { - loops: Animation.Infinite - NumberAnimation { - from: 50 - to: 150 - duration: 7000 - } - NumberAnimation { - from: 150 - to: 50 - duration: 3000 - } - } - } - } - } - - // Clip using scissor - Row { - spacing: 10 - Repeater { - model: 5 - Rectangle { - color: "green" - width: 100 - height: 100 - y: 150 - NumberAnimation on y { - from: 150 - to: 200 - duration: 2000 - loops: Animation.Infinite - } - clip: true - Rectangle { - color: "lightGreen" - width: 50 - height: 50 - x: 75 - y: 75 - } - } - } - } - - // Clip using scissor - Row { - spacing: 10 - Repeater { - model: 5 - Rectangle { - color: "green" - width: 100 - height: 100 - y: 300 - NumberAnimation on y { - from: 300 - to: 400 - duration: 2000 - loops: Animation.Infinite - } - clip: true - Rectangle { - color: "lightGreen" - width: 50 - height: 50 - x: 75 - y: 75 - NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; } - } - } - } - } - - // Clip using stencil - Row { - spacing: 10 - Repeater { - model: 5 - Rectangle { - color: "green" - width: 100 - height: 100 - y: 450 - NumberAnimation on y { - from: 450 - to: 550 - duration: 2000 - loops: Animation.Infinite - } - NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; } - clip: true - Rectangle { - color: "lightGreen" - width: 50 - height: 50 - x: 75 - y: 75 - } - } - } - } - - // The signature red square with another item with animated opacity blended on top - Rectangle { - width: 100 - height: 100 - anchors.centerIn: parent - color: "red" - NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; } - - Rectangle { - color: "gray" - width: 50 - height: 50 - anchors.centerIn: parent - - SequentialAnimation on opacity { - loops: Animation.Infinite - NumberAnimation { - from: 1.0 - to: 0.0 - duration: 4000 - } - NumberAnimation { - from: 0.0 - to: 1.0 - duration: 4000 - easing.type: Easing.InOutQuad - } - } - } - } - - // Animated size and color. - // NB! Causes a full buffer rebuild on every animated change due to the geometry change! - Rectangle { - anchors.right: parent.right - anchors.bottom: parent.bottom - width: 10 - height: 100 - ColorAnimation on color { - from: "blue" - to: "purple" - duration: 5000 - loops: Animation.Infinite - } - NumberAnimation on width { - from: 10 - to: 300 - duration: 5000 - loops: Animation.Infinite - } - } - - // Semi-transparent rect on top. - Rectangle { - anchors.centerIn: parent - opacity: 0.2 - color: "black" - anchors.fill: parent - anchors.margins: 10 - } - } -} diff --git a/tests/manual/nodetypes/Painter.qml b/tests/manual/nodetypes/Painter.qml deleted file mode 100644 index c5db3496f8..0000000000 --- a/tests/manual/nodetypes/Painter.qml +++ /dev/null @@ -1,94 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 -import Stuff 1.0 - -Item { - ListModel { - id: balloonModel - ListElement { - balloonWidth: 200 - } - ListElement { - balloonWidth: 120 - } - ListElement { - balloonWidth: 120 - } - ListElement { - balloonWidth: 120 - } - ListElement { - balloonWidth: 120 - } - } - - ListView { - anchors.fill: parent - anchors.margins: 10 - id: balloonView - model: balloonModel - spacing: 5 - delegate: TextBalloon { - anchors.right: index % 2 == 0 ? undefined : parent.right - height: 60 - rightAligned: index % 2 == 0 ? false : true - width: balloonWidth - innerAnim: model.index === 1 - NumberAnimation on width { - from: 200 - to: 300 - duration: 5000 - running: model.index === 0 - } - } - } -} diff --git a/tests/manual/nodetypes/Rects.qml b/tests/manual/nodetypes/Rects.qml deleted file mode 100644 index 7f12d118dd..0000000000 --- a/tests/manual/nodetypes/Rects.qml +++ /dev/null @@ -1,147 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Item { - Rectangle { - width: 100 - height: 100 - anchors.centerIn: parent - color: "red" - NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; } - - Rectangle { - color: "gray" - width: 50 - height: 50 - anchors.centerIn: parent - - SequentialAnimation on opacity { - loops: Animation.Infinite - NumberAnimation { - from: 1.0 - to: 0.0 - duration: 4000 - } - NumberAnimation { - from: 0.0 - to: 1.0 - duration: 4000 - easing.type: Easing.InOutQuad - } - } - } - } - - Rectangle { - color: "green" - width: 100 - height: 200 - x: 0 - y: 0 - - NumberAnimation on x { - from: 0 - to: 300 - duration: 5000 - } - NumberAnimation on y { - from: 0 - to: 50 - duration: 2000 - } - - clip: true - Rectangle { - color: "lightGreen" - width: 50 - height: 50 - x: 75 - y: 175 - } - } - - Rectangle { - color: "blue" - width: 200 - height: 100 - x: 100 - y: 300 - radius: 16 - border.color: "red" - border.width: 4 - - SequentialAnimation on y { - loops: Animation.Infinite - NumberAnimation { - from: 300 - to: 500 - duration: 7000 - } - NumberAnimation { - from: 500 - to: 300 - duration: 3000 - } - } - } - - Rectangle { - anchors.right: parent.right - width: 100 - height: 100 - gradient: Gradient { - GradientStop { position: 0.0; color: "red" } - GradientStop { position: 0.33; color: "yellow" } - GradientStop { position: 1.0; color: "green" } - } - } -} diff --git a/tests/manual/nodetypes/Text.qml b/tests/manual/nodetypes/Text.qml deleted file mode 100644 index 58befe8c49..0000000000 --- a/tests/manual/nodetypes/Text.qml +++ /dev/null @@ -1,81 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Item { - Text { - id: text1 - anchors.top: parent.top - text: "árvíztűrő tükörfúrógép\nÁRVÍZTŰRŐ TÜKÖRFÚRÓGÉP" - } - Text { - anchors.bottom: parent.bottom - text: "the quick brown fox jumps over the lazy dog\nTHE QUICK BROWN FOX JUMPS OVER THE LAZY DOG" - color: "red" - } - Text { - anchors.centerIn: parent - text: "rotate rotate rotate" - font.bold: true - font.pointSize: 20 - color: "green" - NumberAnimation on rotation { from: 0; to: 360; duration: 2000; loops: Animation.Infinite; } - } - - Row { - anchors.top: text1.bottom - anchors.margins: 10 - Text { font.pointSize: 24; text: "Normal" } - Text { font.pointSize: 24; text: "Raised"; style: Text.Raised; styleColor: "#AAAAAA" } - Text { font.pointSize: 24; text: "Outline"; style: Text.Outline; styleColor: "red" } - Text { font.pointSize: 24; text: "Sunken"; style: Text.Sunken; styleColor: "#AAAAAA" } - } -} diff --git a/tests/manual/nodetypes/face-smile.png b/tests/manual/nodetypes/face-smile.png Binary files differdeleted file mode 100644 index 3d66d72578..0000000000 --- a/tests/manual/nodetypes/face-smile.png +++ /dev/null diff --git a/tests/manual/nodetypes/hlslcompile.bat b/tests/manual/nodetypes/hlslcompile.bat deleted file mode 100644 index b24824e324..0000000000 --- a/tests/manual/nodetypes/hlslcompile.bat +++ /dev/null @@ -1,4 +0,0 @@ -fxc /E VS_Wobble /T vs_5_0 /Fo vs_wobble.cso wobble.hlsl -fxc /E PS_Wobble /T ps_5_0 /Fo ps_wobble.cso wobble.hlsl -fxc /E PS_Shadow1 /T ps_5_0 /Fo ps_shadow1.cso shadow1.hlsl -fxc /E PS_Shadow2 /T ps_5_0 /Fo ps_shadow2.cso shadow2.hlsl diff --git a/tests/manual/nodetypes/main.qml b/tests/manual/nodetypes/main.qml deleted file mode 100644 index 9f1a5c5e9c..0000000000 --- a/tests/manual/nodetypes/main.qml +++ /dev/null @@ -1,93 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -import QtQuick 2.0 - -Item { - focus: true - - Loader { - anchors.fill: parent - id: loader - } - - Keys.onPressed: { - if (event.key === Qt.Key_S) - loader.source = ""; - - if (event.key === Qt.Key_R) - loader.source = "qrc:/Rects.qml"; - if (event.key === Qt.Key_4) - loader.source = "qrc:/LotsOfRects.qml"; - - if (event.key === Qt.Key_I) - loader.source = "qrc:/Images.qml"; - if (event.key === Qt.Key_5) - loader.source = "qrc:/LotsOfImages.qml"; - - if (event.key === Qt.Key_T) - loader.source = "qrc:/Text.qml"; - - if (event.key === Qt.Key_A) - loader.source = "qrc:/Animators.qml"; - - if (event.key === Qt.Key_L) - loader.source = "qrc:/Layers.qml"; - - if (event.key === Qt.Key_E) - loader.source = "qrc:/Effects.qml"; - - if (event.key === Qt.Key_P) - loader.source = "qrc:/Painter.qml"; - - if (event.key === Qt.Key_G) - helper.testGrab() - } -} diff --git a/tests/manual/nodetypes/nodetypes.cpp b/tests/manual/nodetypes/nodetypes.cpp deleted file mode 100644 index 287574f25c..0000000000 --- a/tests/manual/nodetypes/nodetypes.cpp +++ /dev/null @@ -1,216 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the demonstration applications of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** 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. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <QGuiApplication> -#include <QThread> -#include <QQuickView> -#include <QQmlEngine> -#include <QQmlContext> -#include <QQuickPaintedItem> -#include <QPainter> -#include <QTimer> - -class TextBalloon : public QQuickPaintedItem -{ - Q_OBJECT - Q_PROPERTY(bool rightAligned READ isRightAligned WRITE setRightAligned NOTIFY rightAlignedChanged) - Q_PROPERTY(bool innerAnim READ innerAnimEnabled WRITE setInnerAnimEnabled NOTIFY innerAnimChanged) - -public: - TextBalloon(QQuickItem *parent = nullptr) : QQuickPaintedItem(parent) { - connect(&m_timer, &QTimer::timeout, this, &TextBalloon::onAnim); - m_timer.setInterval(500); - } - void paint(QPainter *painter); - - bool isRightAligned() { return m_rightAligned; } - void setRightAligned(bool rightAligned); - - bool innerAnimEnabled() const { return m_innerAnim; } - void setInnerAnimEnabled(bool b); - -signals: - void rightAlignedChanged(); - void innerAnimChanged(); - -private slots: - void onAnim(); - -private: - bool m_rightAligned = false; - bool m_innerAnim = false; - QTimer m_timer; - QRect m_animRect = QRect(10, 10, 50, 20); - int m_anim = 0; -}; - -void TextBalloon::paint(QPainter *painter) -{ - QBrush brush(QColor("#007430")); - - painter->setBrush(brush); - painter->setPen(Qt::NoPen); - painter->setRenderHint(QPainter::Antialiasing); - - painter->drawRoundedRect(0, 0, boundingRect().width(), boundingRect().height() - 10, 10, 10); - - if (m_rightAligned) { - const QPointF points[3] = { - QPointF(boundingRect().width() - 10.0, boundingRect().height() - 10.0), - QPointF(boundingRect().width() - 20.0, boundingRect().height()), - QPointF(boundingRect().width() - 30.0, boundingRect().height() - 10.0), - }; - painter->drawConvexPolygon(points, 3); - } else { - const QPointF points[3] = { - QPointF(10.0, boundingRect().height() - 10.0), - QPointF(20.0, boundingRect().height()), - QPointF(30.0, boundingRect().height() - 10.0), - }; - painter->drawConvexPolygon(points, 3); - } - - if (m_innerAnim) { - painter->fillRect(m_animRect, Qt::lightGray); - const int x = m_animRect.x() + m_anim; - const int y = m_animRect.y() + m_animRect.height() / 2; - painter->setPen(QPen(QBrush(Qt::SolidLine), 4)); - painter->drawLine(x + 4, y, x + 10, y); - m_anim += 10; - if (m_anim > m_animRect.width()) - m_anim = 0; - } -} - -void TextBalloon::setRightAligned(bool rightAligned) -{ - if (m_rightAligned == rightAligned) - return; - - m_rightAligned = rightAligned; - emit rightAlignedChanged(); -} - -void TextBalloon::setInnerAnimEnabled(bool b) -{ - if (m_innerAnim == b) - return; - - m_innerAnim = b; - if (!b) - m_timer.stop(); - else - m_timer.start(); - emit innerAnimChanged(); -} - -void TextBalloon::onAnim() -{ - update(m_animRect); -} - -class Helper : public QObject -{ - Q_OBJECT - -public: - Helper(QQuickWindow *w) : m_window(w) { } - - Q_INVOKABLE void sleep(int ms) { - QThread::msleep(ms); - } - - Q_INVOKABLE void testGrab() { - QImage img = m_window->grabWindow(); - qDebug() << "Saving image to grab_result.png" << img; - img.save("grab_result.png"); - } - - QQuickWindow *m_window; -}; - -int main(int argc, char **argv) -{ - qputenv("QT_QUICK_BACKEND", "d3d12"); - - QGuiApplication app(argc, argv); - - qDebug("Available tests:"); - qDebug(" [R] - Rectangles"); - qDebug(" [4] - A lot of rectangles"); - qDebug(" [I] - Images"); - qDebug(" [5] - A lot of async images"); - qDebug(" [T] - Text"); - qDebug(" [A] - Render thread Animator"); - qDebug(" [L] - Layers"); - qDebug(" [E] - Effects"); - qDebug(" [P] - QQuickPaintedItem"); - qDebug(" [G] - Grab current window"); - qDebug("\nPress S to stop the currently running test\n"); - - QQuickView view; - Helper helper(&view); - if (app.arguments().contains(QLatin1String("--multisample"))) { - qDebug("Requesting sample count 4"); - QSurfaceFormat fmt; - fmt.setSamples(4); - view.setFormat(fmt); - } - view.engine()->rootContext()->setContextProperty(QLatin1String("helper"), &helper); - qmlRegisterType<TextBalloon>("Stuff", 1, 0, "TextBalloon"); - view.setResizeMode(QQuickView::SizeRootObjectToView); - view.resize(1024, 768); - view.setSource(QUrl("qrc:/main.qml")); - view.show(); - - return app.exec(); -} - -#include "nodetypes.moc" diff --git a/tests/manual/nodetypes/nodetypes.pro b/tests/manual/nodetypes/nodetypes.pro deleted file mode 100644 index 959b43cf18..0000000000 --- a/tests/manual/nodetypes/nodetypes.pro +++ /dev/null @@ -1,9 +0,0 @@ -QT += qml quick - -SOURCES += nodetypes.cpp - -RESOURCES += nodetypes.qrc - -OTHER_FILES += main.qml Rects.qml LotsOfRects.qml \ - Images.qml LotsOfImages.qml Text.qml Animators.qml Layers.qml Effects.qml Painter.qml \ - wobble.hlsl shadow1.hlsl shadow2.hlsl diff --git a/tests/manual/nodetypes/nodetypes.qrc b/tests/manual/nodetypes/nodetypes.qrc deleted file mode 100644 index 78c0d085a1..0000000000 --- a/tests/manual/nodetypes/nodetypes.qrc +++ /dev/null @@ -1,21 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>main.qml</file> - <file>Rects.qml</file> - <file>LotsOfRects.qml</file> - <file>Images.qml</file> - <file>LotsOfImages.qml</file> - <file>Text.qml</file> - <file>Animators.qml</file> - <file>Layers.qml</file> - <file>Effects.qml</file> - <file>Painter.qml</file> - <file>qt.png</file> - <file>face-smile.png</file> - <file>shadow.png</file> - <file>vs_wobble.cso</file> - <file>ps_wobble.cso</file> - <file>ps_shadow1.cso</file> - <file>ps_shadow2.cso</file> - </qresource> -</RCC> diff --git a/tests/manual/nodetypes/ps_shadow1.cso b/tests/manual/nodetypes/ps_shadow1.cso Binary files differdeleted file mode 100644 index b6fbe3f3c2..0000000000 --- a/tests/manual/nodetypes/ps_shadow1.cso +++ /dev/null diff --git a/tests/manual/nodetypes/ps_shadow2.cso b/tests/manual/nodetypes/ps_shadow2.cso Binary files differdeleted file mode 100644 index ab8cb63f34..0000000000 --- a/tests/manual/nodetypes/ps_shadow2.cso +++ /dev/null diff --git a/tests/manual/nodetypes/ps_wobble.cso b/tests/manual/nodetypes/ps_wobble.cso Binary files differdeleted file mode 100644 index 4e5b6a27f4..0000000000 --- a/tests/manual/nodetypes/ps_wobble.cso +++ /dev/null diff --git a/tests/manual/nodetypes/qt.png b/tests/manual/nodetypes/qt.png Binary files differdeleted file mode 100644 index f30eec0d4d..0000000000 --- a/tests/manual/nodetypes/qt.png +++ /dev/null diff --git a/tests/manual/nodetypes/shadow.png b/tests/manual/nodetypes/shadow.png Binary files differdeleted file mode 100644 index 8270565e87..0000000000 --- a/tests/manual/nodetypes/shadow.png +++ /dev/null diff --git a/tests/manual/nodetypes/shadow1.hlsl b/tests/manual/nodetypes/shadow1.hlsl deleted file mode 100644 index ff3f4b6fd5..0000000000 --- a/tests/manual/nodetypes/shadow1.hlsl +++ /dev/null @@ -1,18 +0,0 @@ -cbuffer ConstantBuffer : register(b0) -{ - float4x4 qt_Matrix; - float qt_Opacity; - float2 delta; -}; - -Texture2D source : register(t0); -SamplerState sourceSampler : register(s0); - -float4 PS_Shadow1(float4 position : SV_POSITION, float2 coord : TEXCOORD0) : SV_TARGET -{ - return (0.0538 * source.Sample(sourceSampler, coord - 3.182 * delta) - + 0.3229 * source.Sample(sourceSampler, coord - 1.364 * delta) - + 0.2466 * source.Sample(sourceSampler, coord) - + 0.3229 * source.Sample(sourceSampler, coord + 1.364 * delta) - + 0.0538 * source.Sample(sourceSampler, coord + 3.182 * delta)) * qt_Opacity; -} diff --git a/tests/manual/nodetypes/shadow2.hlsl b/tests/manual/nodetypes/shadow2.hlsl deleted file mode 100644 index eaa30cd988..0000000000 --- a/tests/manual/nodetypes/shadow2.hlsl +++ /dev/null @@ -1,22 +0,0 @@ -cbuffer ConstantBuffer : register(b0) -{ - float4x4 qt_Matrix; - float qt_Opacity; - float2 offset; - float darkness; - float2 delta; -}; - -Texture2D source : register(t0); -Texture2D shadow : register(t1); -SamplerState samp : register(s0); -// Use the same sampler for both textures. In fact the engine will create an extra static sampler -// in any case (to match the number of textures) due to some internals, but that won't hurt, the -// shader works either way. - -float4 PS_Shadow2(float4 position : SV_POSITION, float2 coord : TEXCOORD0) : SV_TARGET -{ - float4 fg = source.Sample(samp, coord); - float4 bg = shadow.Sample(samp, coord + delta); - return (fg + float4(0.0, 0.0, 0.0, darkness * bg.a) * (1.0 - fg.a)) * qt_Opacity; -} diff --git a/tests/manual/nodetypes/vs_wobble.cso b/tests/manual/nodetypes/vs_wobble.cso Binary files differdeleted file mode 100644 index f3a2596457..0000000000 --- a/tests/manual/nodetypes/vs_wobble.cso +++ /dev/null diff --git a/tests/manual/nodetypes/wobble.hlsl b/tests/manual/nodetypes/wobble.hlsl deleted file mode 100644 index 203dbda7f2..0000000000 --- a/tests/manual/nodetypes/wobble.hlsl +++ /dev/null @@ -1,32 +0,0 @@ -cbuffer ConstantBuffer : register(b0) -{ - float4x4 qt_Matrix; - float qt_Opacity; - - float amplitude; - float frequency; - float time; -}; - -struct PSInput -{ - float4 position : SV_POSITION; - float2 coord : TEXCOORD0; -}; - -PSInput VS_Wobble(float4 position : POSITION, float2 coord : TEXCOORD0) -{ - PSInput result; - result.position = mul(qt_Matrix, position); - result.coord = coord; - return result; -} - -Texture2D source : register(t0); -SamplerState sourceSampler : register(s0); - -float4 PS_Wobble(PSInput input) : SV_TARGET -{ - float2 p = sin(time + frequency * input.coord); - return source.Sample(sourceSampler, input.coord + amplitude * float2(p.y, -p.x)) * qt_Opacity; -} |