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.
应用程序可以将工具栏嵌入窗口缩略图,会展示工具栏当鼠标悬停任务栏图标时。缩略工具栏可以提供窗口命令的快速访问,无需要求用户还原或激活窗口。
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 .
This property holds the number of buttons in the thumbnail toolbar
注意:
The number of buttons is limited to
7
.
访问函数:
int | count () const |
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 & ) |
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 .
This property holds the pixmap for use as a thumbnail representation
该特性在 Qt 5.4 引入。
访问函数:
QPixmap | iconicThumbnailPixmap () const |
void | setIconicThumbnailPixmap ( const QPixmap & ) |
另请参阅 QWinThumbnailToolBar::iconicPixmapNotificationsEnabled .
This property holds the window whose thumbnail toolbar is manipulated
访问函数:
QWindow * | window () const |
void | setWindow (QWindow * window ) |
构造 QWinThumbnailToolBar 采用指定 parent .
若 parent 是实例 QWindow , it is automatically assigned as the thumbnail toolbar's window .
[虚拟]
QWinThumbnailToolBar::
~QWinThumbnailToolBar
()
Destroys and clears the QWinThumbnailToolBar .
添加 button to the thumbnail toolbar.
注意:
The number of buttons is limited to
7
.
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 .
移除 button from the thumbnail toolbar.
Sets the list of buttons in the thumbnail toolbar.
注意: 任何现有按钮会被替换。
另请参阅 buttons ().