QWinThumbnailToolBar 类

The QWinThumbnailToolBar class allows manipulating the thumbnail toolbar of a window. 更多...

头: #include <QWinThumbnailToolBar>
qmake: QT += winextras
Since: Qt 5.2
继承: QObject

特性

公共函数

QWinThumbnailToolBar (QObject * parent = Q_NULLPTR)
~QWinThumbnailToolBar ()
void addButton (QWinThumbnailToolButton * button )
QList<QWinThumbnailToolButton *> buttons () const
int count () const
QPixmap iconicLivePreviewPixmap () const
bool iconicPixmapNotificationsEnabled () const
QPixmap iconicThumbnailPixmap () const
void removeButton (QWinThumbnailToolButton * button )
void setButtons (const QList<QWinThumbnailToolButton *> & buttons )
void setIconicPixmapNotificationsEnabled (bool enabled )
void setWindow (QWindow * window )
QWindow * window () const

公共槽

void clear ()
void setIconicLivePreviewPixmap ( const QPixmap & )
void setIconicThumbnailPixmap ( const QPixmap & )

信号

void iconicLivePreviewPixmapRequested ()
void iconicThumbnailPixmapRequested ()

额外继承成员

详细描述

The QWinThumbnailToolBar class allows manipulating the thumbnail toolbar of a window.

应用程序可以将工具栏嵌入窗口缩略图,会展示工具栏当鼠标悬停任务栏图标时。缩略工具栏可以提供窗口命令的快速访问,无需要求用户还原或激活窗口。

Media player thumbnail toolbar

The following example code illustrates how to use the functions in the QWinThumbnailToolBar and QWinThumbnailToolButton 类以实现缩略图工具栏:

    QWinThumbnailToolBar *thumbbar = new QWinThumbnailToolBar(widget);
    thumbbar->setWindow(widget->windowHandle());
    QWinThumbnailToolButton *settings = new QWinThumbnailToolButton(thumbbar);
    settings->setToolTip("Settings");
    settings->setIcon(":/settings.png");
    settings->setDismissOnClick(true);
    connect(settings, SIGNAL(clicked()), settingsPage, SLOT(show()));
    QWinThumbnailToolButton *playPause = new QWinThumbnailToolButton(thumbbar);
    playPause->setToolTip("Play/Pause");
    playPause->setIcon(":/play.png");
    connect(playPause, SIGNAL(clicked()), mediaPlayer, SLOT(play()));
    thumbbar->addButton(settings);
    thumbbar->addButton(playPause);
					

另请参阅 QWinThumbnailToolButton .

特性文档编制

count : const int

This property holds the number of buttons in the thumbnail toolbar

注意: The number of buttons is limited to 7 .

访问函数:

int count () const

iconicLivePreviewPixmap : QPixmap

This property holds the pixmap for use as a live (peek) preview when tabbing into the application

该特性在 Qt 5.4 引入。

访问函数:

QPixmap iconicLivePreviewPixmap () const
void setIconicLivePreviewPixmap ( const QPixmap & )

iconicPixmapNotificationsEnabled : bool

This property holds whether signals iconicThumbnailPixmapRequested () 和 iconicLivePreviewPixmapRequested () will be emitted

该特性在 Qt 5.4 引入。

访问函数:

bool iconicPixmapNotificationsEnabled () const
void setIconicPixmapNotificationsEnabled (bool enabled )

另请参阅 QWinThumbnailToolBar::iconicThumbnailPixmap and QWinThumbnailToolBar::iconicLivePreviewPixmap .

iconicThumbnailPixmap : QPixmap

This property holds the pixmap for use as a thumbnail representation

该特性在 Qt 5.4 引入。

访问函数:

QPixmap iconicThumbnailPixmap () const
void setIconicThumbnailPixmap ( const QPixmap & )

另请参阅 QWinThumbnailToolBar::iconicPixmapNotificationsEnabled .

window : QWindow *

This property holds the window whose thumbnail toolbar is manipulated

访问函数:

QWindow * window () const
void setWindow (QWindow * window )

成员函数文档编制

QWinThumbnailToolBar:: QWinThumbnailToolBar ( QObject * parent = Q_NULLPTR)

构造 QWinThumbnailToolBar 采用指定 parent .

parent 是实例 QWindow , it is automatically assigned as the thumbnail toolbar's window .

QWinThumbnailToolBar:: ~QWinThumbnailToolBar ()

Destroys and clears the QWinThumbnailToolBar .

void QWinThumbnailToolBar:: addButton ( QWinThumbnailToolButton * button )

添加 button to the thumbnail toolbar.

注意: The number of buttons is limited to 7 .

QList < QWinThumbnailToolButton *> QWinThumbnailToolBar:: buttons () const

Returns the list of buttons in the thumbnail toolbar.

另请参阅 setButtons ().

[slot] void QWinThumbnailToolBar:: clear ()

Removes all buttons from the thumbnail toolbar.

[signal] void QWinThumbnailToolBar:: iconicLivePreviewPixmapRequested ()

This signal is emitted when the operating system requests a new iconic live preview pixmap, typically when the user ALT-tabs to the application.

该函数在 Qt 5.4 引入。

另请参阅 iconicLivePreviewPixmap .

[signal] void QWinThumbnailToolBar:: iconicThumbnailPixmapRequested ()

This signal is emitted when the operating system requests a new iconic thumbnail pixmap, typically when the thumbnail is shown.

该函数在 Qt 5.4 引入。

另请参阅 iconicThumbnailPixmap .

void QWinThumbnailToolBar:: removeButton ( QWinThumbnailToolButton * button )

移除 button from the thumbnail toolbar.

void QWinThumbnailToolBar:: setButtons (const QList < QWinThumbnailToolButton *> & buttons )

Sets the list of buttons in the thumbnail toolbar.

注意: 任何现有按钮会被替换。

另请参阅 buttons ().