Bug report #12122

No text maximum size for mutilines "Text Edit" (QPlainText) form controls

Added by Médéric RIBREUX over 5 years ago. Updated over 1 year ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Forms
Affected QGIS version:2.6.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:end of life
Crashes QGIS or corrupts data:No Copied to github as #:20316

Description

Hello,

if you use a "Text Edit" Edit Widget on a field in QGis form, the text maximum length is limited to the maximum length of the field (once at the max size, you cannot type anything more).
If you check the multiline option for this field, there is no max length for the form control: you can type as much as you want, there is no limitation on the amount of characters.
If you store your data into an RDBMS and your data is too long, database will report an error and the feature will not be saved because you are exceeding the field size.

I've made tests under Oracle but I think that the situation is the same for the other RDBMS. This bug is reproducible with auto-generated, drag'n drop and custom forms.

In order to avoid database errors and to have a common behaviour for "Text Edit" widgets, QGis should also limit the text size for multine "Text Edit" form controls.

When checking multiline option, QPlainText is used in the form instead of QLineEdit. QLineEdit have a maxLength property so it is easy to fix the maximum size of a character string for these form controls. But you don't have the same property on QPlainText. But you can implement a maxLength property with a little bit of code (Python / C++).

Thanks for fixing this...

History

#1 Updated by Giovanni Manghi over 3 years ago

  • Easy fix? set to No
  • Regression? set to No

#2 Updated by Giovanni Manghi over 1 year ago

  • Resolution set to end of life
  • Status changed from Open to Closed

Also available in: Atom PDF