QWinTaskbarButton Class▲
-
Header: QWinTaskbarButton
-
Since: Qt 5.2
-
qmake: QT += winextras
-
Inherits: QObject
Detailed Description▲
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.

The following example code illustrates how to use the QWinTaskbarButton and QWinTaskbarProgress classes to adjust the look of the taskbar button:
QWinTaskbarButton *
button =
new
QWinTaskbarButton(widget);
button-&
gt;setWindow(widget-&
gt;windowHandle());
button-&
gt;setOverlayIcon(QIcon(":/loading.png"
));
QWinTaskbarProgress *
progress =
button-&
gt;progress();
progress-&
gt;setVisible(true
);
progress-&
gt;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.
See Also▲
See also QWinTaskbarProgress
Property Documentation▲
overlayAccessibleDescription : QString▲
This property holds the description of the overlay for accessibility purposes
Access functions:
-
overlayAccessibleDescription() const
-
void setOverlayAccessibleDescription(const &description)
See Also▲
See also overlayIcon
overlayIcon : QIcon▲
This property holds the overlay icon of the taskbar button
Access functions:
-
overlayIcon() const
-
void setOverlayIcon(const &icon)
-
void clearOverlayIcon()
[read-only] progress : QWinTaskbarProgress* const▲
This property holds the progress indicator of the taskbar button
The progress indicator is not visible by default.
Access functions:
-
*progress() const
window : QWindow*▲
This property holds the window whose taskbar button is manipulated
Access functions:
-
*window() const
-
void setWindow( *window)
Member Function Documentation▲
[explicit] QWinTaskbarButton::QWinTaskbarButton(QObject *parent = nullptr)▲
Constructs a QWinTaskbarButton with the specified parent.
If parent is an instance of QWindow, it is automatically assigned as the taskbar button's window.
[virtual] QWinTaskbarButton::~QWinTaskbarButton()▲
Destroys the QWinTaskbarButton.