VectorImage: Allow fewer types to be children of shapes

We allowed certain node types to be allowed as children underneath
a Shape item. There is no clear reasoning for why these nodes were
selected.

An issue with making items children of what is actually a sibling
is that the z order will no longer be automatically handled, as
the shape will be drawn underneath its children. There is no way
to merge two shapes into one and ensure that an item wedged
between them is placed at the correct z level relative to both.

One case which would work is for text when it is drawn using
paths, so this is a potential optimization. However, it would
require factoring out the logic which detects whether this is
needed. Text may not be a common enough use case for this to
be worth it.

Pick-to: 6.8
Fixes: QTBUG-127656
Change-Id: I7c73535f9298897e1f9e2e4a80814df966f5a501
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2024-08-06 08:16:49 +02:00
parent 862d229666
commit 9038c6f577
1 changed files with 4 additions and 4 deletions

View File

@ -159,15 +159,15 @@ inline bool isPathContainer(const QSvgStructureNode *node)
case QSvgNode::Animation:
case QSvgNode::Use:
case QSvgNode::Video:
case QSvgNode::Image:
case QSvgNode::Textarea:
case QSvgNode::Text:
case QSvgNode::Tspan:
//qCDebug(lcQuickVectorGraphics) << "NOT path container because" << node->typeName() ;
return false;
// nodes that could go inside Shape{}
case QSvgNode::Defs:
case QSvgNode::Image:
case QSvgNode::Textarea:
case QSvgNode::Text:
case QSvgNode::Tspan:
break;
// nodes that are done as pure ShapePath{}