The PySide.QtGui.QToolBar class provides a movable panel that contains a set of controls.
Toolbar buttons are added by adding actions , using PySide.QtGui.QToolBar.addAction() or PySide.QtGui.QWidget.insertAction() . Groups of buttons can be separated using PySide.QtGui.QToolBar.addSeparator() or PySide.QtGui.QToolBar.insertSeparator() . If a toolbar button is not appropriate, a widget can be inserted instead using PySide.QtGui.QToolBar.addWidget() or PySide.QtGui.QToolBar.insertWidget() ; examples of suitable widgets are PySide.QtGui.QSpinBox , PySide.QtGui.QDoubleSpinBox , and PySide.QtGui.QComboBox . When a toolbar button is pressed it emits the PySide.QtGui.QToolBar.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 ( PySide.QtGui.QToolBar.isMovable() ) between toolbar areas; see PySide.QtGui.QToolBar.allowedAreas() and PySide.QtGui.QToolBar.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 PySide.QtGui.QToolBar is not a child of a PySide.QtGui.QMainWindow , it loses the ability to populate the extension pop up with widgets added to the toolbar using PySide.QtGui.QToolBar.addWidget() . Please use widget actions created by inheriting PySide.QtGui.QWidgetAction and implementing QWidgetAction.createWidget() instead.
See also
PySide.QtGui.QToolButton PySide.QtGui.QMenu PySide.QtGui.QAction Application Example
Parameters: |
|
---|
Constructs a PySide.QtGui.QToolBar with the given parent .
Constructs a PySide.QtGui.QToolBar with the given parent .
The given window title identifies the toolbar and is shown in the context menu provided by PySide.QtGui.QMainWindow .
Parameters: | p – PySide.QtCore.QPoint |
---|---|
Return type: | PySide.QtGui.QAction |
Returns the action at point p . This function returns zero if no action was found.
See also
Parameters: |
|
---|---|
Return type: |
This is an overloaded function.
Returns the action at the point x , y . This function returns zero if no action was found.
Parameters: | action – PySide.QtGui.QAction |
---|---|
Return type: | PySide.QtCore.QRect |
Returns the geometry of the toolbar item associated with the given action , or an invalid PySide.QtCore.QRect if no matching item is found.
Parameters: | action – PySide.QtGui.QAction |
---|
Parameters: |
|
---|---|
Return type: |
This is an overloaded function.
Creates a new action with the given text . This action is added to the end of the toolbar. The action’s PySide.QtGui.QAction.triggered() signal is connected to member in receiver .
Parameters: | text – unicode |
---|---|
Return type: | PySide.QtGui.QAction |
This is an overloaded function.
Creates a new action with the given text . This action is added to the end of the toolbar.
Parameters: |
|
---|---|
Return type: |
This is an overloaded function.
Creates a new action with the icon icon and text text . This action is added to the end of the toolbar. The action’s PySide.QtGui.QAction.triggered() signal is connected to member in receiver .
Parameters: |
|
---|---|
Return type: |
This is an overloaded function.
Creates a new action with the given icon and text . This action is added to the end of the toolbar.
Return type: | PySide.QtGui.QAction |
---|
Adds a separator to the end of the toolbar.
Parameters: | widget – PySide.QtGui.QWidget |
---|---|
Return type: | PySide.QtGui.QAction |
Adds the given widget to the toolbar as the toolbar’s last item.
The toolbar takes ownership of widget .
If you add a PySide.QtGui.QToolButton with this method, the tools bar’s Qt.ToolButtonStyle will not be respected.
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
Return type: | PySide.QtCore.Qt.ToolBarAreas |
---|
Parameters: | allowedAreas – PySide.QtCore.Qt.ToolBarAreas |
---|
Removes all actions from the toolbar.
See also
Return type: | PySide.QtCore.QSize |
---|
See also
Parameters: | iconSize – PySide.QtCore.QSize |
---|
Parameters: | option – PySide.QtGui.QStyleOptionToolBar |
---|
Parameters: | before – PySide.QtGui.QAction |
---|---|
Return type: | PySide.QtGui.QAction |
Inserts a separator into the toolbar in front of the toolbar item associated with the before action.
See also
Parameters: |
|
---|---|
Return type: |
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
Parameters: | area – PySide.QtCore.Qt.ToolBarArea |
---|---|
Return type: | PySide.QtCore.bool |
Return type: | PySide.QtCore.bool |
---|
Return type: | PySide.QtCore.bool |
---|
Return type: | PySide.QtCore.bool |
---|
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 PySide.QtGui.QMainWindow .
See also
Parameters: | movable – PySide.QtCore.bool |
---|
Return type: | PySide.QtCore.Qt.Orientation |
---|
Parameters: | orientation – PySide.QtCore.Qt.Orientation |
---|
Parameters: | areas – PySide.QtCore.Qt.ToolBarAreas |
---|
Parameters: | floatable – PySide.QtCore.bool |
---|
See also
Parameters: | iconSize – PySide.QtCore.QSize |
---|
See also
Parameters: | movable – PySide.QtCore.bool |
---|
See also
Parameters: | orientation – PySide.QtCore.Qt.Orientation |
---|
Parameters: | toolButtonStyle – PySide.QtCore.Qt.ToolButtonStyle |
---|
Return type: | PySide.QtGui.QAction |
---|
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
Return type: | PySide.QtCore.Qt.ToolButtonStyle |
---|
Parameters: | toolButtonStyle – PySide.QtCore.Qt.ToolButtonStyle |
---|
Parameters: | topLevel – PySide.QtCore.bool |
---|
Parameters: | visible – PySide.QtCore.bool |
---|
Parameters: | action – PySide.QtGui.QAction |
---|---|
Return type: | PySide.QtGui.QWidget |
Returns the widget associated with the specified action .
See also