Optimize relation combobox panel search against large lists#7008
Optimize relation combobox panel search against large lists#7008
Conversation
|
A bit of background on this: prior to QField 3.7, we would filter and sort through repeated data provider requests. We moved to a full list we filter on the Qt side via a filter proxy model. You can see in the filed issue that we also have a lag pre 3.7, but that's not blocking the UI. |
📱 Android buildsDownload an Android arm64 build of this PR for testing. Other Android architectures🍎 MacOS DMG universal buildsDownload a MacOS DMG universal build of this PR for testing. 🪟 Windows buildsDownload a Windows build of this PR for testing. 🐧 Linux AppImage buildsDownload a Linux AppImage build of this PR for testing. |
|
@FelixHinckel , I never noticed this function -- what are the uses for limiting a relation reference list? |
|
None, I just thought that showing only the 5 first results could decrease the lag. |
|
Do you think this issue will be handled ? I have to say that it is quite important for me, as it will drive the development of the projet I am leading. |
fd2752e to
53b8958
Compare
|
I just checked the latest commit, it works well! |
|
@FelixHinckel , it'll be part of the next release yes, circa end of March 2026. We could backport this but I'm a little bit reluctant at this stage. |
|
No worries, that is just to inform the users! March is good! |
|
Hi @nirvn ! |
|
@FelixHinckel please do report them on GitHub. Just mention you're on master. Thanks! |
kaustuvpokharel
left a comment
There was a problem hiding this comment.
Overall looks good!
src/core/featurelistmodel.cpp
Outdated
| for ( const FeatureExpressionValuesGatherer::Entry &gatheredEntry : gatheredEntries ) | ||
| { | ||
| entries.append( Entry( gatheredEntry.value, gatheredEntry.identifierFields.at( 0 ), gatheredEntry.identifierFields.at( 1 ), gatheredEntry.featureId ) ); | ||
| Entry entry( Entry( gatheredEntry.value, gatheredEntry.identifierFields.at( 0 ), gatheredEntry.identifierFields.at( 1 ), gatheredEntry.featureId ) ); |
There was a problem hiding this comment.
Tiny change, this would redundant initialization, Entry(Entry(...)) does the same job as Entry(...), It only make sense if we were to intentionally force a conversion or selecting a specific constructor in a tricky overload situation.
| Entry entry( Entry( gatheredEntry.value, gatheredEntry.identifierFields.at( 0 ), gatheredEntry.identifierFields.at( 1 ), gatheredEntry.featureId ) ); | |
| Entry entry( gatheredEntry.value, gatheredEntry.identifierFields.at( 0 ), gatheredEntry.identifierFields.at( 1 ), gatheredEntry.featureId ); |
There was a problem hiding this comment.
Yuck, thanks for spotting this.
| if ( mSearchTerm == lowerSearchTerm ) | ||
| return; |
There was a problem hiding this comment.
| if ( mSearchTerm == lowerSearchTerm ) | |
| return; | |
| if ( mSearchTerm == lowerSearchTerm ) | |
| { | |
| return; | |
| } |
dfc3347 to
6f6856b
Compare

Attempt at improving things enough for #7007 to be considered fixed.
@FelixHinckel , can you give this a try? The first strike is still slow-ish but I suspect on lists that are not 100,000 items should now be usable.