pyqtribbon.gallery module

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.

Create a gallery.

Parameters:
  • minimumWidth – minimum width of the gallery

  • popupHideOnClick – hide on click flag

  • parent – parent widget

addButton(text: str | None = None, icon: QIcon | None = None, slot=None, shortcut=None, tooltip=None, statusTip=None, checkable=False) Tuple[RibbonToolButton, 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 and the popup button added

addToggleButton(text: str | None = None, icon: QIcon | None = None, slot=None, shortcut=None, tooltip=None, statusTip=None) Tuple[RibbonToolButton, 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 and the popup button added

hidePopupWidget()[source]

Hide the popup window

popupMenu() RibbonPermanentMenu[source]

Return the popup menu.

popupWindowSize()[source]

Return the size of the popup window

Returns:

size of the popup window

resizeEvent(a0: QResizeEvent) None[source]

Resize the gallery.

setPopupHideOnClick(popupHideOnClick: bool)[source]

Set the hide on click flag

Parameters:

popupHideOnClick – hide on click flag

setPopupWindowSize(size: QSize)[source]

Set the size of the popup window

Parameters:

size – size of the popup window

setSelectedButton()[source]

Set the selected button

showPopup()[source]

Show the popup window

class pyqtribbon.gallery.RibbonGalleryButton[source]

Bases: QToolButton

Gallery button.

class pyqtribbon.gallery.RibbonGalleryListWidget(parent=None)[source]

Bases: QListWidget

Gallery list widget.

resizeEvent(e: QResizeEvent) None[source]

Resize the list widget.

scrollToNextRow() None[source]

Scroll to the next row.

scrollToPreviousRow() None[source]

Scroll to the previous row.

class pyqtribbon.gallery.RibbonGalleryPopupListWidget(parent=None)[source]

Bases: RibbonGalleryListWidget

Gallery popup list widget.

class pyqtribbon.gallery.RibbonPopupWidget[source]

Bases: QFrame

The popup widget for the gallery widget.