From 1f02226620f8923d8a203be7d19419cd31462a11 Mon Sep 17 00:00:00 2001 From: WarmUpTill Date: Wed, 12 Jul 2023 20:06:47 +0200 Subject: [PATCH] Add option to set flags in FindIdxInRagne() --- src/utils/utility.cpp | 4 ++-- src/utils/utility.hpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/utils/utility.cpp b/src/utils/utility.cpp index e021fa70..b04292b6 100644 --- a/src/utils/utility.cpp +++ b/src/utils/utility.cpp @@ -1141,7 +1141,7 @@ void AddSelectionGroup(QComboBox *selection, const QStringList &group, } int FindIdxInRagne(QComboBox *list, int start, int stop, - const std::string &value) + const std::string &value, Qt::MatchFlags flags) { if (value.empty()) { return 0; @@ -1150,7 +1150,7 @@ int FindIdxInRagne(QComboBox *list, int start, int stop, auto startIdx = model->index(start, 0); auto match = model->match(startIdx, Qt::DisplayRole, QString::fromStdString(value), 1, - Qt::MatchExactly | Qt::MatchCaseSensitive); + flags); if (match.isEmpty()) { return 0; } diff --git a/src/utils/utility.hpp b/src/utils/utility.hpp index 89804a49..65888bdc 100644 --- a/src/utils/utility.hpp +++ b/src/utils/utility.hpp @@ -97,7 +97,8 @@ QMetaObject::Connection PulseWidget(QWidget *widget, QColor startColor, void SetHeightToContentHeight(QListWidget *list); void SetButtonIcon(QPushButton *button, const char *path); int FindIdxInRagne(QComboBox *list, int start, int stop, - const std::string &value); + const std::string &value, + Qt::MatchFlags = Qt::MatchExactly | Qt::MatchCaseSensitive); /* UI helpers */