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:
Simon De Backer
2020-09-18 23:01:51 +02:00
parent 0a46b83dca
commit c5be1a98ba

View File

@@ -16,9 +16,10 @@
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>. along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "numerotationcontext.h" #include "numerotationcontext.h"
#include "qet.h"
#include <utility> #include <utility>
#include "qet.h" #include <QRegularExpression>
/** /**
Constructor Constructor
@@ -141,7 +142,7 @@ QString NumerotationContext::validRegExpNumber() const
*/ */
bool NumerotationContext::keyIsAcceptable(const QString &type) const bool NumerotationContext::keyIsAcceptable(const QString &type) const
{ {
return (type.contains(QRegExp(validRegExpNum()))); return (type.contains(QRegularExpression(validRegExpNum())));
} }
/** /**
@@ -150,7 +151,7 @@ bool NumerotationContext::keyIsAcceptable(const QString &type) const
*/ */
bool NumerotationContext::keyIsNumber(const QString &type) const bool NumerotationContext::keyIsNumber(const QString &type) const
{ {
return (type.contains(QRegExp(validRegExpNumber()))); return (type.contains(QRegularExpression(validRegExpNumber())));
} }
/** /**