From 75c74105d78a5acc3e18e5d8fd5fcffa851d79ff Mon Sep 17 00:00:00 2001 From: Karl Fleischmann Date: Tue, 15 Jul 2025 11:59:16 +0200 Subject: [PATCH] gui: Resolve QRegularExpression::match() deprecation Depending on Qt version use QRegularExpression::matchView() when using a QStringView parameter. Remain QRegularExpression::match() for older versions. --- src/gui/rebindwidget.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gui/rebindwidget.cpp b/src/gui/rebindwidget.cpp index 935b7c1a..cdbd4ce5 100644 --- a/src/gui/rebindwidget.cpp +++ b/src/gui/rebindwidget.cpp @@ -377,7 +377,15 @@ void RebindWidget::setSelection(const QStringList& newSelection, bool applyPrevi // If the daemon macro string contains even a single delay, then the we set the // delay to "as typed" instead of "default" QRegularExpression re("=\\d+"); - if(re.match(macroData[0]).hasMatch()) +// Use different match function depending on Qt version, 6.5.0 deprecates +// QRegularExpression::match() in favor of QRegularExpression::matchView() when +// using a QStringView parameter. +#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0) + bool has_match = re.matchView(macroData[0]).hasMatch(); +#else // QT_VERSION < 6.5.0 + bool has_match = re.match(macroData[0]).hasMatch(); +#endif + if(has_match) ui->rb_delay_asTyped->setChecked(true); else ui->rb_delay_default->setChecked(true);