Tool Grid Widget (toolgrid)
A widget containing a grid of clickable actions/buttons.
- class orangecanvas.gui.toolgrid.ToolGrid(parent: Optional[PyQt5.QtWidgets.QWidget] = None, columns: int = 4, buttonSize: PyQt5.QtCore.QSize = PyQt5.QtCore.QSize(- 1, - 1), iconSize: PyQt5.QtCore.QSize = PyQt5.QtCore.QSize(- 1, - 1), toolButtonStyle: PyQt5.QtCore.Qt.ToolButtonStyle = 3, **kwargs: Any)[source]
Bases:
PyQt5.QtWidgets.QFrameA widget containing a grid of actions/buttons.
Actions can be added using standard
QWidget.addAction(QAction)()andQWidget.insertAction(int, QAction)()methods.- Parameters
parent (
QWidget) – Parent widget.columns (int) – Number of columns in the grid layout.
buttonSize (QSize) – Size of tool buttons in the grid.
iconSize (QSize) – Size of icons in the buttons.
toolButtonStyle (
Qt.ToolButtonStyle) – Tool button style.
- actionTriggered(QAction)
Signal emitted when an action is triggered
Signal emitted when an action is triggered.
- actionHovered(QAction)
Signal emitted when an action is hovered
Signal emitted when an action is hovered.
- setIconSize(size: PyQt5.QtCore.QSize) None[source]
Set the button icon size.
The default icon size is style defined.
- iconSize() PyQt5.QtCore.QSize[source]
Return the icon size. If no size is set a default style defined size is returned.
- insertAction(before: Union[PyQt5.QtWidgets.QAction, int], action: PyQt5.QtWidgets.QAction) None[source]
Insert a new action at the position currently occupied by before (can also be an index).
- Parameters
before (
QActionor int) – Position where the action should be inserted.action (
QAction) – Action to insert
- setActions(actions: Iterable[PyQt5.QtWidgets.QAction]) None[source]
Clear the grid and add actions.
- buttonForAction(action: PyQt5.QtWidgets.QAction) PyQt5.QtWidgets.QToolButton[source]
Return the
QToolButtoninstance button for action.