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 = 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 & 描述 ) |
| void | setOverlayIcon (const QIcon & icon ) |
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.
以下範例代碼闡明如何使用 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 .
This property holds the description of the overlay for accessibility purposes
訪問函數:
| QString | overlayAccessibleDescription () const |
| void | setOverlayAccessibleDescription (const QString & 描述 ) |
另請參閱 overlayIcon .
This property holds the overlay icon of the taskbar button
訪問函數:
| QIcon | overlayIcon () const |
| void | setOverlayIcon (const QIcon & icon ) |
| void | clearOverlayIcon () |
此特性保持任務欄按鈕的進度指示器
注意: 進度指示器不 visible 在默認情況下。
訪問函數:
| QWinTaskbarProgress * | progress () const |
此特性保持操縱任務欄按鈕的窗口
訪問函數:
| QWindow * | window () const |
| void | setWindow (QWindow * window ) |
構造 QWinTaskbarButton 采用指定 parent .
若 parent 是實例 QWindow ,將被自動賦值作為任務欄按鈕的 window .
銷毀 QWinTaskbarButton .