[−][src]Struct qt_widgets::QScrollBar
The QScrollBar widget provides a vertical or horizontal scroll bar.
C++ class: QScrollBar
.
The QScrollBar widget provides a vertical or horizontal scroll bar.
A scroll bar is a control that enables the user to access parts of a document that is larger than the widget used to display it. It provides a visual indication of the user's current position within the document and the amount of the document that is visible. Scroll bars are usually equipped with other controls that enable more accurate navigation. Qt displays scroll bars in a way that is appropriate for each platform.
If you need to provide a scrolling view onto another widget, it may be more convenient to use the QScrollArea class because this provides a viewport widget and scroll bars. QScrollBar is useful if you need to implement similar functionality for specialized widgets using QAbstractScrollArea; for example, if you decide to subclass QAbstractItemView. For most other situations where a slider control is used to obtain a value within a given range, the QSlider class may be more appropriate for your needs.
Scroll bars typically include four separate controls: a slider, scroll arrows, and a page control.
|
Each scroll bar has a value that indicates how far the slider is from the start of the scroll bar; this is obtained with value() and set with setValue(). This value always lies within the range of values defined for the scroll bar, from minimum() to maximum() inclusive. The range of acceptable values can be set with setMinimum() and setMaximum(). At the minimum value, the top edge of the slider (for a vertical scroll bar) or left edge (for a horizontal scroll bar) will be at the top (or left) end of the scroll bar. At the maximum value, the bottom (or right) edge of the slider will be at the bottom (or right) end of the scroll bar.
The length of the slider is usually related to the value of the page step, and typically represents the proportion of the document area shown in a scrolling view. The page step is the amount that the value changes by when the user presses the Page Up and Page Down keys, and is set with setPageStep(). Smaller changes to the value defined by the line step are made using the cursor keys, and this quantity is set with setSingleStep().
Note that the range of values used is independent of the actual size of the scroll bar widget. You do not need to take this into account when you choose values for the range and the page step.
The range of values specified for the scroll bar are often determined differently to those for a QSlider because the length of the slider needs to be taken into account. If we have a document with 100 lines, and we can only show 20 lines in a widget, we may wish to construct a scroll bar with a page step of 20, a minimum value of 0, and a maximum value of 80. This would give us a scroll bar with five "pages".
The relationship between a document length, the range of values used in a scroll bar, and the page step is simple in many common situations. The scroll bar's range of values is determined by subtracting a chosen page step from some value representing the length of the document. In such cases, the following equation is useful: document length = maximum() - minimum() + pageStep(). |
QScrollBar only provides integer ranges. Note that although QScrollBar handles very large numbers, scroll bars on current screens cannot usefully represent ranges above about 100,000 pixels. Beyond that, it becomes difficult for the user to control the slider using either the keyboard or the mouse, and the scroll arrows will have limited use.
ScrollBar inherits a comprehensive set of signals from QAbstractSlider:
- valueChanged() is emitted when the scroll bar's value has changed. The tracking() determines whether this signal is emitted during user interaction.
- rangeChanged() is emitted when the scroll bar's range of values has changed.
- sliderPressed() is emitted when the user starts to drag the slider.
- sliderMoved() is emitted when the user drags the slider.
- sliderReleased() is emitted when the user releases the slider.
- actionTriggered() is emitted when the scroll bar is changed by user interaction or via the triggerAction() function.
A scroll bar can be controlled by the keyboard, but it has a default focusPolicy() of Qt::NoFocus. Use setFocusPolicy() to enable keyboard interaction with the scroll bar:
- Left/Right move a horizontal scroll bar by one single step.
- Up/Down move a vertical scroll bar by one single step.
- PageUp moves up one page.
- PageDown moves down one page.
- Home moves to the start (mininum).
- End moves to the end (maximum).
The slider itself can be controlled by using the triggerAction() function to simulate user interaction with the scroll bar controls. This is useful if you have many different widgets that use a common range of values.
Most GUI styles use the pageStep() value to calculate the size of the slider.
Methods
impl QScrollBar
[src]
pub unsafe fn event(&mut self, event: impl CastInto<MutPtr<QEvent>>) -> bool
[src]
Reimplemented from QObject::event().
Calls C++ function: virtual bool QScrollBar::event(QEvent* event)
.
Reimplemented from QObject::event().
pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>
[src]
Calls C++ function: virtual const QMetaObject* QScrollBar::metaObject() const
.
pub unsafe fn from_q_widget(
parent: impl CastInto<MutPtr<QWidget>>
) -> CppBox<QScrollBar>
[src]
parent: impl CastInto<MutPtr<QWidget>>
) -> CppBox<QScrollBar>
Constructs a vertical scroll bar.
Calls C++ function: [constructor] void QScrollBar::QScrollBar(QWidget* parent = …)
.
pub unsafe fn from_orientation_q_widget(
arg1: Orientation,
parent: impl CastInto<MutPtr<QWidget>>
) -> CppBox<QScrollBar>
[src]
arg1: Orientation,
parent: impl CastInto<MutPtr<QWidget>>
) -> CppBox<QScrollBar>
Constructs a scroll bar with the given orientation.
Calls C++ function: [constructor] void QScrollBar::QScrollBar(Qt::Orientation arg1, QWidget* parent = …)
.
pub unsafe fn new() -> CppBox<QScrollBar>
[src]
The QScrollBar widget provides a vertical or horizontal scroll bar.
Calls C++ function: [constructor] void QScrollBar::QScrollBar()
.
The QScrollBar widget provides a vertical or horizontal scroll bar.
A scroll bar is a control that enables the user to access parts of a document that is larger than the widget used to display it. It provides a visual indication of the user's current position within the document and the amount of the document that is visible. Scroll bars are usually equipped with other controls that enable more accurate navigation. Qt displays scroll bars in a way that is appropriate for each platform.
If you need to provide a scrolling view onto another widget, it may be more convenient to use the QScrollArea class because this provides a viewport widget and scroll bars. QScrollBar is useful if you need to implement similar functionality for specialized widgets using QAbstractScrollArea; for example, if you decide to subclass QAbstractItemView. For most other situations where a slider control is used to obtain a value within a given range, the QSlider class may be more appropriate for your needs.
Scroll bars typically include four separate controls: a slider, scroll arrows, and a page control.
|
Each scroll bar has a value that indicates how far the slider is from the start of the scroll bar; this is obtained with value() and set with setValue(). This value always lies within the range of values defined for the scroll bar, from minimum() to maximum() inclusive. The range of acceptable values can be set with setMinimum() and setMaximum(). At the minimum value, the top edge of the slider (for a vertical scroll bar) or left edge (for a horizontal scroll bar) will be at the top (or left) end of the scroll bar. At the maximum value, the bottom (or right) edge of the slider will be at the bottom (or right) end of the scroll bar.
The length of the slider is usually related to the value of the page step, and typically represents the proportion of the document area shown in a scrolling view. The page step is the amount that the value changes by when the user presses the Page Up and Page Down keys, and is set with setPageStep(). Smaller changes to the value defined by the line step are made using the cursor keys, and this quantity is set with setSingleStep().
Note that the range of values used is independent of the actual size of the scroll bar widget. You do not need to take this into account when you choose values for the range and the page step.
The range of values specified for the scroll bar are often determined differently to those for a QSlider because the length of the slider needs to be taken into account. If we have a document with 100 lines, and we can only show 20 lines in a widget, we may wish to construct a scroll bar with a page step of 20, a minimum value of 0, and a maximum value of 80. This would give us a scroll bar with five "pages".
The relationship between a document length, the range of values used in a scroll bar, and the page step is simple in many common situations. The scroll bar's range of values is determined by subtracting a chosen page step from some value representing the length of the document. In such cases, the following equation is useful: document length = maximum() - minimum() + pageStep(). |
QScrollBar only provides integer ranges. Note that although QScrollBar handles very large numbers, scroll bars on current screens cannot usefully represent ranges above about 100,000 pixels. Beyond that, it becomes difficult for the user to control the slider using either the keyboard or the mouse, and the scroll arrows will have limited use.
ScrollBar inherits a comprehensive set of signals from QAbstractSlider:
- valueChanged() is emitted when the scroll bar's value has changed. The tracking() determines whether this signal is emitted during user interaction.
- rangeChanged() is emitted when the scroll bar's range of values has changed.
- sliderPressed() is emitted when the user starts to drag the slider.
- sliderMoved() is emitted when the user drags the slider.
- sliderReleased() is emitted when the user releases the slider.
- actionTriggered() is emitted when the scroll bar is changed by user interaction or via the triggerAction() function.
A scroll bar can be controlled by the keyboard, but it has a default focusPolicy() of Qt::NoFocus. Use setFocusPolicy() to enable keyboard interaction with the scroll bar:
- Left/Right move a horizontal scroll bar by one single step.
- Up/Down move a vertical scroll bar by one single step.
- PageUp moves up one page.
- PageDown moves down one page.
- Home moves to the start (mininum).
- End moves to the end (maximum).
The slider itself can be controlled by using the triggerAction() function to simulate user interaction with the scroll bar controls. This is useful if you have many different widgets that use a common range of values.
Most GUI styles use the pageStep() value to calculate the size of the slider.
pub unsafe fn from_orientation(arg1: Orientation) -> CppBox<QScrollBar>
[src]
Constructs a scroll bar with the given orientation.
Calls C++ function: [constructor] void QScrollBar::QScrollBar(Qt::Orientation arg1)
.
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 QScrollBar::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* QScrollBar::qt_metacast(const char* arg1)
.
pub unsafe fn size_hint(&self) -> CppBox<QSize>
[src]
Reimplemented from QWidget::sizeHint().
Calls C++ function: virtual QSize QScrollBar::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 QScrollBar::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 QScrollBar::trUtf8(const char* s, const char* c, int n)
.
Methods from Deref<Target = QAbstractSlider>
pub fn slot_set_value(&self) -> Receiver<(c_int,)>
[src]
This property holds the slider's current value
Returns a built-in Qt slot QAbstractSlider::setValue
that can be passed to qt_core::Signal::connect
.
This property holds the slider's current value
The slider forces the value to be within the legal range: minimum <= value
<= maximum.
Changing the value also changes the sliderPosition.
Access functions:
int | value() const |
void | setValue(int) |
Notifier signal:
void | valueChanged(int value) |
pub fn slot_set_orientation(&self) -> Receiver<(Orientation,)>
[src]
This property holds the orientation of the slider
Returns a built-in Qt slot QAbstractSlider::setOrientation
that can be passed to qt_core::Signal::connect
.
This property holds the orientation of the slider
The orientation must be Qt::Vertical (the default) or Qt::Horizontal.
Access functions:
Qt::Orientation | orientation() const |
void | setOrientation(Qt::Orientation) |
pub fn slot_set_range(&self) -> Receiver<(c_int, c_int)>
[src]
Sets the slider's minimum to min and its maximum to max.
Returns a built-in Qt slot QAbstractSlider::setRange
that can be passed to qt_core::Signal::connect
.
pub fn value_changed(&self) -> Signal<(c_int,)>
[src]
This signal is emitted when the slider value has changed, with the new slider value as argument.
Returns a built-in Qt signal QAbstractSlider::valueChanged
that can be passed to qt_core::Signal::connect
.
This signal is emitted when the slider value has changed, with the new slider value as argument.
Note: Notifier signal for property value.
pub fn slider_pressed(&self) -> Signal<()>
[src]
This signal is emitted when the user presses the slider with the mouse, or programmatically when setSliderDown(true) is called.
Returns a built-in Qt signal QAbstractSlider::sliderPressed
that can be passed to qt_core::Signal::connect
.
This signal is emitted when the user presses the slider with the mouse, or programmatically when setSliderDown(true) is called.
See also sliderReleased(), sliderMoved(), and isSliderDown().
pub fn slider_moved(&self) -> Signal<(c_int,)>
[src]
This signal is emitted when sliderDown is true and the slider moves. This usually happens when the user is dragging the slider. The value is the new slider position.
Returns a built-in Qt signal QAbstractSlider::sliderMoved
that can be passed to qt_core::Signal::connect
.
This signal is emitted when sliderDown is true and the slider moves. This usually happens when the user is dragging the slider. The value is the new slider position.
This signal is emitted even when tracking is turned off.
Note: Notifier signal for property sliderPosition.
See also setTracking(), valueChanged(), isSliderDown(), sliderPressed(), and sliderReleased().
pub fn slider_released(&self) -> Signal<()>
[src]
This signal is emitted when the user releases the slider with the mouse, or programmatically when setSliderDown(false) is called.
Returns a built-in Qt signal QAbstractSlider::sliderReleased
that can be passed to qt_core::Signal::connect
.
This signal is emitted when the user releases the slider with the mouse, or programmatically when setSliderDown(false) is called.
See also sliderPressed(), sliderMoved(), and sliderDown.
pub fn range_changed(&self) -> Signal<(c_int, c_int)>
[src]
This signal is emitted when the slider range has changed, with min being the new minimum, and max being the new maximum.
Returns a built-in Qt signal QAbstractSlider::rangeChanged
that can be passed to qt_core::Signal::connect
.
pub fn action_triggered(&self) -> Signal<(c_int,)>
[src]
This signal is emitted when the slider action action is triggered. Actions are SliderSingleStepAdd, SliderSingleStepSub, SliderPageStepAdd, SliderPageStepSub, SliderToMinimum, SliderToMaximum, and SliderMove.
Returns a built-in Qt signal QAbstractSlider::actionTriggered
that can be passed to qt_core::Signal::connect
.
This signal is emitted when the slider action action is triggered. Actions are SliderSingleStepAdd, SliderSingleStepSub, SliderPageStepAdd, SliderPageStepSub, SliderToMinimum, SliderToMaximum, and SliderMove.
When the signal is emitted, the sliderPosition has been adjusted according to the action, but the value has not yet been propagated (meaning the valueChanged() signal was not yet emitted), and the visual display has not been updated. In slots connected to this signal you can thus safely adjust any action by calling setSliderPosition() yourself, based on both the action and the slider's value.
See also triggerAction().
pub unsafe fn has_tracking(&self) -> bool
[src]
This property holds whether slider tracking is enabled
Calls C++ function: bool QAbstractSlider::hasTracking() const
.
This property holds whether slider tracking is enabled
If tracking is enabled (the default), the slider emits the valueChanged() signal while the slider is being dragged. If tracking is disabled, the slider emits the valueChanged() signal only when the user releases the slider.
Access functions:
bool | hasTracking() const |
void | setTracking(bool enable) |
See also sliderDown.
pub unsafe fn inverted_appearance(&self) -> bool
[src]
This property holds whether or not a slider shows its values inverted.
Calls C++ function: bool QAbstractSlider::invertedAppearance() const
.
This property holds whether or not a slider shows its values inverted.
If this property is false
(the default), the minimum and maximum will be shown in its classic position for the inherited widget. If the value is true, the minimum and maximum appear at their opposite location.
Note: This property makes most sense for sliders and dials. For scroll bars, the visual effect of the scroll bar subcontrols depends on whether or not the styles understand inverted appearance; most styles ignore this property for scroll bars.
Access functions:
bool | invertedAppearance() const |
void | setInvertedAppearance(bool) |
pub unsafe fn inverted_controls(&self) -> bool
[src]
This property holds whether or not the slider inverts its wheel and key events.
Calls C++ function: bool QAbstractSlider::invertedControls() const
.
This property holds whether or not the slider 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 slider's value towards its maximum. Otherwise pressing page up will move value towards the slider's minimum.
Access functions:
bool | invertedControls() const |
void | setInvertedControls(bool) |
pub unsafe fn is_slider_down(&self) -> bool
[src]
This property holds whether the slider is pressed down.
Calls C++ function: bool QAbstractSlider::isSliderDown() const
.
This property holds whether the slider is pressed down.
The property is set by subclasses in order to let the abstract slider know whether or not tracking has any effect.
Changing the slider down property emits the sliderPressed() and sliderReleased() signals.
Access functions:
bool | isSliderDown() const |
void | setSliderDown(bool) |
pub unsafe fn maximum(&self) -> c_int
[src]
This property holds the slider's maximum value
Calls C++ function: int QAbstractSlider::maximum() const
.
This property holds the slider's maximum value
When setting this property, the minimum is adjusted if necessary to ensure that the range remains valid. Also the slider's current value is adjusted to be within the new range.
Access functions:
int | maximum() const |
void | setMaximum(int) |
pub unsafe fn meta_object(&self) -> Ptr<QMetaObject>
[src]
Calls C++ function: virtual const QMetaObject* QAbstractSlider::metaObject() const
.
pub unsafe fn minimum(&self) -> c_int
[src]
This property holds the sliders's minimum value
Calls C++ function: int QAbstractSlider::minimum() const
.
This property holds the sliders's minimum value
When setting this property, the maximum is adjusted if necessary to ensure that the range remains valid. Also the slider's current value is adjusted to be within the new range.
Access functions:
int | minimum() const |
void | setMinimum(int) |
pub unsafe fn orientation(&self) -> Orientation
[src]
This property holds the orientation of the slider
Calls C++ function: Qt::Orientation QAbstractSlider::orientation() const
.
This property holds the orientation of the slider
The orientation must be Qt::Vertical (the default) or Qt::Horizontal.
Access functions:
Qt::Orientation | orientation() const |
void | setOrientation(Qt::Orientation) |
pub unsafe fn page_step(&self) -> c_int
[src]
This property holds the page step.
Calls C++ function: int QAbstractSlider::pageStep() const
.
This property holds the page step.
The larger of two natural steps that an abstract slider provides and typically corresponds to the user pressing PageUp or PageDown.
Access functions:
int | pageStep() const |
void | setPageStep(int) |
See also singleStep.
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 QAbstractSlider::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* QAbstractSlider::qt_metacast(const char* arg1)
.
pub unsafe fn set_inverted_appearance(&mut self, arg1: bool)
[src]
This property holds whether or not a slider shows its values inverted.
Calls C++ function: void QAbstractSlider::setInvertedAppearance(bool arg1)
.
This property holds whether or not a slider shows its values inverted.
If this property is false
(the default), the minimum and maximum will be shown in its classic position for the inherited widget. If the value is true, the minimum and maximum appear at their opposite location.
Note: This property makes most sense for sliders and dials. For scroll bars, the visual effect of the scroll bar subcontrols depends on whether or not the styles understand inverted appearance; most styles ignore this property for scroll bars.
Access functions:
bool | invertedAppearance() const |
void | setInvertedAppearance(bool) |
pub unsafe fn set_inverted_controls(&mut self, arg1: bool)
[src]
This property holds whether or not the slider inverts its wheel and key events.
Calls C++ function: void QAbstractSlider::setInvertedControls(bool arg1)
.
This property holds whether or not the slider 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 slider's value towards its maximum. Otherwise pressing page up will move value towards the slider's minimum.
Access functions:
bool | invertedControls() const |
void | setInvertedControls(bool) |
pub unsafe fn set_maximum(&mut self, arg1: c_int)
[src]
This property holds the slider's maximum value
Calls C++ function: void QAbstractSlider::setMaximum(int arg1)
.
This property holds the slider's maximum value
When setting this property, the minimum is adjusted if necessary to ensure that the range remains valid. Also the slider's current value is adjusted to be within the new range.
Access functions:
int | maximum() const |
void | setMaximum(int) |
pub unsafe fn set_minimum(&mut self, arg1: c_int)
[src]
This property holds the sliders's minimum value
Calls C++ function: void QAbstractSlider::setMinimum(int arg1)
.
This property holds the sliders's minimum value
When setting this property, the maximum is adjusted if necessary to ensure that the range remains valid. Also the slider's current value is adjusted to be within the new range.
Access functions:
int | minimum() const |
void | setMinimum(int) |
pub unsafe fn set_orientation(&mut self, arg1: Orientation)
[src]
This property holds the orientation of the slider
Calls C++ function: [slot] void QAbstractSlider::setOrientation(Qt::Orientation arg1)
.
This property holds the orientation of the slider
The orientation must be Qt::Vertical (the default) or Qt::Horizontal.
Access functions:
Qt::Orientation | orientation() const |
void | setOrientation(Qt::Orientation) |
pub unsafe fn set_page_step(&mut self, arg1: c_int)
[src]
This property holds the page step.
Calls C++ function: void QAbstractSlider::setPageStep(int arg1)
.
This property holds the page step.
The larger of two natural steps that an abstract slider provides and typically corresponds to the user pressing PageUp or PageDown.
Access functions:
int | pageStep() const |
void | setPageStep(int) |
See also singleStep.
pub unsafe fn set_range(&mut self, min: c_int, max: c_int)
[src]
Sets the slider's minimum to min and its maximum to max.
Calls C++ function: [slot] void QAbstractSlider::setRange(int min, int max)
.
pub unsafe fn set_single_step(&mut self, arg1: c_int)
[src]
This property holds the single step.
Calls C++ function: void QAbstractSlider::setSingleStep(int arg1)
.
This property holds the single step.
The smaller of two natural steps that an abstract sliders provides and typically corresponds to the user pressing an arrow key.
If the property is modified during an auto repeating key event, behavior is undefined.
Access functions:
int | singleStep() const |
void | setSingleStep(int) |
See also pageStep.
pub unsafe fn set_slider_down(&mut self, arg1: bool)
[src]
This property holds whether the slider is pressed down.
Calls C++ function: void QAbstractSlider::setSliderDown(bool arg1)
.
This property holds whether the slider is pressed down.
The property is set by subclasses in order to let the abstract slider know whether or not tracking has any effect.
Changing the slider down property emits the sliderPressed() and sliderReleased() signals.
Access functions:
bool | isSliderDown() const |
void | setSliderDown(bool) |
pub unsafe fn set_slider_position(&mut self, arg1: c_int)
[src]
This property holds the current slider position
Calls C++ function: void QAbstractSlider::setSliderPosition(int arg1)
.
This property holds the current slider position
If tracking is enabled (the default), this is identical to value.
Access functions:
int | sliderPosition() const |
void | setSliderPosition(int) |
Notifier signal:
void | sliderMoved(int value) |
pub unsafe fn set_tracking(&mut self, enable: bool)
[src]
This property holds whether slider tracking is enabled
Calls C++ function: void QAbstractSlider::setTracking(bool enable)
.
This property holds whether slider tracking is enabled
If tracking is enabled (the default), the slider emits the valueChanged() signal while the slider is being dragged. If tracking is disabled, the slider emits the valueChanged() signal only when the user releases the slider.
Access functions:
bool | hasTracking() const |
void | setTracking(bool enable) |
See also sliderDown.
pub unsafe fn set_value(&mut self, arg1: c_int)
[src]
This property holds the slider's current value
Calls C++ function: [slot] void QAbstractSlider::setValue(int arg1)
.
This property holds the slider's current value
The slider forces the value to be within the legal range: minimum <= value
<= maximum.
Changing the value also changes the sliderPosition.
Access functions:
int | value() const |
void | setValue(int) |
Notifier signal:
void | valueChanged(int value) |
pub unsafe fn single_step(&self) -> c_int
[src]
This property holds the single step.
Calls C++ function: int QAbstractSlider::singleStep() const
.
This property holds the single step.
The smaller of two natural steps that an abstract sliders provides and typically corresponds to the user pressing an arrow key.
If the property is modified during an auto repeating key event, behavior is undefined.
Access functions:
int | singleStep() const |
void | setSingleStep(int) |
See also pageStep.
pub unsafe fn slider_position(&self) -> c_int
[src]
This property holds the current slider position
Calls C++ function: int QAbstractSlider::sliderPosition() const
.
This property holds the current slider position
If tracking is enabled (the default), this is identical to value.
Access functions:
int | sliderPosition() const |
void | setSliderPosition(int) |
Notifier signal:
void | sliderMoved(int value) |
pub unsafe fn trigger_action(&mut self, action: SliderAction)
[src]
Triggers a slider action. Possible actions are SliderSingleStepAdd, SliderSingleStepSub, SliderPageStepAdd, SliderPageStepSub, SliderToMinimum, SliderToMaximum, and SliderMove.
Calls C++ function: void QAbstractSlider::triggerAction(QAbstractSlider::SliderAction action)
.
Triggers a slider action. Possible actions are SliderSingleStepAdd, SliderSingleStepSub, SliderPageStepAdd, SliderPageStepSub, SliderToMinimum, SliderToMaximum, and SliderMove.
See also actionTriggered().
pub unsafe fn value(&self) -> c_int
[src]
This property holds the slider's current value
Calls C++ function: int QAbstractSlider::value() const
.
This property holds the slider's current value
The slider forces the value to be within the legal range: minimum <= value
<= maximum.
Changing the value also changes the sliderPosition.
Access functions:
int | value() const |
void | setValue(int) |
Notifier signal:
void | valueChanged(int value) |
Trait Implementations
impl Deref for QScrollBar
[src]
type Target = QAbstractSlider
The resulting type after dereferencing.
fn deref(&self) -> &QAbstractSlider
[src]
Calls C++ function: QAbstractSlider* static_cast<QAbstractSlider*>(QScrollBar* ptr)
.
impl DerefMut for QScrollBar
[src]
fn deref_mut(&mut self) -> &mut QAbstractSlider
[src]
Calls C++ function: QAbstractSlider* static_cast<QAbstractSlider*>(QScrollBar* ptr)
.
impl StaticUpcast<QAbstractSlider> for QScrollBar
[src]
unsafe fn static_upcast(ptr: Ptr<QScrollBar>) -> Ptr<QAbstractSlider>
[src]
Calls C++ function: QAbstractSlider* static_cast<QAbstractSlider*>(QScrollBar* ptr)
.
unsafe fn static_upcast_mut(ptr: MutPtr<QScrollBar>) -> MutPtr<QAbstractSlider>
[src]
Calls C++ function: QAbstractSlider* static_cast<QAbstractSlider*>(QScrollBar* ptr)
.
impl StaticUpcast<QWidget> for QScrollBar
[src]
unsafe fn static_upcast(ptr: Ptr<QScrollBar>) -> Ptr<QWidget>
[src]
Calls C++ function: QWidget* static_cast<QWidget*>(QScrollBar* ptr)
.
unsafe fn static_upcast_mut(ptr: MutPtr<QScrollBar>) -> MutPtr<QWidget>
[src]
Calls C++ function: QWidget* static_cast<QWidget*>(QScrollBar* ptr)
.
impl StaticUpcast<QObject> for QScrollBar
[src]
unsafe fn static_upcast(ptr: Ptr<QScrollBar>) -> Ptr<QObject>
[src]
Calls C++ function: QObject* static_cast<QObject*>(QScrollBar* ptr)
.
unsafe fn static_upcast_mut(ptr: MutPtr<QScrollBar>) -> MutPtr<QObject>
[src]
Calls C++ function: QObject* static_cast<QObject*>(QScrollBar* ptr)
.
impl StaticUpcast<QPaintDevice> for QScrollBar
[src]
unsafe fn static_upcast(ptr: Ptr<QScrollBar>) -> Ptr<QPaintDevice>
[src]
Calls C++ function: QPaintDevice* static_cast<QPaintDevice*>(QScrollBar* ptr)
.
unsafe fn static_upcast_mut(ptr: MutPtr<QScrollBar>) -> MutPtr<QPaintDevice>
[src]
Calls C++ function: QPaintDevice* static_cast<QPaintDevice*>(QScrollBar* ptr)
.
impl StaticDowncast<QScrollBar> for QAbstractSlider
[src]
unsafe fn static_downcast(ptr: Ptr<QAbstractSlider>) -> Ptr<QScrollBar>
[src]
Calls C++ function: QScrollBar* static_cast<QScrollBar*>(QAbstractSlider* ptr)
.
unsafe fn static_downcast_mut(
ptr: MutPtr<QAbstractSlider>
) -> MutPtr<QScrollBar>
[src]
ptr: MutPtr<QAbstractSlider>
) -> MutPtr<QScrollBar>
Calls C++ function: QScrollBar* static_cast<QScrollBar*>(QAbstractSlider* ptr)
.
impl StaticDowncast<QScrollBar> for QWidget
[src]
unsafe fn static_downcast(ptr: Ptr<QWidget>) -> Ptr<QScrollBar>
[src]
Calls C++ function: QScrollBar* static_cast<QScrollBar*>(QWidget* ptr)
.
unsafe fn static_downcast_mut(ptr: MutPtr<QWidget>) -> MutPtr<QScrollBar>
[src]
Calls C++ function: QScrollBar* static_cast<QScrollBar*>(QWidget* ptr)
.
impl StaticDowncast<QScrollBar> for QObject
[src]
unsafe fn static_downcast(ptr: Ptr<QObject>) -> Ptr<QScrollBar>
[src]
Calls C++ function: QScrollBar* static_cast<QScrollBar*>(QObject* ptr)
.
unsafe fn static_downcast_mut(ptr: MutPtr<QObject>) -> MutPtr<QScrollBar>
[src]
Calls C++ function: QScrollBar* static_cast<QScrollBar*>(QObject* ptr)
.
impl StaticDowncast<QScrollBar> for QPaintDevice
[src]
unsafe fn static_downcast(ptr: Ptr<QPaintDevice>) -> Ptr<QScrollBar>
[src]
Calls C++ function: QScrollBar* static_cast<QScrollBar*>(QPaintDevice* ptr)
.
unsafe fn static_downcast_mut(ptr: MutPtr<QPaintDevice>) -> MutPtr<QScrollBar>
[src]
Calls C++ function: QScrollBar* static_cast<QScrollBar*>(QPaintDevice* ptr)
.
impl DynamicCast<QScrollBar> for QAbstractSlider
[src]
unsafe fn dynamic_cast(ptr: Ptr<QAbstractSlider>) -> Ptr<QScrollBar>
[src]
Calls C++ function: QScrollBar* dynamic_cast<QScrollBar*>(QAbstractSlider* ptr)
.
unsafe fn dynamic_cast_mut(ptr: MutPtr<QAbstractSlider>) -> MutPtr<QScrollBar>
[src]
Calls C++ function: QScrollBar* dynamic_cast<QScrollBar*>(QAbstractSlider* ptr)
.
impl DynamicCast<QScrollBar> for QWidget
[src]
unsafe fn dynamic_cast(ptr: Ptr<QWidget>) -> Ptr<QScrollBar>
[src]
Calls C++ function: QScrollBar* dynamic_cast<QScrollBar*>(QWidget* ptr)
.
unsafe fn dynamic_cast_mut(ptr: MutPtr<QWidget>) -> MutPtr<QScrollBar>
[src]
Calls C++ function: QScrollBar* dynamic_cast<QScrollBar*>(QWidget* ptr)
.
impl DynamicCast<QScrollBar> for QObject
[src]
unsafe fn dynamic_cast(ptr: Ptr<QObject>) -> Ptr<QScrollBar>
[src]
Calls C++ function: QScrollBar* dynamic_cast<QScrollBar*>(QObject* ptr)
.
unsafe fn dynamic_cast_mut(ptr: MutPtr<QObject>) -> MutPtr<QScrollBar>
[src]
Calls C++ function: QScrollBar* dynamic_cast<QScrollBar*>(QObject* ptr)
.
impl DynamicCast<QScrollBar> for QPaintDevice
[src]
unsafe fn dynamic_cast(ptr: Ptr<QPaintDevice>) -> Ptr<QScrollBar>
[src]
Calls C++ function: QScrollBar* dynamic_cast<QScrollBar*>(QPaintDevice* ptr)
.
unsafe fn dynamic_cast_mut(ptr: MutPtr<QPaintDevice>) -> MutPtr<QScrollBar>
[src]
Calls C++ function: QScrollBar* dynamic_cast<QScrollBar*>(QPaintDevice* ptr)
.
impl CppDeletable for QScrollBar
[src]
Auto Trait Implementations
impl Send for QScrollBar
impl Sync for QScrollBar
impl Unpin for QScrollBar
impl RefUnwindSafe for QScrollBar
impl UnwindSafe for QScrollBar
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>,