Fix z-value of QGraphicsItems being ignored during draw
In QGraphicsScene's function draw, don't copy the children into a
const copy (to prevent detaching in the loops), as they might get
sorted. Instead, use a const reference.
Amends e349f787d5
, which introduced
the bug by making a copy of the unsorted list.
Fixes: QTBUG-81316
Pick-to: 6.0 6.1
Change-Id: Iab9b87e75178a883806088a9db234c7a2aaa9301
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
cd13ec38a7
commit
269fdef53d
@ -4821,7 +4821,7 @@ void QGraphicsScenePrivate::draw(QGraphicsItem *item, QPainter *painter, const Q
|
||||
qreal opacity, const QTransform *effectTransform,
|
||||
bool wasDirtyParentSceneTransform, bool drawItem)
|
||||
{
|
||||
const auto children = item->d_ptr->children;
|
||||
const auto &children = item->d_ptr->children;
|
||||
|
||||
const bool itemIsFullyTransparent = QGraphicsItemPrivate::isOpacityNull(opacity);
|
||||
const bool itemClipsChildrenToShape = (item->d_ptr->flags & QGraphicsItem::ItemClipsChildrenToShape);
|
||||
|
Loading…
Reference in New Issue
Block a user