[−][src]Struct qt_widgets::QCheckBox
The QCheckBox widget provides a checkbox with a text label.
C++ class: QCheckBox
.
The QCheckBox widget provides a checkbox with a text label.
A QCheckBox is an option button that can be switched on (checked) or off (unchecked). Checkboxes are typically used to represent features in an application that can be enabled or disabled without affecting others. Different types of behavior can be implemented. For example, a QButtonGroup can be used to group check buttons logically, allowing exclusive checkboxes. However, QButtonGroup does not provide any visual representation.
The image below further illustrates the differences between exclusive and non-exclusive checkboxes.
Whenever a checkbox is checked or cleared, it emits the signal stateChanged(). Connect to this signal if you want to trigger an action each time the checkbox changes state. You can use isChecked() to query whether or not a checkbox is checked.
In addition to the usual checked and unchecked states, QCheckBox optionally provides a third state to indicate "no change". This is useful whenever you need to give the user the option of neither checking nor unchecking a checkbox. If you need this third state, enable it with setTristate(), and use checkState() to query the current toggle state.
Just like QPushButton, a checkbox displays text, and optionally a small icon. The icon is set with setIcon(). The text can be set in the constructor or with setText(). A shortcut key can be specified by preceding the preferred character with an ampersand. For example:
QCheckBox *checkbox = new QCheckBox("C&ase sensitive", this);
In this example, the shortcut is Alt+A. See the QShortcut documentation for details. To display an actual ampersand, use '&&'.
Important inherited functions: text(), setText(), text(), pixmap(), setPixmap(), accel(), setAccel(), isToggleButton(), setDown(), isDown(), isOn(), checkState(), autoRepeat(), isExclusiveToggle(), group(), setAutoRepeat(), toggle(), pressed(), released(), clicked(), toggled(), checkState(), and stateChanged().
Methods
impl QCheckBox
[src]
pub fn state_changed(&self) -> Signal<(c_int,)>
[src]
This signal is emitted whenever the checkbox's state changes, i.e., whenever the user checks or unchecks it.
Returns a built-in Qt signal QCheckBox::stateChanged
that can be passed to qt_core::Signal::connect
.
This signal is emitted whenever the checkbox's state changes, i.e., whenever the user checks or unchecks it.
state contains the checkbox's new Qt::CheckState.
pub unsafe fn check_state(&self) -> CheckState
[src]
Returns the checkbox's check state. If you do not need tristate support, you can also use QAbstractButton::isChecked(), which returns a boolean.
Calls C++ function: Qt::CheckState QCheckBox::checkState() const
.
Returns the checkbox's check state. If you do not need tristate support, you can also use QAbstractButton::isChecked(), which returns a boolean.
See also setCheckState() and Qt::CheckState.
pub unsafe fn is_tristate(&self) -> bool
[src]
This property holds whether the checkbox is a tri-state checkbox
Calls C++ function: bool QCheckBox::isTristate() const
.
This property holds whether the checkbox is a tri-state checkbox
The default is false, i.e., the checkbox has only two states.
Access functions:
bool | isTristate() const |
void | setTristate(bool y = true) |
pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>
[src]
Calls C++ function: virtual const QMetaObject* QCheckBox::metaObject() const
.
pub unsafe fn minimum_size_hint(&self) -> CppBox<QSize>
[src]
Reimplemented from QWidget::minimumSizeHint().
Calls C++ function: virtual QSize QCheckBox::minimumSizeHint() const
.
Reimplemented from QWidget::minimumSizeHint().
pub unsafe fn from_q_widget(
parent: impl CastInto<MutPtr<QWidget>>
) -> CppBox<QCheckBox>
[src]
parent: impl CastInto<MutPtr<QWidget>>
) -> CppBox<QCheckBox>
Constructs a checkbox with the given parent, but with no text.
Calls C++ function: [constructor] void QCheckBox::QCheckBox(QWidget* parent = …)
.
Constructs a checkbox with the given parent, but with no text.
parent is passed on to the QAbstractButton constructor.
pub unsafe fn from_q_string_q_widget(
text: impl CastInto<Ref<QString>>,
parent: impl CastInto<MutPtr<QWidget>>
) -> CppBox<QCheckBox>
[src]
text: impl CastInto<Ref<QString>>,
parent: impl CastInto<MutPtr<QWidget>>
) -> CppBox<QCheckBox>
Constructs a checkbox with the given parent and text.
Calls C++ function: [constructor] void QCheckBox::QCheckBox(const QString& text, QWidget* parent = …)
.
Constructs a checkbox with the given parent and text.
parent is passed on to the QAbstractButton constructor.
pub unsafe fn new() -> CppBox<QCheckBox>
[src]
The QCheckBox widget provides a checkbox with a text label.
Calls C++ function: [constructor] void QCheckBox::QCheckBox()
.
The QCheckBox widget provides a checkbox with a text label.
A QCheckBox is an option button that can be switched on (checked) or off (unchecked). Checkboxes are typically used to represent features in an application that can be enabled or disabled without affecting others. Different types of behavior can be implemented. For example, a QButtonGroup can be used to group check buttons logically, allowing exclusive checkboxes. However, QButtonGroup does not provide any visual representation.
The image below further illustrates the differences between exclusive and non-exclusive checkboxes.
Whenever a checkbox is checked or cleared, it emits the signal stateChanged(). Connect to this signal if you want to trigger an action each time the checkbox changes state. You can use isChecked() to query whether or not a checkbox is checked.
In addition to the usual checked and unchecked states, QCheckBox optionally provides a third state to indicate "no change". This is useful whenever you need to give the user the option of neither checking nor unchecking a checkbox. If you need this third state, enable it with setTristate(), and use checkState() to query the current toggle state.
Just like QPushButton, a checkbox displays text, and optionally a small icon. The icon is set with setIcon(). The text can be set in the constructor or with setText(). A shortcut key can be specified by preceding the preferred character with an ampersand. For example:
QCheckBox *checkbox = new QCheckBox("C&ase sensitive", this);
In this example, the shortcut is Alt+A. See the QShortcut documentation for details. To display an actual ampersand, use '&&'.
Important inherited functions: text(), setText(), text(), pixmap(), setPixmap(), accel(), setAccel(), isToggleButton(), setDown(), isDown(), isOn(), checkState(), autoRepeat(), isExclusiveToggle(), group(), setAutoRepeat(), toggle(), pressed(), released(), clicked(), toggled(), checkState(), and stateChanged().
pub unsafe fn from_q_string(
text: impl CastInto<Ref<QString>>
) -> CppBox<QCheckBox>
[src]
text: impl CastInto<Ref<QString>>
) -> CppBox<QCheckBox>
Constructs a checkbox with the given parent and text.
Calls C++ function: [constructor] void QCheckBox::QCheckBox(const QString& text)
.
Constructs a checkbox with the given parent and text.
parent is passed on to the QAbstractButton constructor.
pub unsafe fn qt_metacall(
&mut self,
arg1: Call,
arg2: c_int,
arg3: impl CastInto<MutPtr<*mut c_void>>
) -> c_int
[src]
&mut self,
arg1: Call,
arg2: c_int,
arg3: impl CastInto<MutPtr<*mut c_void>>
) -> c_int
Calls C++ function: virtual int QCheckBox::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]
&mut self,
arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>
Calls C++ function: virtual void* QCheckBox::qt_metacast(const char* arg1)
.
pub unsafe fn set_check_state(&mut self, state: CheckState)
[src]
Sets the checkbox's check state to state. If you do not need tristate support, you can also use QAbstractButton::setChecked(), which takes a boolean.
Calls C++ function: void QCheckBox::setCheckState(Qt::CheckState state)
.
Sets the checkbox's check state to state. If you do not need tristate support, you can also use QAbstractButton::setChecked(), which takes a boolean.
See also checkState() and Qt::CheckState.
pub unsafe fn set_tristate_1a(&mut self, y: bool)
[src]
This property holds whether the checkbox is a tri-state checkbox
Calls C++ function: void QCheckBox::setTristate(bool y = …)
.
This property holds whether the checkbox is a tri-state checkbox
The default is false, i.e., the checkbox has only two states.
Access functions:
bool | isTristate() const |
void | setTristate(bool y = true) |
pub unsafe fn set_tristate_0a(&mut self)
[src]
This property holds whether the checkbox is a tri-state checkbox
Calls C++ function: void QCheckBox::setTristate()
.
This property holds whether the checkbox is a tri-state checkbox
The default is false, i.e., the checkbox has only two states.
Access functions:
bool | isTristate() const |
void | setTristate(bool y = true) |
pub unsafe fn size_hint(&self) -> CppBox<QSize>
[src]
Reimplemented from QWidget::sizeHint().
Calls C++ function: virtual QSize QCheckBox::sizeHint() const
.
Reimplemented from QWidget::sizeHint().
pub unsafe fn static_meta_object() -> Ref<QMetaObject>
[src]
Returns a reference to the staticMetaObject
field.
pub unsafe fn tr(
s: impl CastInto<Ptr<c_char>>,
c: impl CastInto<Ptr<c_char>>,
n: c_int
) -> CppBox<QString>
[src]
s: impl CastInto<Ptr<c_char>>,
c: impl CastInto<Ptr<c_char>>,
n: c_int
) -> CppBox<QString>
Calls C++ function: static QString QCheckBox::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]
s: impl CastInto<Ptr<c_char>>,
c: impl CastInto<Ptr<c_char>>,
n: c_int
) -> CppBox<QString>
Calls C++ function: static QString QCheckBox::trUtf8(const char* s, const char* c, int n)
.
Methods from Deref<Target = QAbstractButton>
pub fn slot_set_icon_size(&self) -> Receiver<(*const QSize,)>
[src]
This property holds the icon size used for this button.
Returns a built-in Qt slot QAbstractButton::setIconSize
that can be passed to qt_core::Signal::connect
.
This property holds the icon size used for this button.
The default size is defined by the GUI style. This is a maximum size for the icons. Smaller icons will not be scaled up.
Access functions:
QSize | iconSize() const |
void | setIconSize(const QSize &size) |
pub fn slot_animate_click(&self) -> Receiver<(c_int,)>
[src]
Performs an animated click: the button is pressed immediately, and released msec milliseconds later (the default is 100 ms).
Returns a built-in Qt slot QAbstractButton::animateClick
that can be passed to qt_core::Signal::connect
.
Performs an animated click: the button is pressed immediately, and released msec milliseconds later (the default is 100 ms).
Calling this function again before the button is released resets the release timer.
All signals associated with a click are emitted as appropriate.
This function does nothing if the button is disabled.
See also click().
pub fn slot_click(&self) -> Receiver<()>
[src]
Performs a click.
Returns a built-in Qt slot QAbstractButton::click
that can be passed to qt_core::Signal::connect
.
Performs a click.
All the usual signals associated with a click are emitted as appropriate. If the button is checkable, the state of the button is toggled.
This function does nothing if the button is disabled.
See also animateClick().
pub fn slot_toggle(&self) -> Receiver<()>
[src]
Toggles the state of a checkable button.
Returns a built-in Qt slot QAbstractButton::toggle
that can be passed to qt_core::Signal::connect
.
Toggles the state of a checkable button.
See also checked.
pub fn slot_set_checked(&self) -> Receiver<(bool,)>
[src]
This property holds whether the button is checked
Returns a built-in Qt slot QAbstractButton::setChecked
that can be passed to qt_core::Signal::connect
.
pub fn pressed(&self) -> Signal<()>
[src]
This signal is emitted when the button is pressed down.
Returns a built-in Qt signal QAbstractButton::pressed
that can be passed to qt_core::Signal::connect
.
pub fn released(&self) -> Signal<()>
[src]
This signal is emitted when the button is released.
Returns a built-in Qt signal QAbstractButton::released
that can be passed to qt_core::Signal::connect
.
pub fn clicked(&self) -> Signal<(bool,)>
[src]
This signal is emitted when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button), when the shortcut key is typed, or when click() or animateClick() is called. Notably, this signal is not emitted if you call setDown(), setChecked() or toggle().
Returns a built-in Qt signal QAbstractButton::clicked
that can be passed to qt_core::Signal::connect
.
This signal is emitted when the button is activated (i.e., pressed down then released while the mouse cursor is inside the button), when the shortcut key is typed, or when click() or animateClick() is called. Notably, this signal is not emitted if you call setDown(), setChecked() or toggle().
If the button is checkable, checked is true if the button is checked, or false if the button is unchecked.
pub fn toggled(&self) -> Signal<(bool,)>
[src]
This signal is emitted whenever a checkable button changes its state. checked is true if the button is checked, or false if the button is unchecked.
Returns a built-in Qt signal QAbstractButton::toggled
that can be passed to qt_core::Signal::connect
.
This signal is emitted whenever a checkable button changes its state. checked is true if the button is checked, or false if the button is unchecked.
This may be the result of a user action, click() slot activation, or because setChecked() is called.
The states of buttons in exclusive button groups are updated before this signal is emitted. This means that slots can act on either the "off" signal or the "on" signal emitted by the buttons in the group whose states have changed.
For example, a slot that reacts to signals emitted by newly checked buttons but which ignores signals from buttons that have been unchecked can be implemented using the following pattern:
void MyWidget::reactToToggle(bool checked) { if (checked) { // Examine the new button states. ... } }
Button groups can be created using the QButtonGroup class, and updates to the button states monitored with the QButtonGroup::buttonClicked() signal.
Note: Notifier signal for property checked.
pub unsafe fn animate_click_1a(&mut self, msec: c_int)
[src]
Performs an animated click: the button is pressed immediately, and released msec milliseconds later (the default is 100 ms).
Calls C++ function: [slot] void QAbstractButton::animateClick(int msec = …)
.
Performs an animated click: the button is pressed immediately, and released msec milliseconds later (the default is 100 ms).
Calling this function again before the button is released resets the release timer.
All signals associated with a click are emitted as appropriate.
This function does nothing if the button is disabled.
See also click().
pub unsafe fn animate_click_0a(&mut self)
[src]
Performs an animated click: the button is pressed immediately, and released msec milliseconds later (the default is 100 ms).
Calls C++ function: [slot] void QAbstractButton::animateClick()
.
Performs an animated click: the button is pressed immediately, and released msec milliseconds later (the default is 100 ms).
Calling this function again before the button is released resets the release timer.
All signals associated with a click are emitted as appropriate.
This function does nothing if the button is disabled.
See also click().
pub unsafe fn auto_exclusive(&self) -> bool
[src]
This property holds whether auto-exclusivity is enabled
Calls C++ function: bool QAbstractButton::autoExclusive() const
.
This property holds whether auto-exclusivity is enabled
If auto-exclusivity is enabled, checkable buttons that belong to the same parent widget behave as if they were part of the same exclusive button group. In an exclusive button group, only one button can be checked at any time; checking another button automatically unchecks the previously checked one.
The property has no effect on buttons that belong to a button group.
autoExclusive is off by default, except for radio buttons.
Access functions:
bool | autoExclusive() const |
void | setAutoExclusive(bool) |
See also QRadioButton.
pub unsafe fn auto_repeat(&self) -> bool
[src]
This property holds whether autoRepeat is enabled
Calls C++ function: bool QAbstractButton::autoRepeat() const
.
This property holds whether autoRepeat is enabled
If autoRepeat is enabled, then the pressed(), released(), and clicked() signals are emitted at regular intervals when the button is down. autoRepeat is off by default. The initial delay and the repetition interval are defined in milliseconds by autoRepeatDelay and autoRepeatInterval.
Note: If a button is pressed down by a shortcut key, then auto-repeat is enabled and timed by the system and not by this class. The pressed(), released(), and clicked() signals will be emitted like in the normal case.
Access functions:
bool | autoRepeat() const |
void | setAutoRepeat(bool) |
pub unsafe fn auto_repeat_delay(&self) -> c_int
[src]
This property holds the initial delay of auto-repetition
Calls C++ function: int QAbstractButton::autoRepeatDelay() const
.
This property holds the initial delay of auto-repetition
If autoRepeat is enabled, then autoRepeatDelay defines the initial delay in milliseconds before auto-repetition kicks in.
This property was introduced in Qt 4.2.
Access functions:
int | autoRepeatDelay() const |
void | setAutoRepeatDelay(int) |
See also autoRepeat and autoRepeatInterval.
pub unsafe fn auto_repeat_interval(&self) -> c_int
[src]
This property holds the interval of auto-repetition
Calls C++ function: int QAbstractButton::autoRepeatInterval() const
.
This property holds the interval of auto-repetition
If autoRepeat is enabled, then autoRepeatInterval defines the length of the auto-repetition interval in millisecons.
This property was introduced in Qt 4.2.
Access functions:
int | autoRepeatInterval() const |
void | setAutoRepeatInterval(int) |
See also autoRepeat and autoRepeatDelay.
pub unsafe fn click(&mut self)
[src]
Performs a click.
Calls C++ function: [slot] void QAbstractButton::click()
.
Performs a click.
All the usual signals associated with a click are emitted as appropriate. If the button is checkable, the state of the button is toggled.
This function does nothing if the button is disabled.
See also animateClick().
pub unsafe fn group(&self) -> MutPtr<QButtonGroup>
[src]
Returns the group that this button belongs to.
Calls C++ function: QButtonGroup* QAbstractButton::group() const
.
Returns the group that this button belongs to.
If the button is not a member of any QButtonGroup, this function returns 0.
See also QButtonGroup.
pub unsafe fn icon(&self) -> CppBox<QIcon>
[src]
This property holds the icon shown on the button
Calls C++ function: QIcon QAbstractButton::icon() const
.
This property holds the icon shown on the button
The icon's default size is defined by the GUI style, but can be adjusted by setting the iconSize property.
Access functions:
QIcon | icon() const |
void | setIcon(const QIcon &icon) |
pub unsafe fn icon_size(&self) -> CppBox<QSize>
[src]
This property holds the icon size used for this button.
Calls C++ function: QSize QAbstractButton::iconSize() const
.
This property holds the icon size used for this button.
The default size is defined by the GUI style. This is a maximum size for the icons. Smaller icons will not be scaled up.
Access functions:
QSize | iconSize() const |
void | setIconSize(const QSize &size) |
pub unsafe fn is_checkable(&self) -> bool
[src]
This property holds whether the button is checkable
Calls C++ function: bool QAbstractButton::isCheckable() const
.
This property holds whether the button is checkable
By default, the button is not checkable.
Access functions:
bool | isCheckable() const |
void | setCheckable(bool) |
See also checked.
pub unsafe fn is_checked(&self) -> bool
[src]
This property holds whether the button is checked
Calls C++ function: bool QAbstractButton::isChecked() const
.
pub unsafe fn is_down(&self) -> bool
[src]
This property holds whether the button is pressed down
Calls C++ function: bool QAbstractButton::isDown() const
.
pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>
[src]
Calls C++ function: virtual const QMetaObject* QAbstractButton::metaObject() const
.
pub unsafe fn qt_metacall(
&mut self,
arg1: Call,
arg2: c_int,
arg3: impl CastInto<MutPtr<*mut c_void>>
) -> c_int
[src]
&mut self,
arg1: Call,
arg2: c_int,
arg3: impl CastInto<MutPtr<*mut c_void>>
) -> c_int
Calls C++ function: virtual int QAbstractButton::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]
&mut self,
arg1: impl CastInto<Ptr<c_char>>
) -> MutPtr<c_void>
Calls C++ function: virtual void* QAbstractButton::qt_metacast(const char* arg1)
.
pub unsafe fn set_auto_exclusive(&mut self, arg1: bool)
[src]
This property holds whether auto-exclusivity is enabled
Calls C++ function: void QAbstractButton::setAutoExclusive(bool arg1)
.
This property holds whether auto-exclusivity is enabled
If auto-exclusivity is enabled, checkable buttons that belong to the same parent widget behave as if they were part of the same exclusive button group. In an exclusive button group, only one button can be checked at any time; checking another button automatically unchecks the previously checked one.
The property has no effect on buttons that belong to a button group.
autoExclusive is off by default, except for radio buttons.
Access functions:
bool | autoExclusive() const |
void | setAutoExclusive(bool) |
See also QRadioButton.
pub unsafe fn set_auto_repeat(&mut self, arg1: bool)
[src]
This property holds whether autoRepeat is enabled
Calls C++ function: void QAbstractButton::setAutoRepeat(bool arg1)
.
This property holds whether autoRepeat is enabled
If autoRepeat is enabled, then the pressed(), released(), and clicked() signals are emitted at regular intervals when the button is down. autoRepeat is off by default. The initial delay and the repetition interval are defined in milliseconds by autoRepeatDelay and autoRepeatInterval.
Note: If a button is pressed down by a shortcut key, then auto-repeat is enabled and timed by the system and not by this class. The pressed(), released(), and clicked() signals will be emitted like in the normal case.
Access functions:
bool | autoRepeat() const |
void | setAutoRepeat(bool) |
pub unsafe fn set_auto_repeat_delay(&mut self, arg1: c_int)
[src]
This property holds the initial delay of auto-repetition
Calls C++ function: void QAbstractButton::setAutoRepeatDelay(int arg1)
.
This property holds the initial delay of auto-repetition
If autoRepeat is enabled, then autoRepeatDelay defines the initial delay in milliseconds before auto-repetition kicks in.
This property was introduced in Qt 4.2.
Access functions:
int | autoRepeatDelay() const |
void | setAutoRepeatDelay(int) |
See also autoRepeat and autoRepeatInterval.
pub unsafe fn set_auto_repeat_interval(&mut self, arg1: c_int)
[src]
This property holds the interval of auto-repetition
Calls C++ function: void QAbstractButton::setAutoRepeatInterval(int arg1)
.
This property holds the interval of auto-repetition
If autoRepeat is enabled, then autoRepeatInterval defines the length of the auto-repetition interval in millisecons.
This property was introduced in Qt 4.2.
Access functions:
int | autoRepeatInterval() const |
void | setAutoRepeatInterval(int) |
See also autoRepeat and autoRepeatDelay.
pub unsafe fn set_checkable(&mut self, arg1: bool)
[src]
This property holds whether the button is checkable
Calls C++ function: void QAbstractButton::setCheckable(bool arg1)
.
This property holds whether the button is checkable
By default, the button is not checkable.
Access functions:
bool | isCheckable() const |
void | setCheckable(bool) |
See also checked.
pub unsafe fn set_checked(&mut self, arg1: bool)
[src]
This property holds whether the button is checked
Calls C++ function: [slot] void QAbstractButton::setChecked(bool arg1)
.
pub unsafe fn set_down(&mut self, arg1: bool)
[src]
This property holds whether the button is pressed down
Calls C++ function: void QAbstractButton::setDown(bool arg1)
.
pub unsafe fn set_icon(&mut self, icon: impl CastInto<Ref<QIcon>>)
[src]
This property holds the icon shown on the button
Calls C++ function: void QAbstractButton::setIcon(const QIcon& icon)
.
This property holds the icon shown on the button
The icon's default size is defined by the GUI style, but can be adjusted by setting the iconSize property.
Access functions:
QIcon | icon() const |
void | setIcon(const QIcon &icon) |
pub unsafe fn set_icon_size(&mut self, size: impl CastInto<Ref<QSize>>)
[src]
This property holds the icon size used for this button.
Calls C++ function: [slot] void QAbstractButton::setIconSize(const QSize& size)
.
This property holds the icon size used for this button.
The default size is defined by the GUI style. This is a maximum size for the icons. Smaller icons will not be scaled up.
Access functions:
QSize | iconSize() const |
void | setIconSize(const QSize &size) |
pub unsafe fn set_shortcut(&mut self, key: impl CastInto<Ref<QKeySequence>>)
[src]
This property holds the mnemonic associated with the button
Calls C++ function: void QAbstractButton::setShortcut(const QKeySequence& key)
.
This property holds the mnemonic associated with the button
Access functions:
QKeySequence | shortcut() const |
void | setShortcut(const QKeySequence &key) |
pub unsafe fn set_text(&mut self, text: impl CastInto<Ref<QString>>)
[src]
This property holds the text shown on the button
Calls C++ function: void QAbstractButton::setText(const QString& text)
.
This property holds the text shown on the button
If the button has no text, the text() function will return an empty string.
If the text contains an ampersand character ('&'), a shortcut is automatically created for it. The character that follows the '&' will be used as the shortcut key. Any previous shortcut will be overwritten or cleared if no shortcut is defined by the text. See the QShortcut documentation for details. To display an actual ampersand, use '&&'.
There is no default text.
Access functions:
QString | text() const |
void | setText(const QString &text) |
pub unsafe fn shortcut(&self) -> CppBox<QKeySequence>
[src]
This property holds the mnemonic associated with the button
Calls C++ function: QKeySequence QAbstractButton::shortcut() const
.
This property holds the mnemonic associated with the button
Access functions:
QKeySequence | shortcut() const |
void | setShortcut(const QKeySequence &key) |
pub unsafe fn text(&self) -> CppBox<QString>
[src]
This property holds the text shown on the button
Calls C++ function: QString QAbstractButton::text() const
.
This property holds the text shown on the button
If the button has no text, the text() function will return an empty string.
If the text contains an ampersand character ('&'), a shortcut is automatically created for it. The character that follows the '&' will be used as the shortcut key. Any previous shortcut will be overwritten or cleared if no shortcut is defined by the text. See the QShortcut documentation for details. To display an actual ampersand, use '&&'.
There is no default text.
Access functions:
QString | text() const |
void | setText(const QString &text) |
pub unsafe fn toggle(&mut self)
[src]
Toggles the state of a checkable button.
Calls C++ function: [slot] void QAbstractButton::toggle()
.
Toggles the state of a checkable button.
See also checked.
Trait Implementations
impl Deref for QCheckBox
[src]
type Target = QAbstractButton
The resulting type after dereferencing.
fn deref(&self) -> &QAbstractButton
[src]
Calls C++ function: QAbstractButton* static_cast<QAbstractButton*>(QCheckBox* ptr)
.
impl DerefMut for QCheckBox
[src]
fn deref_mut(&mut self) -> &mut QAbstractButton
[src]
Calls C++ function: QAbstractButton* static_cast<QAbstractButton*>(QCheckBox* ptr)
.
impl StaticUpcast<QAbstractButton> for QCheckBox
[src]
unsafe fn static_upcast(ptr: Ptr<QCheckBox>) -> Ptr<QAbstractButton>
[src]
Calls C++ function: QAbstractButton* static_cast<QAbstractButton*>(QCheckBox* ptr)
.
unsafe fn static_upcast_mut(ptr: MutPtr<QCheckBox>) -> MutPtr<QAbstractButton>
[src]
Calls C++ function: QAbstractButton* static_cast<QAbstractButton*>(QCheckBox* ptr)
.
impl StaticUpcast<QWidget> for QCheckBox
[src]
unsafe fn static_upcast(ptr: Ptr<QCheckBox>) -> Ptr<QWidget>
[src]
Calls C++ function: QWidget* static_cast<QWidget*>(QCheckBox* ptr)
.
unsafe fn static_upcast_mut(ptr: MutPtr<QCheckBox>) -> MutPtr<QWidget>
[src]
Calls C++ function: QWidget* static_cast<QWidget*>(QCheckBox* ptr)
.
impl StaticUpcast<QObject> for QCheckBox
[src]
unsafe fn static_upcast(ptr: Ptr<QCheckBox>) -> Ptr<QObject>
[src]
Calls C++ function: QObject* static_cast<QObject*>(QCheckBox* ptr)
.
unsafe fn static_upcast_mut(ptr: MutPtr<QCheckBox>) -> MutPtr<QObject>
[src]
Calls C++ function: QObject* static_cast<QObject*>(QCheckBox* ptr)
.
impl StaticUpcast<QPaintDevice> for QCheckBox
[src]
unsafe fn static_upcast(ptr: Ptr<QCheckBox>) -> Ptr<QPaintDevice>
[src]
Calls C++ function: QPaintDevice* static_cast<QPaintDevice*>(QCheckBox* ptr)
.
unsafe fn static_upcast_mut(ptr: MutPtr<QCheckBox>) -> MutPtr<QPaintDevice>
[src]
Calls C++ function: QPaintDevice* static_cast<QPaintDevice*>(QCheckBox* ptr)
.
impl StaticDowncast<QCheckBox> for QAbstractButton
[src]
unsafe fn static_downcast(ptr: Ptr<QAbstractButton>) -> Ptr<QCheckBox>
[src]
Calls C++ function: QCheckBox* static_cast<QCheckBox*>(QAbstractButton* ptr)
.
unsafe fn static_downcast_mut(ptr: MutPtr<QAbstractButton>) -> MutPtr<QCheckBox>
[src]
Calls C++ function: QCheckBox* static_cast<QCheckBox*>(QAbstractButton* ptr)
.
impl StaticDowncast<QCheckBox> for QWidget
[src]
unsafe fn static_downcast(ptr: Ptr<QWidget>) -> Ptr<QCheckBox>
[src]
Calls C++ function: QCheckBox* static_cast<QCheckBox*>(QWidget* ptr)
.
unsafe fn static_downcast_mut(ptr: MutPtr<QWidget>) -> MutPtr<QCheckBox>
[src]
Calls C++ function: QCheckBox* static_cast<QCheckBox*>(QWidget* ptr)
.
impl StaticDowncast<QCheckBox> for QObject
[src]
unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QCheckBox>
[src]
Calls C++ function: QCheckBox* static_cast<QCheckBox*>(QObject* ptr)
.
unsafe fn static_downcast_mut(ptr: MutPtr<QObject>) -> MutPtr<QCheckBox>
[src]
Calls C++ function: QCheckBox* static_cast<QCheckBox*>(QObject* ptr)
.
impl StaticDowncast<QCheckBox> for QPaintDevice
[src]
unsafe fn static_downcast(ptr: Ptr<QPaintDevice>) -> Ptr<QCheckBox>
[src]
Calls C++ function: QCheckBox* static_cast<QCheckBox*>(QPaintDevice* ptr)
.
unsafe fn static_downcast_mut(ptr: MutPtr<QPaintDevice>) -> MutPtr<QCheckBox>
[src]
Calls C++ function: QCheckBox* static_cast<QCheckBox*>(QPaintDevice* ptr)
.
impl DynamicCast<QCheckBox> for QAbstractButton
[src]
unsafe fn dynamic_cast(ptr: Ptr<QAbstractButton>) -> Ptr<QCheckBox>
[src]
Calls C++ function: QCheckBox* dynamic_cast<QCheckBox*>(QAbstractButton* ptr)
.
unsafe fn dynamic_cast_mut(ptr: MutPtr<QAbstractButton>) -> MutPtr<QCheckBox>
[src]
Calls C++ function: QCheckBox* dynamic_cast<QCheckBox*>(QAbstractButton* ptr)
.
impl DynamicCast<QCheckBox> for QWidget
[src]
unsafe fn dynamic_cast(ptr: Ptr<QWidget>) -> Ptr<QCheckBox>
[src]
Calls C++ function: QCheckBox* dynamic_cast<QCheckBox*>(QWidget* ptr)
.
unsafe fn dynamic_cast_mut(ptr: MutPtr<QWidget>) -> MutPtr<QCheckBox>
[src]
Calls C++ function: QCheckBox* dynamic_cast<QCheckBox*>(QWidget* ptr)
.
impl DynamicCast<QCheckBox> for QObject
[src]
unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QCheckBox>
[src]
Calls C++ function: QCheckBox* dynamic_cast<QCheckBox*>(QObject* ptr)
.
unsafe fn dynamic_cast_mut(ptr: MutPtr<QObject>) -> MutPtr<QCheckBox>
[src]
Calls C++ function: QCheckBox* dynamic_cast<QCheckBox*>(QObject* ptr)
.
impl DynamicCast<QCheckBox> for QPaintDevice
[src]
unsafe fn dynamic_cast(ptr: Ptr<QPaintDevice>) -> Ptr<QCheckBox>
[src]
Calls C++ function: QCheckBox* dynamic_cast<QCheckBox*>(QPaintDevice* ptr)
.
unsafe fn dynamic_cast_mut(ptr: MutPtr<QPaintDevice>) -> MutPtr<QCheckBox>
[src]
Calls C++ function: QCheckBox* dynamic_cast<QCheckBox*>(QPaintDevice* ptr)
.
impl CppDeletable for QCheckBox
[src]
Auto Trait Implementations
impl Send for QCheckBox
impl Sync for QCheckBox
impl Unpin for QCheckBox
impl RefUnwindSafe for QCheckBox
impl UnwindSafe for QCheckBox
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> StaticUpcast<T> for T
[src]
unsafe fn static_upcast(ptr: Ptr<T>) -> Ptr<T>
[src]
unsafe fn static_upcast_mut(ptr: MutPtr<T>) -> MutPtr<T>
[src]
impl<T, U> CastInto<U> for T where
U: CastFrom<T>,
[src]
U: CastFrom<T>,