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

QDoubleSpinBox - unsafe implementation of setMinimum(), setMaximum()

XMLWordPrintable

      The implementation of setMinimum() and setMaximum() for QDoubleSpinBox is unsafe and may lead to undesirable results. I.e. in a QDoubleSpinBox with decimals set to 1 a range of setMinimum(0.44) and setMaximum(1.55) will lead to a range of 0.4 - 1.6 because the values are rounded. That means the actual limits of the spin box are outside of the specified range and the user can select values that are outside of the desired range.

      IMHO setMinimum() should do a kind of ceil() and setMaximum() should do a kind of floor(). This would lead to a safe range of 0.5 - 1.5 and this range is inside of the desired range from 0.44 - 1.55.

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

            Unassigned Unassigned
            ukindler Uwe Kindler
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes