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 = nullptr)
virtual ~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 ()

靜態公共成員

const QMetaObject staticMetaObject

額外繼承成員

詳細描述

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 = 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 ().