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

SpinBox allows invalid values after editing is finished

    XMLWordPrintable

Details

    Description

      There is a bug in the current SpinBox implementation which allows to leave the SpinBox with values outside of the predefined range of valid values. To reproduce the bug one must create two SpinBoxes as shown in the following code snippet. The second SpinBox can also be replaced by any other focus able component.

      ColumnLayout {
          SpinBox {
              id: first
              from: 0
              to: 100
              value: 33
              editable: true
          }
          SpinBox {
              id: second
          }
      }
      

      Click into the SpinBox which has the defined range and start to edit the value. Type 133 and finish editing by using tab to set the focus on the second SpinBox. The recently set value of 133 will be reverted to 100 as the IntValidator kicks in and clips the value to the predefined range. Now when you go back to edit the first SpinBox again and type any invalid value like 133 and switch the focus again to the second SpinBox the value isn't clipped by the IntValidator anymore and stays invalid.

      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
            henning Henning Gründl
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes