Add option to set flags in FindIdxInRagne()

This commit is contained in:
WarmUpTill
2023-07-12 20:06:47 +02:00
committed by WarmUpTill
parent ad8c29997c
commit 1f02226620
2 changed files with 4 additions and 3 deletions

View File

@@ -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;
}

View File

@@ -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 */