Feature request #6912

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

Added by Larry Shaffer over 4 years ago. Updated almost 3 years ago.

Status:Open Start Date:12/22/2012
Priority:Normal Due date:
Assigned to:- % Done:


Target version:Future Release - Lower Priority
Platform: Resolution:
Platform version: Pull Request or Patch supplied:No
Status info: Tag:


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?


Updated by J├╝rgen Fischer almost 3 years ago

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

Also available in: Atom