diff options
author | Eirik Aavitsland <[email protected]> | 2024-04-05 12:21:40 +0200 |
---|---|---|
committer | Eirik Aavitsland <[email protected]> | 2024-04-11 07:10:50 +0200 |
commit | 4b633eb984305cee8a2b550781cf0ad7a75c13f0 (patch) | |
tree | 7aba8948ac1c223402f57f893b7863568efc5175 /src/quick/items/qquickpainteditem.cpp | |
parent | ad9b9a60de363e902ed51b8d4c0f90f1d432d3d0 (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 <[email protected]>
Reviewed-by: Andy Nichols <[email protected]>
Diffstat (limited to 'src/quick/items/qquickpainteditem.cpp')
-rw-r--r-- | src/quick/items/qquickpainteditem.cpp | 15 |
1 files changed, 4 insertions, 11 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); |