mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-04-30 18:09:59 +02:00
Fix deprecated QRegExp
Use QRegularExpression instead. https://doc.qt.io/qt-5/qregularexpression.html#notes-for-qregexp-users This function was introduced in Qt 5
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
#include "elementscene.h"
|
||||
#include "QPropertyUndoCommand/qpropertyundocommand.h"
|
||||
|
||||
#include <QRegularExpression>
|
||||
|
||||
/**
|
||||
@brief CustomElementGraphicPart::CustomElementGraphicPart
|
||||
Default constructor.
|
||||
@@ -518,12 +520,12 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde)
|
||||
#endif
|
||||
|
||||
//Check each pair of style
|
||||
QRegExp rx("^\\s*([a-z-]+)\\s*:\\s*([a-zA-Z-]+)\\s*$");
|
||||
QRegularExpression rx("^\\s*([a-z-]+)\\s*:\\s*([a-zA-Z-]+)\\s*$");
|
||||
foreach (QString style, styles)
|
||||
{
|
||||
if (!rx.exactMatch(style)) continue;
|
||||
QString style_name = rx.cap(1);
|
||||
QString style_value = rx.cap(2);
|
||||
if (rx!=QRegularExpression(style)) continue;
|
||||
QString style_name = rx.namedCaptureGroups().at(1);
|
||||
QString style_value = rx.namedCaptureGroups().at(2);
|
||||
if (style_name == "line-style")
|
||||
{
|
||||
if (style_value == "dashed") _linestyle = DashedStyle;
|
||||
|
||||
Reference in New Issue
Block a user