diff options
author | Mitch Curtis <mitch.curtis@digia.com> | 2014-02-07 12:45:15 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-12 10:34:50 +0100 |
commit | 8730085fe4ce124cefaa563b42f433cbd31a3860 (patch) | |
tree | e4b12dfc4da0bef1d68c278080b0d84bfdb3a1d7 /tests/auto/quick/qquickrectangle | |
parent | 6c840c70d61c3ae277b60a024a086215c743e5b3 (diff) |
Expose Qt Quick gradient conversion code privately.
Rectangle is currently the only item that supports gradients, but other
items have been introduced (within Qt Quick Enterprise Controls) which
need QQuickGradient => QLinearGradient conversion, and it doesn't make
sense to duplicate the gradient stop conversion code.
The QQuickGradient and QQuickGradientStop classes need to be privately
exported so that modules that use private Qt API can use the classes
with quick-private.
Change-Id: I8b130ff5384d9481d3f29510b3de61f7d8f775e2
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
Diffstat (limited to 'tests/auto/quick/qquickrectangle')
-rw-r--r-- | tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp b/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp index 204a3ff019..5657ec44a8 100644 --- a/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp +++ b/tests/auto/quick/qquickrectangle/tst_qquickrectangle.cpp @@ -79,6 +79,13 @@ void tst_qquickrectangle::gradient() QCOMPARE(stops.at(&stops, 1)->position(), 1.0); QCOMPARE(stops.at(&stops, 1)->color(), QColor("white")); + QGradientStops gradientStops = grad->gradientStops(); + QCOMPARE(gradientStops.count(), 2); + QCOMPARE(gradientStops.at(0).first, 0.0); + QCOMPARE(gradientStops.at(0).second, QColor("gray")); + QCOMPARE(gradientStops.at(1).first, 1.0); + QCOMPARE(gradientStops.at(1).second, QColor("white")); + QMetaObject::invokeMethod(rect, "resetGradient"); grad = rect->gradient(); |