|
|||||||||
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.QProgressBar
public class QProgressBar
The QProgressBar widget provides a horizontal or vertical progress bar.
A progress bar is used to give the user an indication of the progress of an operation and to reassure them that the application is still running.
The progress bar uses the concept of steps. You set it up by specifying the minimum and maximum possible step values, and it will display the percentage of steps that have been completed when you later give it the current step value. The percentage is calculated by dividing the progress (value - minimum) divided by maximum - minimum.
You can specify the minimum and maximum number of steps with setMinimum and setMaximum. The current number of steps is set with setValue. The progress bar can be rewound to the beginning with reset.
If minimum and maximum both are set to 0, the bar shows a busy indicator instead of a percentage of steps. This is useful, for example, when using QFtp or QHttp to download items when they are unable to determine the size of the item being downloaded.
![]() | A progress bar shown in the Macintosh widget style. |
![]() | A progress bar shown in the Windows XP widget style. |
![]() | A progress bar shown in the Plastique widget style. |
Nested Class Summary | |
---|---|
static class |
QProgressBar.Direction
Specifies the reading direction of the text for vertical progress bars. |
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.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 | |
---|---|
QSignalEmitter.Signal1<java.lang.Integer> |
valueChanged
This signal is emitted when the value shown in the progress bar changes. |
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
Constructor Summary | |
---|---|
QProgressBar()
Equivalent to QProgressBar(0). |
|
QProgressBar(QWidget parent)
Constructs a progress bar with the given parent. |
Method Summary | |
---|---|
Qt.Alignment |
alignment()
Returns the alignment of the progress bar. |
boolean |
event(QEvent e)
This function is reimplemented for internal reasons. |
java.lang.String |
format()
Returns the string used to generate the current text. |
static QProgressBar |
fromNativePointer(QNativePointer nativePointer)
This function returns the QProgressBar instance pointed to by nativePointer |
protected void |
initStyleOption(QStyleOptionProgressBar option)
Initialize option with the values from this QProgressBar. |
boolean |
invertedAppearance()
Returns whether or not a progress bar shows its progress inverted. |
boolean |
isTextVisible()
Returns whether the current completed percentage should be displayed. |
int |
maximum()
Returns the progress bar's maximum value. |
int |
minimum()
Returns the progress bar's minimum value. |
QSize |
minimumSizeHint()
This function is reimplemented for internal reasons. |
Qt.Orientation |
orientation()
Returns the orientation of the progress bar. |
protected void |
paintEvent(QPaintEvent arg__1)
This function is reimplemented for internal reasons. |
void |
reset()
Reset the progress bar. |
void |
setAlignment(Qt.Alignment alignment)
Sets the alignment of the progress bar to alignment. |
void |
setAlignment(Qt.AlignmentFlag... alignment)
Sets the alignment of the progress bar to alignment. |
void |
setFormat(java.lang.String format)
Sets the string used to generate the current text to format. |
void |
setInvertedAppearance(boolean invert)
Sets whether or not a progress bar shows its progress inverted to invert. |
void |
setMaximum(int maximum)
Sets the progress bar's maximum value to maximum. |
void |
setMinimum(int minimum)
Sets the progress bar's minimum value to minimum. |
void |
setOrientation(Qt.Orientation arg__1)
Sets the orientation of the progress bar to arg__1. |
void |
setRange(int minimum,
int maximum)
Sets the progress bar's minimum and maximum values to minimum and maximum respectively. |
void |
setTextDirection(QProgressBar.Direction textDirection)
Sets the reading direction of the text for vertical progress bars to textDirection. |
void |
setTextVisible(boolean visible)
Sets whether the current completed percentage should be displayed to visible. |
void |
setValue(int value)
Sets the progress bar's current value to value. |
QSize |
sizeHint()
This function is reimplemented for internal reasons. |
java.lang.String |
text()
Returns the descriptive text shown with the progress bar. |
QProgressBar.Direction |
textDirection()
Returns the reading direction of the text for vertical progress bars. |
int |
value()
Returns the progress bar's current value. |
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, timerEvent |
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 |
Field Detail |
---|
public final QSignalEmitter.Signal1<java.lang.Integer> valueChanged
This signal is emitted when the value shown in the progress bar changes. value is the new value shown by the progress bar.
Constructor Detail |
---|
public QProgressBar()
Equivalent to QProgressBar(0).
public QProgressBar(QWidget parent)
Constructs a progress bar with the given parent.
By default, the minimum step value is set to 0, and the maximum to 100.
Method Detail |
---|
public final Qt.Alignment alignment()
Returns the alignment of the progress bar.
public final java.lang.String format()
Returns the string used to generate the current text.
%p - is replaced by the percentage completed. %v - is replaced by the current value. %m - is replaced by the total number of steps.
The default value is "%p%".
public final boolean invertedAppearance()
Returns whether or not a progress bar shows its progress inverted.
If this property is false, the progress bar grows in the other direction (e.g. from right to left). By default, the progress bar is not inverted.
public final boolean isTextVisible()
Returns whether the current completed percentage should be displayed.
public final int maximum()
Returns the progress bar's maximum value.
When setting this property, the minimum is adjusted if necessary to ensure that the range remains valid. If the current value falls outside the new range, the progress bar is reset with reset.
public final int minimum()
Returns the progress bar's minimum value.
When setting this property, the maximum is adjusted if necessary to ensure that the range remains valid. If the current value falls outside the new range, the progress bar is reset with reset.
public final Qt.Orientation orientation()
Returns the orientation of the progress bar.
The orientation must be Qt::Horizontal (the default) or Qt::Vertical.
public final void reset()
Reset the progress bar. The progress bar "rewinds" and shows no progress.
public final void setAlignment(Qt.AlignmentFlag... alignment)
Sets the alignment of the progress bar to alignment.
public final void setAlignment(Qt.Alignment alignment)
Sets the alignment of the progress bar to alignment.
public final void setFormat(java.lang.String format)
Sets the string used to generate the current text to format.
%p - is replaced by the percentage completed. %v - is replaced by the current value. %m - is replaced by the total number of steps.
The default value is "%p%".
public final void setInvertedAppearance(boolean invert)
Sets whether or not a progress bar shows its progress inverted to invert.
If this property is false, the progress bar grows in the other direction (e.g. from right to left). By default, the progress bar is not inverted.
public final void setMaximum(int maximum)
Sets the progress bar's maximum value to maximum.
When setting this property, the minimum is adjusted if necessary to ensure that the range remains valid. If the current value falls outside the new range, the progress bar is reset with reset.
public final void setMinimum(int minimum)
Sets the progress bar's minimum value to minimum.
When setting this property, the maximum is adjusted if necessary to ensure that the range remains valid. If the current value falls outside the new range, the progress bar is reset with reset.
public final void setOrientation(Qt.Orientation arg__1)
Sets the orientation of the progress bar to arg__1.
The orientation must be Qt::Horizontal (the default) or Qt::Vertical.
public final void setRange(int minimum, int maximum)
Sets the progress bar's minimum and maximum values to minimum and maximum respectively.
If maximum is smaller than minimum, minimum becomes the only legal value.
If the current value falls outside the new range, the progress bar is reset with reset.
public final void setTextDirection(QProgressBar.Direction textDirection)
Sets the reading direction of the text for vertical progress bars to textDirection.
This property has no impact on horizontal progress bars. By default, the reading direction is QProgressBar::TopToBottom.
public final void setTextVisible(boolean visible)
Sets whether the current completed percentage should be displayed to visible.
public final void setValue(int value)
Sets the progress bar's current value to value.
Attempting to change the current value to one outside the minimum-maximum range has no effect on the current value.
public final QProgressBar.Direction textDirection()
Returns the reading direction of the text for vertical progress bars.
This property has no impact on horizontal progress bars. By default, the reading direction is QProgressBar::TopToBottom.
public final int value()
Returns the progress bar's current value.
Attempting to change the current value to one outside the minimum-maximum range has no effect on the current value.
public boolean event(QEvent e)
This function is reimplemented for internal reasons.
event
in class QWidget
public QSize minimumSizeHint()
This function is reimplemented for internal reasons.
minimumSizeHint
in class QWidget
protected void paintEvent(QPaintEvent arg__1)
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 java.lang.String text()
Returns the descriptive text shown with the progress bar.
The text returned is the same as the text displayed in the center (or in some styles, to the left) of the progress bar.
The progress shown in the text may be smaller than the minimum value, indicating that the progress bar is in the "reset" state before any progress is set.
In the default implementation, the text either contains a percentage value that indicates the progress so far, or it is blank because the progress bar is in the reset state.
public static QProgressBar fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.protected final void initStyleOption(QStyleOptionProgressBar option)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |