Skip to main content

QCustomAvatarGroup

QCustomAvatarGroup

A row of overlapping avatars with overflow.

Circular initials-avatars overlap; beyond maxVisible a "+N" chip shows the remainder. Each avatar's colour is derived deterministically from its name. The separating ring colour comes from tokens (qproperty ringColor).

At a glance

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

Quick start

from Custom_Widgets.QCustomAvatarGroup import QCustomAvatarGroup

widget = QCustomAvatarGroup()
widget.setAvatars(["Amara Mensah", "Ben Ortiz", "Chidi Okafor", "Dana Levy",
"Eli Novak", "Farah Aziz"])

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.

QCustomAvatarGroup in dark theme

Properties

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

PropertyTypeDefault
maxVisibleint4
ringColorcolor
overflowBgcolor
overflowTextcolor

Methods

MethodDescription
maxVisible(*args, **kwargs)Max visible.
names()Names.
overflowBg(*args, **kwargs)Overflow bg.
overflowText(*args, **kwargs)Overflow text.
ringColor(*args, **kwargs)Ring color.
setAvatars(names)Set the avatars.

Theming

Colours come from the design tokens, so they follow the active theme. Roles used: surface, surface-muted, on-surface.

See Design tokens.

AnalogGaugeWidget · QCustomAgendaList · QCustomAlert · QCustomAvatar · QCustomBadge · QCustomCard · QCustomChip · QCustomClockLabel