aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickitem.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/items/qquickitem.cpp')
-rw-r--r--src/quick/items/qquickitem.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp
index 7b031f3b5b..b6939ddaba 100644
--- a/src/quick/items/qquickitem.cpp
+++ b/src/quick/items/qquickitem.cpp
@@ -2161,6 +2161,17 @@ QQuickItem::~QQuickItem()
d->changeListeners.clear();
+ /*
+ Remove any references our transforms have to us, in case they try to
+ remove themselves from our list of transforms when that list has already
+ been destroyed after ~QQuickItem() has run.
+ */
+ for (int ii = 0; ii < d->transforms.count(); ++ii) {
+ QQuickTransform *t = d->transforms.at(ii);
+ QQuickTransformPrivate *tp = QQuickTransformPrivate::get(t);
+ tp->items.removeOne(this);
+ }
+
if (d->extra.isAllocated()) {
delete d->extra->contents; d->extra->contents = 0;
delete d->extra->layer; d->extra->layer = 0;
@@ -5166,6 +5177,8 @@ void QQuickItem::setScale(qreal s)
rectangle has specified an opacity of 0.5, which affects the opacity of
its blue child rectangle even though the child has not specified an opacity.
+ Values outside the range of 0 to 1 will be clamped.
+
\table
\row
\li \image declarative-item_opacity1.png
@@ -5213,9 +5226,10 @@ qreal QQuickItem::opacity() const
return d->opacity();
}
-void QQuickItem::setOpacity(qreal o)
+void QQuickItem::setOpacity(qreal newOpacity)
{
Q_D(QQuickItem);
+ qreal o = qBound<qreal>(0, newOpacity, 1);
if (d->opacity() == o)
return;