From 64e07c405aaaad2305e1f4375bc77046688b9e51 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 8 Oct 2015 20:45:26 +0300 Subject: [PATCH] Fix for build on drone.io. --HG-- branch : develop --- src/app/tape/tmainwindow.cpp | 6 +++++- src/app/valentina/dialogs/dialogincrements.cpp | 6 +++++- src/app/valentina/dialogs/dialogsavelayout.cpp | 9 ++++++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/app/tape/tmainwindow.cpp b/src/app/tape/tmainwindow.cpp index bc6162553..8a5570d60 100644 --- a/src/app/tape/tmainwindow.cpp +++ b/src/app/tape/tmainwindow.cpp @@ -1722,7 +1722,11 @@ void TMainWindow::InitWindow() ui->actionReadOnly->setEnabled(true); ui->actionSaveAs->setEnabled(true); - ui->lineEditName->setValidator( new QRegularExpressionValidator(QRegularExpression(NameRegExp())) ); +#if QT_VERSION > QT_VERSION_CHECK(5, 1, 0) + ui->lineEditName->setValidator( new QRegularExpressionValidator(QRegularExpression(NameRegExp()), this)); +#else + ui->lineEditName->setValidator( new QRegExpValidator(QRegExp(NameRegExp()), this)); +#endif connect(ui->toolButtonRemove, &QToolButton::clicked, this, &TMainWindow::Remove); connect(ui->toolButtonUp, &QToolButton::clicked, this, &TMainWindow::MoveUp); diff --git a/src/app/valentina/dialogs/dialogincrements.cpp b/src/app/valentina/dialogs/dialogincrements.cpp index 3d0a98a5a..62f7cfda4 100644 --- a/src/app/valentina/dialogs/dialogincrements.cpp +++ b/src/app/valentina/dialogs/dialogincrements.cpp @@ -80,7 +80,11 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par connect(this->doc, &VPattern::FullUpdateFromFile, this, &DialogIncrements::FullUpdateFromFile); ui->tabWidget->setCurrentIndex(0); - ui->lineEditName->setValidator( new QRegularExpressionValidator(QRegularExpression(NameRegExp()))); +#if QT_VERSION > QT_VERSION_CHECK(5, 1, 0) + ui->lineEditName->setValidator( new QRegularExpressionValidator(QRegularExpression(NameRegExp()), this)); +#else + ui->lineEditName->setValidator( new QRegExpValidator(QRegExp(NameRegExp()), this)); +#endif connect(ui->tableWidgetIncrement, &QTableWidget::itemSelectionChanged, this, &DialogIncrements::ShowIncrementDetails); diff --git a/src/app/valentina/dialogs/dialogsavelayout.cpp b/src/app/valentina/dialogs/dialogsavelayout.cpp index f3859f392..2261082e8 100644 --- a/src/app/valentina/dialogs/dialogsavelayout.cpp +++ b/src/app/valentina/dialogs/dialogsavelayout.cpp @@ -69,9 +69,12 @@ DialogSaveLayout::DialogSaveLayout(int count, const QString &fileName, QWidget * SCASSERT(bOk != nullptr); bOk->setEnabled(false); - QRegularExpressionValidator *validator = new QRegularExpressionValidator(QRegularExpression(baseFilenameRegExp), - this); - ui->lineEditFileName->setValidator(validator); +#if QT_VERSION > QT_VERSION_CHECK(5, 1, 0) + ui->lineEditFileName->setValidator( new QRegularExpressionValidator(QRegularExpression(baseFilenameRegExp), this)); +#else + ui->lineEditFileName->setValidator( new QRegExpValidator(QRegExp(baseFilenameRegExp), this)); +#endif + const QString mask = fileName+QLatin1Literal("_"); if (VApplication::CheckGUI()) {