|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.gui.QWidget
com.trolltech.qt.gui.QAbstractSlider
com.trolltech.qt.gui.QSlider
public class QSlider
The QSlider widget provides a vertical or horizontal slider.
The slider is the classic widget for controlling a bounded value. It lets the user move a slider handle along a horizontal or vertical groove and translates the handle's position into an integer value within the legal range.
QSlider has very few of its own functions; most of the functionality is in QAbstractSlider. The most useful functions are setValue to set the slider directly to some value; triggerAction to simulate the effects of clicking (useful for shortcut keys); setSingleStep, setPageStep to set the steps; and setMinimum and setMaximum to define the range of the scroll bar.
QSlider provides methods for controlling tickmarks. You can use setTickPosition to indicate where you want the tickmarks to be, setTickInterval to indicate how many of them you want. the currently set tick position and interval can be queried using the tickPosition and tickInterval functions, respectively.
QSlider inherits a comprehensive set of signals:
Signal | Description |
---|---|
valueChanged | Emitted when the slider's value has changed. The tracking() determines whether this signal is emitted during user interaction. |
sliderPressed | Emitted when the user starts to drag the slider. |
sliderMoved | Emitted when the user drags the slider. |
sliderReleased | Emitted when the user releases the slider. |
QSlider only provides integer ranges. Note that although QSlider handles very large numbers, it becomes difficult for users to use a slider accurately for very large ranges.
A slider accepts focus on Tab and provides both a mouse wheel and a keyboard interface. The keyboard interface is the following:
![]() | A slider shown in the Macintosh widget style. |
![]() | A slider shown in the Windows XP widget style. |
![]() | A slider shown in the Plastique widget style. |
Nested Class Summary | |
---|---|
static class |
QSlider.TickPosition
This enum specifies where the tick marks are to be drawn relative to the slider's groove and the handle the user moves. |
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QAbstractSlider |
---|
QAbstractSlider.SliderAction, QAbstractSlider.SliderChange |
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget |
---|
QWidget.RenderFlag, QWidget.RenderFlags |
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
Field Summary |
---|
Fields inherited from class com.trolltech.qt.gui.QAbstractSlider |
---|
actionTriggered, rangeChanged, sliderMoved, sliderPressed, sliderReleased, valueChanged |
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
Constructor Summary | |
---|---|
QSlider()
Equivalent to QSlider(0). |
|
QSlider(Qt.Orientation orientation)
Equivalent to QSlider(orientation, 0). |
|
QSlider(Qt.Orientation orientation,
QWidget parent)
Constructs a slider with the given parent. |
|
QSlider(QWidget parent)
Constructs a vertical slider with the given parent. |
Method Summary | |
---|---|
boolean |
event(QEvent event)
This function is reimplemented for internal reasons. |
static QSlider |
fromNativePointer(QNativePointer nativePointer)
This function returns the QSlider instance pointed to by nativePointer |
protected void |
initStyleOption(QStyleOptionSlider option)
Initialize option with the values from this QSlider. |
QSize |
minimumSizeHint()
This function is reimplemented for internal reasons. |
protected void |
mouseMoveEvent(QMouseEvent ev)
This function is reimplemented for internal reasons. |
protected void |
mousePressEvent(QMouseEvent ev)
This function is reimplemented for internal reasons. |
protected void |
mouseReleaseEvent(QMouseEvent ev)
This function is reimplemented for internal reasons. |
protected void |
paintEvent(QPaintEvent ev)
This function is reimplemented for internal reasons. |
void |
setTickInterval(int ti)
Sets the interval between tickmarks to ti. |
void |
setTickPosition(QSlider.TickPosition position)
Sets the tickmark position for this slider to position. |
QSize |
sizeHint()
This function is reimplemented for internal reasons. |
int |
tickInterval()
Returns the interval between tickmarks. |
QSlider.TickPosition |
tickPosition()
Returns the tickmark position for this slider. |
Methods inherited from class com.trolltech.qt.gui.QAbstractSlider |
---|
changeEvent, hasTracking, invertedAppearance, invertedControls, isSliderDown, keyPressEvent, maximum, minimum, orientation, pageStep, repeatAction, setInvertedAppearance, setInvertedControls, setMaximum, setMinimum, setOrientation, setPageStep, setRange, setRepeatAction, setRepeatAction, setRepeatAction, setSingleStep, setSliderDown, setSliderPosition, setTracking, setValue, singleStep, sliderChange, sliderPosition, timerEvent, triggerAction, value, wheelEvent |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
blockSignals, childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, property, removeEventFilter, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
disconnect, disconnect, signalSender |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Constructor Detail |
---|
public QSlider()
Equivalent to QSlider(0).
public QSlider(QWidget parent)
Constructs a vertical slider with the given parent.
public QSlider(Qt.Orientation orientation)
Equivalent to QSlider(orientation, 0).
public QSlider(Qt.Orientation orientation, QWidget parent)
Constructs a slider with the given parent. The orientation parameter determines whether the slider is horizontal or vertical; the valid values are Qt::Vertical and Qt::Horizontal.
Method Detail |
---|
public final void setTickInterval(int ti)
Sets the interval between tickmarks to ti.
This is a value interval, not a pixel interval. If it is 0, the slider will choose between lineStep() and pageStep.
The default value is 0.
public final void setTickPosition(QSlider.TickPosition position)
Sets the tickmark position for this slider to position.
The valid values are described by the QSlider::TickPosition enum.
The default value is QSlider::NoTicks.
public final int tickInterval()
Returns the interval between tickmarks.
This is a value interval, not a pixel interval. If it is 0, the slider will choose between lineStep() and pageStep.
The default value is 0.
public final QSlider.TickPosition tickPosition()
Returns the tickmark position for this slider.
The valid values are described by the QSlider::TickPosition enum.
The default value is QSlider::NoTicks.
public boolean event(QEvent event)
This function is reimplemented for internal reasons.
event
in class QAbstractSlider
public QSize minimumSizeHint()
This function is reimplemented for internal reasons.
minimumSizeHint
in class QWidget
protected void mouseMoveEvent(QMouseEvent ev)
This function is reimplemented for internal reasons.
mouseMoveEvent
in class QWidget
Example
protected void mousePressEvent(QMouseEvent ev)
This function is reimplemented for internal reasons.
mousePressEvent
in class QWidget
Example
protected void mouseReleaseEvent(QMouseEvent ev)
This function is reimplemented for internal reasons.
mouseReleaseEvent
in class QWidget
Example
protected void paintEvent(QPaintEvent ev)
This function is reimplemented for internal reasons.
paintEvent
in class QWidget
public QSize sizeHint()
This function is reimplemented for internal reasons.
sizeHint
in class QWidget
public static QSlider fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.protected final void initStyleOption(QStyleOptionSlider option)
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |