iblqt.widgets.ColoredButton

class iblqt.widgets.ColoredButton[source]

Bases: QPushButton

A QPushButton that can change color.

__init__(text, color=None, parent=None, **kwargs)[source]

Initialize the ColoredButton.

Parameters:
  • text (str) – The text to be displayed.

  • color (QColor, optional) – The color to use for the button.

  • parent (QWidget) – The parent widget.

  • **kwargs (dict) – Arbitrary keyword arguments (passed to QPushButton).

color()[source]

Return the color of the button.

Returns:

The color of the button.

Return type:

QColor

setColor(color)[source]

Set the color of the button.

Parameters:

color (QColor, optional) – The new color of the button. If None, the color will be reset to it’s default color.

Return type:

None