QWinTaskbarProgress 类

QWinTaskbarProgress 类表示 Windows 任务栏进度指示器。 更多...

头: #include <QWinTaskbarProgress>
qmake: QT += winextras
Since: Qt 5.2
继承: QObject

该类已过时。 提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。

该类在 Qt 5.2 引入。

特性

公共函数

QWinTaskbarProgress (QObject * parent = nullptr)
virtual ~QWinTaskbarProgress ()
bool isPaused () const
bool isStopped () const
bool isVisible () const
int maximum () const
int minimum () const
int value () const

公共槽

void hide ()
void pause ()
void reset ()
void resume ()
void setMaximum (int maximum )
void setMinimum (int minimum )
void setPaused (bool paused )
void setRange (int minimum , int maximum )
void setValue (int value )
void setVisible (bool visible )
void show ()
void stop ()

信号

void maximumChanged (int maximum )
void minimumChanged (int minimum )
void pausedChanged (bool paused )
void stoppedChanged (bool stopped )
void valueChanged (int value )
void visibilityChanged (bool visible )

详细描述

A progress indicator 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 indicator uses the concept of steps . It is set 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 ()) 除以 maximum () - minimum ().

The minimum and maximum number of steps can be specified by calling setMinimum () 和 setMaximum (). The current number of steps is set with setValue (). The progress indicator can be rewound to the beginning with reset ().

If minimum and maximum both are set to 0 , the indicator shows up as a busy (indeterminate) indicator instead of a percentage of steps. This is useful when it is not possible to determine the number of steps.

Screenshot of a progress indicator A progress indicator at 50%.
Screenshot of a paused progress indicator A paused progress indicator at 50%.
Screenshot of a stopped progress indicator A stopped progress indicator at 50%.
Screenshot of an indeterminate progress indicator An indeterminate progress indicator.

注意: The final appearance of the progress indicator varies depending on the active Windows theme.

另请参阅 QWinTaskbarButton .

特性文档编制

maximum : int

此特性保持进度指示器的最大值

默认值为 100 .

访问函数:

int maximum () const
void setMaximum (int maximum )

通知程序信号:

void maximumChanged (int maximum )

minimum : int

此特性保持进度指示器的最小值

默认值为 0 .

访问函数:

int minimum () const
void setMinimum (int minimum )

通知程序信号:

void minimumChanged (int minimum )

paused : bool

This property holds whether the progress indicator is paused.

默认值为 false .

The final appearance of a paused progress indicator depends on the active Windows theme. Typically, a paused progress indicator turns yellow to indicate that the progress is currently paused. Unlike a stopped progress indicator, a paused progress should not be used to indicate an error.

访问函数:

bool isPaused () const
void setPaused (bool paused )

通知程序信号:

void pausedChanged (bool paused )

另请参阅 pause () 和 resume ().

stopped : const bool

This property holds whether the progress indicator is stopped.

默认值为 false .

The final appearance of a stopped progress indicator depends on the active Windows theme. Typically, a stopped progress indicator turns red to indicate that the progress is currently stopped. Unlike a paused progress indicator, a stopped progress may be used to indicate an error.

访问函数:

bool isStopped () const

通知程序信号:

void stoppedChanged (bool stopped )

另请参阅 stop () 和 resume ().

value : int

This property holds the current value of the progress indicator

默认值为 0 .

访问函数:

int value () const
void setValue (int value )

通知程序信号:

void valueChanged (int value )

visible : bool

This property holds whether the progress indicator is visible.

默认值为 false .

访问函数:

bool isVisible () const
void setVisible (bool visible )

通知程序信号:

void visibilityChanged (bool visible )

成员函数文档编制

QWinTaskbarProgress:: QWinTaskbarProgress ( QObject * parent = nullptr)

Constructs a QWinTaskbarProgress with the parent object parent .

[slot] void QWinTaskbarProgress:: hide ()

Hides the progress indicator.

[slot] void QWinTaskbarProgress:: pause ()

Pauses the progress indicator.

另请参阅 paused .

[slot] void QWinTaskbarProgress:: reset ()

Resets the progress indicator.

This function rewinds the value to the minimum value.

[slot] void QWinTaskbarProgress:: resume ()

Resumes a paused or stopped progress indicator.

另请参阅 paused and stopped .

[slot] void QWinTaskbarProgress:: setRange ( int minimum , int maximum )

Sets both the minimum and maximum 值。

[slot] void QWinTaskbarProgress:: show ()

Shows the progress indicator.

[slot] void QWinTaskbarProgress:: stop ()

Stops the progress indicator.

另请参阅 stopped .

[虚拟] QWinTaskbarProgress:: ~QWinTaskbarProgress ()

销毁 QWinTaskbarProgress .