-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
In Value Relation widget the new function current_value in filter expression is not affected by a settext of a python initialization function. #29667
Comments
dataset.zip |
Another problem that may be related. example if you enter 10 the list will be for example 10a, 10b, 10c... we choose 10b which is displayed, but it is the value 10a which is saved. |
I'm not sure this really an issue. When forcing the value at form opening the relational widget (the combobox) is filtered as expected. The value We get the same behavior when changing the value I fail to reproduce the second issue, the expression |
Proposed PR #30554 |
Author Name: Alain FERRATON (@FERRATON)
Original Redmine Issue: 21852
Affected QGIS version: 3.4.5
Redmine category:forms
I'm not sure it's a bug, because the problem is a bit complex.
I am in a case where I have to initialize a field, in reality by recovering a value in another layer that contains the entered point, but for the example just by assignment in a form open function
from PyQt5.QtWidgets import QDialogButtonBox, QLineEdit
def my_form_open(dialog, layer, feature):
dialog.findChild(QLineEdit,'id').setText('10')
Another field (ref) is defined as a relational value and uses a filter for this purpose
id" = current_value("id')
when the form is initialized, the id value is not recovered by the current_value() function. All layer values are displayed instead of being filtered.
it is necessary to retype the value in the field so that the field 'ref' is filtered
In the same case, the formValuerelation plugin worked correctly with QGIS 2.
attached two layers gpkg and a project for testing
The text was updated successfully, but these errors were encountered: