QWinThumbnailToolBar Class

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

头文件: #include <QWinThumbnailToolBar>
qmake: QT += winextras
开始支持版本: 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
  • 32 个公有函数继承自 QObject

公有槽函数

void clear()
void setIconicLivePreviewPixmap(const QPixmap &)
void setIconicThumbnailPixmap(const QPixmap &)
  • 1 个公有槽函数继承自 QObject

信号

其他继承的成员

  • 1 个公有变量继承自 QObject
  • 10 个静态公有成员继承自 QObject
  • 9 个受保护的函数继承自 QObject
  • 2 个受保护的变量继承自 QObject

详细描述

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

Applications can embed a toolbar in the thumbnail of a window, which is shown when hovering over its taskbar icon. A thumbnail toolbar may provide quick access to the commands of a window without requiring the user to restore or activate the window.

Media player thumbnail toolbar

The following example code illustrates how to use the functions in the QWinThumbnailToolBar and QWinThumbnailToolButton class to implement a thumbnail toolbar:


      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

Note: 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

This property was introduced in Qt 5.4.

访问函数:

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

iconicPixmapNotificationsEnabled : bool

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

This property was introduced in 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

This property was introduced in 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)

Constructs a QWinThumbnailToolBar with the specified parent.

If parent is an instance of QWindow, it is automatically assigned as the thumbnail toolbar's window.

QWinThumbnailToolBar::~QWinThumbnailToolBar()

Destroys and clears the QWinThumbnailToolBar.

void QWinThumbnailToolBar::addButton(QWinThumbnailToolButton *button)

Adds a button to the thumbnail toolbar.

Note: 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.

This function was introduced in 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.

This function was introduced in Qt 5.4.

参见 iconicThumbnailPixmap.

void QWinThumbnailToolBar::removeButton(QWinThumbnailToolButton *button)

Removes the button from the thumbnail toolbar.

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

Sets the list of buttons in the thumbnail toolbar.

Note: Any existing buttons are replaced.

参见 buttons().