QWinTaskbarButton 類

The 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 = nullptr)
virtual ~QWinTaskbarButton ()
QString overlayAccessibleDescription () const
QIcon overlayIcon () const
QWinTaskbarProgress * progress () const
void setWindow (QWindow * window )
QWindow * window () const

公共槽

void clearOverlayIcon ()
void setOverlayAccessibleDescription (const QString & 描述 )
void setOverlayIcon (const QIcon & icon )

靜態公共成員

const QMetaObject staticMetaObject

額外繼承成員

詳細描述

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

The 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 & 描述 )

另請參閱 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 = nullptr)

構造 QWinTaskbarButton 采用指定 parent .

parent 是實例 QWindow ,將被自動賦值作為任務欄按鈕的 window .

[虛擬] QWinTaskbarButton:: ~QWinTaskbarButton ()

銷毀 QWinTaskbarButton .