mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-09-13 20:23:04 +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:
parent
46e96f0a67
commit
432e80cecb
@ -18,7 +18,7 @@
|
||||
#include "conductorproperties.h"
|
||||
#include <QPainter>
|
||||
#include <QMetaEnum>
|
||||
|
||||
#include <QRegularExpression>
|
||||
/**
|
||||
Constructeur par defaut
|
||||
*/
|
||||
@ -789,11 +789,12 @@ void ConductorProperties::readStyle(const QString &style_string) {
|
||||
QStringList styles = style_string.split(";", Qt::SkipEmptyParts);
|
||||
#endif
|
||||
|
||||
QRegExp rx("^\\s*([a-z-]+)\\s*:\\s*([a-z-]+)\\s*$");
|
||||
QRegularExpression Rx("^\\s*([a-z-]+)\\s*:\\s*([a-z-]+)\\s*$");
|
||||
foreach (QString style_str, styles) {
|
||||
if (rx.exactMatch(style_str)) {
|
||||
QString style_name = rx.cap(1);
|
||||
QString style_value = rx.cap(2);
|
||||
if (Rx==QRegularExpression(style_str)) {
|
||||
|
||||
QString style_name = Rx.namedCaptureGroups().at(1);
|
||||
QString style_value = Rx.namedCaptureGroups().at(2);
|
||||
if (style_name == "line-style") {
|
||||
if (style_value == "dashed") style = Qt::DashLine;
|
||||
else if (style_value == "dashdotted") style = Qt::DashDotLine;
|
||||
|
Loading…
x
Reference in New Issue
Block a user