From 4a4aa35ec4555153f58078b844a7929d756dbb59 Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Mon, 29 May 2023 17:16:58 +0200 Subject: [PATCH] Only use filterRegularExpression for Qt6 In Qt5, setFilterFixedString does not change the filterRegularExpression property --- smsapp/conversationssortfilterproxymodel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/smsapp/conversationssortfilterproxymodel.cpp b/smsapp/conversationssortfilterproxymodel.cpp index bc7e375bd..9946946c8 100644 --- a/smsapp/conversationssortfilterproxymodel.cpp +++ b/smsapp/conversationssortfilterproxymodel.cpp @@ -58,7 +58,11 @@ bool ConversationsSortFilterProxyModel::filterAcceptsRow(int sourceRow, const QM const QList addressList = sourceModel()->data(index, ConversationListModel::AddressesRole).value>(); for (const ConversationAddress &address : addressList) { QString canonicalAddress = SmsHelper::canonicalizePhoneNumber(address.address()); +#if QT_VERSION_MAJOR < 6 + if (canonicalAddress.contains(filterRegExp())) { +#else if (canonicalAddress.contains(filterRegularExpression())) { +#endif return true; } }