Skip to main content

QCustomActionButton

QCustomActionButton

A round icon button with a caption beneath it.

The "quick action" tile seen on profile panels and toolbars (Profile / Mute / Search, Call / Video, …): a circular icon button over a small caption label. The icon is a normal Qt icon so it can be set in Designer OR from QSS (#objectName { qproperty-icon: url(theme-icons:…) }) and recolours with the theme; colours are qproperties. Emits clicked. Designer-droppable, so a row of these is assembled in the form, not hand-built in Python.

At a glance​

TierFree (GPLv3)
Importfrom Custom_Widgets.QCustomActionButton import QCustomActionButton
Qt DesignerYes — drag it from the palette

Quick start​

from Custom_Widgets.QCustomActionButton import QCustomActionButton

widget = QCustomActionButton()
widget.icon = QIcon(_iconPath("paid.png"))
widget.caption = "Transfer"

That is the exact code behind the screenshot above.

Dark theme​

Colours come from the design tokens, so the widget follows the app theme with no extra work.

QCustomActionButton in dark theme

Properties​

Every property below is settable in code and in Qt Designer.

PropertyTypeDefault
frameShapeQFrame::Shape—
frameShadowQFrame::Shadow—
lineWidthint—
midLineWidthint—
frameWidthint—
frameRectQRect—
captionstringProfile
iconQIcon—
buttonSizeint46
iconSizeint19
bgColorcolor#f0f2f6
hoverColorcolor#1b74e4
captionColorcolor#8a93a6

Signals​

Signal
clicked()

Methods​

MethodDescription
bgColor(*args, **kwargs)Bg color.
buttonSize(*args, **kwargs)Button size.
caption(*args, **kwargs)Caption.
captionColor(*args, **kwargs)Caption color.
clicked(...)Clicked.
hoverColor(*args, **kwargs)Hover color.
icon(*args, **kwargs)Icon.
iconSize(*args, **kwargs)Icon size.

QCustomCopyButton · QCustomQPushButton · QCustomQPushButtonGroup · QCustomRainbowButton · QCustomSocialButton · QCustomThemeDarkLightToggle · QCustomTileButton