aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickrectangle.cpp
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@live.com>2013-11-08 20:17:00 -0600
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-12-03 22:10:50 +0100
commit3a9b01127054901293b177e538eb8cfa3937e9fe (patch)
treec03b62b924591ad87598c4b755c93f432606a81d /src/quick/items/qquickrectangle.cpp
parent204500b6f5133a56d32799581543fbcdd4095545 (diff)
Support toggling antialiasing for Text and Rectangle.
Task-number: QTBUG-27968 Task-number: QTBUG-34366 Change-Id: Ic446ff4470abf21696e1764f902bd71e79762697 Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'src/quick/items/qquickrectangle.cpp')
-rw-r--r--src/quick/items/qquickrectangle.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/quick/items/qquickrectangle.cpp b/src/quick/items/qquickrectangle.cpp
index dd482eddb7..d6323026e7 100644
--- a/src/quick/items/qquickrectangle.cpp
+++ b/src/quick/items/qquickrectangle.cpp
@@ -321,6 +321,16 @@ void QQuickRectangle::doUpdate()
}
/*!
+ \qmlproperty bool QtQuick::Rectangle::antialiasing
+
+ Used to decide if the Rectangle should use antialiasing or not.
+ \l {Antialiasing} provides information on the performance implications
+ of this property.
+
+ The default is true for Rectangles with a radius, and false otherwise.
+*/
+
+/*!
\qmlproperty int QtQuick::Rectangle::border.width
\qmlproperty color QtQuick::Rectangle::border.color
@@ -408,6 +418,8 @@ void QQuickRectangle::setRadius(qreal radius)
return;
d->radius = radius;
+ d->setImplicitAntialiasing(radius != 0.0);
+
update();
emit radiusChanged();
}
@@ -475,7 +487,7 @@ QSGNode *QQuickRectangle::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData
}
rectangle->setRadius(d->radius);
- rectangle->setAntialiasing(d->antialiasing || d->radius > 0);
+ rectangle->setAntialiasing(antialiasing());
QGradientStops stops;
if (d->gradient) {