API References
Main Window
Ribbon Bar
- class ribbon.ribbonbar.RibbonBar(title='PyQtRibbon', parent=None)[source]
The RibbonBar class is the top level widget that contains the ribbon.
Methods
addApplicationOptionAction
(action)Add a display option to the ribbon.
addCategory
(title[, style, color])Add a new category to the ribbon.
addContextCategory
(title[, color])Add a new context category to the ribbon.
addNormalCategory
(title)Add a new category to the ribbon.
addQuickAccessButton
(button)Add a button to the quick access bar.
addRightToolButton
(button)Add a widget to the right button bar.
Return the application button.
Return a list of categories of the ribbon.
Return the collapse ribbon button.
hideContextCategory
(category)Hide the given category, if it is not a context category, nothing happens.
Hide the ribbon.
Return the minimum size hint of the widget.
Return the quick access toolbar of the ribbon.
removeCategory
(category)Remove a category from the ribbon.
Remove the min button from the ribbon.
Remove the help button from the ribbon.
Get the total height of the ribbon.
Get the visibility of the ribbon.
Return the right toolbar of the ribbon.
setApplicationIcon
(icon)Set the application icon.
setCollapseButtonIcon
(icon)Set the icon of the min button.
setCurrentCategory
(category)Set the current category.
setHelpButtonIcon
(icon)Set the icon of the help button.
setQuickAccessButtonHeight
([height])Set the height of the quick access buttons.
setRibbonHeight
(height)Set the total height of the ribbon.
setRibbonStyle
(style)Set the style of the ribbon.
setRibbonVisible
(visible)Set the visibility of the ribbon.
setRightToolBarHeight
([height])Set the height of the right buttons.
setTabBarHeight
([height])Set the height of the tab bar.
setTitle
(title)Set the title of the ribbon.
showContextCategory
(category)Show the given category, if it is not a context category, nothing happens.
Show the ribbon.
tabBar
()Return the tab bar of the ribbon.
Get the height of the tab bar.
tabRect
(category)Get the rectangle of the tab of the given category.
title
()Return the title of the ribbon.
helpButtonClicked
- addApplicationOptionAction(action: QAction)[source]
Add a display option to the ribbon.
- Parameters
action – The action of the display option.
- addCategory(title: str, style=RibbonCategoryStyle.Normal, color: Optional[QColor] = None) Union[RibbonNormalCategory, 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.
- addContextCategory(title: str, color: Optional[QColor] = None) 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.
- addNormalCategory(title: str) RibbonNormalCategory [source]
Add a new category to the ribbon.
- Parameters
title – The title of the category.
- Returns
The newly created category.
- addQuickAccessButton(button: QToolButton)[source]
Add a button to the quick access bar.
- Parameters
button – The button to add.
- addRightToolButton(button: QToolButton)[source]
Add a widget to the right button bar.
- Parameters
button – The button to add.
- categories() List[RibbonCategory] [source]
Return a list of categories of the ribbon.
- Returns
A list of categories of the ribbon.
- collapseRibbonButton() QToolButton [source]
Return the collapse ribbon button.
- Returns
The collapse ribbon button.
- hideContextCategory(category: RibbonContextCategory)[source]
Hide the given category, if it is not a context category, nothing happens.
- Parameters
category – The category to hide.
- minimumSizeHint() QSize [source]
Return the minimum size hint of the widget.
- Returns
The minimum size hint.
- quickAccessToolBar() QToolBar [source]
Return the quick access toolbar of the ribbon.
- Returns
The quick access toolbar of the ribbon.
- removeCategory(category: RibbonCategory)[source]
Remove a category from the ribbon.
- Parameters
category – The category to remove.
- ribbonVisible() bool [source]
Get the visibility of the ribbon.
- Returns
True if the ribbon is visible, False otherwise.
- rightToolBar() QToolBar [source]
Return the right toolbar of the ribbon.
- Returns
The right toolbar of the ribbon.
- setApplicationIcon(icon: QIcon)[source]
Set the application icon.
- Parameters
icon – The icon to set.
- setCollapseButtonIcon(icon: QIcon)[source]
Set the icon of the min button.
- Parameters
icon – The icon to set.
- setCurrentCategory(category: RibbonCategory)[source]
Set the current category.
- Parameters
category – The category to set.
- setHelpButtonIcon(icon: QIcon)[source]
Set the icon of the help button.
- Parameters
icon – The icon to set.
- setQuickAccessButtonHeight(height: int = 40)[source]
Set the height of the quick access buttons.
- Parameters
height – The height to set.
- setRibbonHeight(height: int)[source]
Set the total height of the ribbon.
- Parameters
height – The height to set.
- setRibbonStyle(style: RibbonStyle)[source]
Set the style of the ribbon.
- Parameters
style – The style to set.
- setRibbonVisible(visible: bool)[source]
Set the visibility of the ribbon.
- Parameters
visible – True to show the ribbon, False to hide it.
- setRightToolBarHeight(height: int = 24)[source]
Set the height of the right buttons.
- Parameters
height – The height to set.
- setTabBarHeight(height: int = 50)[source]
Set the height of the tab bar.
- Parameters
height – The height to set.
- showContextCategory(category: RibbonContextCategory)[source]
Show the given category, if it is not a context category, nothing happens.
- Parameters
category – The category to show.
- tabRect(category: RibbonCategory) QRect [source]
Get the rectangle of the tab of the given category.
- Parameters
category – The category to get the tab rectangle of.
- Returns
The rectangle of the tab.
Ribbon Title
RibbonTabBar
- class ribbon.tabbar.RibbonTabBar(parent=None)[source]
The TabBar for the title widget.
Methods
addTab
(text[, color])Add a new tab to the tab bar.
Current tab color
indexOf
(tabName)Return the index of the tab with the given name.
paintEvent
(a0)Paint the tab bar.
- addTab(text: str, color: Optional[QColor] = None) int [source]
Add a new tab to the tab bar.
- Parameters
text – The text of the tab.
color – The color of the tab.
- Returns
The index of the tab.
RibbonTitleLabel
RibbonTitleWidget
- class ribbon.titlewidget.RibbonTitleWidget(title='PyQtRibbon', parent=None)[source]
The title widget of the ribbon.
Methods
addApplicationOptionAction
(action)Add a display option to the category.
addQuickAccessButton
(button)Add a widget to the quick access bar.
addRightToolButton
(button)Add a widget to the right button bar.
Return the application button.
Return the application menu.
Return the collapse ribbon button.
Return the quick access buttons of the ribbon.
Return the quick access toolbar of the ribbon.
Remove the min button from the ribbon.
Remove the help button from the ribbon.
Return the right toolbar of the ribbon.
setApplicationIcon
(icon)Set the application icon.
setCollapseButtonIcon
(icon)Set the icon of the min button.
setHelpButtonIcon
(icon)Set the icon of the help button.
setQuickAccessButtonHeight
([height])Set the height of the quick access buttons.
setRightToolBarHeight
([height])Set the height of the right buttons.
setTabBarHeight
([height])Set the height of the tab bar.
setTitle
(title)Set the title of the ribbon.
tabBar
()Return the tab bar of the ribbon.
Get the height of the tab bar.
title
()Return the title of the ribbon.
collapseRibbonButtonClicked
helpButtonClicked
- addApplicationOptionAction(action: QAction)[source]
Add a display option to the category.
- Parameters
action – The action of the display option.
- addQuickAccessButton(button: QToolButton)[source]
Add a widget to the quick access bar.
- Parameters
button – The button to add.
- addRightToolButton(button: QToolButton)[source]
Add a widget to the right button bar.
- Parameters
button – The button to add.
- collapseRibbonButton() QToolButton [source]
Return the collapse ribbon button.
- Returns
The collapse ribbon button.
- quickAccessButtons() list[PyQt5.QtWidgets.QToolButton] [source]
Return the quick access buttons of the ribbon.
- Returns
The quick access buttons of the ribbon.
- quickAccessToolBar() QToolBar [source]
Return the quick access toolbar of the ribbon.
- Returns
The quick access toolbar of the ribbon.
- rightToolBar() QToolBar [source]
Return the right toolbar of the ribbon.
- Returns
The right toolbar of the ribbon.
- setApplicationIcon(icon: QIcon)[source]
Set the application icon.
- Parameters
icon – The icon to set.
- setCollapseButtonIcon(icon: QIcon)[source]
Set the icon of the min button.
- Parameters
icon – The icon to set.
- setHelpButtonIcon(icon: QIcon)[source]
Set the icon of the help button.
- Parameters
icon – The icon to set.
- setQuickAccessButtonHeight(height: int = 40)[source]
Set the height of the quick access buttons.
- Parameters
height – The height to set.
- setRightToolBarHeight(height: int = 24)[source]
Set the height of the right buttons.
- Parameters
height – The height to set.
- setTabBarHeight(height: int = 50)[source]
Set the height of the tab bar.
- Parameters
height – The height to set.
- tabBar() RibbonTabBar [source]
Return the tab bar of the ribbon.
- Returns
The tab bar of the ribbon.
Ribbon Category
RibbonCategory
- class ribbon.category.RibbonCategory(title: str, style: RibbonCategoryStyle = RibbonCategoryStyle.Normal, color: Optional[QColor] = None, parent=None)[source]
The RibbonCategory is the logical grouping that represents the contents of a ribbon tab.
Methods
addPanel
(title)Add a new panel to the category.
Return the button style of the category.
panel
(title)Return a panel from the category.
removePanel
(title)Remove a panel from the category.
setCategoryStyle
(style)Set the button style of the category.
takePanel
(title)Remove and return a panel from the category.
title
()Return the title of the category.
displayOptionsButtonClicked
- addPanel(title: str) RibbonPanel [source]
Add a new panel to the category.
- Parameters
title – The title of the panel.
- Returns
The newly created panel.
- displayOptionsButtonClicked[source]
The signal that is emitted when the display options button is clicked.
- panel(title: str)[source]
Return a panel from the category.
- Parameters
title – The title of the panel.
- Returns
The panel.
- removePanel(title: str)[source]
Remove a panel from the category.
- Parameters
title – The title of the panel.
- setCategoryStyle(style: RibbonCategoryStyle)[source]
Set the button style of the category.
- Parameters
style – The button style.
RibbonNormalCategory
- class ribbon.category.RibbonNormalCategory(title: str, parent: QWidget)[source]
A normal category.
Methods
setCategoryStyle
(style)Set the button style of the category.
- setCategoryStyle(style: RibbonCategoryStyle)[source]
Set the button style of the category.
- Parameters
style – The button style.
RibbonContextCategory
- class ribbon.category.RibbonContextCategory(title: str, color: QColor, parent: QWidget)[source]
A context category.
Methods
Return whether the category is shown.
color
()Return the color of the context category.
Hide the given category, if it is not a context category, nothing happens.
setCategoryStyle
(style)Set the button style of the category.
setCategoryVisible
(state)Set the state of the category.
setColor
(color)Set the color of the context category.
Show the given category, if it is not a context category, nothing happens.
- categoryVisible() bool [source]
Return whether the category is shown.
- Returns
Whether the category is shown.
- color() QColor [source]
Return the color of the context category.
- Returns
The color of the context category.
- hideContextCategory()[source]
Hide the given category, if it is not a context category, nothing happens.
- setCategoryStyle(style: RibbonCategoryStyle)[source]
Set the button style of the category.
- Parameters
style – The button style.
- setCategoryVisible(state: bool)[source]
Set the state of the category.
- Parameters
state – The state.
RibbonCategoryStyle
RibbonCategoryScrollArea
RibbonCategoryScrollAreaContents
RibbonCategoryLayoutWidget
- class ribbon.categorylayoutwidget.RibbonCategoryLayoutWidget(parent=None)[source]
The category layout widget’s category scroll area to arrange the widgets in the category.
Methods
addWidget
(widget)Add a widget to the category layout.
Set the visibility of the scroll buttons.
paintEvent
(a0)Override the paint event to draw the background.
removeWidget
(widget)Remove a widget from the category layout.
resizeEvent
(a0)Override the resize event to resize the scroll area.
Scroll the category to the next widget.
Scroll the category to the previous widget.
takeWidget
(widget)Remove and return a widget from the category layout.
displayOptionsButtonClicked
- addWidget(widget: QWidget)[source]
Add a widget to the category layout.
- Parameters
widget – The widget to add.
Ribbon Panel
RibbonPanel
- class ribbon.panel.RibbonPanel(title: str, maxRows=6, parent=None)[source]
Panel in the ribbon category.
Methods
addButton
([text, icon, style, showText, ...])Add a button to the panel.
addCalendarWidget
([rowSpan, colSpan, mode, ...])Add a calendar widget to the panel.
addComboBox
(items[, rowSpan, colSpan, mode, ...])Add a combo box to the panel.
addDateEdit
([rowSpan, colSpan, mode, alignment])Add a date edit to the panel.
addDateTimeEdit
([rowSpan, colSpan, mode, ...])Add a date time edit to the panel.
addDoubleSpinBox
([rowSpan, colSpan, mode, ...])Add a double spin box to the panel.
addFontComboBox
([rowSpan, colSpan, mode, ...])Add a font combo box to the panel.
addGallery
([minimumWidth, popupHideOnClick, ...])Add a gallery to the panel.
addHorizontalSeparator
([linewidth, rowSpan, ...])Add a horizontal separator to the panel.
addLabel
(text[, rowSpan, colSpan, mode, ...])Add a label to the panel.
addLargeButton
([text, icon, showText, ...])Add a large button to the panel.
addLargeToggleButton
([text, icon, showText, ...])Add a large toggle button to the panel.
addLargeWidget
(widget[, mode, alignment])Add a large widget to the panel.
addLineEdit
([rowSpan, colSpan, mode, alignment])Add a line edit to the panel.
addListWidget
([rowSpan, colSpan, mode, ...])Add a list widget to the panel.
addMediumButton
([text, icon, showText, ...])Add a medium button to the panel.
addMediumToggleButton
([text, icon, ...])Add a medium toggle button to the panel.
addMediumWidget
(widget[, mode, alignment])Add a medium widget to the panel.
addPlainTextEdit
([rowSpan, colSpan, mode, ...])Add a plain text edit to the panel.
addProgressBar
([rowSpan, colSpan, mode, ...])Add a progress bar to the panel.
addSeparator
([orientation, width, rowSpan, ...])Add a separator to the panel.
addSlider
([rowSpan, colSpan, mode, alignment])Add a slider to the panel.
addSmallButton
([text, icon, showText, ...])Add a small button to the panel.
addSmallToggleButton
([text, icon, showText, ...])Add a small toggle button to the panel.
addSmallWidget
(widget[, mode, alignment])Add a small widget to the panel.
addSpinBox
([rowSpan, colSpan, mode, alignment])Add a spin box to the panel.
addTableWidget
([rowSpan, colSpan, mode, ...])Add a table widget to the panel.
addTextEdit
([rowSpan, colSpan, mode, alignment])Add a text edit to the panel.
addTimeEdit
([rowSpan, colSpan, mode, alignment])Add a time edit to the panel.
addToggleButton
([text, icon, style, ...])Add a toggle button to the panel.
addTreeWidget
([rowSpan, colSpan, mode, ...])Add a tree widget to the panel.
addVerticalSeparator
([linewidth, rowSpan, ...])Add a vertical separator to the panel.
addWidget
(widget[, rowSpan, colSpan, mode, ...])Add a widget to the panel.
Return the panel option button.
removeWidget
(widget)Remove a widget from the panel.
Return the height of a row.
setPanelOptionToolTip
(text)Set the tooltip of the panel option button.
setTitleText
(text)Set the title text of the panel.
Get the title text of the panel.
widget
(index)Get the widget at the given index.
panelOptionClicked
- addButton(text: Optional[str] = None, icon: Optional[QIcon] = None, style: RibbonButtonStyle = RibbonButtonStyle.Large, showText: bool = True, colSpan: int = 1, slot=None, shortcut=None, tooltip=None, statusTip=None, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) RibbonToolButton [source]
Add a button to the panel.
- Parameters
text – The text of the button.
icon – The icon of the button.
style – The style of the button.
showText – Whether to show the text of the button.
colSpan – The number of columns the button should span.
slot – The slot to call when the button is clicked.
shortcut – The shortcut of the button.
tooltip – The tooltip of the button.
statusTip – The status tip of the button.
mode – The mode to find spaces.
alignment – The alignment of the button.
- Returns
The button that was added.
- addCalendarWidget(rowSpan: int = 6, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) QCalendarWidget [source]
Add a calendar widget to the panel.
- Parameters
rowSpan – The number of rows the calendar widget should span.
colSpan – The number of columns the calendar widget should span.
mode – The mode to find spaces.
alignment – The alignment of the calendar widget.
- addComboBox(items: List[str], rowSpan: int = 2, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) QComboBox [source]
Add a combo box to the panel.
- Parameters
items – The items of the combo box.
rowSpan – The number of rows the combo box should span.
colSpan – The number of columns the combo box should span.
mode – The mode to find spaces.
alignment – The alignment of the combo box.
- addDateEdit(rowSpan: int = 2, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) QDateEdit [source]
Add a date edit to the panel.
- Parameters
rowSpan – The number of rows the date edit should span.
colSpan – The number of columns the date edit should span.
mode – The mode to find spaces.
alignment – The alignment of the date edit.
- addDateTimeEdit(rowSpan: int = 2, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) QDateTimeEdit [source]
Add a date time edit to the panel.
- Parameters
rowSpan – The number of rows the date time edit should span.
colSpan – The number of columns the date time edit should span.
mode – The mode to find spaces.
alignment – The alignment of the date time edit.
- addDoubleSpinBox(rowSpan: int = 2, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) QDoubleSpinBox [source]
Add a double spin box to the panel.
- Parameters
rowSpan – The number of rows the double spin box should span.
colSpan – The number of columns the double spin box should span.
mode – The mode to find spaces.
alignment – The alignment of the double spin box.
- addFontComboBox(rowSpan: int = 2, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) QFontComboBox [source]
Add a font combo box to the panel.
- Parameters
rowSpan – The number of rows the combo box should span.
colSpan – The number of columns the combo box should span.
mode – The mode to find spaces.
alignment – The alignment of the combo box.
- addGallery(minimumWidth=800, popupHideOnClick=False, rowSpan: int = 6, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise) RibbonGallery [source]
Add a gallery to the panel.
- Parameters
minimumWidth – The minimum width of the gallery.
popupHideOnClick – Whether the gallery popup should be hidden when a user clicks on it.
rowSpan – The number of rows the gallery spans.
colSpan – The number of columns the gallery spans.
mode – The mode of the gallery.
- Returns
The gallery.
- addHorizontalSeparator(linewidth=6, rowSpan: int = 1, colSpan: int = 2, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) RibbonHorizontalSeparator [source]
Add a horizontal separator to the panel.
- Parameters
linewidth – The width of the separator.
rowSpan – The number of rows the separator spans.
colSpan – The number of columns the separator spans.
mode – The mode to find spaces.
alignment – The alignment of the separator.
- Returns
The separator.
- addLabel(text: str, rowSpan: int = 2, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) QLabel [source]
Add a label to the panel.
- Parameters
text – The text of the label.
rowSpan – The number of rows the label should span.
colSpan – The number of columns the label should span.
mode – The mode to find spaces.
alignment – The alignment of the label.
- addLargeButton(text: Optional[str] = None, icon: Optional[QIcon] = None, showText: bool = True, colSpan: int = 1, slot=None, shortcut=None, tooltip=None, statusTip=None, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) RibbonToolButton [source]
Add a large button to the panel.
- Parameters
text – The text of the button.
icon – The icon of the button.
showText – Whether to show the text of the button.
colSpan – The number of columns the button should span.
slot – The slot to call when the button is clicked.
shortcut – The shortcut of the button.
tooltip – The tooltip of the button.
statusTip – The status tip of the button.
mode – The mode to find spaces.
alignment – The alignment of the button.
- addLargeToggleButton(text: Optional[str] = None, icon: Optional[QIcon] = None, showText: bool = True, colSpan: int = 1, slot=None, shortcut=None, tooltip=None, statusTip=None, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) RibbonToolButton [source]
Add a large toggle button to the panel.
- Parameters
text – The text of the button.
icon – The icon of the button.
showText – Whether to show the text of the button.
colSpan – The number of columns the button should span.
slot – The slot to call when the button is clicked.
shortcut – The shortcut of the button.
tooltip – The tooltip of the button.
statusTip – The status tip of the button.
mode – The mode to find spaces.
alignment – The alignment of the button.
- addLargeWidget(widget: QWidget, mode=RibbonSpaceFindMode.ColumnWise, alignment=132)[source]
Add a large widget to the panel.
- Parameters
widget – The widget to add.
mode – The mode to find spaces.
alignment – The alignment of the widget.
- addLineEdit(rowSpan: int = 2, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) QLineEdit [source]
Add a line edit to the panel.
- Parameters
rowSpan – The number of rows the line edit should span.
colSpan – The number of columns the line edit should span.
mode – The mode to find spaces.
alignment – The alignment of the line edit.
- addListWidget(rowSpan: int = 6, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) QListWidget [source]
Add a list widget to the panel.
- Parameters
rowSpan – The number of rows the list widget should span.
colSpan – The number of columns the list widget should span.
mode – The mode to find spaces.
alignment – The alignment of the list widget.
- addMediumButton(text: Optional[str] = None, icon: Optional[QIcon] = None, showText: bool = True, colSpan: int = 1, slot=None, shortcut=None, tooltip=None, statusTip=None, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) RibbonToolButton [source]
Add a medium button to the panel.
- Parameters
text – The text of the button.
icon – The icon of the button.
showText – Whether to show the text of the button.
colSpan – The number of columns the button should span.
slot – The slot to call when the button is clicked.
shortcut – The shortcut of the button.
tooltip – The tooltip of the button.
statusTip – The status tip of the button.
mode – The mode to find spaces.
alignment – The alignment of the button.
- addMediumToggleButton(text: Optional[str] = None, icon: Optional[QIcon] = None, showText: bool = True, colSpan: int = 1, slot=None, shortcut=None, tooltip=None, statusTip=None, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) RibbonToolButton [source]
Add a medium toggle button to the panel.
- Parameters
text – The text of the button.
icon – The icon of the button.
showText – Whether to show the text of the button.
colSpan – The number of columns the button should span.
slot – The slot to call when the button is clicked.
shortcut – The shortcut of the button.
tooltip – The tooltip of the button.
statusTip – The status tip of the button.
mode – The mode to find spaces.
alignment – The alignment of the button.
- addMediumWidget(widget: QWidget, mode=RibbonSpaceFindMode.ColumnWise, alignment=132)[source]
Add a medium widget to the panel.
- Parameters
widget – The widget to add.
mode – The mode to find spaces.
alignment – The alignment of the widget.
- addPlainTextEdit(rowSpan: int = 2, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) QPlainTextEdit [source]
Add a plain text edit to the panel.
- Parameters
rowSpan – The number of rows the text edit should span.
colSpan – The number of columns the text edit should span.
mode – The mode to find spaces.
alignment – The alignment of the text edit.
- addProgressBar(rowSpan: int = 2, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) QProgressBar [source]
Add a progress bar to the panel.
- Parameters
rowSpan – The number of rows the progress bar should span.
colSpan – The number of columns the progress bar should span.
mode – The mode to find spaces.
alignment – The alignment of the progress bar.
- addSeparator(orientation=2, width=6, rowSpan: int = 6, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) Union[RibbonHorizontalSeparator, RibbonVerticalSeparator] [source]
Add a separator to the panel.
- Parameters
orientation – The orientation of the separator.
width – The width of the separator.
rowSpan – The number of rows the separator spans.
colSpan – The number of columns the separator spans.
mode – The mode to find spaces.
alignment – The alignment of the separator.
- Returns
The separator.
- addSlider(rowSpan: int = 2, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) QSlider [source]
Add a slider to the panel.
- Parameters
rowSpan – The number of rows the slider should span.
colSpan – The number of columns the slider should span.
mode – The mode to find spaces.
alignment – The alignment of the slider.
- addSmallButton(text: Optional[str] = None, icon: Optional[QIcon] = None, showText: bool = True, colSpan: int = 1, slot=None, shortcut=None, tooltip=None, statusTip=None, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) RibbonToolButton [source]
Add a small button to the panel.
- Parameters
text – The text of the button.
icon – The icon of the button.
showText – Whether to show the text of the button.
colSpan – The number of columns the button should span.
slot – The slot to call when the button is clicked.
shortcut – The shortcut of the button.
tooltip – The tooltip of the button.
statusTip – The status tip of the button.
mode – The mode to find spaces.
alignment – The alignment of the button.
- addSmallToggleButton(text: Optional[str] = None, icon: Optional[QIcon] = None, showText: bool = True, colSpan: int = 1, slot=None, shortcut=None, tooltip=None, statusTip=None, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) RibbonToolButton [source]
Add a small toggle button to the panel.
- Parameters
text – The text of the button.
icon – The icon of the button.
showText – Whether to show the text of the button.
colSpan – The number of columns the button should span.
slot – The slot to call when the button is clicked.
shortcut – The shortcut of the button.
tooltip – The tooltip of the button.
statusTip – The status tip of the button.
mode – The mode to find spaces.
alignment – The alignment of the button.
- addSmallWidget(widget: QWidget, mode=RibbonSpaceFindMode.ColumnWise, alignment=132)[source]
Add a small widget to the panel.
- Parameters
widget – The widget to add.
mode – The mode to find spaces.
alignment – The alignment of the widget.
- Returns
The widget that was added.
- addSpinBox(rowSpan: int = 2, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) QSpinBox [source]
Add a spin box to the panel.
- Parameters
rowSpan – The number of rows the spin box should span.
colSpan – The number of columns the spin box should span.
mode – The mode to find spaces.
alignment – The alignment of the spin box.
- addTableWidget(rowSpan: int = 6, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) QTableWidget [source]
Add a table widget to the panel.
- Parameters
rowSpan – The number of rows the table widget should span.
colSpan – The number of columns the table widget should span.
mode – The mode to find spaces.
alignment – The alignment of the table widget.
- addTextEdit(rowSpan: int = 2, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) QTextEdit [source]
Add a text edit to the panel.
- Parameters
rowSpan – The number of rows the text edit should span.
colSpan – The number of columns the text edit should span.
mode – The mode to find spaces.
alignment – The alignment of the text edit.
- addTimeEdit(rowSpan: int = 2, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) QTimeEdit [source]
Add a time edit to the panel.
- Parameters
rowSpan – The number of rows the time edit should span.
colSpan – The number of columns the time edit should span.
mode – The mode to find spaces.
alignment – The alignment of the time edit.
- addToggleButton(text: Optional[str] = None, icon: Optional[QIcon] = None, style: RibbonButtonStyle = RibbonButtonStyle.Large, showText: bool = True, colSpan: int = 1, slot=None, shortcut=None, tooltip=None, statusTip=None, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) RibbonToolButton [source]
Add a toggle button to the panel.
- Parameters
text – The text of the button.
icon – The icon of the button.
style – The style of the button.
showText – Whether to show the text of the button.
colSpan – The number of columns the button should span.
slot – The slot to call when the button is clicked.
shortcut – The shortcut of the button.
tooltip – The tooltip of the button.
statusTip – The status tip of the button.
mode – The mode to find spaces.
alignment – The alignment of the button.
- addTreeWidget(rowSpan: int = 6, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) QTreeWidget [source]
Add a tree widget to the panel.
- Parameters
rowSpan – The number of rows the tree widget should span.
colSpan – The number of columns the tree widget should span.
mode – The mode to find spaces.
alignment – The alignment of the tree widget.
- addVerticalSeparator(linewidth=6, rowSpan: int = 6, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132) RibbonVerticalSeparator [source]
Add a vertical separator to the panel.
- Parameters
linewidth – The width of the separator.
rowSpan – The number of rows the separator spans.
colSpan – The number of columns the separator spans.
mode – The mode to find spaces.
alignment – The alignment of the separator.
- Returns
The separator.
- addWidget(widget: QWidget, rowSpan: int = 2, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132)[source]
Add a widget to the panel.
- Parameters
widget – The widget to add.
rowSpan – The number of rows the widget should span, 2: small, 3: medium, 6: large.
colSpan – The number of columns the widget should span.
mode – The mode to find spaces.
alignment – The alignment of the widget.
- panelOptionButton() RibbonPanelOptionButton [source]
Return the panel option button.
- Returns
The panel option button.
- setPanelOptionToolTip(text: str)[source]
Set the tooltip of the panel option button.
- Parameters
text – The tooltip text.
RibbonPanelItemWidget
RibbonSpaceFindMode
RibbonGridLayoutManager
- class ribbon.panel.RibbonGridLayoutManager(rows: int)[source]
Grid Layout Manager.
Methods
request_cells
([rowSpan, colSpan, mode])Request a number of available cells from the grid.
- request_cells(rowSpan: int = 1, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise)[source]
Request a number of available cells from the grid.
- Parameters
rowSpan – The number of rows the cell should span.
colSpan – The number of columns the cell should span.
mode – The mode of the grid.
- Returns
row, col, the row and column of the requested cell.
Ribbon Gallery
RibbonGallery
- class ribbon.gallery.RibbonGallery(minimumWidth=800, popupHideOnClick=False, parent=None)[source]
A widget that displays a gallery of buttons.
Methods
addButton
([text, icon, slot, shortcut, ...])Add a button to the gallery
addToggleButton
([text, icon, slot, ...])Add a toggle button to the gallery
Return the size of the popup window
resizeEvent
(a0)Resize the gallery.
setPopupHideOnClick
(popupHideOnClick)Set the hide on click flag
setPopupWindowSize
(size)Set the size of the popup window
Set the selected button
Show the popup window
- addButton(text: Optional[str] = None, icon: Optional[QIcon] = None, slot=None, shortcut=None, tooltip=None, statusTip=None, checkable=False) RibbonToolButton [source]
Add a button to the gallery
- Parameters
text – text of the button
icon – icon of the button
slot – slot to call when the button is clicked
shortcut – shortcut of the button
tooltip – tooltip of the button
statusTip – status tip of the button
checkable – checkable flag of the button
- Returns
the button added
- addToggleButton(text: Optional[str] = None, icon: Optional[QIcon] = None, slot=None, shortcut=None, tooltip=None, statusTip=None) RibbonToolButton [source]
Add a toggle button to the gallery
- Parameters
text – text of the button
icon – icon of the button
slot – slot to call when the button is clicked
shortcut – shortcut of the button
tooltip – tooltip of the button
statusTip – status tip of the button
- Returns
the button added
- setPopupHideOnClick(popupHideOnClick: bool)[source]
Set the hide on click flag
- Parameters
popupHideOnClick – hide on click flag
RibbonGalleryListWidget
- class ribbon.gallery.RibbonGalleryListWidget(parent=None)[source]
Gallery list widget.
Methods
resizeEvent
(e)Resize the list widget.
Scroll to the next row.
Scroll to the previous row.
RibbonGalleryPopupListWidget
Ribbon Separator
RibbonSeparator
- class ribbon.separator.RibbonSeparator(orientation=2, width=6, parent=None)[source]
The RibbonSeparator is a separator that can be used to separate widgets in a ribbon.
Methods
paintEvent
(event)Paint the separator.
setTopBottomMargins
(top, bottom)Set the top and bottom margins.
sizeHint
()Return the size hint.