Match case-insensitive during completion
This commit is contained in:
@@ -12,10 +12,13 @@ bool CompletionProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &so
|
|||||||
if (m_filterText.isEmpty()) {
|
if (m_filterText.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return (sourceModel()->data(sourceModel()->index(sourceRow, 0), filterRole()).toString().startsWith(m_filterText)
|
return (sourceModel()->data(sourceModel()->index(sourceRow, 0), filterRole()).toString().startsWith(m_filterText, Qt::CaseInsensitive)
|
||||||
&& !m_fullText.startsWith(sourceModel()->data(sourceModel()->index(sourceRow, 0), filterRole()).toString()))
|
&& !m_fullText.startsWith(sourceModel()->data(sourceModel()->index(sourceRow, 0), filterRole()).toString()))
|
||||||
|| (m_secondaryFilterRole != -1
|
|| (m_secondaryFilterRole != -1
|
||||||
&& sourceModel()->data(sourceModel()->index(sourceRow, 0), secondaryFilterRole()).toString().startsWith(m_filterText.midRef(1)));
|
&& sourceModel()
|
||||||
|
->data(sourceModel()->index(sourceRow, 0), secondaryFilterRole())
|
||||||
|
.toString()
|
||||||
|
.startsWith(m_filterText.midRef(1), Qt::CaseInsensitive));
|
||||||
}
|
}
|
||||||
|
|
||||||
int CompletionProxyModel::secondaryFilterRole() const
|
int CompletionProxyModel::secondaryFilterRole() const
|
||||||
|
|||||||
Reference in New Issue
Block a user