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

Textnput validator does not set the value when focus is lost

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.0.2, 5.7.1, 5.8.0
    • None

    Description

      Steps to reproduce:

      1. Run the application below.
      2. Delete the first TextInput's text.
      3. Click in the second TextInput so that the first one loses focus; the first TextInput should be set back to 0 but it remains empty.
      import QtQuick 2.0
      import QtQuick.Window 2.0
      
      Window {
          visible: true
          width: 640
          height: 480
          title: "qtbug59153"
      
          Column {
              TextInput {
                  text: "0"
                  width: 200
                  height: 50
      
                  validator: IntValidator {
                      bottom: 0
                      top: 1
                  }
              }
              TextInput {
                  text: "0"
                  width: 200
                  height: 50
              }
          }
      }
      

      This was initially observed in SpinBox from Qt Quick Controls 2, which uses TextInput as its editor, along with IntValidator.

      Attachments

        1. testvalidator.png
          10 kB
          Alexander
        2. testvalidator.qml
          0.2 kB
          Alexander
        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
            lom2k Alexander
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes