QMacToolBarItem Class

The QMacToolBarItem class provides an item for QMacToolBar. More...

Header: #include <QMacToolBarItem>
qmake: QT += macextras
Since: Qt 5.3
Inherits: QObject

Public Types

enum StandardItem { NoStandardItem, Space, FlexibleSpace }


  • 1 property inherited from QObject

Public Functions

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
  • 34 public functions inherited from QObject


void activated()

Additional Inherited Members

  • 1 public slot inherited from QObject
  • 1 public variable inherited from QObject
  • 10 static public members inherited from QObject
  • 9 protected functions inherited from QObject
  • 2 protected variables inherited from QObject

Detailed Description

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.

See also QMacToolBar.

Member Type Documentation

enum QMacToolBarItem::StandardItem

QMacToolBarItem::NoStandardItem0Don't use a standard item
QMacToolBarItem::Space1A spacing item
QMacToolBarItem::FlexibleSpace2A spacing item which grows to fill available space

Property Documentation

icon : QIcon

This property holds the item's icon.

Access functions:

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

selectable : bool

This property holds whether the item is selecatble

This property's default is false.

Access functions:

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.

Access functions:

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

text : QString

This property holds the item's text.

Access functions:

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

Member Function Documentation

QMacToolBarItem::QMacToolBarItem(QObject *parent = nullptr)

Constructs a QMacToolBarItem with parent.

[virtual] QMacToolBarItem::~QMacToolBarItem()

Destroys a 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.

© 2018 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.