[][src]Struct qt_widgets::QSpinBox

#[repr(C)]
pub struct QSpinBox { /* fields omitted */ }

The QSpinBox class provides a spin box widget.

C++ class: QSpinBox.

C++ documentation:

The QSpinBox class provides a spin box widget.

QSpinBox is designed to handle integers and discrete sets of values (e.g., month names); use QDoubleSpinBox for floating point values.

QSpinBox allows the user to choose a value by clicking the up/down buttons or pressing up/down on the keyboard to increase/decrease the value currently displayed. The user can also type the value in manually. The spin box supports integer values but can be extended to use different strings with validate(), textFromValue() and valueFromText().

Every time the value changes QSpinBox emits two valueChanged() signals, one providing an int and the other a QString. The QString overload provides the value with both prefix() and suffix(). The current value can be fetched with value() and set with setValue().

Clicking the up/down buttons or using the keyboard accelerator's up and down arrows will increase or decrease the current value in steps of size singleStep(). If you want to change this behaviour you can reimplement the virtual function stepBy(). The minimum and maximum value and the step size can be set using one of the constructors, and can be changed later with setMinimum(), setMaximum() and setSingleStep().

Most spin boxes are directional, but QSpinBox can also operate as a circular spin box, i.e. if the range is 0-99 and the current value is 99, clicking "up" will give 0 if wrapping() is set to true. Use setWrapping() if you want circular behavior.

The displayed value can be prepended and appended with arbitrary strings indicating, for example, currency or the unit of measurement. See setPrefix() and setSuffix(). The text in the spin box is retrieved with text() (which includes any prefix() and suffix()), or with cleanText() (which has no prefix(), no suffix() and no leading or trailing whitespace).

It is often desirable to give the user a special (often default) choice in addition to the range of numeric values. See setSpecialValueText() for how to do this with QSpinBox.

Methods

impl QSpinBox[src]

pub fn slot_set_value(&self) -> Receiver<(c_int,)>[src]

This property holds the value of the spin box

Returns a built-in Qt slot QSpinBox::setValue that can be passed to qt_core::Signal::connect.

C++ documentation:

This property holds the value of the spin box

setValue() will emit valueChanged() if the new value is different from the old one. The value property has a second notifier signal which includes the spin box's prefix and suffix.

Access functions:

int value() const
void setValue(int val)

Notifier signal:

void valueChanged(int i)
void valueChanged(const QString &text)

pub fn value_changed(&self) -> Signal<(c_int,)>[src]

This signal is emitted whenever the spin box's value is changed. The new value's integer value is passed in i.

Returns a built-in Qt signal QSpinBox::valueChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted whenever the spin box's value is changed. The new value's integer value is passed in i.

Note: Signal valueChanged is overloaded in this class. To connect to this one using the function pointer syntax, you must specify the signal type in a static cast, as shown in this example:

connect(spinBox, static_cast<void(QSpinBox::)(int)>(&QSpinBox::valueChanged), [=](int i){ / ... */ });

Note: Notifier signal for property value.

pub fn value_changed2(&self) -> Signal<(*const QString,)>[src]

This is an overloaded function.

Returns a built-in Qt signal QSpinBox::valueChanged that can be passed to qt_core::Signal::connect.

C++ documentation:

This is an overloaded function.

The new value is passed in text with prefix() and suffix().

Note: Signal valueChanged is overloaded in this class. To connect to this one using the function pointer syntax, you must specify the signal type in a static cast, as shown in this example:

connect(spinBox, static_cast<void(QSpinBox::)(const QString &)>(&QSpinBox::valueChanged), [=](const QString &text){ / ... */ });

Note: Notifier signal for property value.

pub unsafe fn clean_text(&self) -> CppBox<QString>[src]

This property holds the text of the spin box excluding any prefix, suffix, or leading or trailing whitespace.

Calls C++ function: QString QSpinBox::cleanText() const.

C++ documentation:

This property holds the text of the spin box excluding any prefix, suffix, or leading or trailing whitespace.

Access functions:

QString cleanText() const

See also text, QSpinBox::prefix, and QSpinBox::suffix.

pub unsafe fn display_integer_base(&self) -> c_int[src]

This property holds the base used to display the value of the spin box

Calls C++ function: int QSpinBox::displayIntegerBase() const.

C++ documentation:

This property holds the base used to display the value of the spin box

The default displayIntegerBase value is 10.

This property was introduced in Qt 5.2.

Access functions:

int displayIntegerBase() const
void setDisplayIntegerBase(int base)

See also textFromValue() and valueFromText().

pub unsafe fn maximum(&self) -> c_int[src]

This property holds the maximum value of the spin box

Calls C++ function: int QSpinBox::maximum() const.

C++ documentation:

This property holds the maximum value of the spin box

When setting this property the minimum is adjusted if necessary, to ensure that the range remains valid.

The default maximum value is 99.

Access functions:

int maximum() const
void setMaximum(int max)

See also setRange() and specialValueText.

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QSpinBox::metaObject() const.

pub unsafe fn minimum(&self) -> c_int[src]

This property holds the minimum value of the spin box

Calls C++ function: int QSpinBox::minimum() const.

C++ documentation:

This property holds the minimum value of the spin box

When setting this property the maximum is adjusted if necessary to ensure that the range remains valid.

The default minimum value is 0.

Access functions:

int minimum() const
void setMinimum(int min)

See also setRange() and specialValueText.

pub unsafe fn new_1a(parent: impl CastInto<MutPtr<QWidget>>) -> CppBox<QSpinBox>[src]

Constructs a spin box with 0 as minimum value and 99 as maximum value, a step value of 1. The value is initially set to 0. It is parented to parent.

