QWinTaskbarButton 类表示用于顶层窗口的 Windows 任务栏按钮 (Windows 7 及更高版本)。 更多...
头: | #include <QWinTaskbarButton> |
qmake: | QT += winextras |
Since: | Qt 5.2 |
继承: | QObject |
该类已过时。 提供它是为使旧源代码能继续工作。强烈建议不要在新代码中使用它。
该类在 Qt 5.2 引入。
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 & description ) |
void | setOverlayIcon (const QIcon & icon ) |
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 类去调节任务栏按钮的外观:
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 & description ) |
另请参阅 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::
~QWinTaskbarButton
()
销毁 QWinTaskbarButton .