QWinTaskbarButton 类

QWinTaskbarButton class represents the Windows taskbar button for a top-level window (Windows 7 and newer). 更多...

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

特性

公共函数

QWinTaskbarButton (QObject * parent = Q_NULLPTR)
~QWinTaskbarButton ()
QString overlayAccessibleDescription () const
QIcon overlayIcon () const
QWinTaskbarProgress * progress () const
void setWindow (QWindow * window )
QWindow * window () const

公共槽

void clearOverlayIcon ()
void setOverlayAccessibleDescription (const QString & description )
void setOverlayIcon (const QIcon & icon )

额外继承成员

详细描述

QWinTaskbarButton class represents the Windows taskbar button for a top-level window (Windows 7 and newer).

QWinTaskbarButton class enables you to set overlay icons on a taskbar button, and provides access to its progress indicator.

An overlay icon indicates change in the state of an application, whereas a progress indicator shows how time-consuming tasks are progressing.

Taskbar Button

以下范例代码阐明如何使用 QWinTaskbarButton and QWinTaskbarProgress 类去调节任务栏按钮的外观:

    QWinTaskbarButton *button = new QWinTaskbarButton(widget);
    button->setWindow(widget->windowHandle());
    button->setOverlayIcon(QIcon(":/loading.png"));
    QWinTaskbarProgress *progress = button->progress();
    progress->setVisible(true);
    progress->setValue(50);
					

注意: QWidget::windowHandle () returns a valid instance of a QWindow only after the widget has been shown. It is therefore recommended to delay the initialization of the QWinTaskbarButton instances until QWidget::showEvent ().

注意: The class wraps API only available since Windows 7. Instantiating it on Windows XP or Windows Vista causes a runtime warning.

另请参阅 QWinTaskbarProgress .

特性文档编制

overlayAccessibleDescription : QString

This property holds the description of the overlay for accessibility purposes

访问函数:

QString overlayAccessibleDescription () const
void setOverlayAccessibleDescription (const QString & description )

另请参阅 overlayIcon .

overlayIcon : QIcon

This property holds the overlay icon of the taskbar button

访问函数:

QIcon overlayIcon () const
void setOverlayIcon (const QIcon & icon )
void clearOverlayIcon ()

progress : QWinTaskbarProgress * const

此特性保持任务栏按钮的进度指示器

注意: 进度指示器不 visible 在默认情况下。

访问函数:

QWinTaskbarProgress * progress () const

window : QWindow *

此特性保持操纵任务栏按钮的窗口

访问函数:

QWindow * window () const
void setWindow (QWindow * window )

成员函数文档编制

QWinTaskbarButton:: QWinTaskbarButton ( QObject * parent = Q_NULLPTR)

构造 QWinTaskbarButton 采用指定 parent .

parent 是实例 QWindow ,将被自动赋值作为任务栏按钮的 window .

QWinTaskbarButton:: ~QWinTaskbarButton ()

销毁 QWinTaskbarButton .