Calls C++ function: [constructor] void QSpinBox::QSpinBox(QWidget* parent = …).

C++ documentation:

Constructs a spin box with 0 as minimum value and 99 as maximum value, a step value of 1. The value is initially set to 0. It is parented to parent.

See also setMinimum(), setMaximum(), and setSingleStep().

pub unsafe fn new_0a() -> CppBox<QSpinBox>[src]

The QSpinBox class provides a spin box widget.

Calls C++ function: [constructor] void QSpinBox::QSpinBox().

C++ documentation:

The QSpinBox class provides a spin box widget.

QSpinBox is designed to handle integers and discrete sets of values (e.g., month names); use QDoubleSpinBox for floating point values.

QSpinBox allows the user to choose a value by clicking the up/down buttons or pressing up/down on the keyboard to increase/decrease the value currently displayed. The user can also type the value in manually. The spin box supports integer values but can be extended to use different strings with validate(), textFromValue() and valueFromText().

Every time the value changes QSpinBox emits two valueChanged() signals, one providing an int and the other a QString. The QString overload provides the value with both prefix() and suffix(). The current value can be fetched with value() and set with setValue().

Clicking the up/down buttons or using the keyboard accelerator's up and down arrows will increase or decrease the current value in steps of size singleStep(). If you want to change this behaviour you can reimplement the virtual function stepBy(). The minimum and maximum value and the step size can be set using one of the constructors, and can be changed later with setMinimum(), setMaximum() and setSingleStep().

Most spin boxes are directional, but QSpinBox can also operate as a circular spin box, i.e. if the range is 0-99 and the current value is 99, clicking "up" will give 0 if wrapping() is set to true. Use setWrapping() if you want circular behavior.

The displayed value can be prepended and appended with arbitrary strings indicating, for example, currency or the unit of measurement. See setPrefix() and setSuffix(). The text in the spin box is retrieved with text() (which includes any prefix() and suffix()), or with cleanText() (which has no prefix(), no suffix() and no leading or trailing whitespace).

It is often desirable to give the user a special (often default) choice in addition to the range of numeric values. See setSpecialValueText() for how to do this with QSpinBox.

pub unsafe fn prefix(&self) -> CppBox<QString>[src]

This property holds the spin box's prefix

Calls C++ function: QString QSpinBox::prefix() const.

C++ documentation:

This property holds the spin box's prefix

The prefix is prepended to the start of the displayed value. Typical use is to display a unit of measurement or a currency symbol. For example:

sb->setPrefix("$");

To turn off the prefix display, set this property to an empty string. The default is no prefix. The prefix is not displayed when value() == minimum() and specialValueText() is set.

If no prefix is set, prefix() returns an empty string.

Access functions:

QString prefix() const
void setPrefix(const QString &prefix)

See also suffix(), setSuffix(), specialValueText(), and setSpecialValueText().

pub unsafe fn qt_metacall(
    &mut self,
    arg1: Call,
    arg2: c_int,
    arg3: impl CastInto<MutPtr<*mut c_void>>
) -> c_int
[src]

