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

TextInput does not accept enter/return

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.11.0
    • None
    • All

    Description

      TextInput has the onAccpeted signal emitted when the used presses return or enter while editing the field, but this does not actually accept the event

      from qquicktextinput.cpp, processKeyEvent():

      ...
      emit q->accepted();
      }
      event->ignore();

      ...

       

      This is a problem if the parent of the TextInput does something with the key event itself, which will be managed even if it's completely unexpected as no other key even besides enter/return was propagated

      QtQuickControls2 LineEdit is also affected, being a subclass of TextInput

      The problem was noted first with a QDialog that contained a QQuickWidget which had some lineedits, and pressing return with the focus on any of the line edits, unexpectedly closed the qdialog

       

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            notmart Marco Martin
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes