Fixed deprecated regex exactMatch()

This commit is contained in:
Magnus Hellströmer
2024-09-08 21:10:13 +02:00
parent 0b307abf34
commit 0dc45f056e

View File

@@ -805,15 +805,15 @@ bool ElementsLocation::setXml(const QDomDocument &xml_document) const
qDebug() << "Help code for QT 6 or later";
QString path_ = collectionPath(false);
QRegularExpression rx("^(.*)/(.*\\.elmt)$");
if (rx.exactMatch(path_))
QRegularExpression rx(QRegularExpression::anchoredPattern("(.*)/(.*\\.elmt)"));
QRegularExpressionMatch match = rx.match(path_);
if (match.hasMatch())
{
return project()
->embeddedElementCollection()
->addElementDefinition(
rx.cap(1),
rx.cap(2),
match.captured(1),
match.captured(2),
xml_document.documentElement());
}
else