Custom SpinBox The ctkDoubleSpinBox internaly uses a QDoubleSpinBox while it retain controls over it.
More...
#include <Libs/Widgets/ctkDoubleSpinBox.h>
|
enum | DecimalsOption {
FixedDecimals = 0x000
, DecimalsByShortcuts = 0x001
, DecimalsByKey = 0x002
, DecimalsByValue = 0x004
,
InsertDecimals = 0x008
, ReplaceDecimals = 0x010
, DecimalsAsMax = 0x020
, DecimalsAsMin = 0x040
,
DecimalPointAlwaysVisible = 0x080
} |
|
enum | SetMode { SetAlways
, SetIfDifferent
} |
|
enum | SizeHintPolicy { SizeHintByMinMax
, SizeHintByValue
} |
|
typedef QWidget | Superclass |
|
|
virtual bool | eventFilter (QObject *obj, QEvent *event) |
| Reimplemented to support shortcuts on the double spinbox. More...
|
|
virtual void | keyPressEvent (QKeyEvent *event) |
| Reimplemented to support shortcuts. More...
|
|
|
ctkDoubleSpinBoxPrivate *const | d_ptr |
|
Custom SpinBox The ctkDoubleSpinBox internaly uses a QDoubleSpinBox while it retain controls over it.
- See also
- ctkDoubleSlider, ctkSliderWidget, ctkRangeSlider
Definition at line 45 of file ctkDoubleSpinBox.h.
◆ Superclass
◆ DecimalsOption
DecimalsOption enums the input style of the spinbox decimals. Default option is DecimalsByShortcuts.
- See also
- decimals(), currentDecimals()
Enumerator |
---|
FixedDecimals | Behaves just like a QDoubleSpinBox. The maximum number of decimals allowed is given by decimals().
|
DecimalsByShortcuts | When the spinbox has focus, entering the shortcut "CTRL +" adds decimals to the current number of decimals. "CTRL -" decreases the number of decimals and "CTRL 0" returns it to its original decimals() value.
|
DecimalsByKey | Allow the number of decimals to be controlled by adding/removing digits with key strokes. - See also
- InsertDecimals, ReplaceDecimals
|
DecimalsByValue | Allow the number of decimals to be controlled by the value set by setValue().
|
InsertDecimals | This flag controls whether inserted intermediate decimals increase the number of decimals (on) or not (off). It is incompatible with the ReplaceDecimals flag. - See also
- DecimalsByKey.
|
ReplaceDecimals | This flag controls whether inserted intermediate decimals replace the existing decimals (on) or not (off). This is similar to Insert but just for decimal digits. It is incompatible with the InsertDecimals flag. - See also
- DecimalsByKey, InsertDecimals
|
DecimalsAsMax | Use the "decimals" property as a maximum limit for the number of decimals.
|
DecimalsAsMin | Use the "decimals" property as a minimum limit for the number of decimals.
|
DecimalPointAlwaysVisible | Even if the number of decimals is 0, it enforces the decimal to be visible (e.g. "0." ) - See also
- decimals
|
Definition at line 113 of file ctkDoubleSpinBox.h.
◆ SetMode
SetMode enums for the spinbox behavior. SetAlways: No check is made and the given parameters is directly set on the internal QDoubleSpinBox. SetIfDifferent: Default mode, the given parameter is checked agains the current internal value and only set if they are different. For double, the comparison is based on the input parameters rounded with the current number of decimals (see round()).
- See also
- setMode(), setSetMode(), round()
Enumerator |
---|
SetAlways | |
SetIfDifferent | |
Definition at line 104 of file ctkDoubleSpinBox.h.
◆ SizeHintPolicy
◆ ctkDoubleSpinBox() [1/2]
ctkDoubleSpinBox::ctkDoubleSpinBox |
( |
QWidget * |
parent = 0 | ) |
|
|
explicit |
Constructor, creates a ctkDoubleSpinBox. The look and feel are the same as of a QDoubleSpinBox
◆ ctkDoubleSpinBox() [2/2]
◆ ~ctkDoubleSpinBox()
virtual ctkDoubleSpinBox::~ctkDoubleSpinBox |
( |
| ) |
|
|
virtual |
◆ alignment()
Qt::Alignment ctkDoubleSpinBox::alignment |
( |
| ) |
const |
Set/Get the spinbox alignement.
◆ cleanText()
QString ctkDoubleSpinBox::cleanText |
( |
| ) |
const |
Get the spinbox current text. This excludes any prefix or suffix.
- See also
- value()
◆ decimals()
int ctkDoubleSpinBox::decimals |
( |
| ) |
const |
◆ decimalsChanged
void ctkDoubleSpinBox::decimalsChanged |
( |
int |
| ) |
|
|
signal |
Signal emitted when the decimals of the displayed are changed.
◆ decimalsOption()
ctkDoubleSpinBox::DecimalsOptions ctkDoubleSpinBox::decimalsOption |
( |
| ) |
|
◆ displayedValue()
double ctkDoubleSpinBox::displayedValue |
( |
| ) |
const |
◆ editingFinished
void ctkDoubleSpinBox::editingFinished |
( |
| ) |
|
|
signal |
Simple broadcast of the QAbstractSpinbox::editingFinished
- See also
- QAbstractSpinbox::editingFinished
◆ eventFilter()
virtual bool ctkDoubleSpinBox::eventFilter |
( |
QObject * |
obj, |
|
|
QEvent * |
event |
|
) |
| |
|
protectedvirtual |
Reimplemented to support shortcuts on the double spinbox.
◆ hasFrame()
bool ctkDoubleSpinBox::hasFrame |
( |
| ) |
const |
◆ invertedControls()
bool ctkDoubleSpinBox::invertedControls |
( |
| ) |
const |
◆ keyPressEvent()
virtual void ctkDoubleSpinBox::keyPressEvent |
( |
QKeyEvent * |
event | ) |
|
|
protectedvirtual |
Reimplemented to support shortcuts.
◆ lineEdit()
QLineEdit* ctkDoubleSpinBox::lineEdit |
( |
| ) |
const |
Get a pointer on the line edit of the spinbox.
- See also
- QLineEdit, spinBox()
◆ maximum()
double ctkDoubleSpinBox::maximum |
( |
| ) |
const |
◆ minimum()
double ctkDoubleSpinBox::minimum |
( |
| ) |
const |
Set/Get the range of the spinbox. Default range is [0.0, 9.9].
◆ minimumSizeHint()
virtual QSize ctkDoubleSpinBox::minimumSizeHint |
( |
| ) |
const |
|
virtual |
Reimplemented to respect the sizeHintPolicy property value.
- See also
- sizeHintPolicy
◆ prefix()
QString ctkDoubleSpinBox::prefix |
( |
| ) |
const |
Add/Get a prefix to the displayed value. For example, one might want to add the $ sign.
- See also
- suffix(), text()
◆ round()
double ctkDoubleSpinBox::round |
( |
double |
value | ) |
const |
Returns the rounded value according to the number of decimals of the spinbox.
- See also
- decimals()
◆ setAlignment()
void ctkDoubleSpinBox::setAlignment |
( |
Qt::Alignment |
flag | ) |
|
◆ setDecimals
void ctkDoubleSpinBox::setDecimals |
( |
int |
decimal | ) |
|
|
slot |
Set the decimals property value.
- See also
- decimals
◆ setDecimalsOption()
void ctkDoubleSpinBox::setDecimalsOption |
( |
ctkDoubleSpinBox::DecimalsOptions |
option | ) |
|
◆ setDisplayedValue()
void ctkDoubleSpinBox::setDisplayedValue |
( |
double |
displayValue | ) |
|
Set the displayed value if there is no proxy installed. If there is a proxy installed, then it allows to modify the proxy value. If there is no value proxy installed, then it's just a setter to the value property.
- See also
- displayedValue(), setValue(), value(), setValueProxy()
◆ setFrame()
void ctkDoubleSpinBox::setFrame |
( |
bool |
frame | ) |
|
◆ setInvertedControls()
void ctkDoubleSpinBox::setInvertedControls |
( |
bool |
invertedControls | ) |
|
This property holds whether or not the spin box inverts its wheel and key events. If this property is false, scrolling the mouse wheel "up" and using keys like page up will increase the spinbox's value towards its maximum. Otherwise pressing page up will move value towards the slider's minimum.
◆ setMaximum()
void ctkDoubleSpinBox::setMaximum |
( |
double |
max | ) |
|
◆ setMinimum()
void ctkDoubleSpinBox::setMinimum |
( |
double |
min | ) |
|
◆ setMode()
◆ setPrefix()
void ctkDoubleSpinBox::setPrefix |
( |
const QString & |
prefix | ) |
|
◆ setRange()
void ctkDoubleSpinBox::setRange |
( |
double |
min, |
|
|
double |
max |
|
) |
| |
◆ setSetMode()
void ctkDoubleSpinBox::setSetMode |
( |
SetMode |
mode | ) |
|
◆ setSingleStep()
void ctkDoubleSpinBox::setSingleStep |
( |
double |
value | ) |
|
◆ setSizeHintPolicy()
void ctkDoubleSpinBox::setSizeHintPolicy |
( |
SizeHintPolicy |
newSizeHintPolicy | ) |
|
◆ setSuffix()
void ctkDoubleSpinBox::setSuffix |
( |
const QString & |
suffix | ) |
|
◆ setValue
void ctkDoubleSpinBox::setValue |
( |
double |
value | ) |
|
|
slot |
◆ setValueAlways
void ctkDoubleSpinBox::setValueAlways |
( |
double |
value | ) |
|
|
slot |
◆ setValueIfDifferent
void ctkDoubleSpinBox::setValueIfDifferent |
( |
double |
value | ) |
|
|
slot |
◆ setValueProxy()
Install or remove a value proxy filter. The value proxy decouples the displayed value from the value retrieved by the value property. For example, the value proxy can allow one to display celsius in the spinbox while the value retrieved from the value property and signals are in farenheit. To remove the proxy, simply install a new empty proxy. The proxy installation/removal is silent.
- See also
- installValueProxy(), valueProxy()
◆ singleStep()
double ctkDoubleSpinBox::singleStep |
( |
| ) |
const |
Set/Get the single step. This represents by how much the value will decrease or increase when clicking the spinbox arrow or using stepUp or stepDown(). Default is 1.0.
- See also
- setUp(), stepDown(), setDecimals().
◆ sizeHint()
virtual QSize ctkDoubleSpinBox::sizeHint |
( |
| ) |
const |
|
virtual |
Reimplemented to respect the sizeHintPolicy property value.
- See also
- sizeHintPolicy
◆ sizeHintPolicy()
◆ spinBox()
QDoubleSpinBox* ctkDoubleSpinBox::spinBox |
( |
| ) |
const |
Get a pointer on the spinbox used internally. It can be useful to change display properties for example. To use with caution.
- See also
- QDoubleSpinBox, lineEdit()
◆ stepDown
void ctkDoubleSpinBox::stepDown |
( |
| ) |
|
|
slot |
◆ stepUp
void ctkDoubleSpinBox::stepUp |
( |
| ) |
|
|
slot |
◆ suffix()
QString ctkDoubleSpinBox::suffix |
( |
| ) |
const |
Add/Get a suffix to the displayed value. For example, one might want to add the F (fahrenheit) sign.
- See also
- prefix(), text()
◆ text()
QString ctkDoubleSpinBox::text |
( |
| ) |
const |
Get the spinbox current text. This includes any prefix or suffix.
- See also
- prefix(), suffix()
◆ value()
double ctkDoubleSpinBox::value |
( |
| ) |
const |
◆ valueChanged [1/2]
void ctkDoubleSpinBox::valueChanged |
( |
const QString & |
| ) |
|
|
signal |
◆ valueChanged [2/2]
void ctkDoubleSpinBox::valueChanged |
( |
double |
| ) |
|
|
signal |
Emitted everytime the spinbox value is modified
- See also
- QDoubleSpinBox::valueChanged()
◆ valueProxy()
◆ ctkCoordinatesWidgetPrivate
friend class ctkCoordinatesWidgetPrivate |
|
friend |
◆ d_ptr
ctkDoubleSpinBoxPrivate* const ctkDoubleSpinBox::d_ptr |
|
protected |
◆ alignment
Qt::Alignment ctkDoubleSpinBox::alignment |
|
readwrite |
◆ cleanText
QString ctkDoubleSpinBox::cleanText |
|
read |
◆ decimals
int ctkDoubleSpinBox::decimals |
|
readwrite |
This property holds the precision of the spin box, in decimals. Sets how many decimals the spinbox will use for displaying and interpreting doubles. If the flag DecimalsByShortcuts is set, decimals can be increased/decreased by Ctrl+/Ctrl-, Ctrl0 restores the original decimals value. If the flag DecimalsAsMax and/or DecimalsAsMin are set, decimals behave also as the max and/or min number of decimals settable by DecimalsByShortcuts, DecimalsByKey and DecimalsByValue. 2 by default.
- See also
- decimalsOption, decimals(), setDecimals(), decimalsChanged
Definition at line 1 of file ctkDoubleSpinBox.h.
◆ decimalsOption
DecimalsOptions ctkDoubleSpinBox::decimalsOption |
|
readwrite |
This property provides more controls over the decimals. The default (DecimalsByShortcuts|InsertDecimals) behaves as a QDoubleSpinbox with an explicit control of decimals via shortcuts.
- See also
- DecimalsOptions, decimals
Definition at line 1 of file ctkDoubleSpinBox.h.
◆ frame
bool ctkDoubleSpinBox::frame |
|
readwrite |
◆ invertedControls
bool ctkDoubleSpinBox::invertedControls |
|
readwrite |
This property controls whether decreasing the value by the mouse button or mouse wheel increases the value of the widget, and inverts the control similarly in the other way round or not. The property is switched off by default.
- See also
- invertedControls(), setInvertedControls()
Definition at line 1 of file ctkDoubleSpinBox.h.
◆ maximum
double ctkDoubleSpinBox::maximum |
|
readwrite |
◆ minimum
double ctkDoubleSpinBox::minimum |
|
readwrite |
◆ prefix
QString ctkDoubleSpinBox::prefix |
|
readwrite |
◆ setMode
◆ singleStep
double ctkDoubleSpinBox::singleStep |
|
readwrite |
◆ sizeHintPolicy
◆ suffix
QString ctkDoubleSpinBox::suffix |
|
readwrite |
◆ value
double ctkDoubleSpinBox::value |
|
readwrite |
The documentation for this class was generated from the following file: