spyder.api.widgets.comboboxes#

Spyder combobox widgets.

Use these widgets for any combobox you want to add to Spyder.

Classes

SpyderComboBox([parent, items_elide_mode])

Default combobox widget for Spyder.

SpyderComboBoxWithIcons([parent, ...])

Combobox widget for Spyder when its items have icons.

SpyderFontComboBox([parent])

A specialized combobox for showing a list of font choices.

class spyder.api.widgets.comboboxes.SpyderComboBox(
parent: QWidget | None = None,
items_elide_mode: TextElideMode | None = None,
)[source]#

Bases: _SpyderComboBoxMixin, QComboBox

Default combobox widget for Spyder.

Used for all comboboxes in Spyder so they have a uniform styling across operating systems.

__init__(
parent: QWidget | None = None,
items_elide_mode: TextElideMode | None = None,
) None[source]#

Default combobox widget for Spyder.

Parameters:
  • parent (QWidget | None, optional) – The parent widget of the combobox.

  • items_elide_mode (TextElideMode | None, optional) – The elide mode for the combobox items, which controls whether the ellipses (...) is placed to the left, center or right for overly long text. If None, the default, will be eliding to the right (e.g. Very long name...).

Return type:

None

showEvent(event: QShowEvent) None[source]#

Adjustments when the widget is shown.

Parameters:

event (QShowEvent) – The event object showing the widget.

Return type:

None

showPopup() None[source]#

Adjustments when the popup is shown.

Return type:

None

hidePopup() None[source]#

Adjustments when the popup is hidden.

Return type:

None

class spyder.api.widgets.comboboxes.SpyderComboBoxWithIcons(
parent: QWidget | None = None,
items_elide_mode: TextElideMode | None = None,
)[source]#

Bases: SpyderComboBox

Combobox widget for Spyder when its items have icons.

__init__(
parent: QWidget | None = None,
items_elide_mode: TextElideMode | None = None,
) None[source]#

Combobox widget for Spyder when its items have icons.

Parameters:
  • parent (QWidget | None, optional) – This combobox’s parent widget; by default, no parent (None).

  • items_elide_mode (TextElideMode | None, optional) – The elide mode for the combobox items, which controls whether the ellipses (...) is placed to the left, center or right for overly long text. If None, the default, will be eliding to the right (e.g. Very long name...).

Return type:

None

class spyder.api.widgets.comboboxes.SpyderFontComboBox(parent: QWidget | None = None)[source]#

Bases: _SpyderComboBoxMixin, QFontComboBox

A specialized combobox for showing a list of font choices.

__init__(parent: QWidget | None = None) None[source]#

Create a new combobox for displaying font choices.

Parameters:

parent (QWidget | None, optional) – This combobox’s parent widget; by default, no parent (None).

Return type:

None

showPopup() None[source]#

Adjustments for when the font combobox popup is shown.

Return type:

None

hidePopup() None[source]#

Adjustments for when the font combobox popup is hidden.

Return type:

None