pyqtribbon.category
Module Contents
Classes
The button style of a category. |
|
Previous/Next buttons in the category when the |
|
Scroll area for the gallery |
|
Scroll area contents for the gallery |
|
The category layout widget's category scroll area to arrange the widgets in the category. |
|
The RibbonCategory is the logical grouping that represents the contents of a ribbon tab. |
|
A normal category. |
|
A context category. |
|
A list of context categories. |
- class pyqtribbon.category.RibbonCategoryStyle[source]
Bases:
enum.IntEnumThe button style of a category.
- class pyqtribbon.category.RibbonCategoryLayoutButton[source]
Bases:
qtpy.QtWidgets.QToolButtonPrevious/Next buttons in the category when the size is not enough for the widgets.
- class pyqtribbon.category.RibbonCategoryScrollArea[source]
Bases:
qtpy.QtWidgets.QScrollAreaScroll area for the gallery
- class pyqtribbon.category.RibbonCategoryScrollAreaContents[source]
Bases:
qtpy.QtWidgets.QFrameScroll area contents for the gallery
- class pyqtribbon.category.RibbonCategoryLayoutWidget(parent=None)[source]
Bases:
qtpy.QtWidgets.QFrameThe category layout widget’s category scroll area to arrange the widgets in the category.
- paintEvent(a0: qtpy.QtGui.QPaintEvent) None[source]
Override the paint event to draw the background.
- resizeEvent(a0: qtpy.QtGui.QResizeEvent) None[source]
Override the resize event to resize the scroll area.
- addWidget(widget: qtpy.QtWidgets.QWidget)[source]
Add a widget to the category layout.
- Parameters:
widget – The widget to add.
- class pyqtribbon.category.RibbonCategory(title: str = '', style: RibbonCategoryStyle = RibbonCategoryStyle.Normal, color: qtpy.QtGui.QColor = None, parent=None) RibbonCategory(parent=None)[source]
Bases:
RibbonCategoryLayoutWidgetThe RibbonCategory is the logical grouping that represents the contents of a ribbon tab.
- setMaximumRows(rows: int)[source]
Set the maximum number of rows.
- Parameters:
rows – The maximum number of rows.
- setCategoryStyle(style: RibbonCategoryStyle)[source]
Set the button style of the category.
- Parameters:
style – The button style.
- categoryStyle() RibbonCategoryStyle[source]
Return the button style of the category.
- Returns:
The button style.
- addPanelsBy(data: Dict[str, Dict]) Dict[str, pyqtribbon.panel.RibbonPanel][source]
Add panels from a dictionary.
- Parameters:
data –
The dictionary. The keys are the titles of the panels. The value is a dictionary of arguments. the argument showPanelOptionButton is a boolean to decide whether to show the panel option button, the rest arguments are passed to the RibbonPanel.addWidgetsBy() method. The dict is of the form:
{ "panel-title": { "showPanelOptionButton": True, "widgets": { "widget-name": { "type": "Button", "arguments": { "key1": "value1", "key2": "value2" } }, } }, }
- Returns:
A dictionary of the newly created panels.
- addPanel(title: str, showPanelOptionButton=True) pyqtribbon.panel.RibbonPanel[source]
Add a new panel to the category.
- Parameters:
title – The title of the panel.
showPanelOptionButton – Whether to show the panel option button.
- Returns:
The newly created panel.
- removePanel(title: str)[source]
Remove a panel from the category.
- Parameters:
title – The title of the panel.
- takePanel(title: str) pyqtribbon.panel.RibbonPanel[source]
Remove and return a panel from the category.
- Parameters:
title – The title of the panel.
- Returns:
The removed panel.
- panel(title: str) pyqtribbon.panel.RibbonPanel[source]
Return a panel from the category.
- Parameters:
title – The title of the panel.
- Returns:
The panel.
- panels() Dict[str, pyqtribbon.panel.RibbonPanel][source]
Return all panels in the category.
- Returns:
The panels.
- class pyqtribbon.category.RibbonNormalCategory(title: str, parent: qtpy.QtWidgets.QWidget)[source]
Bases:
RibbonCategoryA normal category.
- setCategoryStyle(style: RibbonCategoryStyle)[source]
Set the button style of the category.
- Parameters:
style – The button style.
- class pyqtribbon.category.RibbonContextCategory(title: str, color: qtpy.QtGui.QColor, parent: qtpy.QtWidgets.QWidget)[source]
Bases:
RibbonCategoryA context category.
- setCategoryStyle(style: RibbonCategoryStyle)[source]
Set the button style of the category.
- Parameters:
style – The button style.
- color() qtpy.QtGui.QColor[source]
Return the color of the context category.
- Returns:
The color of the context category.
- setColor(color: qtpy.QtGui.QColor)[source]
Set the color of the context category.
- Parameters:
color – The color of the context category.
- showContextCategory()[source]
Show the given category, if it is not a context category, nothing happens.
- hideContextCategory()[source]
Hide the given category, if it is not a context category, nothing happens.
- class pyqtribbon.category.RibbonContextCategories(name: str, color: qtpy.QtGui.QColor, categories: Dict[str, RibbonContextCategory], ribbon)[source]
Bases:
Dict[str,RibbonContextCategory]A list of context categories.