aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@qt.io>2024-04-05 12:21:40 +0200
committerEirik Aavitsland <eirik.aavitsland@qt.io>2024-04-11 07:10:50 +0200
commit4b633eb984305cee8a2b550781cf0ad7a75c13f0 (patch)
tree7aba8948ac1c223402f57f893b7863568efc5175 /src/quick
parentad9b9a60de363e902ed51b8d4c0f90f1d432d3d0 (diff)
QQuickPaintedItem: make the antialiasing property work
The QQuickPaintedItem class was implemented with its own antialiasing setting and [set]antialiasing() functions. Those were never reached from qml side however, since the the parent class, QQuickItem, has an antialiasing property, with non-virtual accessor functions of the same names. The result was that the paint() function in QQuickPaintedItems would always be called with a QPainter without the Antialiasing render hint set. Fix by dropping the redundant local antialiasing setting in QQuickPaintedItem. Its accessor functions can presumably not be removed yet because of bic, but their implementation is changed to just call the corresponding accessor in QQuickitem. Fixes: QTBUG-124170 Change-Id: I004fc59a754e30abe4390ffc8aa1015dcf493c36 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquickpainteditem.cpp15
-rw-r--r--src/quick/items/qquickpainteditem_p.h1
2 files changed, 4 insertions, 12 deletions
diff --git a/src/quick/items/qquickpainteditem.cpp b/src/quick/items/qquickpainteditem.cpp
index c0b591b2bb..df4ee6014d 100644
--- a/src/quick/items/qquickpainteditem.cpp
+++ b/src/quick/items/qquickpainteditem.cpp
@@ -87,7 +87,6 @@ QQuickPaintedItemPrivate::QQuickPaintedItemPrivate()
, fillColor(Qt::transparent)
, renderTarget(QQuickPaintedItem::Image)
, opaquePainting(false)
- , antialiasing(false)
, mipmap(false)
, textureProvider(nullptr)
, node(nullptr)
@@ -177,6 +176,7 @@ void QQuickPaintedItem::setOpaquePainting(bool opaque)
QQuickItem::update();
}
+//### Qt7: remove the aa functions; they shadow the QQuickItem property
/*!
Returns true if antialiased painting is enabled; otherwise, false is returned.
@@ -186,8 +186,7 @@ void QQuickPaintedItem::setOpaquePainting(bool opaque)
*/
bool QQuickPaintedItem::antialiasing() const
{
- Q_D(const QQuickPaintedItem);
- return d->antialiasing;
+ return QQuickItem::antialiasing();
}
/*!
@@ -199,13 +198,7 @@ bool QQuickPaintedItem::antialiasing() const
*/
void QQuickPaintedItem::setAntialiasing(bool enable)
{
- Q_D(QQuickPaintedItem);
-
- if (d->antialiasing == enable)
- return;
-
- d->antialiasing = enable;
- update();
+ QQuickItem::setAntialiasing(enable);
}
/*!
@@ -550,7 +543,7 @@ QSGNode *QQuickPaintedItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeDat
node->setPreferredRenderTarget(d->renderTarget);
node->setFastFBOResizing(d->performanceHints & FastFBOResizing);
- node->setSmoothPainting(d->antialiasing);
+ node->setSmoothPainting(antialiasing());
node->setLinearFiltering(d->smooth);
node->setMipmapping(d->mipmap);
node->setOpaquePainting(d->opaquePainting);
diff --git a/src/quick/items/qquickpainteditem_p.h b/src/quick/items/qquickpainteditem_p.h
index b6930b4b5f..2695d13da4 100644
--- a/src/quick/items/qquickpainteditem_p.h
+++ b/src/quick/items/qquickpainteditem_p.h
@@ -40,7 +40,6 @@ public:
QRect dirtyRect;
bool opaquePainting: 1;
- bool antialiasing: 1;
bool mipmap: 1;
mutable QQuickPaintedItemTextureProvider *textureProvider;