mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 14:50:53 +01:00
Fixed deprecated regex exactMatch()
This commit is contained in:
@@ -805,15 +805,15 @@ bool ElementsLocation::setXml(const QDomDocument &xml_document) const
|
|||||||
qDebug() << "Help code for QT 6 or later";
|
qDebug() << "Help code for QT 6 or later";
|
||||||
|
|
||||||
QString path_ = collectionPath(false);
|
QString path_ = collectionPath(false);
|
||||||
QRegularExpression rx("^(.*)/(.*\\.elmt)$");
|
QRegularExpression rx(QRegularExpression::anchoredPattern("(.*)/(.*\\.elmt)"));
|
||||||
|
QRegularExpressionMatch match = rx.match(path_);
|
||||||
if (rx.exactMatch(path_))
|
if (match.hasMatch())
|
||||||
{
|
{
|
||||||
return project()
|
return project()
|
||||||
->embeddedElementCollection()
|
->embeddedElementCollection()
|
||||||
->addElementDefinition(
|
->addElementDefinition(
|
||||||
rx.cap(1),
|
match.captured(1),
|
||||||
rx.cap(2),
|
match.captured(2),
|
||||||
xml_document.documentElement());
|
xml_document.documentElement());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user