-
-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Brand new search bar active layer feature matching functionality + UI/UX improvements #4546
Conversation
🎉 Ta-daaa, freshly created APKs are available for 45a7bf1: arm64-android |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code looks good.
Needs a bit of docs here and there.
Also put some braces (
for single line ifs. They are okayish if they are followed by return
, break
or continue
, but become super confusing with other statements and error prone when refactoring.
IMO we should add this as a rule to the linter. Opinions @nirvn @m-kuhn ?
QStringList prepare( const QString &string, const QgsLocatorContext &locatorContext ) override; | ||
void fetchResults( const QString &string, const QgsLocatorContext &context, QgsFeedback *feedback ) override; | ||
void triggerResult( const QgsLocatorResult &result ) override; | ||
void triggerResultFromAction( const QgsLocatorResult &result, const int actionId ) override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QStringList prepare( const QString &string, const QgsLocatorContext &locatorContext ) override; | |
void fetchResults( const QString &string, const QgsLocatorContext &context, QgsFeedback *feedback ) override; | |
void triggerResult( const QgsLocatorResult &result ) override; | |
void triggerResultFromAction( const QgsLocatorResult &result, const int actionId ) override; | |
QStringList prepare( const QString &string, const QgsLocatorContext &locatorContext ) override; | |
void fetchResults( const QString &string, const QgsLocatorContext &context, QgsFeedback *feedback ) override; | |
void triggerResult( const QgsLocatorResult &result ) override; | |
void triggerResultFromAction( const QgsLocatorResult &result, const int actionId ) override; |
A bit of docs would be nice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@suricactus , doc available in the parent class: https://api.qgis.org/api/classQgsLocatorFilter.html
cee49c4
to
adb838c
Compare
@suricactus , review addressed, thanks a bunch for looking over this. |
…ing or all numerical and text attributes) of active layer
adb838c
to
45a7bf1
Compare
This PR adds a new functionality to the search bar: an active layer feature matching. To begin with, here's a screencast showcasing the UI/UX:
Screencast.from.2023-09-01.11-07-04.webm
Few notes:
f @ATTRIBUTE_NAME search term
'). This matches the behavior found in QGIS and can be super useful in narrowing searches on the spot.The screencast also shows a nice UX improvements added here. Since we are now having quite a few search functionalities, with a few activated only via prefix, it has become slightly harder for QField users to be made aware of all of the cool stuff the search bar those. To remedy to that, the search bar now shows a list of functionalities when users activate the search bar prior to entering text.
Part of the code logic was taken from @nyalldawson 's equivalent locator filter in QGIS (https://github.com/qgis/QGIS/blob/master/src/app/locator/qgsactivelayerfeatureslocatorfilter.cpp). Insuring that QField and QGIS have matching behaviors was important. I'm pretty sure we'll get a few QField users aware of the
@ATTRIBUTE
restriction in QGIS now ;-P