Calls C++ function: virtual int QSpinBox::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(
    &mut self,
    arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>
[src]

Calls C++ function: virtual void* QSpinBox::qt_metacast(const char* arg1).

pub unsafe fn set_display_integer_base(&mut self, base: c_int)[src]

This property holds the base used to display the value of the spin box

Calls C++ function: void QSpinBox::setDisplayIntegerBase(int base).

C++ documentation:

This property holds the base used to display the value of the spin box

The default displayIntegerBase value is 10.

This property was introduced in Qt 5.2.

Access functions:

int displayIntegerBase() const
void setDisplayIntegerBase(int base)

See also textFromValue() and valueFromText().

pub unsafe fn set_maximum(&mut self, max: c_int)[src]

This property holds the maximum value of the spin box

Calls C++ function: void QSpinBox::setMaximum(int max).

C++ documentation:

This property holds the maximum value of the spin box

When setting this property the minimum is adjusted if necessary, to ensure that the range remains valid.

The default maximum value is 99.

Access functions:

int maximum() const
void setMaximum(int max)

See also setRange() and specialValueText.

pub unsafe fn set_minimum(&mut self, min: c_int)[src]

This property holds the minimum value of the spin box

Calls C++ function: void QSpinBox::setMinimum(int min).

C++ documentation:

This property holds the minimum value of the spin box

When setting this property the maximum is adjusted if necessary to ensure that the range remains valid.

The default minimum value is 0.

Access functions:

int minimum() const
void setMinimum(int min)

See also setRange() and specialValueText.

pub unsafe fn set_prefix(&mut self, prefix: impl CastInto<Ref<QString>>)[src]

This property holds the spin box's prefix

Calls C++ function: void QSpinBox::setPrefix(const QString& prefix).

C++ documentation:

This property holds the spin box's prefix

The prefix is prepended to the start of the displayed value. Typical use is to display a unit of measurement or a currency symbol. For example:

sb->setPrefix("$");

To turn off the prefix display, set this property to an empty string. The default is no prefix. The prefix is not displayed when value() == minimum() and specialValueText() is set.

If no prefix is set, prefix() returns an empty string.

Access functions:

QString prefix() const
void setPrefix(const QString &prefix)

See also suffix(), setSuffix(), specialValueText(), and setSpecialValueText().

pub unsafe fn set_range(&mut self, min: c_int, max: c_int)[src]

Convenience function to set the minimum, and maximum values with a single function call.

Calls C++ function: void QSpinBox::setRange(int min, int max).

C++ documentation:

Convenience function to set the minimum, and maximum values with a single function call.


  setRange(minimum, maximum);

is equivalent to:

setMinimum(minimum); setMaximum(maximum);

See also minimum and maximum.

pub unsafe fn set_single_step(&mut self, val: c_int)[src]

This property holds the step value

Calls C++ function: void QSpinBox::setSingleStep(int val).

C++ documentation:

This property holds the step value

When the user uses the arrows to change the spin box's value the value will be incremented/decremented by the amount of the singleStep. The default value is 1. Setting a singleStep value of less than 0 does nothing.

Access functions:

int singleStep() const
void setSingleStep(int val)

pub unsafe fn set_step_type(&mut self, step_type: StepType)[src]

Sets the step type for the spin box to stepType, which is single step or adaptive decimal step.

Calls C++ function: void QSpinBox::setStepType(QAbstractSpinBox::StepType stepType).

C++ documentation:

Sets the step type for the spin box to stepType, which is single step or adaptive decimal step.

Adaptive decimal step means that the step size will continuously be adjusted to one power of ten below the current value. So when the value is 1100, the step is set to 100, so stepping up once increases it to 1200. For 1200 stepping up takes it to 1300. For negative values, stepping down from -1100 goes to -1200.

Step direction is taken into account to handle edges cases, so that stepping down from 100 takes the value to 99 instead of 90. Thus a step up followed by a step down -- or vice versa -- always lands on the starting value; 99 -> 100 -> 99.

Setting this will cause the spin box to disregard the value of singleStep, although it is preserved so that singleStep comes into effect if adaptive decimal step is later turned off.

This function was introduced in Qt 5.12.

Note: Setter function for property stepType.

See also stepType().

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0").

pub unsafe fn set_suffix(&mut self, suffix: impl CastInto<Ref<QString>>)[src]

This property holds the suffix of the spin box

Calls C++ function: void QSpinBox::setSuffix(const QString& suffix).

C++ documentation:

This property holds the suffix of the spin box

The suffix is appended to the end of the displayed value. Typical use is to display a unit of measurement or a currency symbol. For example:

sb->setSuffix(" km");

To turn off the suffix display, set this property to an empty string. The default is no suffix. The suffix is not displayed for the minimum() if specialValueText() is set.

If no suffix is set, suffix() returns an empty string.

Access functions:

QString suffix() const
void setSuffix(const QString &suffix)

See also prefix(), setPrefix(), specialValueText(), and setSpecialValueText().

pub unsafe fn set_value(&mut self, val: c_int)[src]

This property holds the value of the spin box

Calls C++ function: [slot] void QSpinBox::setValue(int val).

C++ documentation:

This property holds the value of the spin box

setValue() will emit valueChanged() if the new value is different from the old one. The value property has a second notifier signal which includes the spin box's prefix and suffix.

Access functions:

int value() const
void setValue(int val)

Notifier signal:

void valueChanged(int i)
void valueChanged(const QString &text)

pub unsafe fn single_step(&self) -> c_int[src]

This property holds the step value

Calls C++ function: int QSpinBox::singleStep() const.

C++ documentation:

This property holds the step value

When the user uses the arrows to change the spin box's value the value will be incremented/decremented by the amount of the singleStep. The default value is 1. Setting a singleStep value of less than 0 does nothing.

Access functions:

int singleStep() const
void setSingleStep(int val)

pub unsafe fn static_meta_object() -> Ref<QMetaObject>[src]

Returns a reference to the staticMetaObject field.

pub unsafe fn step_type(&self) -> StepType[src]

This property holds the step type.

Calls C++ function: QAbstractSpinBox::StepType QSpinBox::stepType() const.

C++ documentation:

This property holds the step type.

The step type can be single step or adaptive decimal step.

Access functions:

QAbstractSpinBox::StepType stepType() const
void setStepType(QAbstractSpinBox::StepType stepType)

This item is available if any(cpp_lib_version="5.12.2", cpp_lib_version="5.13.0").

pub unsafe fn suffix(&self) -> CppBox<QString>[src]

This property holds the suffix of the spin box

Calls C++ function: QString QSpinBox::suffix() const.

C++ documentation:

This property holds the suffix of the spin box

The suffix is appended to the end of the displayed value. Typical use is to display a unit of measurement or a currency symbol. For example:

sb->setSuffix(" km");

To turn off the suffix display, set this property to an empty string. The default is no suffix. The suffix is not displayed for the minimum() if specialValueText() is set.

If no suffix is set, suffix() returns an empty string.

Access functions:

QString suffix() const
void setSuffix(const QString &suffix)

See also prefix(), setPrefix(), specialValueText(), and setSpecialValueText().

pub unsafe fn tr(
    s: impl CastInto<Ptr<c_char>>,
    c: impl CastInto<Ptr<c_char>>,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QSpinBox::tr(const char* s, const char* c, int n).

pub unsafe fn tr_utf8(
    s: impl CastInto<Ptr<c_char>>,
    c: impl CastInto<Ptr<c_char>>,
    n: c_int
) -> CppBox<QString>
[src]

Calls C++ function: static QString QSpinBox::trUtf8(const char* s, const char* c, int n).

pub unsafe fn value(&self) -> c_int[src]

This property holds the value of the spin box

Calls C++ function: int QSpinBox::value() const.

C++ documentation:

This property holds the value of the spin box

setValue() will emit valueChanged() if the new value is different from the old one. The value property has a second notifier signal which includes the spin box's prefix and suffix.

Access functions:

int value() const
void setValue(int val)

Notifier signal:

void valueChanged(int i)
void valueChanged(const QString &text)

Methods from Deref<Target = QAbstractSpinBox>

pub fn slot_step_up(&self) -> Receiver<()>[src]

Steps up by one linestep Calling this slot is analogous to calling stepBy(1);

Returns a built-in Qt slot QAbstractSpinBox::stepUp that can be passed to qt_core::Signal::connect.

C++ documentation:

Steps up by one linestep Calling this slot is analogous to calling stepBy(1);

See also stepBy() and stepDown().

pub fn slot_step_down(&self) -> Receiver<()>[src]

Steps down by one linestep Calling this slot is analogous to calling stepBy(-1);

Returns a built-in Qt slot QAbstractSpinBox::stepDown that can be passed to qt_core::Signal::connect.

C++ documentation:

Steps down by one linestep Calling this slot is analogous to calling stepBy(-1);

See also stepBy() and stepUp().

pub fn slot_select_all(&self) -> Receiver<()>[src]

Selects all the text in the spinbox except the prefix and suffix.

Returns a built-in Qt slot QAbstractSpinBox::selectAll that can be passed to qt_core::Signal::connect.

C++ documentation:

Selects all the text in the spinbox except the prefix and suffix.

pub fn slot_clear(&self) -> Receiver<()>[src]

Clears the lineedit of all text but prefix and suffix.

Returns a built-in Qt slot QAbstractSpinBox::clear that can be passed to qt_core::Signal::connect.

C++ documentation:

Clears the lineedit of all text but prefix and suffix.

pub fn editing_finished(&self) -> Signal<()>[src]

This signal is emitted editing is finished. This happens when the spinbox loses focus and when enter is pressed.

Returns a built-in Qt signal QAbstractSpinBox::editingFinished that can be passed to qt_core::Signal::connect.

C++ documentation:

This signal is emitted editing is finished. This happens when the spinbox loses focus and when enter is pressed.

pub unsafe fn alignment(&self) -> QFlags<AlignmentFlag>[src]

This property holds the alignment of the spin box

Calls C++ function: QFlags<Qt::AlignmentFlag> QAbstractSpinBox::alignment() const.

C++ documentation:

This property holds the alignment of the spin box

Possible Values are Qt::AlignLeft, Qt::AlignRight, and Qt::AlignHCenter.

By default, the alignment is Qt::AlignLeft

Attempting to set the alignment to an illegal flag combination does nothing.

Access functions:

Qt::Alignment alignment() const
void setAlignment(Qt::Alignment flag)

See also Qt::Alignment.

pub unsafe fn button_symbols(&self) -> ButtonSymbols[src]

This property holds the current button symbol mode

Calls C++ function: QAbstractSpinBox::ButtonSymbols QAbstractSpinBox::buttonSymbols() const.

C++ documentation:

This property holds the current button symbol mode

The possible values can be either UpDownArrows or PlusMinus. The default is UpDownArrows.

Note that some styles might render PlusMinus and UpDownArrows identically.

Access functions:

ButtonSymbols buttonSymbols() const
void setButtonSymbols(ButtonSymbols bs)

See also ButtonSymbols.

pub unsafe fn clear(&mut self)[src]

Clears the lineedit of all text but prefix and suffix.

Calls C++ function: virtual [slot] void QAbstractSpinBox::clear().

C++ documentation:

Clears the lineedit of all text but prefix and suffix.

pub unsafe fn correction_mode(&self) -> CorrectionMode[src]

This property holds the mode to correct an Intermediate value if editing finishes

Calls C++ function: QAbstractSpinBox::CorrectionMode QAbstractSpinBox::correctionMode() const.

C++ documentation:

This property holds the mode to correct an Intermediate value if editing finishes

The default mode is QAbstractSpinBox::CorrectToPreviousValue.

This property was introduced in Qt 4.2.

Access functions:

CorrectionMode correctionMode() const
void setCorrectionMode(CorrectionMode cm)

See also acceptableInput, validate(), and fixup().

pub unsafe fn event(&mut self, event: impl CastInto<MutPtr<QEvent>>) -> bool[src]

Reimplemented from QObject::event().

Calls C++ function: virtual bool QAbstractSpinBox::event(QEvent* event).

C++ documentation:

Reimplemented from QObject::event().

pub unsafe fn fixup(&self, input: impl CastInto<MutRef<QString>>)[src]

This virtual function is called by the QAbstractSpinBox if the input is not validated to QValidator::Acceptable when Return is pressed or interpretText() is called. It will try to change the text so it is valid. Reimplemented in the various subclasses.

Calls C++ function: virtual void QAbstractSpinBox::fixup(QString& input) const.

C++ documentation:

This virtual function is called by the QAbstractSpinBox if the input is not validated to QValidator::Acceptable when Return is pressed or interpretText() is called. It will try to change the text so it is valid. Reimplemented in the various subclasses.

pub unsafe fn has_acceptable_input(&self) -> bool[src]

This property holds whether the input satisfies the current validation

Calls C++ function: bool QAbstractSpinBox::hasAcceptableInput() const.

C++ documentation:

This property holds whether the input satisfies the current validation

This property was introduced in Qt 4.2.

Access functions:

bool hasAcceptableInput() const

See also validate(), fixup(), and correctionMode.

pub unsafe fn has_frame(&self) -> bool[src]

This property holds whether the spin box draws itself with a frame

Calls C++ function: bool QAbstractSpinBox::hasFrame() const.

C++ documentation:

This property holds whether the spin box draws itself with a frame

If enabled (the default) the spin box draws itself inside a frame, otherwise the spin box draws itself without any frame.

Access functions:

bool hasFrame() const
void setFrame(bool)

pub unsafe fn input_method_query(
    &self,
    arg1: InputMethodQuery
) -> CppBox<QVariant>
[src]

Reimplemented from QWidget::inputMethodQuery().

Calls C++ function: virtual QVariant QAbstractSpinBox::inputMethodQuery(Qt::InputMethodQuery arg1) const.

C++ documentation:

Reimplemented from QWidget::inputMethodQuery().

pub unsafe fn interpret_text(&mut self)[src]

This function interprets the text of the spin box. If the value has changed since last interpretation it will emit signals.

Calls C++ function: void QAbstractSpinBox::interpretText().

C++ documentation:

This function interprets the text of the spin box. If the value has changed since last interpretation it will emit signals.

pub unsafe fn is_accelerated(&self) -> bool[src]

This property holds whether the spin box will accelerate the frequency of the steps when pressing the step Up/Down buttons.

Calls C++ function: bool QAbstractSpinBox::isAccelerated() const.

C++ documentation:

This property holds whether the spin box will accelerate the frequency of the steps when pressing the step Up/Down buttons.

If enabled the spin box will increase/decrease the value faster the longer you hold the button down.

This property was introduced in Qt 4.2.

Access functions:

bool isAccelerated() const
void setAccelerated(bool on)

pub unsafe fn is_group_separator_shown(&self) -> bool[src]

This property holds whether a thousands separator is enabled. By default this property is false.

Calls C++ function: bool QAbstractSpinBox::isGroupSeparatorShown() const.

C++ documentation:

This property holds whether a thousands separator is enabled. By default this property is false.

This property was introduced in Qt 5.3.

Access functions:

bool isGroupSeparatorShown() const
void setGroupSeparatorShown(bool shown)

pub unsafe fn is_read_only(&self) -> bool[src]

This property holds whether the spin box is read only.

Calls C++ function: bool QAbstractSpinBox::isReadOnly() const.

C++ documentation:

This property holds whether the spin box is read only.

In read-only mode, the user can still copy the text to the clipboard, or drag and drop the text; but cannot edit it.

The QLineEdit in the QAbstractSpinBox does not show a cursor in read-only mode.

Access functions:

bool isReadOnly() const
void setReadOnly(bool r)

See also QLineEdit::readOnly.

pub unsafe fn keyboard_tracking(&self) -> bool[src]

This property holds whether keyboard tracking is enabled for the spinbox.

Calls C++ function: bool QAbstractSpinBox::keyboardTracking() const.

C++ documentation:

This property holds whether keyboard tracking is enabled for the spinbox.

If keyboard tracking is enabled (the default), the spinbox emits the valueChanged() signal while the new value is being entered from the keyboard.

E.g. when the user enters the value 600 by typing 6, 0, and 0, the spinbox emits 3 signals with the values 6, 60, and 600 respectively.

If keyboard tracking is disabled, the spinbox doesn't emit the valueChanged() signal while typing. It emits the signal later, when the return key is pressed, when keyboard focus is lost, or when other spinbox functionality is used, e.g. pressing an arrow key.

This property was introduced in Qt 4.3.

Access functions:

bool keyboardTracking() const
void setKeyboardTracking(bool kt)

pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>[src]

Calls C++ function: virtual const QMetaObject* QAbstractSpinBox::metaObject() const.

pub unsafe fn minimum_size_hint(&self) -> CppBox<QSize>[src]

Reimplemented from QWidget::minimumSizeHint().

Calls C++ function: virtual QSize QAbstractSpinBox::minimumSizeHint() const.

C++ documentation:

Reimplemented from QWidget::minimumSizeHint().

pub unsafe fn qt_metacall(
    &mut self,
    arg1: Call,
    arg2: c_int,
    arg3: impl CastInto<MutPtr<*mut c_void>>
) -> c_int
[src]

Calls C++ function: virtual int QAbstractSpinBox::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3).

pub unsafe fn qt_metacast(
    &mut self,
    arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>
[src]

Calls C++ function: virtual void* QAbstractSpinBox::qt_metacast(const char* arg1).

pub unsafe fn select_all(&mut self)[src]

Selects all the text in the spinbox except the prefix and suffix.

Calls C++ function: [slot] void QAbstractSpinBox::selectAll().

C++ documentation:

Selects all the text in the spinbox except the prefix and suffix.

pub unsafe fn set_accelerated(&mut self, on: bool)[src]

This property holds whether the spin box will accelerate the frequency of the steps when pressing the step Up/Down buttons.

Calls C++ function: void QAbstractSpinBox::setAccelerated(bool on).

C++ documentation:

This property holds whether the spin box will accelerate the frequency of the steps when pressing the step Up/Down buttons.

If enabled the spin box will increase/decrease the value faster the longer you hold the button down.

This property was introduced in Qt 4.2.

Access functions:

bool isAccelerated() const
void setAccelerated(bool on)

pub unsafe fn set_alignment(&mut self, flag: QFlags<AlignmentFlag>)[src]

This property holds the alignment of the spin box

Calls C++ function: void QAbstractSpinBox::setAlignment(QFlags<Qt::AlignmentFlag> flag).

C++ documentation:

This property holds the alignment of the spin box

Possible Values are Qt::AlignLeft, Qt::AlignRight, and Qt::AlignHCenter.

By default, the alignment is Qt::AlignLeft

Attempting to set the alignment to an illegal flag combination does nothing.

Access functions:

Qt::Alignment alignment() const
void setAlignment(Qt::Alignment flag)

See also Qt::Alignment.

pub unsafe fn set_button_symbols(&mut self, bs: ButtonSymbols)[src]

This property holds the current button symbol mode

Calls C++ function: void QAbstractSpinBox::setButtonSymbols(QAbstractSpinBox::ButtonSymbols bs).

C++ documentation:

This property holds the current button symbol mode

The possible values can be either UpDownArrows or PlusMinus. The default is UpDownArrows.

Note that some styles might render PlusMinus and UpDownArrows identically.

Access functions:

ButtonSymbols buttonSymbols() const
void setButtonSymbols(ButtonSymbols bs)

See also ButtonSymbols.

pub unsafe fn set_correction_mode(&mut self, cm: CorrectionMode)[src]

This property holds the mode to correct an Intermediate value if editing finishes

Calls C++ function: void QAbstractSpinBox::setCorrectionMode(QAbstractSpinBox::CorrectionMode cm).

C++ documentation:

This property holds the mode to correct an Intermediate value if editing finishes

The default mode is QAbstractSpinBox::CorrectToPreviousValue.

This property was introduced in Qt 4.2.

Access functions:

CorrectionMode correctionMode() const
void setCorrectionMode(CorrectionMode cm)

See also acceptableInput, validate(), and fixup().

pub unsafe fn set_frame(&mut self, arg1: bool)[src]

This property holds whether the spin box draws itself with a frame

Calls C++ function: void QAbstractSpinBox::setFrame(bool arg1).

C++ documentation:

This property holds whether the spin box draws itself with a frame

If enabled (the default) the spin box draws itself inside a frame, otherwise the spin box draws itself without any frame.

Access functions:

bool hasFrame() const
void setFrame(bool)

pub unsafe fn set_group_separator_shown(&mut self, shown: bool)[src]

This property holds whether a thousands separator is enabled. By default this property is false.

Calls C++ function: void QAbstractSpinBox::setGroupSeparatorShown(bool shown).

C++ documentation:

This property holds whether a thousands separator is enabled. By default this property is false.

This property was introduced in Qt 5.3.

Access functions:

bool isGroupSeparatorShown() const
void setGroupSeparatorShown(bool shown)

pub unsafe fn set_keyboard_tracking(&mut self, kt: bool)[src]

This property holds whether keyboard tracking is enabled for the spinbox.

Calls C++ function: void QAbstractSpinBox::setKeyboardTracking(bool kt).

C++ documentation:

This property holds whether keyboard tracking is enabled for the spinbox.

If keyboard tracking is enabled (the default), the spinbox emits the valueChanged() signal while the new value is being entered from the keyboard.

E.g. when the user enters the value 600 by typing 6, 0, and 0, the spinbox emits 3 signals with the values 6, 60, and 600 respectively.

If keyboard tracking is disabled, the spinbox doesn't emit the valueChanged() signal while typing. It emits the signal later, when the return key is pressed, when keyboard focus is lost, or when other spinbox functionality is used, e.g. pressing an arrow key.

This property was introduced in Qt 4.3.

Access functions:

bool keyboardTracking() const
void setKeyboardTracking(bool kt)

pub unsafe fn set_read_only(&mut self, r: bool)[src]

This property holds whether the spin box is read only.

Calls C++ function: void QAbstractSpinBox::setReadOnly(bool r).

C++ documentation:

This property holds whether the spin box is read only.

In read-only mode, the user can still copy the text to the clipboard, or drag and drop the text; but cannot edit it.

The QLineEdit in the QAbstractSpinBox does not show a cursor in read-only mode.

Access functions:

bool isReadOnly() const
void setReadOnly(bool r)

See also QLineEdit::readOnly.

pub unsafe fn set_special_value_text(
    &mut self,
    txt: impl CastInto<Ref<QString>>
)
[src]

This property holds the special-value text

Calls C++ function: void QAbstractSpinBox::setSpecialValueText(const QString& txt).

C++ documentation:

This property holds the special-value text

If set, the spin box will display this text instead of a numeric value whenever the current value is equal to minimum(). Typical use is to indicate that this choice has a special (default) meaning.

For example, if your spin box allows the user to choose a scale factor (or zoom level) for displaying an image, and your application is able to automatically choose one that will enable the image to fit completely within the display window, you can set up the spin box like this:

QSpinBox *zoomSpinBox = new QSpinBox; zoomSpinBox->setRange(0, 1000); zoomSpinBox->setSingleStep(10); zoomSpinBox->setSuffix("%"); zoomSpinBox->setSpecialValueText(tr("Automatic")); zoomSpinBox->setValue(100);

The user will then be able to choose a scale from 1% to 1000% or select "Auto" to leave it up to the application to choose. Your code must then interpret the spin box value of 0 as a request from the user to scale the image to fit inside the window.

All values are displayed with the prefix and suffix (if set), except for the special value, which only shows the special value text. This special text is passed in the QSpinBox::valueChanged() signal that passes a QString.

To turn off the special-value text display, call this function with an empty string. The default is no special-value text, i.e. the numeric value is shown as usual.

If no special-value text is set, specialValueText() returns an empty string.

Access functions:

QString specialValueText() const
void setSpecialValueText(const QString &txt)

pub unsafe fn set_wrapping(&mut self, w: bool)[src]

This property holds whether the spin box is circular.

Calls C++ function: void QAbstractSpinBox::setWrapping(bool w).

C++ documentation:

This property holds whether the spin box is circular.

If wrapping is true stepping up from maximum() value will take you to the minimum() value and vica versa. Wrapping only make sense if you have minimum() and maximum() values set.

QSpinBox *spinBox = new QSpinBox(this); spinBox->setRange(0, 100); spinBox->setWrapping(true); spinBox->setValue(100); spinBox->stepBy(1); // value is 0

Access functions:

bool wrapping() const
void setWrapping(bool w)

See also QSpinBox::minimum() and QSpinBox::maximum().

pub unsafe fn size_hint(&self) -> CppBox<QSize>[src]

Reimplemented from QWidget::sizeHint().

Calls C++ function: virtual QSize QAbstractSpinBox::sizeHint() const.

C++ documentation:

Reimplemented from QWidget::sizeHint().

pub unsafe fn special_value_text(&self) -> CppBox<QString>[src]

This property holds the special-value text

Calls C++ function: QString QAbstractSpinBox::specialValueText() const.

C++ documentation:

This property holds the special-value text

If set, the spin box will display this text instead of a numeric value whenever the current value is equal to minimum(). Typical use is to indicate that this choice has a special (default) meaning.

For example, if your spin box allows the user to choose a scale factor (or zoom level) for displaying an image, and your application is able to automatically choose one that will enable the image to fit completely within the display window, you can set up the spin box like this:

QSpinBox *zoomSpinBox = new QSpinBox; zoomSpinBox->setRange(0, 1000); zoomSpinBox->setSingleStep(10); zoomSpinBox->setSuffix("%"); zoomSpinBox->setSpecialValueText(tr("Automatic")); zoomSpinBox->setValue(100);

The user will then be able to choose a scale from 1% to 1000% or select "Auto" to leave it up to the application to choose. Your code must then interpret the spin box value of 0 as a request from the user to scale the image to fit inside the window.

All values are displayed with the prefix and suffix (if set), except for the special value, which only shows the special value text. This special text is passed in the QSpinBox::valueChanged() signal that passes a QString.

To turn off the special-value text display, call this function with an empty string. The default is no special-value text, i.e. the numeric value is shown as usual.

If no special-value text is set, specialValueText() returns an empty string.

Access functions:

QString specialValueText() const
void setSpecialValueText(const QString &txt)

pub unsafe fn step_by(&mut self, steps: c_int)[src]

Virtual function that is called whenever the user triggers a step. The steps parameter indicates how many steps were taken, e.g. Pressing Qt::Key_Down will trigger a call to stepBy(-1), whereas pressing Qt::Key_Prior will trigger a call to stepBy(10).

Calls C++ function: virtual void QAbstractSpinBox::stepBy(int steps).

C++ documentation:

Virtual function that is called whenever the user triggers a step. The steps parameter indicates how many steps were taken, e.g. Pressing Qt::Key_Down will trigger a call to stepBy(-1), whereas pressing Qt::Key_Prior will trigger a call to stepBy(10).

If you subclass QAbstractSpinBox you must reimplement this function. Note that this function is called even if the resulting value will be outside the bounds of minimum and maximum. It's this function's job to handle these situations.

pub unsafe fn step_down(&mut self)[src]

Steps down by one linestep Calling this slot is analogous to calling stepBy(-1);

Calls C++ function: [slot] void QAbstractSpinBox::stepDown().

C++ documentation:

Steps down by one linestep Calling this slot is analogous to calling stepBy(-1);

See also stepBy() and stepUp().

pub unsafe fn step_up(&mut self)[src]

Steps up by one linestep Calling this slot is analogous to calling stepBy(1);

Calls C++ function: [slot] void QAbstractSpinBox::stepUp().

C++ documentation:

Steps up by one linestep Calling this slot is analogous to calling stepBy(1);

See also stepBy() and stepDown().

pub unsafe fn text(&self) -> CppBox<QString>[src]

This property holds the spin box's text, including any prefix and suffix

Calls C++ function: QString QAbstractSpinBox::text() const.

C++ documentation:

This property holds the spin box's text, including any prefix and suffix

There is no default text.

Access functions:

QString text() const

pub unsafe fn validate(
    &self,
    input: impl CastInto<MutRef<QString>>,
    pos: impl CastInto<MutRef<c_int>>
) -> State
[src]

This virtual function is called by the QAbstractSpinBox to determine whether input is valid. The pos parameter indicates the position in the string. Reimplemented in the various subclasses.

Calls C++ function: virtual QValidator::State QAbstractSpinBox::validate(QString& input, int& pos) const.

C++ documentation:

This virtual function is called by the QAbstractSpinBox to determine whether input is valid. The pos parameter indicates the position in the string. Reimplemented in the various subclasses.

pub unsafe fn wrapping(&self) -> bool[src]

This property holds whether the spin box is circular.

Calls C++ function: bool QAbstractSpinBox::wrapping() const.

C++ documentation:

This property holds whether the spin box is circular.

If wrapping is true stepping up from maximum() value will take you to the minimum() value and vica versa. Wrapping only make sense if you have minimum() and maximum() values set.

QSpinBox *spinBox = new QSpinBox(this); spinBox->setRange(0, 100); spinBox->setWrapping(true); spinBox->setValue(100); spinBox->stepBy(1); // value is 0

Access functions:

bool wrapping() const
void setWrapping(bool w)

See also QSpinBox::minimum() and QSpinBox::maximum().

Trait Implementations

impl Deref for QSpinBox[src]

type Target = QAbstractSpinBox

The resulting type after dereferencing.

fn deref(&self) -> &QAbstractSpinBox[src]

Calls C++ function: QAbstractSpinBox* static_cast<QAbstractSpinBox*>(QSpinBox* ptr).

impl DerefMut for QSpinBox[src]

fn deref_mut(&mut self) -> &mut QAbstractSpinBox[src]

Calls C++ function: QAbstractSpinBox* static_cast<QAbstractSpinBox*>(QSpinBox* ptr).

impl StaticUpcast<QAbstractSpinBox> for QSpinBox[src]

unsafe fn static_upcast(ptr: Ptr<QSpinBox>) -> Ptr<QAbstractSpinBox>[src]

Calls C++ function: QAbstractSpinBox* static_cast<QAbstractSpinBox*>(QSpinBox* ptr).

unsafe fn static_upcast_mut(ptr: MutPtr<QSpinBox>) -> MutPtr<QAbstractSpinBox>[src]

Calls C++ function: QAbstractSpinBox* static_cast<QAbstractSpinBox*>(QSpinBox* ptr).

impl StaticUpcast<QWidget> for QSpinBox[src]

unsafe fn static_upcast(ptr: Ptr<QSpinBox>) -> Ptr<QWidget>[src]

Calls C++ function: QWidget* static_cast<QWidget*>(QSpinBox* ptr).

unsafe fn static_upcast_mut(ptr: MutPtr<QSpinBox>) -> MutPtr<QWidget>[src]

Calls C++ function: QWidget* static_cast<QWidget*>(QSpinBox* ptr).

impl StaticUpcast<QObject> for QSpinBox[src]

unsafe fn static_upcast(ptr: Ptr<QSpinBox>) -> Ptr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QSpinBox* ptr).

unsafe fn static_upcast_mut(ptr: MutPtr<QSpinBox>) -> MutPtr<QObject>[src]

Calls C++ function: QObject* static_cast<QObject*>(QSpinBox* ptr).

impl StaticUpcast<QPaintDevice> for QSpinBox[src]

unsafe fn static_upcast(ptr: Ptr<QSpinBox>) -> Ptr<QPaintDevice>[src]

Calls C++ function: QPaintDevice* static_cast<QPaintDevice*>(QSpinBox* ptr).

unsafe fn static_upcast_mut(ptr: MutPtr<QSpinBox>) -> MutPtr<QPaintDevice>[src]

Calls C++ function: QPaintDevice* static_cast<QPaintDevice*>(QSpinBox* ptr).

impl StaticDowncast<QSpinBox> for QAbstractSpinBox[src]

unsafe fn static_downcast(ptr: Ptr<QAbstractSpinBox>) -> Ptr<QSpinBox>[src]

Calls C++ function: QSpinBox* static_cast<QSpinBox*>(QAbstractSpinBox* ptr).

unsafe fn static_downcast_mut(ptr: MutPtr<QAbstractSpinBox>) -> MutPtr<QSpinBox>[src]

Calls C++ function: QSpinBox* static_cast<QSpinBox*>(QAbstractSpinBox* ptr).

impl StaticDowncast<QSpinBox> for QWidget[src]

unsafe fn static_downcast(ptr: Ptr<QWidget>) -> Ptr<QSpinBox>[src]

Calls C++ function: QSpinBox* static_cast<QSpinBox*>(QWidget* ptr).

unsafe fn static_downcast_mut(ptr: MutPtr<QWidget>) -> MutPtr<QSpinBox>[src]

Calls C++ function: QSpinBox* static_cast<QSpinBox*>(QWidget* ptr).

impl StaticDowncast<QSpinBox> for QObject[src]

unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QSpinBox>[src]

Calls C++ function: QSpinBox* static_cast<QSpinBox*>(QObject* ptr).

unsafe fn static_downcast_mut(ptr: MutPtr<QObject>) -> MutPtr<QSpinBox>[src]

Calls C++ function: QSpinBox* static_cast<QSpinBox*>(QObject* ptr).

impl StaticDowncast<QSpinBox> for QPaintDevice[src]

unsafe fn static_downcast(ptr: Ptr<QPaintDevice>) -> Ptr<QSpinBox>[src]

Calls C++ function: QSpinBox* static_cast<QSpinBox*>(QPaintDevice* ptr).

unsafe fn static_downcast_mut(ptr: MutPtr<QPaintDevice>) -> MutPtr<QSpinBox>[src]

Calls C++ function: QSpinBox* static_cast<QSpinBox*>(QPaintDevice* ptr).

impl DynamicCast<QSpinBox> for QAbstractSpinBox[src]

unsafe fn dynamic_cast(ptr: Ptr<QAbstractSpinBox>) -> Ptr<QSpinBox>[src]

Calls C++ function: QSpinBox* dynamic_cast<QSpinBox*>(QAbstractSpinBox* ptr).

unsafe fn dynamic_cast_mut(ptr: MutPtr<QAbstractSpinBox>) -> MutPtr<QSpinBox>[src]

Calls C++ function: QSpinBox* dynamic_cast<QSpinBox*>(QAbstractSpinBox* ptr).

impl DynamicCast<QSpinBox> for QWidget[src]

unsafe fn dynamic_cast(ptr: Ptr<QWidget>) -> Ptr<QSpinBox>[src]

Calls C++ function: QSpinBox* dynamic_cast<QSpinBox*>(QWidget* ptr).

unsafe fn dynamic_cast_mut(ptr: MutPtr<QWidget>) -> MutPtr<QSpinBox>[src]

Calls C++ function: QSpinBox* dynamic_cast<QSpinBox*>(QWidget* ptr).

impl DynamicCast<QSpinBox> for QObject[src]

unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QSpinBox>[src]

Calls C++ function: QSpinBox* dynamic_cast<QSpinBox*>(QObject* ptr).

unsafe fn dynamic_cast_mut(ptr: MutPtr<QObject>) -> MutPtr<QSpinBox>[src]

Calls C++ function: QSpinBox* dynamic_cast<QSpinBox*>(QObject* ptr).

impl DynamicCast<QSpinBox> for QPaintDevice[src]

unsafe fn dynamic_cast(ptr: Ptr<QPaintDevice>) -> Ptr<QSpinBox>[src]

Calls C++ function: QSpinBox* dynamic_cast<QSpinBox*>(QPaintDevice* ptr).

unsafe fn dynamic_cast_mut(ptr: MutPtr<QPaintDevice>) -> MutPtr<QSpinBox>[src]

Calls C++ function: QSpinBox* dynamic_cast<QSpinBox*>(QPaintDevice* ptr).

impl CppDeletable for QSpinBox[src]

unsafe fn delete(&mut self)[src]

Destructor.

Calls C++ function: virtual [destructor] void QSpinBox::~QSpinBox().

C++ documentation:

Destructor.

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> StaticUpcast<T> for T[src]

impl<T, U> CastInto<U> for T where
    U: CastFrom<T>, 
[src]