From a4872bf68614318567f9ba86400898c069d6fc91 Mon Sep 17 00:00:00 2001 From: Simon De Backer Date: Sun, 7 Mar 2021 20:21:39 +0100 Subject: [PATCH] [Qt6] mod QRegExp to QRegularExpression note ad Core5Compat to Cmake --- .../ElementsCollection/elementslocation.cpp | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/sources/ElementsCollection/elementslocation.cpp b/sources/ElementsCollection/elementslocation.cpp index c97a6bfb4..2d035b809 100644 --- a/sources/ElementsCollection/elementslocation.cpp +++ b/sources/ElementsCollection/elementslocation.cpp @@ -773,8 +773,27 @@ bool ElementsLocation::setXml(const QDomDocument &xml_document) const #else #if TODO_LIST #pragma message("@TODO remove code for QT 6 or later") +# pragma message("@TODO ad Core5Compat to Cmake") #endif - qDebug()<<"Help code for QT 6 or later"; + qDebug() << "Help code for QT 6 or later"; + + QString path_ = collectionPath(false); + QRegularExpression rx("^(.*)/(.*\\.elmt)$"); + + if (rx.exactMatch(path_)) + { + return project() + ->embeddedElementCollection() + ->addElementDefinition( + rx.cap(1), + rx.cap(2), + xml_document.documentElement()); + } + else + { + qDebug() << "ElementsLocation::setXml :" + " rx don't match"; + } #endif } }