spark.graph_editor.widgets.collapsible#

Classes#

QCollapsible

A collapsible widget to hide and unhide child widgets.

Module Contents#

class spark.graph_editor.widgets.collapsible.QCollapsible(title='', expandedIcon='▼', collapsedIcon='▲')[source]#

Bases: PySide6.QtWidgets.QFrame

A collapsible widget to hide and unhide child widgets. A signal is emitted when the widget is expanded (True) or collapsed (False).

Parameters:
  • title (str)

  • expandedIcon (PySide6.QtGui.QIcon | str | None)

  • collapsedIcon (PySide6.QtGui.QIcon | str | None)

toggled[source]#
toggleButton()[source]#

Return the toggle button.

Return type:

PySide6.QtWidgets.QPushButton

setText(text)[source]#

Set the text of the toggle button.

Parameters:

text (str)

Return type:

None

text()[source]#

Return the text of the toggle button.

Return type:

str

setContent(content)[source]#

Replace central widget (the widget that gets expanded/collapsed).

Parameters:

content (PySide6.QtWidgets.QWidget)

Return type:

None

content()[source]#

Return the current content widget.

Return type:

PySide6.QtWidgets.QWidget | None

expandedIcon()[source]#

Returns the icon used when the widget is expanded.

Return type:

PySide6.QtGui.QIcon

setExpandedIcon(icon=None)[source]#

Set the icon on the toggle button when the widget is expanded.

Parameters:

icon (PySide6.QtGui.QIcon | str | None)

Return type:

None

collapsedIcon()[source]#

Returns the icon used when the widget is collapsed.

Return type:

PySide6.QtGui.QIcon

setCollapsedIcon(icon=None)[source]#

Set the icon on the toggle button when the widget is collapsed.

Parameters:

icon (PySide6.QtGui.QIcon | str | None)

Return type:

None

setDuration(msecs)[source]#

Set duration of the collapse/expand animation.

Parameters:

msecs (int)

Return type:

None

setEasingCurve(easing)[source]#

Set the easing curve for the collapse/expand animation.

Parameters:

easing (PySide6.QtCore.QEasingCurve | PySide6.QtCore.QEasingCurve.Type)

Return type:

None

addWidget(widget)[source]#

Add a widget to the central content widget’s layout.

Parameters:

widget (PySide6.QtWidgets.QWidget)

Return type:

None

removeWidget(widget)[source]#

Remove widget from the central content widget’s layout.

Parameters:

widget (PySide6.QtWidgets.QWidget)

Return type:

None

expand(animate=True)[source]#

Expand (show) the collapsible section.

Parameters:

animate (bool)

Return type:

None

collapse(animate=True)[source]#

Collapse (hide) the collapsible section.

Parameters:

animate (bool)

Return type:

None

isExpanded()[source]#

Return whether the collapsible section is visible.

Return type:

bool

setLocked(locked=True)[source]#

Set whether collapse/expand is disabled.

Parameters:

locked (bool)

Return type:

None

locked()[source]#

Return True if collapse/expand is disabled.

Return type:

bool

eventFilter(a0, a1)[source]#

If a child widget resizes, we need to update our expanded height.

Parameters:
  • a0 (PySide6.QtCore.QObject)

  • a1 (PySide6.QtCore.QEvent)

Return type:

bool