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
432e80cecb
commit
859f6dd06d
@ -16,9 +16,10 @@
|
||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
#include "diagramcontext.h"
|
||||
#include <QRegExp>
|
||||
#include "qet.h"
|
||||
#include <QDebug>
|
||||
#include <QRegularExpression>
|
||||
#include <QRegularExpressionMatch>
|
||||
|
||||
/**
|
||||
@brief DiagramContext::add
|
||||
@ -241,8 +242,9 @@ bool DiagramContext::stringLongerThan(const QString &a, const QString &b) {
|
||||
*/
|
||||
bool DiagramContext::keyIsAcceptable(const QString &key) const
|
||||
{
|
||||
QRegExp re(DiagramContext::validKeyRegExp());
|
||||
return(re.exactMatch(key));
|
||||
QRegularExpression re(DiagramContext::validKeyRegExp());
|
||||
QRegularExpressionMatch match =re.match(key);
|
||||
return match.hasMatch();
|
||||
}
|
||||
|
||||
QDebug operator <<(QDebug debug, const DiagramContext &context)
|
||||
|
Loading…
x
Reference in New Issue
Block a user