mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-04-30 01:39: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:
@@ -20,6 +20,8 @@
|
||||
#include "qetapp.h"
|
||||
#include "qetproject.h"
|
||||
|
||||
#include <QRegularExpression>
|
||||
|
||||
/**
|
||||
Constructor
|
||||
@param parent Parent QObject
|
||||
@@ -408,7 +410,7 @@ QString TitleBlockTemplatesFilesCollection::path(const QString &template_name) c
|
||||
QStringList TitleBlockTemplatesFilesCollection::templates()
|
||||
{
|
||||
QStringList templates_names;
|
||||
QRegExp replace_regexp(QString("%1$").arg(TITLEBLOCKS_FILE_EXTENSION));
|
||||
QRegularExpression replace_regexp(QString("%1$").arg(TITLEBLOCKS_FILE_EXTENSION));
|
||||
foreach(QString name, dir_.entryList()) {
|
||||
templates_names << name.replace(replace_regexp, "");
|
||||
}
|
||||
@@ -544,7 +546,7 @@ bool TitleBlockTemplatesFilesCollection::isReadOnly(const QString &template_name
|
||||
@return the template name for \a file_name
|
||||
*/
|
||||
QString TitleBlockTemplatesFilesCollection::toTemplateName(const QString &file_name) {
|
||||
static QRegExp replace_regexp(QString("%1$").arg(TITLEBLOCKS_FILE_EXTENSION));
|
||||
static QRegularExpression replace_regexp(QString("%1$").arg(TITLEBLOCKS_FILE_EXTENSION));
|
||||
QString template_name(file_name);
|
||||
return(template_name.replace(replace_regexp, ""));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user