diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-06-06 14:54:37 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-06-08 10:32:18 +0000 |
commit | f4f89858cffa1107af5139dfb1e1d7b16ca3a1a0 (patch) | |
tree | 848471b6d85eebfea8915f1da89b26286f0dbbc7 /tests/auto/quick/qquickshape/tst_qquickshape.cpp | |
parent | 8a5837467d153c50c869625390a584b0335b77b7 (diff) |
Use GradientStop and rename ShapeLinearGradient to LinearGradient
Thus application code becomes:
ShapePath {
...
fillGradient: LinearGradient {
...
GradientStop { ... }
}
}
which is even more clean and readable. The duplication for stops is
now avoided.
Change-Id: I50ae2f388e21683a37dc4787763dc71e16eef4f5
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/auto/quick/qquickshape/tst_qquickshape.cpp')
-rw-r--r-- | tests/auto/quick/qquickshape/tst_qquickshape.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/auto/quick/qquickshape/tst_qquickshape.cpp b/tests/auto/quick/qquickshape/tst_qquickshape.cpp index fecac573b7..a984c28732 100644 --- a/tests/auto/quick/qquickshape/tst_qquickshape.cpp +++ b/tests/auto/quick/qquickshape/tst_qquickshape.cpp @@ -65,9 +65,8 @@ tst_QQuickShape::tst_QQuickShape() const char *uri = "tst_qquickpathitem"; qmlRegisterType<QQuickShape>(uri, 1, 0, "Shape"); qmlRegisterType<QQuickShapePath>(uri, 1, 0, "ShapePath"); - qmlRegisterType<QQuickShapeGradientStop>(uri, 1, 0, "ShapeGradientStop"); qmlRegisterUncreatableType<QQuickShapeGradient>(uri, 1, 0, "ShapeGradient", QQuickShapeGradient::tr("ShapeGradient is an abstract base class")); - qmlRegisterType<QQuickShapeLinearGradient>(uri, 1, 0, "ShapeLinearGradient"); + qmlRegisterType<QQuickShapeLinearGradient>(uri, 1, 0, "LinearGradient"); } void tst_QQuickShape::initValues() @@ -206,9 +205,9 @@ void tst_QQuickShape::changeSignals() QCOMPARE(vpChangeSpy.count(), 14); QQmlListReference stopList(lgrad, "stops"); QCOMPARE(stopList.count(), 5); - qobject_cast<QQuickShapeGradientStop *>(stopList.at(1))->setPosition(0.3); + qobject_cast<QQuickGradientStop *>(stopList.at(1))->setPosition(0.3); QCOMPARE(vpChangeSpy.count(), 15); - qobject_cast<QQuickShapeGradientStop *>(stopList.at(1))->setColor(Qt::black); + qobject_cast<QQuickGradientStop *>(stopList.at(1))->setColor(Qt::black); QCOMPARE(vpChangeSpy.count(), 16); } |