QWinTaskbarButton Class
The QWinTaskbarButton class represents the Windows taskbar button for a top-level window (Windows 7 and newer). More...
| Header: | #include <QWinTaskbarButton> |
| qmake: | QT += winextras |
| Since: | Qt 5.2 |
| Inherits: | QObject |
This class was introduced in Qt 5.2.
Properties
- overlayAccessibleDescription : QString
- overlayIcon : QIcon
- progress : QWinTaskbarProgress* const
- window : QWindow*
- 1 property inherited from QObject
Public Functions
| QWinTaskbarButton(QObject *parent = nullptr) | |
| virtual | ~QWinTaskbarButton() |
| QString | overlayAccessibleDescription() const |
| QIcon | overlayIcon() const |
| QWinTaskbarProgress * | progress() const |
| void | setWindow(QWindow *window) |
| QWindow * | window() const |
- 30 public functions inherited from QObject
Public Slots
| void | clearOverlayIcon() |
| void | setOverlayAccessibleDescription(const QString &description) |
| void | setOverlayIcon(const QIcon &icon) |
- 1 public slot inherited from QObject
Related Non-Members
| typedef | QObjectList |
| QList<T> | qFindChildren(const QObject *obj, const QRegExp ®Exp) |
| T | qobject_cast(QObject *object) |
| T | qobject_cast(const QObject *object) |
Macros
| QT_NO_NARROWING_CONVERSIONS_IN_CONNECT | |
| Q_CLASSINFO(Name, Value) | |
| Q_DISABLE_COPY(Class) | |
| Q_DISABLE_COPY_MOVE(Class) | |
| Q_DISABLE_MOVE(Class) | |
| Q_EMIT | |
| Q_ENUM(...) | |
| Q_ENUM_NS(...) | |
| Q_FLAG(...) | |
| Q_FLAG_NS(...) | |
| Q_GADGET | |
| Q_INTERFACES(...) | |
| Q_INVOKABLE | |
| Q_NAMESPACE | |
| Q_OBJECT | |
| Q_PROPERTY(...) | |
| Q_REVISION | |
| Q_SET_OBJECT_NAME(Object) | |
| Q_SIGNAL | |
| Q_SIGNALS | |
| Q_SLOT | |
| Q_SLOTS |
Additional Inherited Members
- 2 signals inherited from QObject
- 9 static public members inherited from QObject
- 9 protected functions inherited from 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->setWindow(widget->windowHandle());
button->setOverlayIcon(QIcon(":/loading.png"));
QWinTaskbarProgress *progress = button->progress();
progress->setVisible(true);
progress->setValue(50);
Note: 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().
Note: The class wraps API only available since Windows 7. Instantiating it on Windows XP or Windows Vista causes a runtime warning.
See also QWinTaskbarProgress.
Property Documentation
overlayAccessibleDescription : QString
This property holds the description of the overlay for accessibility purposes
Access functions:
| QString | overlayAccessibleDescription() const |
| void | setOverlayAccessibleDescription(const QString &description) |
See also overlayIcon.
overlayIcon : QIcon
This property holds the overlay icon of the taskbar button
Access functions:
| QIcon | overlayIcon() const |
| void | setOverlayIcon(const QIcon &icon) |
| void | clearOverlayIcon() |
progress : QWinTaskbarProgress* const
This property holds the progress indicator of the taskbar button
Note: The progress indicator is not visible by default.
Access functions:
| QWinTaskbarProgress * | progress() const |
window : QWindow*
This property holds the window whose taskbar button is manipulated
Access functions:
| QWindow * | window() const |
| void | setWindow(QWindow *window) |
Member Function Documentation
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.