From 97b2ebe1b0d2bafb9d870bc9422ee721e08a6657 Mon Sep 17 00:00:00 2001 From: John Fultz Date: Sat, 15 Jul 2023 21:03:02 -0500 Subject: QRegEx -> QRegularExpression I think these changes would still be fine in Qt5, but are required for Qt6. Also DataLocation was deprecated in v6, AppLocalDataLocation is the same for both Qt5 and Qt6. --- quacker/lister.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'quacker/lister.cpp') diff --git a/quacker/lister.cpp b/quacker/lister.cpp index b0c7451..c3a4ea9 100644 --- a/quacker/lister.cpp +++ b/quacker/lister.cpp @@ -612,14 +612,13 @@ RegexFilter::RegexFilter(ListerDialog *dialog) void RegexFilter::apply() { - QRegExp regexp(m_lineEdit->text()); - regexp.setCaseSensitivity(Qt::CaseInsensitive); + QRegularExpression regexp(m_lineEdit->text(), QRegularExpression::PatternOption::CaseInsensitiveOption); Dict::WordList filteredList; const Dict::WordList &list = m_dialog->wordList();; for (const auto& it : list) - if (regexp.indexIn(it.word) >= 0) + if (regexp.match(it.word).hasMatch()) filteredList.append(it); m_dialog->setWordList(filteredList); -- cgit v1.2.3