mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-03-17 15:49:59 +01: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 "elementscene.h"
|
||||||
#include "QPropertyUndoCommand/qpropertyundocommand.h"
|
#include "QPropertyUndoCommand/qpropertyundocommand.h"
|
||||||
|
|
||||||
|
#include <QRegularExpression>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief CustomElementGraphicPart::CustomElementGraphicPart
|
@brief CustomElementGraphicPart::CustomElementGraphicPart
|
||||||
Default constructor.
|
Default constructor.
|
||||||
@@ -518,12 +520,12 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//Check each pair of style
|
//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)
|
foreach (QString style, styles)
|
||||||
{
|
{
|
||||||
if (!rx.exactMatch(style)) continue;
|
if (rx!=QRegularExpression(style)) continue;
|
||||||
QString style_name = rx.cap(1);
|
QString style_name = rx.namedCaptureGroups().at(1);
|
||||||
QString style_value = rx.cap(2);
|
QString style_value = rx.namedCaptureGroups().at(2);
|
||||||
if (style_name == "line-style")
|
if (style_name == "line-style")
|
||||||
{
|
{
|
||||||
if (style_value == "dashed") _linestyle = DashedStyle;
|
if (style_value == "dashed") _linestyle = DashedStyle;
|
||||||
|
|||||||
Reference in New Issue
Block a user