pyqtribbon
Submodules
Package Contents
Classes
The button style of a category. |
|
A permanent menu. |
|
Mode to find available space in a grid layout, ColumnWise or RowWise. |
|
The RibbonBar class is the top level widget that contains the ribbon. |
|
Enum where members are also (and must be) ints |
|
Button style, Small, Medium, or Large. |
Attributes
- class pyqtribbon.RibbonCategoryStyle[source]
Bases:
enum.IntEnum
The button style of a category.
- class pyqtribbon.RibbonMenu(title: str = '', parent=None) RibbonMenu(parent=None)[source]
Bases:
qtpy.QtWidgets.QMenu
- addWidget(widget: qtpy.QtWidgets.QWidget)[source]
Add a widget to the menu.
- Parameters:
widget – The widget to add.
- addHorizontalLayoutWidget() qtpy.QtWidgets.QHBoxLayout [source]
Add a horizontal layout widget to the menu.
- Returns:
The horizontal layout.
- addVerticalLayoutWidget() qtpy.QtWidgets.QVBoxLayout [source]
Add a vertical layout widget to the menu.
- Returns:
The vertical layout.
- addGridLayoutWidget() qtpy.QtWidgets.QGridLayout [source]
Add a grid layout widget to the menu.
- Returns:
The grid layout.
- class pyqtribbon.RibbonPermanentMenu(title: str = '', parent=None) RibbonPermanentMenu(parent=None)[source]
Bases:
RibbonMenu
A permanent menu.
- hideEvent(a0: QHideEvent) None [source]
- actionEvent(a0: QActionEvent) None [source]
- class pyqtribbon.RibbonSpaceFindMode[source]
Bases:
enum.IntEnum
Mode to find available space in a grid layout, ColumnWise or RowWise.
- class pyqtribbon.RibbonBar(title: str = '', maxRows=6, parent=None) RibbonBar(parent=None)[source]
Bases:
qtpy.QtWidgets.QMenuBar
The RibbonBar class is the top level widget that contains the ribbon.
- _categories: Dict[str, pyqtribbon.category.RibbonCategory][source]
- setRibbonStyle(style: RibbonStyle)[source]
Set the style of the ribbon.
- Parameters:
style – The style to set.
- applicationOptionButton() pyqtribbon.titlewidget.RibbonApplicationButton [source]
Return the application button.
- setApplicationIcon(icon: qtpy.QtGui.QIcon)[source]
Set the application icon.
- Parameters:
icon – The icon to set.
- addTitleWidget(widget: qtpy.QtWidgets.QWidget)[source]
Add a widget to the title widget.
- Parameters:
widget – The widget to add.
- removeTitleWidget(widget: qtpy.QtWidgets.QWidget)[source]
Remove a widget from the title widget.
- Parameters:
widget – The widget to remove.
- insertTitleWidget(index: int, widget: qtpy.QtWidgets.QWidget)[source]
Insert a widget to the title widget.
- Parameters:
index – The index to insert the widget.
widget – The widget to insert.
- addFileMenu() pyqtribbon.menu.RibbonMenu [source]
Add a file menu to the ribbon.
- setRibbonHeight(height: int)[source]
Set the total height of the ribbon.
- Parameters:
height – The height to set.
- tabBar() pyqtribbon.tabbar.RibbonTabBar [source]
Return the tab bar of the ribbon.
- Returns:
The tab bar of the ribbon.
- quickAccessToolBar() qtpy.QtWidgets.QToolBar [source]
Return the quick access toolbar of the ribbon.
- Returns:
The quick access toolbar of the ribbon.
- addQuickAccessButton(button: qtpy.QtWidgets.QToolButton)[source]
Add a button to the quick access bar.
- Parameters:
button – The button to add.
- setQuickAccessButtonHeight(height: int = 30)[source]
Set the height of the quick access buttons.
- Parameters:
height – The height to set.
- rightToolBar() qtpy.QtWidgets.QToolBar [source]
Return the right toolbar of the ribbon.
- Returns:
The right toolbar of the ribbon.
- addRightToolButton(button: qtpy.QtWidgets.QToolButton)[source]
Add a widget to the right button bar.
- Parameters:
button – The button to add.
- setRightToolBarHeight(height: int = 24)[source]
Set the height of the right buttons.
- Parameters:
height – The height to set.
- helpRibbonButton() qtpy.QtWidgets.QToolButton [source]
Return the help button of the ribbon.
- Returns:
The help button of the ribbon.
- setHelpButtonIcon(icon: qtpy.QtGui.QIcon)[source]
Set the icon of the help button.
- Parameters:
icon – The icon to set.
- collapseRibbonButton() qtpy.QtWidgets.QToolButton [source]
Return the collapse ribbon button.
- Returns:
The collapse ribbon button.
- setCollapseButtonIcon(icon: qtpy.QtGui.QIcon)[source]
Set the icon of the min button.
- Parameters:
icon – The icon to set.
- category(name: str) pyqtribbon.category.RibbonCategory [source]
Return the category with the given name.
- Parameters:
name – The name of the category.
- Returns:
The category with the given name.
- categories() Dict[str, pyqtribbon.category.RibbonCategory] [source]
Return a list of categories of the ribbon.
- Returns:
A dict of categories of the ribbon.
- addCategoriesBy(data: Dict[str, Dict]) Dict[str, pyqtribbon.category.RibbonCategory] [source]
Add categories from a dict.
- Parameters:
data –
The dict of categories. The dict is of the form:
{ "category-title": { "style": RibbonCategoryStyle.Normal, "color": QtCore.Qt.red, "panels": { "panel-title": { "showPanelOptionButton": True, "widgets": { "widget-name": { "type": "Button", "arguments": { "key1": "value1", "key2": "value2" } }, } }, }, } }
- Returns:
A dict of categories of the ribbon.
- addCategory(title: str, style=RibbonCategoryStyle.Normal, color: qtpy.QtGui.QColor = None) pyqtribbon.category.RibbonNormalCategory | pyqtribbon.category.RibbonContextCategory [source]
Add a new category to the ribbon.
- Parameters:
title – The title of the category.
style – The button style of the category.
color – The color of the context category, only used if style is Context, if None, the default color will be used.
- Returns:
The newly created category.
- addNormalCategory(title: str) pyqtribbon.category.RibbonNormalCategory [source]
Add a new category to the ribbon.
- Parameters:
title – The title of the category.
- Returns:
The newly created category.
- addContextCategory(title: str, color: qtpy.QtGui.QColor | qtpy.QtCore.Qt.GlobalColor = QtCore.Qt.blue) pyqtribbon.category.RibbonContextCategory [source]
Add a new context category to the ribbon.
- Parameters:
title – The title of the category.
color – The color of the context category, if None, the default color will be used.
- Returns:
The newly created category.
- addContextCategories(name: str, titles: List[str], color: qtpy.QtGui.QColor | qtpy.QtCore.Qt.GlobalColor = QtCore.Qt.blue) pyqtribbon.category.RibbonContextCategories [source]
Add a group of context categories with the same tab color to the ribbon.
- Parameters:
name – The name of the context categories.
titles – The title of the category.
color – The color of the context category, if None, the default color will be used.
- Returns:
The newly created category.
- showContextCategory(category: pyqtribbon.category.RibbonContextCategory | pyqtribbon.category.RibbonContextCategories)[source]
Show the given category or categories, if it is not a context category, nothing happens.
- Parameters:
category – The category to show.
- hideContextCategory(category: pyqtribbon.category.RibbonContextCategory | pyqtribbon.category.RibbonContextCategories)[source]
Hide the given category or categories, if it is not a context category, nothing happens.
- Parameters:
category – The category to hide.
- categoryVisible(category: pyqtribbon.category.RibbonCategory) bool [source]
Return whether the category is shown.
- Parameters:
category – The category to check.
- Returns:
Whether the category is shown.
- removeCategory(category: pyqtribbon.category.RibbonCategory)[source]
Remove a category from the ribbon.
- Parameters:
category – The category to remove.
- removeCategories(categories: pyqtribbon.category.RibbonContextCategories)[source]
Remove a list of categories from the ribbon.
- Parameters:
categories – The categories to remove.
- setCurrentCategory(category: pyqtribbon.category.RibbonCategory)[source]
Set the current category.
- Parameters:
category – The category to set.
- currentCategory() pyqtribbon.category.RibbonCategory [source]
Return the current category.
- Returns:
The current category.
- minimumSizeHint() qtpy.QtCore.QSize [source]
Return the minimum size hint of the widget.
- Returns:
The minimum size hint.
- class pyqtribbon.RibbonStyle[source]
Bases:
enum.IntEnum
Enum where members are also (and must be) ints
- class pyqtribbon.RibbonButtonStyle[source]
Bases:
enum.IntEnum
Button style, Small, Medium, or Large.