Feature request #6912

Add data provider field validation for Q[Plain]TextEdit widgets

Added by Larry Shaffer almost 12 years ago. Updated over 7 years ago.

Status:Open
Priority:Normal
Assignee:-
Category:GUI
Pull Request or Patch supplied:No Resolution:
Easy fix?:No Copied to github as #:16035

Description

Currently there is QgsFieldValidator for validation of QLineEdit, editable QComboBox and numeric input widgets, because those widgets allow a validator to be readily set. QgsFieldValidator is subclassed from QValidator.

However, when using custom .ui forms for attribute editing and the mapped text field is QPlainTextEdit or QTextEdit, there is no basic field validation (e.g. field length). While it's possible to create custom validation via Python for the custom form, it would be good to offer basic field validation for those widgets in core C++.

This probably means QPlainTextEdit and QTextEdit they will need to have Qgs-prefixed subclasses so that a setValidator() method can extend them, and then QgsFieldValidator can be updated to work with those widget types. The validation could be handled on the textChanged() signal, and other appropriate (and missing) widget data provider field properties should probably be added (e.g. maxLength, like with QLineEdit).

Or, am I missing such an existing feature?

History

#1 Updated by Jürgen Fischer over 10 years ago

  • Target version changed from Version 2.0.0 to Future Release - Lower Priority

#2 Updated by Giovanni Manghi over 7 years ago

  • Easy fix? set to No

Also available in: Atom PDF