Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[feature] Form context expressions in value relation widget
The value relation widget filter expression can now use two new functions/variables that have access to the current values and geometry of the form being edited. This allows for dynamic filtering (drill-down) as explained in the crowdfunding page: https://north-road.com/drill-down-cascading-forms/ The new functions/variables are: Function: get_current_form_field_value( 'FIELD_NAME' ) Variable: @current_form_geometry
- Loading branch information
Showing
with
607 additions
and 83 deletions.
- +57 −5 python/core/auto_generated/fieldformatter/qgsvaluerelationfieldformatter.sip.in
- +8 −0 python/core/auto_generated/qgsexpressioncontext.sip.in
- +4 −0 python/gui/auto_generated/editorwidgets/core/qgseditorwidgetwrapper.sip.in
- +19 −0 python/gui/auto_generated/qgsattributeeditorcontext.sip.in
- +2 −1 python/gui/auto_generated/qgsattributeform.sip.in
- +7 −0 resources/function_help/json/get_current_form_field_value.txt
- +3 −0 src/core/expression/qgsexpression.cpp
- +68 −3 src/core/fieldformatter/qgsvaluerelationfieldformatter.cpp
- +56 −5 src/core/fieldformatter/qgsvaluerelationfieldformatter.h
- +39 −0 src/core/qgsexpressioncontext.cpp
- +15 −8 src/core/qgsexpressioncontext.h
- +5 −1 src/gui/attributetable/qgsattributetabledelegate.cpp
- +1 −1 src/gui/attributetable/qgsattributetablemodel.h
- +12 −2 src/gui/editorwidgets/core/qgseditorwidgetwrapper.h
- +1 −0 src/gui/editorwidgets/qgsvaluerelationconfigdlg.cpp
- +0 −1 src/gui/editorwidgets/qgsvaluerelationsearchwidgetwrapper.cpp
- +139 −54 src/gui/editorwidgets/qgsvaluerelationwidgetwrapper.cpp
- +31 −0 src/gui/editorwidgets/qgsvaluerelationwidgetwrapper.h
- +18 −0 src/gui/qgsattributeeditorcontext.h
- +1 −0 src/gui/qgsattributeform.cpp
- +4 −1 src/gui/qgsattributeform.h
- +82 −0 tests/src/gui/testqgsvaluerelationwidgetwrapper.cpp
- +35 −1 tests/src/python/test_qgsfieldformatters.py
@@ -0,0 +1,7 @@ | ||
{ | ||
"name": "get_current_form_field_value", | ||
"type": "function", | ||
"description": "Returns the current value of a field in the form or table row currently being edited.", | ||
"arguments": [ {"arg":"field_name","description":"a field name in the current form or table row"}], | ||
"examples": [ { "expression":"get_current_form_field_value( 'FIELD_NAME' )","returns":"The current value of field 'FIELD_NAME'."} ] | ||
} |
Oops, something went wrong.