diff options
author | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2018-07-02 10:16:54 +0200 |
---|---|---|
committer | Eirik Aavitsland <eirik.aavitsland@qt.io> | 2018-07-24 16:45:53 +0000 |
commit | 1ed0b2170de0ad6f3c40a6105d05e87e3c26ad35 (patch) | |
tree | d91054263270f108aa2e12e5c86657cfc42f84f2 | |
parent | bafa5a14dde4415b13de3f3d44af6333538deff5 (diff) |
Give the QGradient presets ObjectMode coordinate mode by default
ObjectBoundingMode has inconsistent behavior and is deprecated in
favor of ObjectMode.
Change-Id: I748f6283f3db5869bb9a67c08bf5f16abc6f95b0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r-- | src/gui/painting/qbrush.cpp | 4 | ||||
-rw-r--r-- | tests/auto/gui/painting/qbrush/tst_qbrush.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp index 9a4e89a6cf..860653cc4c 100644 --- a/src/gui/painting/qbrush.cpp +++ b/src/gui/painting/qbrush.cpp @@ -1352,7 +1352,7 @@ QGradient::QGradient() Constructs a gradient based on a predefined \a preset. The coordinate mode of the resulting gradient is - QGradient::ObjectBoundingMode, allowing the preset + QGradient::ObjectMode, allowing the preset to be applied to arbitrary object sizes. */ QGradient::QGradient(Preset preset) @@ -1380,7 +1380,7 @@ QGradient::QGradient(Preset preset) return; m_type = LinearGradient; - setCoordinateMode(ObjectBoundingMode); + setCoordinateMode(ObjectMode); setSpread(PadSpread); const QJsonValue start = presetData[QLatin1Literal("start")]; diff --git a/tests/auto/gui/painting/qbrush/tst_qbrush.cpp b/tests/auto/gui/painting/qbrush/tst_qbrush.cpp index e4b43f2912..cd3eaa1478 100644 --- a/tests/auto/gui/painting/qbrush/tst_qbrush.cpp +++ b/tests/auto/gui/painting/qbrush/tst_qbrush.cpp @@ -331,7 +331,7 @@ void tst_QBrush::gradientPresets() { QGradient gradient(QGradient::WarmFlame); QCOMPARE(gradient.type(), QGradient::LinearGradient); - QCOMPARE(gradient.coordinateMode(), QGradient::ObjectBoundingMode); + QCOMPARE(gradient.coordinateMode(), QGradient::ObjectMode); QLinearGradient *lg = static_cast<QLinearGradient *>(&gradient); QCOMPARE(lg->start(), QPointF(0, 1)); |