![]() |
CopperSpice API
1.7.4
|
Provides a movable panel that contains a set of controls. More...
Public Signals | |
void | actionTriggered (QAction *action) |
void | allowedAreasChanged (Qt::ToolBarAreas allowedAreas) |
void | iconSizeChanged (const QSize &iconSize) |
void | movableChanged (bool movable) |
void | orientationChanged (Qt::Orientation orientation) |
void | toolButtonStyleChanged (Qt::ToolButtonStyle toolButtonStyle) |
void | topLevelChanged (bool topLevel) |
void | visibilityChanged (bool visible) |
![]() | |
void | customContextMenuRequested (const QPoint &pos) |
void | windowIconChanged (const QIcon &icon) |
void | windowIconTextChanged (const QString &iconText) |
void | windowTitleChanged (const QString &title) |
![]() | |
void | destroyed (QObject *obj=nullptr) |
void | objectNameChanged (const QString &objectName) |
Public Slots | |
void | setIconSize (const QSize &iconSize) |
void | setToolButtonStyle (Qt::ToolButtonStyle toolButtonStyle) |
![]() | |
bool | close () |
void | hide () |
void | lower () |
void | raise () |
void | repaint () |
void | setDisabled (bool disable) |
void | setEnabled (bool enable) |
void | setFocus () |
void | setHidden (bool hidden) |
void | setStyleSheet (const QString &styleSheet) |
virtual void | setVisible (bool visible) |
void | setWindowModified (bool modified) |
void | setWindowTitle (const QString &title) |
void | show () |
void | showFullScreen () |
void | showMaximized () |
void | showMinimized () |
void | showNormal () |
void | update () |
![]() | |
void | deleteLater () |
Public Methods | |
QToolBar (const QString &title, QWidget *parent=nullptr) | |
QToolBar (QWidget *parent=nullptr) | |
~QToolBar () | |
QAction * | actionAt (const QPoint &p) const |
QAction * | actionAt (int x, int y) const |
QRect | actionGeometry (QAction *action) const |
QAction * | addAction (const QIcon &icon, const QString &text) |
template<typename Func1 > | |
QAction * | addAction (const QIcon &icon, const QString &text, const QObject *context, Func1 slot) |
QAction * | addAction (const QIcon &icon, const QString &text, const QObject *receiver, const QString &member) |
template<typename Func1 > | |
QAction * | addAction (const QIcon &icon, const QString &text, Func1 slot) |
QAction * | addAction (const QString &text) |
template<typename Func1 > | |
QAction * | addAction (const QString &text, const QObject *context, Func1 slot) |
QAction * | addAction (const QString &text, const QObject *receiver, const QString &member) |
template<typename Func1 > | |
QAction * | addAction (const QString &text, Func1 slot) |
void | addAction (QAction *action) |
QAction * | addSeparator () |
QAction * | addWidget (QWidget *widget) |
Qt::ToolBarAreas | allowedAreas () const |
void | clear () |
QSize | iconSize () const |
QAction * | insertSeparator (QAction *before) |
QAction * | insertWidget (QAction *before, QWidget *widget) |
bool | isAreaAllowed (Qt::ToolBarArea area) const |
bool | isFloatable () const |
bool | isFloating () const |
bool | isMovable () const |
Qt::Orientation | orientation () const |
void | setAllowedAreas (Qt::ToolBarAreas areas) |
void | setFloatable (bool floatable) |
void | setMovable (bool movable) |
void | setOrientation (Qt::Orientation orientation) |
QAction * | toggleViewAction () const |
Qt::ToolButtonStyle | toolButtonStyle () const |
QWidget * | widgetForAction (QAction *action) const |
![]() | |
QWidget (QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::EmptyFlag) | |
~QWidget () | |
bool | acceptDrops () const |
QString | accessibleDescription () const |
QString | accessibleName () const |
QList< QAction * > | actions () const |
void | activateWindow () |
void | addAction (QAction *action) |
void | addActions (const QList< QAction * > &actions) |
void | adjustSize () |
bool | autoFillBackground () const |
QPalette::ColorRole | backgroundRole () const |
QBackingStore * | backingStore () const |
QSize | baseSize () const |
QWidget * | childAt (const QPoint &position) const |
QWidget * | childAt (int x, int y) const |
QRect | childrenRect () const |
QRegion | childrenRegion () const |
void | clearFocus () |
void | clearMask () |
QMargins | contentsMargins () const |
QRect | contentsRect () const |
Qt::ContextMenuPolicy | contextMenuPolicy () const |
QCursor | cursor () const |
WId | effectiveWinId () const |
void | ensurePolished () const |
Qt::FocusPolicy | focusPolicy () const |
QWidget * | focusProxy () const |
QWidget * | focusWidget () const |
const QFont & | font () const |
QFontInfo | fontInfo () const |
QFontMetrics | fontMetrics () const |
QPalette::ColorRole | foregroundRole () const |
QRect | frameGeometry () const |
QSize | frameSize () const |
const QRect & | geometry () const |
void | getContentsMargins (int *left, int *top, int *right, int *bottom) const |
QPixmap | grab (const QRect &rectangle=QRect (QPoint (0, 0), QSize (-1,-1))) |
void | grabGesture (Qt::GestureType gestureType, Qt::GestureFlags flags=Qt::GestureFlags ()) |
void | grabKeyboard () |
void | grabMouse () |
void | grabMouse (const QCursor &cursor) |
int | grabShortcut (const QKeySequence &key, Qt::ShortcutContext context=Qt::WindowShortcut) |
QGraphicsEffect * | graphicsEffect () const |
QGraphicsProxyWidget * | graphicsProxyWidget () const |
bool | hasEditFocus () const |
bool | hasFocus () const |
virtual bool | hasHeightForWidth () const |
bool | hasMouseTracking () const |
int | height () const |
virtual int | heightForWidth (int width) const |
Qt::InputMethodHints | inputMethodHints () const |
virtual QVariant | inputMethodQuery (Qt::InputMethodQuery query) const |
void | insertAction (QAction *before, QAction *action) |
void | insertActions (QAction *before, QList< QAction * > actions) |
bool | isActiveWindow () const |
bool | isAncestorOf (const QWidget *child) const |
bool | isEnabled () const |
bool | isEnabledTo (const QWidget *parent) const |
bool | isEnabledToTLW () const |
bool | isFullScreen () const |
bool | isHidden () const |
bool | isMaximized () const |
bool | isMinimized () const |
bool | isModal () const |
bool | isTopLevel () const |
bool | isVisible () const |
bool | isVisibleTo (const QWidget *parent) const |
bool | isWindow () const |
bool | isWindowModified () const |
QLayout * | layout () const |
Qt::LayoutDirection | layoutDirection () const |
QLocale | locale () const |
QPoint | mapFrom (const QWidget *parent, const QPoint &pos) const |
QPoint | mapFromGlobal (const QPoint &pos) const |
QPoint | mapFromParent (const QPoint &pos) const |
QPoint | mapTo (const QWidget *parent, const QPoint &pos) const |
QPoint | mapToGlobal (const QPoint &pos) const |
QPoint | mapToParent (const QPoint &pos) const |
QRegion | mask () const |
int | maximumHeight () const |
QSize | maximumSize () const |
int | maximumWidth () const |
int | minimumHeight () const |
QSize | minimumSize () const |
virtual QSize | minimumSizeHint () const |
int | minimumWidth () const |
void | move (const QPoint &point) |
void | move (int x, int y) |
QWidget * | nativeParentWidget () const |
QWidget * | nextInFocusChain () const |
QRect | normalGeometry () const |
void | overrideWindowFlags (Qt::WindowFlags flags) |
QPaintEngine * | paintEngine () const override |
const QPalette & | palette () const |
QWidget * | parentWidget () const |
QPoint | pos () const |
QWidget * | previousInFocusChain () const |
QRect | rect () const |
void | releaseKeyboard () |
void | releaseMouse () |
void | releaseShortcut (int id) |
void | removeAction (QAction *action) |
void | render (QPaintDevice *target, const QPoint &targetOffset=QPoint (), const QRegion &sourceRegion=QRegion (), RenderFlags renderFlags=RenderFlags (DrawWindowBackground|DrawChildren)) |
void | render (QPainter *painter, const QPoint &targetOffset=QPoint (), const QRegion &sourceRegion=QRegion (), RenderFlags renderFlags=RenderFlags (DrawWindowBackground|DrawChildren)) |
void | repaint (const QRect &rect) |
void | repaint (const QRegion ®ion) |
void | repaint (int x, int y, int w, int h) |
void | resize (const QSize &size) |
void | resize (int w, int h) |
bool | restoreGeometry (const QByteArray &geometry) |
QByteArray | saveGeometry () const |
void | scroll (int dx, int dy) |
void | scroll (int dx, int dy, const QRect &rect) |
void | setAcceptDrops (bool on) |
void | setAccessibleDescription (const QString &description) |
void | setAccessibleName (const QString &name) |
void | setAttribute (Qt::WidgetAttribute attribute, bool enable=true) |
void | setAutoFillBackground (bool enable) |
void | setBackgroundRole (QPalette::ColorRole role) |
void | setBaseSize (const QSize &size) |
void | setBaseSize (int basew, int baseh) |
void | setContentsMargins (const QMargins &margins) |
void | setContentsMargins (int left, int top, int right, int bottom) |
void | setContextMenuPolicy (Qt::ContextMenuPolicy policy) |
void | setCursor (const QCursor &cursor) |
void | setEditFocus (bool enable) |
void | setFixedHeight (int h) |
void | setFixedSize (const QSize &size) |
void | setFixedSize (int w, int h) |
void | setFixedWidth (int w) |
void | setFocus (Qt::FocusReason reason) |
void | setFocusPolicy (Qt::FocusPolicy policy) |
void | setFocusProxy (QWidget *widget) |
void | setFont (const QFont &font) |
void | setForegroundRole (QPalette::ColorRole role) |
void | setGeometry (const QRect &rect) |
void | setGeometry (int x, int y, int w, int h) |
void | setGraphicsEffect (QGraphicsEffect *effect) |
void | setInputMethodHints (Qt::InputMethodHints hints) |
void | setLayout (QLayout *layout) |
void | setLayoutDirection (Qt::LayoutDirection direction) |
void | setLocale (const QLocale &locale) |
void | setMask (const QBitmap &bitmap) |
void | setMask (const QRegion ®ion) |
void | setMaximumHeight (int maxh) |
void | setMaximumSize (const QSize &size) |
void | setMaximumSize (int maxw, int maxh) |
void | setMaximumWidth (int maxw) |
void | setMinimumHeight (int minh) |
void | setMinimumSize (const QSize &size) |
void | setMinimumSize (int minw, int minh) |
void | setMinimumWidth (int minw) |
void | setMouseTracking (bool enable) |
void | setPalette (const QPalette &palette) |
void | setParent (QWidget *parent) |
void | setParent (QWidget *parent, Qt::WindowFlags flags) |
void | setShortcutAutoRepeat (int id, bool enable=true) |
void | setShortcutEnabled (int id, bool enable=true) |
void | setSizeIncrement (const QSize &size) |
void | setSizeIncrement (int w, int h) |
void | setSizePolicy (QSizePolicy policy) |
void | setSizePolicy (QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical) |
void | setStatusTip (const QString &data) |
void | setStyle (QStyle *style) |
void | setToolTip (const QString &data) |
void | setToolTipDuration (int msec) |
void | setUpdatesEnabled (bool enable) |
void | setWhatsThis (const QString &str) |
void | setWindowFilePath (const QString &filePath) |
void | setWindowFlags (Qt::WindowFlags flags) |
void | setWindowIcon (const QIcon &icon) |
void | setWindowModality (Qt::WindowModality windowModality) |
void | setWindowOpacity (qreal level) |
void | setWindowRole (const QString &role) |
void | setWindowState (Qt::WindowStates windowState) |
QSize | size () const |
virtual QSize | sizeHint () const |
QSize | sizeIncrement () const |
QSizePolicy | sizePolicy () const |
void | stackUnder (QWidget *widget) |
QString | statusTip () const |
QStyle * | style () const |
QString | styleSheet () const |
bool | testAttribute (Qt::WidgetAttribute attribute) const |
QString | toolTip () const |
int | toolTipDuration () const |
QWidget * | topLevelWidget () const |
bool | underMouse () const |
void | ungrabGesture (Qt::GestureType gestureType) |
void | unsetCursor () |
void | unsetLayoutDirection () |
void | unsetLocale () |
void | update (const QRect &rect) |
void | update (const QRegion ®ion) |
void | update (int x, int y, int w, int h) |
void | updateGeometry () |
bool | updatesEnabled () const |
QRegion | visibleRegion () const |
QString | whatsThis () const |
int | width () const |
QWidget * | window () const |
QString | windowFilePath () const |
Qt::WindowFlags | windowFlags () const |
QWindow * | windowHandle () const |
QIcon | windowIcon () const |
Qt::WindowModality | windowModality () const |
qreal | windowOpacity () const |
QString | windowRole () const |
Qt::WindowStates | windowState () const |
QString | windowTitle () const |
Qt::WindowType | windowType () const |
WId | winId () const |
int | x () const |
int | y () const |
![]() | |
QObject (QObject *parent=nullptr) | |
~QObject () | |
bool | blockSignals (bool block) |
const QList< QObject * > & | children () const |
bool | connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
bool | connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
bool | disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const |
bool | disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const |
bool | disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QString > | dynamicPropertyNames () const |
virtual bool | event (QEvent *event) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
template<typename T > | |
T | findChild (const QString &childName=QString ()) const |
template<class T > | |
QList< T > | findChildren (const QRegularExpression ®Exp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
template<class T > | |
QList< T > | findChildren (const QString &objName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
bool | inherits (const QString &className) const |
void | installEventFilter (QObject *filterObj) |
bool | isWidgetType () const |
bool | isWindowType () const |
void | killTimer (int id) |
const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const |
QObject * | parent () const |
template<class T = QVariant> | |
T | property (const QString &name) const |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const QString &name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
QThread * | thread () const |
![]() | |
virtual | ~QPaintDevice () |
int | colorCount () const |
int | depth () const |
int | devicePixelRatio () const |
qreal | devicePixelRatioF () const |
int | height () const |
int | heightMM () const |
int | logicalDpiX () const |
int | logicalDpiY () const |
bool | paintingActive () const |
int | physicalDpiX () const |
int | physicalDpiY () const |
int | width () const |
int | widthMM () const |
Protected Methods | |
void | actionEvent (QActionEvent *event) override |
void | changeEvent (QEvent *event) override |
void | paintEvent (QPaintEvent *event) override |
![]() | |
virtual void | closeEvent (QCloseEvent *event) |
virtual void | contextMenuEvent (QContextMenuEvent *event) |
void | create (WId window=0, bool initializeWindow=true, bool destroyOldWindow=true) |
void | destroy (bool destroyWindow=true, bool destroySubWindows=true) |
virtual void | dragEnterEvent (QDragEnterEvent *event) |
virtual void | dragLeaveEvent (QDragLeaveEvent *event) |
virtual void | dragMoveEvent (QDragMoveEvent *event) |
virtual void | dropEvent (QDropEvent *event) |
virtual void | enterEvent (QEvent *event) |
bool | event (QEvent *event) override |
virtual void | focusInEvent (QFocusEvent *event) |
bool | focusNextChild () |
virtual bool | focusNextPrevChild (bool next) |
virtual void | focusOutEvent (QFocusEvent *event) |
bool | focusPreviousChild () |
virtual void | hideEvent (QHideEvent *event) |
void | initPainter (QPainter *painter) const override |
virtual void | inputMethodEvent (QInputMethodEvent *event) |
virtual void | keyPressEvent (QKeyEvent *event) |
virtual void | keyReleaseEvent (QKeyEvent *event) |
virtual void | leaveEvent (QEvent *event) |
int | metric (PaintDeviceMetric metric) const override |
virtual void | mouseDoubleClickEvent (QMouseEvent *event) |
virtual void | mouseMoveEvent (QMouseEvent *event) |
virtual void | mousePressEvent (QMouseEvent *event) |
virtual void | mouseReleaseEvent (QMouseEvent *event) |
virtual void | moveEvent (QMoveEvent *event) |
virtual bool | nativeEvent (const QByteArray &eventType, void *message, long *result) |
virtual void | resizeEvent (QResizeEvent *event) |
virtual void | showEvent (QShowEvent *event) |
virtual void | tabletEvent (QTabletEvent *event) |
virtual void | wheelEvent (QWheelEvent *event) |
![]() | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signalMethod) const |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signalMethod) const |
bool | isSignalConnected (const QMetaMethod &signalMethod) const |
int | receivers (const QString &signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
![]() | |
QPaintDevice () | |
Friends | |
class | QMainWindow |
Additional Inherited Members | |
![]() | |
enum | RenderFlag |
![]() | |
enum | PaintDeviceMetric |
![]() | |
static QWidget * | createWindowContainer (QWindow *window, QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::EmptyFlag) |
static QWidget * | find (WId id) |
static QWidget * | keyboardGrabber () |
static QWidget * | mouseGrabber () |
static void | setTabOrder (QWidget *firstWidget, QWidget *secondWidget) |
![]() | |
static bool | connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ()) |
static bool | connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn > | |
static bool | connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T > | |
static bool | connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod) |
static bool | disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod) |
static bool | disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod) |
static bool | disconnect (const QObject *sender, std::nullptr_t, const QObject *receiver, std::nullptr_t) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...)) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod) |
static QMetaObject & | staticMetaObject () |
static QString | tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >()) |
![]() | |
void | updateMicroFocus () |
![]() | |
QWidgetList | |
WId | |
![]() | |
T | qobject_cast (QObject *object) |
QObjectList | |
The QToolBar class provides a movable panel that contains a set of controls.
Toolbar buttons are added by adding actions, using addAction() or insertAction(). Groups of buttons can be separated using addSeparator() or insertSeparator(). If a toolbar button is not appropriate, a widget can be inserted instead using addWidget() or insertWidget(); examples of suitable widgets are QSpinBox, QDoubleSpinBox, and QComboBox. When a toolbar button is pressed it emits the actionTriggered() signal.
A toolbar can be fixed in place in a particular area (e.g. at the top of the window), or it can be movable (isMovable()) between toolbar areas; see allowedAreas() and isAreaAllowed().
When a toolbar is resized in such a way that it is too small to show all the items it contains, an extension button will appear as the last item in the toolbar. Pressing the extension button will pop up a menu containing the items that does not currently fit in the toolbar.
When a QToolBar is not a child of a QMainWindow, it loses the ability to populate the extension pop up with widgets added to the toolbar using addWidget(). Please use widget actions created by inheriting QWidgetAction and implementing QWidgetAction::createWidget() instead.
Constructs a QToolBar with the given parent.
The given window title identifies the toolbar and is shown in the context menu provided by QMainWindow.
|
explicit |
Constructs a QToolBar with the given parent.
QToolBar::~QToolBar | ( | ) |
Destroys the toolbar.
Returns the action at point p. This method returns a nullptr if no action was found.
|
inline |
Returns the action at the point x, y. This method returns a nullptr if no action was found.
|
overrideprotectedvirtual |
This event handler is called with the given event whenever the widget's actions are changed.
Reimplemented from QWidget.
Returns the geometry of the toolbar item associated with the given action or an invalid QRect if no matching item is found.
|
signal |
This signal is emitted when an action in this toolbar is triggered. This happens when the action's tool button is pressed, or when the action is triggered in some other way outside the tool bar. The parameter holds the triggered action.
Creates a new action with the given icon and text. This action is added to the end of the toolbar.
QAction * QToolBar::addAction | ( | const QIcon & | icon, |
const QString & | text, | ||
const QObject * | context, | ||
Func1 | slot | ||
) |
Creates a new action with the given icon and text. This action is added to the end of the toolbar. The action's triggered() signal is connected to the slot.
If context is destroyed, the slot will not be called.
QAction * QToolBar::addAction | ( | const QIcon & | icon, |
const QString & | text, | ||
const QObject * | receiver, | ||
const QString & | member | ||
) |
Creates a new action with the given icon and text. This action is added to the end of the toolbar. The QAction::triggered() signal is connected to member in receiver.
QAction * QToolBar::addAction | ( | const QIcon & | icon, |
const QString & | text, | ||
Func1 | slot | ||
) |
Creates a new action with the given icon and text. This action is added to the end of the toolbar. The action's triggered() signal is connected to the slot.
Creates a new action with the given actionIcon and text. This action is added to the end of the toolbar. The QAction::triggered() signal is connected to the function object slot.
Creates a new action with the given text. This action is added to the end of the toolbar.
QAction * QToolBar::addAction | ( | const QString & | text, |
const QObject * | context, | ||
Func1 | slot | ||
) |
Creates a new action with the given text. This action is added to the end of the toolbar. The action's triggered() signal is connected to the slot.
If context is destroyed, the slot will not be called.
QAction * QToolBar::addAction | ( | const QString & | text, |
const QObject * | receiver, | ||
const QString & | member | ||
) |
Creates a new action with the given text. This action is added to the end of the toolbar. The QAction::triggered() signal is connected to member in receiver.
Creates a new action with the given text. This action is added to the end of the toolbar. The action's triggered() signal is connected to the slot.
|
using |
Appends action to the list of existing actions available for this widget. A QAction list is typically used to create a context QMenu, however it can be represented in different ways depending on the widget.
A QWidget should only have one of each action. Adding an action which already exists will not cause the same action to be in the widget multiple times. The ownership of action is not transferred to this QWidget.
QAction * QToolBar::addSeparator | ( | ) |
Adds a separator to the end of the toolbar.
Adds the given widget to the toolbar as the toolbar's last item.
The toolbar takes ownership of widget.
If you add a QToolButton with this method, the tools bar's Qt::ToolButtonStyle will not be respected.
Qt::ToolBarAreas QToolBar::allowedAreas | ( | ) | const |
Returns the value of the property.
|
signal |
This signal is emitted when the collection of allowed areas for the toolbar is changed. The new areas in which the toolbar can be positioned are specified by allowedAreas.
|
overrideprotectedvirtual |
This event handler can be reimplemented to handle state changes. The state being changed in this event can be retrieved through the event supplied.
Reimplemented from QWidget.
void QToolBar::clear | ( | ) |
Removes all actions from the toolbar.
QSize QToolBar::iconSize | ( | ) | const |
Returns the value of the property.
|
signal |
This signal is emitted when the icon size is changed. The iconSize parameter holds the toolbar's new icon size.
Inserts a separator into the toolbar in front of the toolbar item associated with the before action.
Inserts the given widget in front of the toolbar item associated with the before action.
Note: You should use QAction::setVisible() to change the visibility of the widget. Using QWidget::setVisible(), QWidget::show() and QWidget::hide() does not work.
|
inline |
Returns true if this toolbar is dockable in the given area, otherwise returns false.
bool QToolBar::isFloatable | ( | ) | const |
Property documentation pending.
bool QToolBar::isFloating | ( | ) | const |
Property documentation pending.
bool QToolBar::isMovable | ( | ) | const |
Returns the value of the property.
|
signal |
This signal is emitted when the toolbar becomes movable or fixed. If the toolbar can be moved, movable is true, otherwise it is false.
Qt::Orientation QToolBar::orientation | ( | ) | const |
Returns the value of the property.
|
signal |
This signal is emitted when the orientation of the toolbar changes. The new orientation is specified by the orientation given.
|
overrideprotectedvirtual |
This event handler can be reimplemented in a subclass to receive paint events passed in event. A paint event is a request to repaint all or part of a widget. It can happen for one of the following reasons.
Many widgets can simply repaint their entire surface when asked to, but some slow widgets need to optimize by painting only the requested region: QPaintEvent::region(). This speed optimization does not change the result, as painting is clipped to that region during event processing. QListView and QTableView do this, for example.
CopperSpice also tries to speed up painting by merging multiple paint events into one. When update() is called several times or the window system sends several paint events, CopperSpice merges these events into one event with a larger region (see QRegion::united()). The repaint() function does not permit this optimization, so we suggest using update() whenever possible.
When the paint event occurs, the update region has normally been erased, so you are painting on the widget's background. The background can be set using setBackgroundRole() and setPalette().
QWidget automatically double-buffers its painting, so there is no need to write double-buffering code in paintEvent() to avoid flicker.
For the X11 platform it is possible to toggle global double buffering by calling qt_x11_set_global_double_buffer()
.
Generally you should refrain from calling update() or repaint() inside a paintEvent(). For example, calling update() or repaint() on children inside a paintevent() results in undefined behavior; the child may or may not get a paint event.
Reimplemented from QWidget.
void QToolBar::setAllowedAreas | ( | Qt::ToolBarAreas | areas | ) |
Sets the value of the property to areas.
void QToolBar::setFloatable | ( | bool | floatable | ) |
Property documentation pending.
|
slot |
Property documentation pending.
void QToolBar::setMovable | ( | bool | movable | ) |
Sets the value of the property to moveable.
void QToolBar::setOrientation | ( | Qt::Orientation | orientation | ) |
Sets the value of the property to orientation.
|
slot |
Property documentation pending.
QAction * QToolBar::toggleViewAction | ( | ) | const |
Returns a checkable action that can be used to show or hide this toolbar.
The action's text is set to the toolbar's window title.
Qt::ToolButtonStyle QToolBar::toolButtonStyle | ( | ) | const |
Returns the value of the property.
|
signal |
This signal is emitted when the tool button style is changed. The toolButtonStyle parameter holds the toolbar's new tool button style.
|
signal |
This signal is emitted when the floating property changes. The topLevel parameter is true if the toolbar is now floating, otherwise it is false.
|
signal |
This signal is emitted when the toolbar becomes visible (or invisible). This happens when the widget is hidden or shown.
Returns the widget associated with the specified action.
|
This property holds areas where the toolbar may be placed. The default is Qt::AllToolBarAreas. This property only makes sense if the toolbar is in a QMainWindow.
Properties | Class Methods |
---|---|
read | allowedAreas |
write | setAllowedAreas |
|
This property holds whether the toolbar can be dragged and dropped as an independent window. The default is true.
Properties | Class Methods |
---|---|
read | isFloatable |
write | setFloatable |
|
This property holds whether the toolbar is an independent window. By default, this property is true.
Properties | Class Methods |
---|---|
read | isFloating |
|
This property holds size of icons in the toolbar.
The default size is determined by the application's style and is derived from the QStyle::PM_ToolBarIconSize pixel metric. It is the maximum size an icon can have. Icons of smaller size will not be scaled up.
Properties | Class Methods |
---|---|
read | iconSize |
write | setIconSize |
notify | iconSizeChanged |
|
This property holds whether the user can move the toolbar within the toolbar area, or between toolbar areas. By default, this property is true.
This property only makes sense if the toolbar is in a QMainWindow.
Properties | Class Methods |
---|---|
read | isMovable |
write | setMovable |
|
This property holds orientation of the toolbar. The default is Qt::Horizontal.
This method should not be used when the toolbar is managed by QMainWindow. You can use QMainWindow::addToolBar() or QMainWindow::insertToolBar() if you wish to move a toolbar (that is already added to a main window) to another Qt::ToolBarArea.
Properties | Class Methods |
---|---|
read | orientation |
write | setOrientation |
|
This property holds the style of toolbar buttons.
This property defines the style of all tool buttons that are added as QActions. Note that if you add a QToolButton with the addWidget() method, it will not get this button style.
The default is Qt::ToolButtonIconOnly.
Properties | Class Methods |
---|---|
read | toolButtonStyle |
write | setToolButtonStyle |
notify | toolButtonStyleChanged |