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

The signal editingFinished is emitted twice

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 5.12.2
    • None
    • macOS

      When the signal handler of editingFinished changes the focus, by e.g. showing a warning dialog, the signal editingFinished is emitted twice, even though the value of text did not change.

      This is a regression from Qt 5.11.x to Qt 5.12.x

      import QtQuick 2.11
      import emptyTest 1.0
      
      Item {
          id: root
          width: Constants.width
          height: Constants.height
      
          TextInput {
              id: textEdit
              x: 129
              y: 102
              width: 80
              height: 20
              text: qsTr("Text Edit")
              font.pixelSize: 12
      
      
              onEditingFinished: {
                  print("finished")
                  element.text = text
                  textEdit2.focus = true
              }
      
          }
      
          Text {
              id: element
              x: 129
              y: 159
              text: qsTr("Text")
              font.pixelSize: 12
          }
      
          TextInput {
              id: textEdit2
              x: 395
              y: 96
              width: 80
              height: 20
              text: qsTr("Text Edit")
              font.pixelSize: 12
          }
      }
      

      This is a small example that reproduces the issue. Setting the focus emits a second editingFinished, even though the value of text did not change.

        For Gerrit Dashboard: QTBUG-74554
        # Subject Branch Project Status CR V

            vestbo Tor Arne Vestbø
            brook_cronin_qt Brook Cronin
            Veli-Pekka Heinonen Veli-Pekka Heinonen
            Votes:
            2 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes