mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-18 05:00:33 +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:
@@ -18,6 +18,8 @@
|
|||||||
#include "diagramcontextwidget.h"
|
#include "diagramcontextwidget.h"
|
||||||
#include "ui_diagramcontextwidget.h"
|
#include "ui_diagramcontextwidget.h"
|
||||||
|
|
||||||
|
#include <QRegularExpression>
|
||||||
|
|
||||||
DiagramContextWidget::DiagramContextWidget(QWidget *parent) :
|
DiagramContextWidget::DiagramContextWidget(QWidget *parent) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
ui(new Ui::DiagramContextWidget)
|
ui(new Ui::DiagramContextWidget)
|
||||||
@@ -118,7 +120,7 @@ void DiagramContextWidget::clear()
|
|||||||
*/
|
*/
|
||||||
int DiagramContextWidget::highlightNonAcceptableKeys()
|
int DiagramContextWidget::highlightNonAcceptableKeys()
|
||||||
{
|
{
|
||||||
static QRegExp re(DiagramContext::validKeyRegExp());
|
static QRegularExpression re(DiagramContext::validKeyRegExp());
|
||||||
|
|
||||||
QBrush fg_brush = ui->m_table->palette().brush(QPalette::WindowText);
|
QBrush fg_brush = ui->m_table->palette().brush(QPalette::WindowText);
|
||||||
|
|
||||||
@@ -133,7 +135,7 @@ int DiagramContextWidget::highlightNonAcceptableKeys()
|
|||||||
bool highlight = false;
|
bool highlight = false;
|
||||||
if (!qtwi_name -> text().isEmpty())
|
if (!qtwi_name -> text().isEmpty())
|
||||||
{
|
{
|
||||||
if (!re.exactMatch(qtwi_name -> text()))
|
if (re!=QRegularExpression(qtwi_name -> text()))
|
||||||
{
|
{
|
||||||
highlight = true;
|
highlight = true;
|
||||||
++ invalid_keys;
|
++ invalid_keys;
|
||||||
|
|||||||
Reference in New Issue
Block a user