API References
Ribbon Bar
RibbonBar
- class pyqtribbon.ribbonbar.RibbonBar(title: str = '', maxRows=6, parent=None)[source]
- class pyqtribbon.ribbonbar.RibbonBar(parent=None)
Bases:
QMenuBar
The RibbonBar class is the top level widget that contains the ribbon.
Methods
actionAt
(self, a0)actionGeometry
(self, a0)activeAction
(self)addAction
(-> QAction)addCategoriesBy
(data)Add categories from a dict.
addCategory
(title[, style, color])Add a new category to the ribbon.
addContextCategories
(name, titles[, color])Add a group of context categories with the same tab color to the ribbon.
addContextCategory
(title[, color])Add a new context category to the ribbon.
Add a file menu to the ribbon.
addMenu
(-> QAction -> QMenu)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.
addSeparator
(self)addTitleWidget
(widget)Add a widget to the title widget.
Return the application button.
Return a list of categories of the ribbon.
category
(name)Return the category with the given name.
categoryVisible
(category)Return whether the category is shown.
clear
(self)Return the collapse ribbon button.
cornerWidget
(self[, corner])Return the current category.
Return the help button of the ribbon.
hideContextCategory
(category)Hide the given category or categories, if it is not a context category, nothing happens.
Hide the ribbon.
insertMenu
(self, before, menu)insertSeparator
(self, before)insertTitleWidget
(index, widget)Insert a widget to the title widget.
isDefaultUp
(self)isNativeMenuBar
(self)Return the minimum size hint of the widget.
Return the quick access toolbar of the ribbon.
removeCategories
(categories)Remove a list of categories from the ribbon.
removeCategory
(category)Remove a category from the ribbon.
Remove the min button from the ribbon.
Remove the help button from the ribbon.
removeTitleWidget
(widget)Remove a widget from the title widget.
Get the total height of the ribbon.
Get the visibility of the ribbon.
Return the right toolbar of the ribbon.
setActiveAction
(self, action)setApplicationIcon
(icon)Set the application icon.
setCollapseButtonIcon
(icon)Set the icon of the min button.
setCornerWidget
(self, widget[, corner])setCurrentCategory
(category)Set the current category.
setDefaultUp
(self, a0)setHelpButtonIcon
(icon)Set the icon of the help button.
setNativeMenuBar
(self, nativeMenuBar)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.
setTitle
(title)Set the title of the ribbon.
showCategoryByIndex
(index)Show category by tab index
showContextCategory
(category)Show the given category or categories, if it is not a context category, nothing happens.
Show the ribbon.
tabBar
()Return the tab bar of the ribbon.
title
()Return the title of the ribbon.
fileButtonClicked
helpButtonClicked
- addAction(self, action: QAction)[source]
- addAction(self, text: str) QAction
- addAction(self, text: str, slot: PYQT_SLOT) QAction
- addCategoriesBy(data: Dict[str, Dict]) Dict[str, 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: 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.
- addContextCategories(name: str, titles: List[str], color: Union[QColor, GlobalColor] = 9) 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.
- addContextCategory(title: str, color: Union[QColor, GlobalColor] = 9) 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.
- addFileMenu() RibbonMenu [source]
Add a file menu to the ribbon.
- addMenu(self, menu: QMenu) QAction [source]
- addMenu(self, title: str) QMenu
- addMenu(self, icon: QIcon, title: str) QMenu
- 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.
- addTitleWidget(widget: QWidget)[source]
Add a widget to the title widget.
- Parameters
widget – The widget to add.
- applicationOptionButton() RibbonApplicationButton [source]
Return the application button.
- categories() Dict[str, RibbonCategory] [source]
Return a list of categories of the ribbon.
- Returns
A dict of categories of the ribbon.
- category(name: str) RibbonCategory [source]
Return the category with the given name.
- Parameters
name – The name of the category.
- Returns
The category with the given name.
- categoryVisible(category: RibbonCategory) bool [source]
Return whether the category is shown.
- Parameters
category – The category to check.
- Returns
Whether the category is shown.
- collapseRibbonButton() QToolButton [source]
Return the collapse ribbon button.
- Returns
The collapse ribbon button.
- currentCategory() RibbonCategory [source]
Return the current category.
- Returns
The current category.
- helpRibbonButton() QToolButton [source]
Return the help button of the ribbon.
- Returns
The help button of the ribbon.
- hideContextCategory(category: Union[RibbonContextCategory, RibbonContextCategories])[source]
Hide the given category or categories, if it is not a context category, nothing happens.
- Parameters
category – The category to hide.
- insertTitleWidget(index: int, widget: QWidget)[source]
Insert a widget to the title widget.
- Parameters
index – The index to insert the widget.
widget – The widget to insert.
- 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.
- removeCategories(categories: RibbonContextCategories)[source]
Remove a list of categories from the ribbon.
- Parameters
categories – The categories to remove.
- removeCategory(category: RibbonCategory)[source]
Remove a category from the ribbon.
- Parameters
category – The category to remove.
- removeTitleWidget(widget: QWidget)[source]
Remove a widget from the title widget.
- Parameters
widget – The widget 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 = 30)[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.
- showContextCategory(category: Union[RibbonContextCategory, RibbonContextCategories])[source]
Show the given category or categories, if it is not a context category, nothing happens.
- Parameters
category – The category to show.
- tabBar() RibbonTabBar [source]
Return the tab bar of the ribbon.
- Returns
The tab bar of the ribbon.
Ribbon Title
RibbonTabBar
- class pyqtribbon.tabbar.RibbonTabBar(parent=None)[source]
Bases:
QTabBar
The TabBar for the title widget.
Methods
addAssociatedTabs
(name, texts, color)Add associated multiple tabs which have the same color to the tab bar.
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.
removeAssociatedTabs
(titles)Remove tabs with the given titles.
Return the titles of all tabs.
- addAssociatedTabs(name: str, texts: List[str], color: QColor) List[int] [source]
Add associated multiple tabs which have the same color to the tab bar.
- Parameters
name – The name of the context category.
texts – The texts of the tabs.
color – The color of the tabs.
- Returns
The indices of the tabs.
- 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.
- indexOf(tabName: str) int [source]
Return the index of the tab with the given name.
- Parameters
tabName – The name of the tab.
- Returns
The index of the tab.
- paintEvent(a0: QPaintEvent) None [source]
Paint the tab bar.
RibbonTitleLabel
RibbonTitleWidget
- class pyqtribbon.titlewidget.RibbonTitleWidget(title='PyQtRibbon', parent=None)[source]
- class pyqtribbon.titlewidget.RibbonTitleWidget(parent=None)
Bases:
QFrame
The title widget of the ribbon.
Methods
addQuickAccessButton
(button)Add a widget to the quick access bar.
addRightToolButton
(button)Add a widget to the right button bar.
addTitleWidget
(widget)Add a widget to the title layout.
Return the application button.
Return the collapse ribbon button.
Return the help ribbon button.
insertTitleWidget
(index, widget)Insert a widget to the title layout.
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.
removeTitleWidget
(widget)Remove a widget from the title layout.
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.
setTitle
(title)Set the title of the ribbon.
tabBar
()Return the tab bar of the ribbon.
title
()Return the title of the ribbon.
collapseRibbonButtonClicked
helpButtonClicked
- 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.
- addTitleWidget(widget: QWidget)[source]
Add a widget to the title layout.
- Parameters
widget – The widget to add.
- applicationButton() RibbonApplicationButton [source]
Return the application button.
- collapseRibbonButton() QToolButton [source]
Return the collapse ribbon button.
- Returns
The collapse ribbon button.
- helpRibbonButton() QToolButton [source]
Return the help ribbon button.
- Returns
The help ribbon button.
- insertTitleWidget(index: int, widget: QWidget)[source]
Insert a widget to the title layout.
- Parameters
index – The index to insert the widget.
widget – The widget to insert.
- quickAccessButtons() List[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.
- removeTitleWidget(widget: QWidget)[source]
Remove a widget from the title layout.
- Parameters
widget – The widget to remove.
- 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 = 30)[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.
- tabBar() RibbonTabBar [source]
Return the tab bar of the ribbon.
- Returns
The tab bar of the ribbon.
Ribbon Stacked Widget
RibbonStackedWidget
- class pyqtribbon.ribbonbar.RibbonStackedWidget(parent=None)[source]
Bases:
QStackedWidget
Stacked widget that is used to display the ribbon.
Ribbon Category
RibbonCategory
- class pyqtribbon.category.RibbonCategory(title: str = '', style: RibbonCategoryStyle = RibbonCategoryStyle.Normal, color: QColor = None, parent=None)[source]
- class pyqtribbon.category.RibbonCategory(parent=None)
Bases:
QFrame
The RibbonCategory is the logical grouping that represents the contents of a ribbon tab.
Methods
addPanel
(title[, showPanelOptionButton])Add a new panel to the category.
addPanelsBy
(data)Add panels from a dictionary.
Return the button style of the category.
panel
(title)Return a panel from the category.
panels
()Return all panels in the category.
removePanel
(title)Remove a panel from the category.
setCategoryStyle
(style)Set the button style of the category.
setMaximumRows
(rows)Set the maximum number of rows.
takePanel
(title)Remove and return a panel from the category.
title
()Return the title of the category.
- addPanel(title: str, showPanelOptionButton=True) 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.
- addPanelsBy(data: Dict[str, Dict]) Dict[str, 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.
- categoryStyle() RibbonCategoryStyle [source]
Return the button style of the category.
- Returns
The button style.
- panel(title: str) RibbonPanel [source]
Return a panel from the category.
- Parameters
title – The title of the panel.
- Returns
The panel.
- panels() Dict[str, RibbonPanel] [source]
Return all panels in the category.
- Returns
The panels.
- 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.
- setMaximumRows(rows: int)[source]
Set the maximum number of rows.
- Parameters
rows – The maximum number of rows.
- takePanel(title: str) RibbonPanel [source]
Remove and return a panel from the category.
- Parameters
title – The title of the panel.
- Returns
The removed panel.
RibbonNormalCategory
- class pyqtribbon.category.RibbonNormalCategory(title: str, parent: QWidget)[source]
Bases:
RibbonCategory
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 pyqtribbon.category.RibbonContextCategory(title: str, color: QColor, parent: QWidget)[source]
Bases:
RibbonCategory
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
(visible)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(visible: bool)[source]
Set the state of the category.
- Parameters
visible – The state.
RibbonContextCategories
- class pyqtribbon.category.RibbonContextCategories(name: str, color: QColor, categories: Dict[str, RibbonContextCategory], ribbon)[source]
Bases:
Dict
[str
,RibbonContextCategory
]A list of context categories.
Methods
Return whether the categories are shown.
color
()Return the color of the context categories.
Hide the categories
name
()Return the name of the context categories.
setCategoriesVisible
(visible)Set the state of the categories.
setColor
(color)Set the color of the context categories.
setName
(name)Set the name of the context categories.
Show the categories
RibbonCategoryStyle
RibbonCategoryScrollArea
RibbonCategoryScrollAreaContents
RibbonCategoryLayoutWidget
Ribbon Panel
RibbonPanel
- class pyqtribbon.panel.RibbonPanel(title: str = '', maxRows: int = 6, showPanelOptionButton=True, parent=None)[source]
- class pyqtribbon.panel.RibbonPanel(parent=None)
Bases:
QFrame
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, ...])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
([width, 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, ...])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, ...])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, ...])Add a spin box to the panel.
addTableWidget
([rowSpan, colSpan, mode, ...])Add a table widget to the panel.
addTextEdit
([rowSpan, colSpan, mode, ...])Add a text edit to the panel.
addTimeEdit
([rowSpan, colSpan, mode, ...])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
([width, rowSpan, ...])Add a vertical separator to the panel.
addWidget
(widget[, rowSpan, colSpan, mode, ...])Add a widget to the panel.
addWidgetsBy
(data)Add widgets to the panel.
defaultRowSpan
(rowSpan)Return the number of span rows for the given widget type.
Return the number of span rows for large widgets.
Return the maximal number of rows in the panel.
Return the number of span rows for medium widgets.
Return the panel option button.
removeWidget
(widget)Remove a widget from the panel.
Return the height of a row.
setLargeRows
(rows)Set the number of span rows for large widgets.
setMaximumRows
(maxRows)Set the maximal number of rows in the panel.
setMediumRows
(rows)Set the number of span rows for medium widgets.
setPanelOptionToolTip
(text)Set the tooltip of the panel option button.
setSmallRows
(rows)Set the number of span rows for small widgets.
setTitle
(title)Set the title of the panel.
Return the number of span rows for small widgets.
title
()Get the title of the panel.
widget
(index)Get the widget at the given index.
widgets
()Get all the widgets in the panel.
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, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The button that was added.
- addCalendarWidget(rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Large, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The calendar widget that was added.
- addComboBox(items: List[str], rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Small, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The combo box that was added.
- addDateEdit(rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Small, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The date edit that was added.
- addDateTimeEdit(rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Small, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The date time edit that was added.
- addDoubleSpinBox(rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Small, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The double spin box that was added.
- addFontComboBox(rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Small, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The combo box that was added.
- addGallery(minimumWidth=800, popupHideOnClick=False, rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Large, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) 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.
alignment – The alignment of the gallery.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The gallery.
- addHorizontalSeparator(width=6, rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Small, colSpan: int = 2, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) RibbonHorizontalSeparator [source]
Add a horizontal separator to the panel.
- Parameters
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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The separator.
- addLabel(text: str, rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Small, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The label that was added.
- 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, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The button that was added.
- 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, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The button that was added.
- addLargeWidget(widget: QWidget, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False)[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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- addLineEdit(rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Small, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The line edit that was added.
- addListWidget(rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Large, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The list widget that was added.
- 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, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The button that was added.
- 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, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The button that was added.
- addMediumWidget(widget: QWidget, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False)[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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- addPlainTextEdit(rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Small, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The text edit that was added.
- addProgressBar(rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Small, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The progress bar that was added.
- addSeparator(orientation=2, width=6, rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Large, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The separator.
- addSlider(rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Small, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The slider that was added.
- 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, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The button that was added.
- 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, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The button that was added.
- addSmallWidget(widget: QWidget, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False)[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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The widget that was added.
- addSpinBox(rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Small, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The spin box that was added.
- addTableWidget(rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Large, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The table widget that was added.
- addTextEdit(rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Small, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The text edit that was added.
- addTimeEdit(rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Small, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The time edit that was added.
- 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, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The button that was added.
- addTreeWidget(rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Large, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) 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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The tree widget that was added.
- addVerticalSeparator(width=6, rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Large, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False) RibbonVerticalSeparator [source]
Add a vertical separator to the panel.
- Parameters
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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- Returns
The separator.
- addWidget(widget: QWidget, rowSpan: Union[int, RibbonButtonStyle] = RibbonButtonStyle.Small, colSpan: int = 1, mode=RibbonSpaceFindMode.ColumnWise, alignment=132, fixedHeight: Union[bool, float] = False)[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.
fixedHeight – Whether to fix the height of the widget, it can be a boolean, a percentage or a fixed height, when a boolean is given, the height is fixed to the maximum height allowed if the value is True, when a percentage is given (0 < percentage < 1) the height is calculated from the height of the maximum height allowed, depends on the number of rows to span. The minimum height is 40% of the maximum height allowed.
- addWidgetsBy(data: Dict[str, Dict]) Dict[str, QWidget] [source]
Add widgets to the panel.
- Parameters
data –
The data to add. The dict is of the form: {
- ”widget-name”: {
“type”: “Button”, “arguments”: {
”key1”: “value1”, “key2”: “value2”
}
},
} Possible types are: Button, SmallButton, MediumButton, LargeButton, ToggleButton, SmallToggleButton, MediumToggleButton, LargeToggleButton, ComboBox, FontComboBox, LineEdit, TextEdit, PlainTextEdit, Label, ProgressBar, SpinBox, DoubleSpinBox, DataEdit, TimeEdit, DateTimeEdit, TableWidget, TreeWidget, ListWidget, CalendarWidget, Separator, HorizontalSeparator, VerticalSeparator, Gallery.
- Returns
A dictionary of the added widgets.
- defaultRowSpan(rowSpan: Union[int, RibbonButtonStyle])[source]
Return the number of span rows for the given widget type.
- Parameters
rowSpan – row span or type.
- Returns
The number of span rows for the given widget type.
- largeRows() int [source]
Return the number of span rows for large widgets.
- Returns
The number of span rows for large widgets.
- maximumRows() int [source]
Return the maximal number of rows in the panel.
- Returns
The maximal number of rows in the panel.
- mediumRows() int [source]
Return the number of span rows for medium widgets.
- Returns
The number of span rows for medium widgets.
- panelOptionButton() RibbonPanelOptionButton [source]
Return the panel option button.
- Returns
The panel option button.
- setLargeRows(rows: int)[source]
Set the number of span rows for large widgets.
- Parameters
rows – The number of span rows for large widgets.
- setMaximumRows(maxRows: int)[source]
Set the maximal number of rows in the panel.
- Parameters
maxRows – The maximal number of rows in the panel.
- setMediumRows(rows: int)[source]
Set the number of span rows for medium widgets.
- Parameters
rows – The number of span rows for medium widgets.
- setPanelOptionToolTip(text: str)[source]
Set the tooltip of the panel option button.
- Parameters
text – The tooltip text.
- setSmallRows(rows: int)[source]
Set the number of span rows for small widgets.
- Parameters
rows – The number of span rows for small widgets.
- smallRows() int [source]
Return the number of span rows for small widgets.
- Returns
The number of span rows for small widgets.
RibbonPanelItemWidget
RibbonSpaceFindMode
RibbonGridLayoutManager
- class pyqtribbon.panel.RibbonGridLayoutManager(rows: int)[source]
Bases:
object
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 pyqtribbon.gallery.RibbonGallery(minimumWidth=800, popupHideOnClick=False, parent=None)[source]
- class pyqtribbon.gallery.RibbonGallery(parent=None)
Bases:
QFrame
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
Hide the popup window
Return the popup menu.
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
- popupMenu() RibbonPermanentMenu [source]
Return the popup menu.
- resizeEvent(a0: QResizeEvent) None [source]
Resize the gallery.
- setPopupHideOnClick(popupHideOnClick: bool)[source]
Set the hide on click flag
- Parameters
popupHideOnClick – hide on click flag
RibbonGalleryListWidget
- class pyqtribbon.gallery.RibbonGalleryListWidget(parent=None)[source]
Bases:
QListWidget
Gallery list widget.
Methods
resizeEvent
(e)Resize the list widget.
Scroll to the next row.
Scroll to the previous row.
- resizeEvent(e: QResizeEvent) None [source]
Resize the list widget.
RibbonGalleryPopupListWidget
- class pyqtribbon.gallery.RibbonGalleryPopupListWidget(parent=None)[source]
Bases:
RibbonGalleryListWidget
Gallery popup list widget.
RibbonPopupWidget
Ribbon Separator
RibbonSeparator
- class pyqtribbon.separator.RibbonSeparator(orientation=QtCore.Qt.Vertical, width=6, parent=None)[source]
- class pyqtribbon.separator.RibbonSeparator(parent=None)
Bases:
QFrame
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.
- paintEvent(event: QPaintEvent) None [source]
Paint the separator.
RibbonHorizontalSeparator
- class pyqtribbon.separator.RibbonHorizontalSeparator(width: int = 6, parent=None)[source]
Bases:
RibbonSeparator
Horizontal separator.
RibbonVerticalSeparator
- class pyqtribbon.separator.RibbonVerticalSeparator(width: int = 6, parent=None)[source]
Bases:
RibbonSeparator
Vertical separator.