From 62e883ec13b9b6eb5b05aeb82d9cde4f73c730d4 Mon Sep 17 00:00:00 2001 From: Spiros Date: Sun, 9 Jun 2024 23:47:47 +0300 Subject: [PATCH] Use a static qregexp instead of a temporary one Qt complains --- mainwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index 374d724..b81ca06 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -113,7 +113,9 @@ void MainWindow::scanDevices() int startIndex = 0; int endIndex = 0; - while ((endIndex = allDevicesOutput.indexOf(QRegularExpression("\\}\\n\\{"), startIndex)) != -1) { + static const QRegularExpression re("\\}\\n\\{"); + + while ((endIndex = allDevicesOutput.indexOf(re, startIndex)) != -1) { ++endIndex; QString jsonFragment = allDevicesOutput.mid(startIndex, endIndex - startIndex); deviceOutputs.append(jsonFragment);