aboutsummaryrefslogtreecommitdiffstats
path: root/src/declarative/items/qsgpainteditem.cpp
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@nokia.com>2011-05-03 14:41:52 +0200
committerYoann Lopes <yoann.lopes@nokia.com>2011-05-03 14:41:52 +0200
commit9267a7bce715924a96c8636a3110d90879e5927c (patch)
tree8b52a8feb99f3eaaef12ba45aaefa68830ee6549 /src/declarative/items/qsgpainteditem.cpp
parentd3be822c1bc167878ae75943c39dfb3f40bb3800 (diff)
Added antialiasing property to QSGPaintedItem.
Diffstat (limited to 'src/declarative/items/qsgpainteditem.cpp')
-rw-r--r--src/declarative/items/qsgpainteditem.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/declarative/items/qsgpainteditem.cpp b/src/declarative/items/qsgpainteditem.cpp
index 8eb8afe8be..e0d63fa436 100644
--- a/src/declarative/items/qsgpainteditem.cpp
+++ b/src/declarative/items/qsgpainteditem.cpp
@@ -186,6 +186,37 @@ void QSGPaintedItem::setOpaquePainting(bool opaque)
QSGItem::update();
}
+/*!
+ Returns true if antialiased painting is enabled; otherwise, false is returned.
+
+ By default, antialiasing is not enabled.
+
+ \sa setAntialiasing()
+*/
+bool QSGPaintedItem::antialiasing() const
+{
+ Q_D(const QSGPaintedItem);
+ return d->antialiasing;
+}
+
+/*!
+ If \a enable is true, antialiased painting is enabled.
+
+ By default, antialiasing is not enabled.
+
+ \sa antialiasing()
+*/
+void QSGPaintedItem::setAntialiasing(bool enable)
+{
+ Q_D(QSGPaintedItem);
+
+ if (d->antialiasing == enable)
+ return;
+
+ d->antialiasing = enable;
+ update();
+}
+
QSize QSGPaintedItem::contentsSize() const
{
// XXX todo
@@ -337,7 +368,7 @@ QSGNode *QSGPaintedItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
node->setPreferredRenderTarget(d->renderTarget);
node->setSize(QSize(d->width, d->height));
- node->setSmoothPainting(d->smooth);
+ node->setSmoothPainting(d->antialiasing);
node->setLinearFiltering(d->smooth);
node->setOpaquePainting(d->opaquePainting);
node->setFillColor(d->fillColor);