diff options
author | Alexandru Croitor <[email protected]> | 2021-08-12 11:24:12 +0200 |
---|---|---|
committer | Alexandru Croitor <[email protected]> | 2021-08-12 17:51:01 +0200 |
commit | 425911d07fc8c3bb899226a1355c38a166b5e1de (patch) | |
tree | 1d5e0e5ae3ec66b10920bb9104e7d12c69b4a52f /tests/auto | |
parent | 59ab3e11433a5157aac0f3af7c0d7fe70a373373 (diff) |
Add a README.md mentioning the documentation on where the ported
effects can be found, as well as how to check out the Qt5 branch.
Pick-to: 6.2
Fixes: QTBUG-95757
Change-Id: Ib47c7e73f8622c8e287df0f74c6f16a5113b357e
Reviewed-by: Tor Arne Vestbø <[email protected]>
Reviewed-by: Volker Hilsheimer <[email protected]>
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/CMakeLists.txt | 17 | ||||
-rw-r--r-- | tests/auto/auto.pro | 11 | ||||
-rw-r--r-- | tests/auto/dummy.qml | 6 | ||||
-rw-r--r-- | tests/auto/tst_qtgraphicaleffects.cpp | 542 |
4 files changed, 0 insertions, 576 deletions
diff --git a/tests/auto/CMakeLists.txt b/tests/auto/CMakeLists.txt deleted file mode 100644 index fad899f..0000000 --- a/tests/auto/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -# Generated from auto.pro. - -##################################################################### -## tst_qtgraphicaleffects Test: -##################################################################### - -qt_internal_add_test(tst_qtgraphicaleffects - SOURCES - tst_qtgraphicaleffects.cpp - PUBLIC_LIBRARIES - Qt::Gui - Qt::Qml - Qt::Quick -) - -#### Keys ignored in scope 1:.:.:auto.pro:<TRUE>: -# DISTFILES = "dummy.qml" diff --git a/tests/auto/auto.pro b/tests/auto/auto.pro deleted file mode 100644 index df22767..0000000 --- a/tests/auto/auto.pro +++ /dev/null @@ -1,11 +0,0 @@ - -CONFIG += testcase - -QT += qml testlib quick - -TARGET = tst_qtgraphicaleffects - -SOURCES += tst_qtgraphicaleffects.cpp - -DISTFILES += \ - dummy.qml diff --git a/tests/auto/dummy.qml b/tests/auto/dummy.qml deleted file mode 100644 index 17ba150..0000000 --- a/tests/auto/dummy.qml +++ /dev/null @@ -1,6 +0,0 @@ -import QtQuick 2.0 -import QtGraphicalEffects 1.0 - -Item { - -} diff --git a/tests/auto/tst_qtgraphicaleffects.cpp b/tests/auto/tst_qtgraphicaleffects.cpp deleted file mode 100644 index f83fc02..0000000 --- a/tests/auto/tst_qtgraphicaleffects.cpp +++ /dev/null @@ -1,542 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the Qt Graphical Effects module. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include <qtest.h> -#include <QtCore/qscopedpointer.h> -#include <QtCore/QLibraryInfo> -#include <QtQml> - -class tst_qtgraphicaleffects : public QObject -{ - Q_OBJECT - -private slots: - void initTestCase(); - - void brightnessContrast(); - void colorize(); - void colorOverlay(); - void conicalGradient(); - void desaturate(); - void displace(); - void dropShadow(); - void fastBlur(); - void gammaAdjust(); - void glow(); - void hueSaturation(); - void levelAdjust(); - void linearGradient(); - void opacityMask(); - void radialGradient(); - void rectangularGlow(); - void thresholdMask(); - -private: - QString componentErrors(const QQmlComponent*) const; - - QString importSelf; - QQmlEngine engine; -}; - -QString tst_qtgraphicaleffects::componentErrors(const QQmlComponent* component) const -{ - if (!component) { - return "(null component)"; - } - - QStringList out; - - const auto errors = component->errors(); - for (const QQmlError &error : errors) - out << error.toString(); - - return out.join("\n"); -} - -void tst_qtgraphicaleffects::initTestCase() -{ - QString import; - - QString qmlImportPath = qgetenv("QML2_IMPORT_PATH"); - if (qmlImportPath.isEmpty() || !QFile::exists(qmlImportPath)) - qmlImportPath = QLibraryInfo::location(QLibraryInfo::Qml2ImportsPath); - - // Allow the test to work whether or not the module is yet installed. - if (QFile::exists(qmlImportPath + "/QtGraphicalEffects")) { - // Module is installed - import it the nice way - import = "QtGraphicalEffects"; - } - else { - // Module is not installed - import it from the source tree, by URI - QString qmldir = QFINDTESTDATA("../../src/effects/qmldir"); - QVERIFY2(QFile::exists(qmldir), qPrintable(qmldir)); - - QUrl url = QUrl::fromLocalFile(QFileInfo(qmldir).canonicalPath()); - import = "\"" + url.toString() + "\""; - } - - importSelf = QString("import %1 1.0\n").arg(import); -} - - -void tst_qtgraphicaleffects::brightnessContrast() -{ - // Creation - QString componentStr = "import QtQuick 2.0\n" - + importSelf + - "BrightnessContrast {" - "width: 50; height: 50\n" - "source: ShaderEffectSource {sourceItem: Rectangle {width: 100; height: 100}}" - "}"; - QQmlComponent component(&engine); - component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QVERIFY2(component.status() != QQmlComponent::Error, qPrintable(componentErrors(&component))); - QTRY_COMPARE(component.status(), QQmlComponent::Ready); - QScopedPointer<QObject> obj(component.create()); - QVERIFY(!obj.isNull()); - - // Default values - QCOMPARE(obj->property("brightness").type(), QVariant::Double); - QCOMPARE(obj->property("brightness").toDouble(), 0.0); - QCOMPARE(obj->property("contrast").type(), QVariant::Double); - QCOMPARE(obj->property("contrast").toDouble(), 0.0); - QCOMPARE(obj->property("source").toInt(), 0); - QCOMPARE(obj->property("cached").toBool(), false); -} - -void tst_qtgraphicaleffects::colorize() -{ - // Creation - QString componentStr = "import QtQuick 2.0\n" - + importSelf + - "Colorize {" - "width: 50; height: 50\n" - "source: ShaderEffectSource {sourceItem: Rectangle {width: 100; height: 100}}" - "}"; - QQmlComponent component(&engine); - component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QVERIFY2(component.status() != QQmlComponent::Error, qPrintable(componentErrors(&component))); - QTRY_COMPARE(component.status(), QQmlComponent::Ready); - QScopedPointer<QObject> obj(component.create()); - QVERIFY(!obj.isNull()); - - // Default values - QCOMPARE(obj->property("hue").type(), QVariant::Double); - QCOMPARE(obj->property("hue").toDouble(), 0.0); - QCOMPARE(obj->property("saturation").type(), QVariant::Double); - QCOMPARE(obj->property("saturation").toDouble(), 1.0); - QCOMPARE(obj->property("lightness").type(), QVariant::Double); - QCOMPARE(obj->property("lightness").toDouble(), 0.0); - QCOMPARE(obj->property("source").toInt(), 0); - QCOMPARE(obj->property("cached").toBool(), false); -} - -void tst_qtgraphicaleffects::fastBlur() -{ - // Creation - QString componentStr = "import QtQuick 2.0\n" - + importSelf + - "FastBlur {" - "width: 50; height: 50\n" - "source: ShaderEffectSource {sourceItem: Rectangle {width: 100; height: 100}}" - "}"; - QQmlComponent component(&engine); - component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QVERIFY2(component.status() != QQmlComponent::Error, qPrintable(componentErrors(&component))); - QTRY_COMPARE(component.status(), QQmlComponent::Ready); - QScopedPointer<QObject> obj(component.create()); - QVERIFY(!obj.isNull()); - - // Default values - QCOMPARE(obj->property("radius").type(), QVariant::Double); - QCOMPARE(obj->property("radius").toDouble(), 0.0); - QCOMPARE(obj->property("transparentBorder").toBool(), false); - QCOMPARE(obj->property("source").toInt(), 0); - QCOMPARE(obj->property("cached").toBool(), false); -} - -void tst_qtgraphicaleffects::desaturate() -{ - // Creation - QString componentStr = "import QtQuick 2.0\n" - + importSelf + - "Desaturate {" - "width: 50; height: 50\n" - "source: ShaderEffectSource {sourceItem: Rectangle {width: 100; height: 100}}" - "}"; - QQmlComponent component(&engine); - component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QVERIFY2(component.status() != QQmlComponent::Error, qPrintable(componentErrors(&component))); - QTRY_COMPARE(component.status(), QQmlComponent::Ready); - QScopedPointer<QObject> obj(component.create()); - QVERIFY(!obj.isNull()); - - // Default values - QCOMPARE(obj->property("desaturation").type(), QVariant::Double); - QCOMPARE(obj->property("desaturation").toDouble(), 0.0); - QCOMPARE(obj->property("source").toInt(), 0); - QCOMPARE(obj->property("cached").toBool(), false); -} - -void tst_qtgraphicaleffects::hueSaturation() -{ - // Creation - QString componentStr = "import QtQuick 2.0\n" - + importSelf + - "HueSaturation {" - "width: 50; height: 50\n" - "source: ShaderEffectSource {sourceItem: Rectangle {width: 100; height: 100}}" - "}"; - QQmlComponent component(&engine); - component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QVERIFY2(component.status() != QQmlComponent::Error, qPrintable(componentErrors(&component))); - QTRY_COMPARE(component.status(), QQmlComponent::Ready); - QScopedPointer<QObject> obj(component.create()); - QVERIFY(!obj.isNull()); - - // Default values - QCOMPARE(obj->property("hue").type(), QVariant::Double); - QCOMPARE(obj->property("hue").toDouble(), 0.0); - QCOMPARE(obj->property("saturation").type(), QVariant::Double); - QCOMPARE(obj->property("saturation").toDouble(), 0.0); - QCOMPARE(obj->property("lightness").type(), QVariant::Double); - QCOMPARE(obj->property("lightness").toDouble(), 0.0); - QCOMPARE(obj->property("source").toInt(), 0); - QCOMPARE(obj->property("cached").toBool(), false); -} - -void tst_qtgraphicaleffects::opacityMask() -{ - // Creation - QString componentStr = "import QtQuick 2.0\n" - + importSelf + - "OpacityMask {" - "width: 50; height: 50\n" - "source: ShaderEffectSource {sourceItem: Rectangle {width: 100; height: 100}}" - "maskSource: ShaderEffectSource {sourceItem: Rectangle {width: 100; height: 100}}" - "}"; - QQmlComponent component(&engine); - component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QVERIFY2(component.status() != QQmlComponent::Error, qPrintable(componentErrors(&component))); - QTRY_COMPARE(component.status(), QQmlComponent::Ready); - QScopedPointer<QObject> obj(component.create()); - QVERIFY(!obj.isNull()); - - // Default values - QCOMPARE(obj->property("source").toInt(), 0); - QCOMPARE(obj->property("maskSource").toInt(), 0); - QCOMPARE(obj->property("cached").toBool(), false); -} - -void tst_qtgraphicaleffects::radialGradient() -{ - // Creation - QString componentStr = "import QtQuick 2.0\n" - + importSelf + - "RadialGradient {" - "width: 50; height: 50\n" - "}"; - QQmlComponent component(&engine); - component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QVERIFY2(component.status() != QQmlComponent::Error, qPrintable(componentErrors(&component))); - QTRY_COMPARE(component.status(), QQmlComponent::Ready); - QScopedPointer<QObject> obj(component.create()); - QVERIFY(!obj.isNull()); - - // Default values - QCOMPARE(obj->property("gradient").toInt(), 0); - QCOMPARE(obj->property("horizontalOffset").type(), QVariant::Double); - QCOMPARE(obj->property("horizontalOffset").toDouble(), 0.0); - QCOMPARE(obj->property("verticalOffset").type(), QVariant::Double); - QCOMPARE(obj->property("verticalOffset").toDouble(), 0.0); - QCOMPARE(obj->property("horizontalRadius").type(), QVariant::Double); - QCOMPARE(obj->property("horizontalRadius").toDouble(), 50.0); - QCOMPARE(obj->property("verticalRadius").type(), QVariant::Double); - QCOMPARE(obj->property("verticalRadius").toDouble(), 50.0); - QCOMPARE(obj->property("source").toInt(), 0); - QCOMPARE(obj->property("angle").type(), QVariant::Double); - QCOMPARE(obj->property("angle").toDouble(), 0.0); - QCOMPARE(obj->property("cached").toBool(), false); -} - -void tst_qtgraphicaleffects::linearGradient() -{ - // Creation - QString componentStr = "import QtQuick 2.0\n" - + importSelf + - "LinearGradient {" - "width: 50; height: 50\n" - "}"; - QQmlComponent component(&engine); - component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QVERIFY2(component.status() != QQmlComponent::Error, qPrintable(componentErrors(&component))); - QTRY_COMPARE(component.status(), QQmlComponent::Ready); - QScopedPointer<QObject> obj(component.create()); - QVERIFY(!obj.isNull()); - - // Default values - QCOMPARE(obj->property("gradient").toInt(), 0); - QCOMPARE(obj->property("start").toPointF(), QPointF(0.0, 0.0)); - QCOMPARE(obj->property("end").toPointF(), QPointF(0.0, 50.0)); - QCOMPARE(obj->property("source").toInt(), 0); - QCOMPARE(obj->property("cached").toBool(), false); -} - -void tst_qtgraphicaleffects::rectangularGlow() -{ - // Creation - QString componentStr = "import QtQuick 2.0\n" - + importSelf + - "RectangularGlow {" - "width: 50; height: 50\n" - "}"; - QQmlComponent component(&engine); - component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QVERIFY2(component.status() != QQmlComponent::Error, qPrintable(componentErrors(&component))); - QTRY_COMPARE(component.status(), QQmlComponent::Ready); - QScopedPointer<QObject> obj(component.create()); - QVERIFY(!obj.isNull()); - - // Default values - QCOMPARE(obj->property("spread").type(), QVariant::Double); - QCOMPARE(obj->property("spread").toDouble(), 0.0); - QCOMPARE(obj->property("glowRadius").type(), QVariant::Double); - QCOMPARE(obj->property("glowRadius").toDouble(), 0.0); - QCOMPARE(obj->property("color").toString(), QString("#ffffff")); - QCOMPARE(obj->property("cornerRadius").type(), QVariant::Double); - QCOMPARE(obj->property("cornerRadius").toDouble(), 0.0); - QCOMPARE(obj->property("cached").toBool(), false); -} - -void tst_qtgraphicaleffects::conicalGradient() -{ - // Creation - QString componentStr = "import QtQuick 2.0\n" - + importSelf + - "ConicalGradient {" - "width: 50; height: 50\n" - "}"; - QQmlComponent component(&engine); - component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QVERIFY2(component.status() != QQmlComponent::Error, qPrintable(componentErrors(&component))); - QTRY_COMPARE(component.status(), QQmlComponent::Ready); - QScopedPointer<QObject> obj(component.create()); - QVERIFY(!obj.isNull()); - - // Default values - QCOMPARE(obj->property("angle").type(), QVariant::Double); - QCOMPARE(obj->property("angle").toDouble(), 0.0); - QCOMPARE(obj->property("gradient").toInt(), 0); - QCOMPARE(obj->property("horizontalOffset").type(), QVariant::Double); - QCOMPARE(obj->property("horizontalOffset").toDouble(), 0.0); - QCOMPARE(obj->property("horizontalOffset").type(), QVariant::Double); - QCOMPARE(obj->property("verticalOffset").toDouble(), 0.0); - QCOMPARE(obj->property("source").toInt(), 0); - QCOMPARE(obj->property("cached").toBool(), false); -} - -void tst_qtgraphicaleffects::colorOverlay() -{ - // Creation - QString componentStr = "import QtQuick 2.0\n" - + importSelf + - "ColorOverlay {" - "width: 50; height: 50\n" - "source: ShaderEffectSource {sourceItem: Rectangle {width: 100; height: 100}}" - "}"; - QQmlComponent component(&engine); - component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QVERIFY2(component.status() != QQmlComponent::Error, qPrintable(componentErrors(&component))); - QTRY_COMPARE(component.status(), QQmlComponent::Ready); - QScopedPointer<QObject> obj(component.create()); - QVERIFY(!obj.isNull()); - - // Default values - QCOMPARE(obj->property("cached").toBool(), false); - QCOMPARE(obj->property("color").toString(), QString("#00000000")); -} - -void tst_qtgraphicaleffects::dropShadow() -{ - // Creation - QString componentStr = "import QtQuick 2.0\n" - + importSelf + - "DropShadow {" - "source: ShaderEffectSource {sourceItem: Rectangle {width: 100; height: 100}}" - "width: 50; height: 50\n" - "}"; - QQmlComponent component(&engine); - component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QVERIFY2(component.status() != QQmlComponent::Error, qPrintable(componentErrors(&component))); - QTRY_COMPARE(component.status(), QQmlComponent::Ready); - QScopedPointer<QObject> obj(component.create()); - QVERIFY(!obj.isNull()); - - // Default values - QCOMPARE(obj->property("radius").type(), QVariant::Double); - QCOMPARE(obj->property("radius").toDouble(), 0.0); - QCOMPARE(obj->property("horizontalOffset").type(), QVariant::Double); - QCOMPARE(obj->property("horizontalOffset").toDouble(), 0.0); - QCOMPARE(obj->property("verticalOffset").type(), QVariant::Double); - QCOMPARE(obj->property("verticalOffset").toDouble(), 0.0); - QCOMPARE(obj->property("cached").toBool(), false); - QCOMPARE(obj->property("source").toInt(), 0); - QCOMPARE(obj->property("color").toString(), QString("#000000")); - QCOMPARE(obj->property("spread").type(), QVariant::Double); - QCOMPARE(obj->property("spread").toDouble(), 0.0); - QCOMPARE(obj->property("transparentBorder").toBool(), false); -} - -void tst_qtgraphicaleffects::gammaAdjust() -{ - // Creation - QString componentStr = "import QtQuick 2.0\n" - + importSelf + - "GammaAdjust {" - "source: ShaderEffectSource {sourceItem: Rectangle {width: 100; height: 100}}" - "width: 50; height: 50\n" - "}"; - QQmlComponent component(&engine); - component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QVERIFY2(component.status() != QQmlComponent::Error, qPrintable(componentErrors(&component))); - QTRY_COMPARE(component.status(), QQmlComponent::Ready); - QScopedPointer<QObject> obj(component.create()); - QVERIFY(!obj.isNull()); - - // Default values - QCOMPARE(obj->property("gamma").type(), QVariant::Double); - QCOMPARE(obj->property("gamma").toDouble(), 1.0); - QCOMPARE(obj->property("source").toInt(), 0); - QCOMPARE(obj->property("cached").toBool(), false); -} - -void tst_qtgraphicaleffects::thresholdMask() -{ - // Creation - QString componentStr = "import QtQuick 2.0\n" - + importSelf + - "ThresholdMask {" - "width: 50; height: 50\n" - "source: ShaderEffectSource {sourceItem: Rectangle {width: 100; height: 100}}" - "maskSource: ShaderEffectSource {sourceItem: Rectangle {width: 100; height: 100}}" - "}"; - QQmlComponent component(&engine); - component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QVERIFY2(component.status() != QQmlComponent::Error, qPrintable(componentErrors(&component))); - QTRY_COMPARE(component.status(), QQmlComponent::Ready); - QScopedPointer<QObject> obj(component.create()); - QVERIFY(!obj.isNull()); - - // Default values - QCOMPARE(obj->property("source").toInt(), 0); - QCOMPARE(obj->property("maskSource").toInt(), 0); - QCOMPARE(obj->property("cached").toBool(), false); - QCOMPARE(obj->property("threshold").type(), QVariant::Double); - QCOMPARE(obj->property("threshold").toDouble(), 0.0); - QCOMPARE(obj->property("spread").type(), QVariant::Double); - QCOMPARE(obj->property("spread").toDouble(), 0.0); -} - -void tst_qtgraphicaleffects::glow() -{ - // Creation - QString componentStr = "import QtQuick 2.0\n" - + importSelf + - "Glow {" - "source: ShaderEffectSource {sourceItem: Rectangle {width: 100; height: 100}}" - "width: 50; height: 50\n" - "}"; - QQmlComponent component(&engine); - component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QVERIFY2(component.status() != QQmlComponent::Error, qPrintable(componentErrors(&component))); - QTRY_COMPARE(component.status(), QQmlComponent::Ready); - QScopedPointer<QObject> obj(component.create()); - QVERIFY(!obj.isNull()); - - // Default values - QCOMPARE(obj->property("radius").type(), QVariant::Double); - QCOMPARE(obj->property("radius").toDouble(), 0); - QCOMPARE(obj->property("cached").toBool(), false); - QCOMPARE(obj->property("spread").type(), QVariant::Double); - QCOMPARE(obj->property("spread").toDouble(), 0); - QCOMPARE(obj->property("color").toString(), QString("#ffffff")); - QCOMPARE(obj->property("transparentBorder").toBool(), false); -} - -void tst_qtgraphicaleffects::displace() -{ - // Creation - QString componentStr = "import QtQuick 2.0\n" - + importSelf + - "Displace {" - "source: ShaderEffectSource {sourceItem: Rectangle {width: 100; height: 100}}" - "displacementSource: ShaderEffectSource {sourceItem: Rectangle {width: 100; height: 100}}" - "width: 50; height: 50\n" - "}"; - QQmlComponent component(&engine); - component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QVERIFY2(component.status() != QQmlComponent::Error, qPrintable(componentErrors(&component))); - QTRY_COMPARE(component.status(), QQmlComponent::Ready); - QScopedPointer<QObject> obj(component.create()); - QVERIFY(!obj.isNull()); - - // Default values - QCOMPARE(obj->property("source").toInt(), 0); - QCOMPARE(obj->property("displacementSource").toInt(), 0); - QCOMPARE(obj->property("cached").toBool(), false); - QCOMPARE(obj->property("displacement").type(), QVariant::Double); - QCOMPARE(obj->property("displacement").toDouble(), 0.0); -} - -void tst_qtgraphicaleffects::levelAdjust() -{ - // Creation - QString componentStr = "import QtQuick 2.0\n" - + importSelf + - "LevelAdjust {" - "width: 50; height: 50\n" - "}"; - QQmlComponent component(&engine); - component.setData(componentStr.toLatin1(), QUrl::fromLocalFile("")); - QVERIFY2(component.status() != QQmlComponent::Error, qPrintable(componentErrors(&component))); - QTRY_COMPARE(component.status(), QQmlComponent::Ready); - QScopedPointer<QObject> obj(component.create()); - QVERIFY(!obj.isNull()); - - // Default values - QCOMPARE(obj->property("source").toInt(), 0); - QCOMPARE(obj->property("minimumInput").toString(), QString("#00000000")); - QCOMPARE(obj->property("maximumInput").toString(), QString("#ffffff")); - QCOMPARE(obj->property("minimumOutput").toString(), QString("#00000000")); - QCOMPARE(obj->property("maximumOutput").toString(), QString("#ffffff")); - QCOMPARE(obj->property("cached").toBool(), false); -} - -QTEST_MAIN(tst_qtgraphicaleffects) - -#include "tst_qtgraphicaleffects.moc" |