VectorImage: Implement support for switch control

There is some support for SVG's switch in Qt Svg, so we support
the same in VectorImage and svgtoqml.

Pick-to: 6.8
Fixes: QTBUG-121645
Change-Id: Ifb90fad3f16337b2a71b48d796dfb0fad82b39b4
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2024-08-07 08:37:16 +02:00
parent f83669821b
commit d37878dedb
2 changed files with 19 additions and 0 deletions

View File

@ -947,6 +947,22 @@ void QSvgVisitorImpl::visitUseNode(const QSvgUse *node)
handleBaseNodeEnd(node);
}
bool QSvgVisitorImpl::visitSwitchNodeStart(const QSvgSwitch *node)
{
QSvgNode *link = node->childToRender();
if (!link)
return false;
QSvgVisitor::traverse(link);
return false;
}
void QSvgVisitorImpl::visitSwitchNodeEnd(const QSvgSwitch *node)
{
Q_UNUSED(node);
}
bool QSvgVisitorImpl::visitDefsNodeStart(const QSvgDefs *node)
{
Q_UNUSED(node)

View File

@ -49,6 +49,9 @@ protected:
bool visitDocumentNodeStart(const QSvgTinyDocument *node) override;
void visitDocumentNodeEnd(const QSvgTinyDocument *node) override;
bool visitSwitchNodeStart(const QSvgSwitch *node) override;
void visitSwitchNodeEnd(const QSvgSwitch *node) override;
private:
void fillCommonNodeInfo(const QSvgNode *node, NodeInfo &info);
void handleBaseNodeSetup(const QSvgNode *node);