class KDoubleSpinBox |
|
|
A spin box for fractional numbers. This class provides a spin box for fractional numbers. See below for code examples on how to use this class. Parameters \n To make successful use of KDoubleSpinBox, you need to understand the relationship between precision and available range.
Since we work with fixed-point numbers internally, the maximum precision is a function of the valid range and vice versa. More precisely, the following relationships hold: max( abs(minimum()), abs(maximum() ) <= INT_MAX/10^precision maxPrecision = floor( log10( INT_MAX/max(abs(minimum()),abs(maximum())) ) ) Since the value, bounds and lineStep are rounded to the current precision, you may find that the order of setting these parameters matters. As an example, the following are not equivalent (try it!):
// sets precision, // then min/max value (rounded to precision and clipped to obtainable range if needed) // then value and lineStep spin = new KDoubleSpinBox( 0, 9.999, 0.001, 4.321, 3, this );
Author Marc Mutz
|
|
Constructs a KDoubleSpinBox with parent parent and default values for range and value (whatever QRangeControl uses) and precision (2). |
|
Constructs a KDoubleSpinBox with parent parent, range [ lower, upper ], lineStep step, precision @p precision and initial value value. |
|
Returns whether the spinbox uses localized numbers |
|
Returns the current upper bound |
|
Returns the current lower bound |
|
Returns the current number of digits displayed to the right of the decimal point. |
|
Sets whether to use and accept localized numbers as returned by KLocale.formatNumber() |
|
Sets the upper bound of the range to value, subject to the contraints that value is first rounded to the current precision and then clipped to the maximum range interval that can be handled at that precision. See also minimum, maximum, setMinimum, setRange |
|
Sets the lower bound of the range to value, subject to the contraints that value is first rounded to the current precision and then clipped to the maximum range interval that can be handled at that precision. See also maximum, minimum, setMaximum, setRange |
|
Equivalent to setPrecision( precision, false ); Needed since Qt's moc doesn't ignore trailing parameters with default args when searching for a property setter method. |
|
Sets the precision (number of digits to the right of the decimal point). Note that there is a tradeoff between the precision used and the available range of values. See the class documentation above for more information on this.
precision - the new precision to use
force - if true, disables checking of bounds violations that can arise if you increase the precision so much that the minimum and maximum values can't be represented anymore. Disabling is useful if you were going to disable range control in any case.
|
|
Sets a new range for the spin box values. Note that lower, @p upper and step are rounded to precision decimal points first. |
|
Sets the step size for clicking the up/down buttons to step, subject to the constraints that step is first rounded to the current precision and then clipped to the meaningful interval [ 1, maximum() - minimum() ]. |
|
Overridden to ignore any setValidator() calls. |
|
Sets the current value to value, subject to the constraints that value is first rounded to the current precision and then clipped to the interval [ minimum() , maximum() ]. |
|
Returns the current step size |
|
|
|
Returns the current value |
|
Emitted whenever QSpinBox.valueChanged( int ) is emitted. |
|