From ae546b701514652638ac487b48b7ae15b3e22c72 Mon Sep 17 00:00:00 2001 From: greg Date: Thu, 14 Nov 2019 01:05:06 -0800 Subject: [PATCH] Fix compiler warning pertaining to deprecated method MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously when compiling, the following deprecation warning would be encountered: ``` src/mainwindow.cpp:447:70: warning: ‘QList QObject::findChildren(const QRegExp&, Qt::FindChildOptions) const [with T = QLineEdit*; Qt::FindChildOptions = QFlags]’ is deprecated: Use findChildren(const QRegularExpression &, ...) instead. [-Wdeprecated-declarations] ``` This commit updates this line to the non-deprecated QT5 version of this method, which uses QRegularExpression rather than QRegExp, thus removing the warning. --- src/mainwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 6d40796..eafdbac 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -16,6 +16,7 @@ #include "connection.h" #include "requestdialog.h" #include "websockets.h" +#include using json = nlohmann::json; @@ -443,7 +444,7 @@ void MainWindow::setupSettingsModal() { void MainWindow::addressBook() { // Check to see if there is a target. - QRegExp re("Address[0-9]+", Qt::CaseInsensitive); + QRegularExpression re("Address[0-9]+", QRegularExpression::CaseInsensitiveOption); for (auto target: ui->sendToWidgets->findChildren(re)) { if (target->hasFocus()) { AddressBook::open(this, target);