Home · All Classes · Main Classes · Grouped Classes · Modules · Functions |
The QToolBar class provides a movable panel that contains a set of controls. More...
#include <QToolBar>
Inherits QWidget.
|
|
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. Note that only action based items will be shown in the menu. If only non-action based items are to appear in the extension menu (e.g. a QSpinBox), the extension button will appear as usual, but it will be disabled to indicate that some items in the toolbar are currently not visible.
See also QToolButton.
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.
Access functions:
See also movable.
This property holds size of icons in the toolbar.
The default is Qt::AutomaticIconSize.
Access functions:
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.
Access functions:
See also allowedAreas.
This property holds orientation of the toolbar.
The default is Qt::Horizontal.
The orientation is updated automatically when the toolbar is managed by QMainWindow.
Access functions:
This property holds the style of toolbar buttons.
The default is Qt::ToolButtonIconOnly.
Access functions:
Constructs a QToolBar with the given parent.
The window title is set to title. This title is used when the toolbar is floating as an independent window. It is also shown in the context menu provided by QMainWindow.
See also setWindowTitle().
Constructs a QToolBar with the given parent.
Destroys the toolbar.
Returns the action at point p. This function returns zero if no action was found.
See also QWidget::childAt().
This is an overloaded member function, provided for convenience.
Returns the action at the point x, y. This function returns zero if no action was found.
This signal is emitted when a toolbar button is pressed. The parameter holds the toolbar button's associated action.
Creates a new action with the given text. This action is added to the end of the toolbar.
This is an overloaded member function, provided for convenience.
Creates a new action with the given icon and text. This action is added to the end of the toolbar.
This is an overloaded member function, provided for convenience.
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 member in receiver.
This is an overloaded member function, provided for convenience.
Creates a new action with the icon icon and text text. This action is added to the end of the toolbar. The action's triggered() signal is connected to member in receiver.
Adds a separator to the end of the toolbar.
See also insertSeparator().
Adds the given widget to the toolbar as the toolbar's last item.
Note: You should use QAction::setVisible() to change the visibility of the widget. Using QWidget::setVisible(), QWidget::show() and QWidget::hide() does not work.
See also insertWidget().
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.
See also allowedAreas.
Removes all actions from the toolbar.
See also removeAction().
This signal is emitted when the icon size is changed. The iconSize parameter holds the toolbar's new icon size.
See also iconSize and QMainWindow::iconSize.
Inserts a separator into the toolbar in front of the toolbar item associated with the before action.
See also addSeparator().
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.
See also addWidget().
Returns true if this toolbar is dockable in the given area; otherwise returns false.
This signal is emitted when the toolbar becomes movable or fixed. If the toolbar can be moved, movable is true; otherwise it is false.
See also movable.
This signal is emitted when the orientation of the toolbar changes. The new orientation is specified by the orientation given.
See also orientation.
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.
See also QAction::text and QWidget::windowTitle.
This signal is emitted when the tool button style is changed. The toolButtonStyle parameter holds the toolbar's new tool button style.
See also toolButtonStyle and QMainWindow::toolButtonStyle.
Copyright © 2006 Trolltech | Trademarks | Qt 4.1.3 |