diff --git a/src/plugins/cpptools/cppquickopenfilter.cpp b/src/plugins/cpptools/cppquickopenfilter.cpp index a1f1a9b3713..ac69c9cc6df 100644 --- a/src/plugins/cpptools/cppquickopenfilter.cpp +++ b/src/plugins/cpptools/cppquickopenfilter.cpp @@ -75,6 +75,12 @@ void CppQuickOpenFilter::refresh(QFutureInterface &future) Q_UNUSED(future); } +static bool compareLexigraphically(const QuickOpen::FilterEntry &a, + const QuickOpen::FilterEntry &b) +{ + return a.displayName < b.displayName; +} + QList CppQuickOpenFilter::matchesFor(const QString &origEntry) { QString entry = trimWildcards(origEntry); @@ -109,6 +115,9 @@ QList CppQuickOpenFilter::matchesFor(const QString &orig } } + if (entries.size() < 1000) + qSort(entries.begin(), entries.end(), compareLexigraphically); + return entries; }