QMacToolBarItem Class

The QMacToolBarItem class provides an item for QMacToolBar . 更多...

头: #include <QMacToolBarItem>
qmake: QT += macextras
Since: Qt 5.3
继承: QObject

公共类型

enum StandardItem { NoStandardItem, Space, FlexibleSpace }

特性

公共函数

QMacToolBarItem (QObject * parent = nullptr)
virtual ~QMacToolBarItem ()
QIcon icon () const
NSToolbarItem * nativeToolBarItem () const
bool selectable () const
void setIcon (const QIcon & icon )
void setSelectable (bool selectable )
void setStandardItem (QMacToolBarItem::StandardItem standardItem )
void setText (const QString & text )
QMacToolBarItem::StandardItem standardItem () const
QString text () const

信号

void activated ()

静态公共成员

const QMetaObject staticMetaObject

额外继承成员

详细描述

The QMacToolBarItem class provides an item for QMacToolBar .

All items should have the text and icon properites set, or have the standardItem property set to something else than NoStandardItem .

另请参阅 QMacToolBar .

成员类型文档编制

enum QMacToolBarItem:: StandardItem

常量 描述
QMacToolBarItem::NoStandardItem 0 Don't use a standard item
QMacToolBarItem::Space 1 A spacing item
QMacToolBarItem::FlexibleSpace 2 A spacing item which grows to fill available space

特性文档编制

icon : QIcon

This property holds the item's icon.

访问函数:

QIcon icon () const
void setIcon (const QIcon & icon )

selectable : bool

This property holds whether the item is selecatble

此特性默认为 false。

访问函数:

bool selectable () const
void setSelectable (bool selectable )

standardItem : StandardItem

This property holds whether the item is a standard item.

This property's default is NoStandardItem , in which case the icon and text property determines the item contents.

Setting this property to somthing else than NoStandardItem takes precendense over icon and text.

访问函数:

QMacToolBarItem::StandardItem standardItem () const
void setStandardItem (QMacToolBarItem::StandardItem standardItem )

text : QString

This property holds the item's text.

访问函数:

QString text () const
void setText (const QString & text )

成员函数文档编制

QMacToolBarItem:: QMacToolBarItem ( QObject * parent = nullptr)

构造 QMacToolBarItem with parent .

[虚拟] QMacToolBarItem:: ~QMacToolBarItem ()

销毁 QMacToolBarItem

[signal] void QMacToolBarItem:: activated ()

This signal is emitted when the toolbar item is clicked or otherwise activated.

NSToolbarItem *QMacToolBarItem:: nativeToolBarItem () const

Returns the native NSToolbarItem.