Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-2420

QLineEdit should not allow CR/LF characters

    XMLWordPrintable

Details

    Description

      At present, QLineEdit renders CR/LF characters as blank spaces, but the character remains a CR/LF.

      QLineEdit is documented as a allowing "the user to enter and edit a single line of plain text with a useful collection of editing functions, including undo and redo, cut and paste, and drag and drop."

      It is easily possible to accidentally paste a CR/LF character into a QLineEdit and not know about it as it appears as a blank space.

      If this QLineEdit is used to obtain character sensitive strings such as Username/Password and then use this string (via QLineEdit::text()) then the data can be incorrect.

      If a QLineEdit is designed specifically for one line of text, then perhaps a CR/LF character has no place in it and should be replaced by (rather than rendered as) a blank space. Perhaps having this as an option would suffice.

      If the wish is to preserve formatting of pasted text, this should at the very least be documented.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            bjnilsen Bjørn Erik Nilsen
            gpf Shane McLaughlin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes