Skip to main content

QCustomChatList

QCustomChatList

A data-driven conversation list.

Wraps a scrollable column of QCustomChatListItem rows and owns the selection (active pill), so a manager just calls setConversations([...]) with DATA and connects currentChanged(index) — it never builds or colours rows. All the row styling (accent, active pill, name/preview/time colours, online dot) is exposed as qproperties on the LIST and forwarded to every row, so the whole look is set in Designer / QSS. Designer-droppable.

Each conversation is a dict: {name, preview, time, unread, online, muted, avatarColor, avatarImage}.

At a glance​

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

Quick start​

from Custom_Widgets.QCustomChatList import QCustomChatList

widget = QCustomChatList()

Dark theme​

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

QCustomChatList in dark theme

Properties​

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

PropertyTypeDefault
frameShapeQFrame::Shape—
frameShadowQFrame::Shadow—
lineWidthint—
midLineWidthint—
frameWidthint—
frameRectQRect—
accentColorcolor#1b74e4
activeColorcolor#12203a
nameColorcolor#1f2430
previewColorcolor#8a93a6
timeColorcolor#99a0b0
activeNameColorcolor#ffffff
activeTimeColorcolor#4c8dff
onlineColorcolor#31c48d
surfaceColorcolor#ffffff
rowSpacingint2

Signals​

Signal
currentChanged(int)
itemClicked(int)

Methods​

MethodDescription
accentColor(*args, **kwargs)Accent color.
activeColor(*args, **kwargs)Active color.
activeNameColor(*args, **kwargs)Active name color.
activeTimeColor(*args, **kwargs)Active time color.
count()Count.
currentChanged(...)Current changed.
currentIndex()Current index.
itemClicked(...)Item clicked.
nameColor(*args, **kwargs)Name color.
onlineColor(*args, **kwargs)Online color.
previewColor(*args, **kwargs)Preview color.
rowSpacing(*args, **kwargs)Row spacing.
setAvatarImageAt(index, image)Set the avatar image at.
setConversations(conversations)Set the conversations.
setCurrentIndex(index, emit=True)Set the current index.
surfaceColor(*args, **kwargs)Surface color.
timeColor(*args, **kwargs)Time color.

Theming​

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

See Design tokens.

QCustomChatBubble · QCustomChatDivider · QCustomChatInput · QCustomChatListItem · QCustomChatThread · QCustomMessageStatus · QCustomReactionBar · QCustomTypingIndicator