Skip to main content

QCustomChatListItem

QCustomChatListItem

One conversation row in a messenger list.

A leading avatar (with an online status dot), the contact name, an elided last-message preview, a timestamp and an optional unread-count badge -- the exact anatomy of a chat/messenger conversation list. Composed from QLabels and a QCustomAvatar so the text uses real fonts and themes by role, while a painted rounded background gives the selected row its highlight pill. Set active to mark the open conversation, unread for the badge count, and muted to dim the row. Emits clicked so a list can route selection.

At a glance​

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

Quick start​

from Custom_Widgets.QCustomChatListItem import QCustomChatListItem

widget = QCustomChatListItem()

Dark theme​

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

QCustomChatListItem in dark theme

Properties​

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

PropertyTypeDefault
frameShapeQFrame::Shape—
frameShadowQFrame::Shadow—
lineWidthint—
midLineWidthint—
frameWidthint—
frameRectQRect—
namestringRicky Smith
previewstringYOU: Okay, let's get the file over to...
timestring1min ago
unreadint0
onlineboolTrue
activeboolFalse
mutedboolFalse
activeColorcolor#12203a
nameColorcolor#1f2430
previewColorcolor#8a93a6
timeColorcolor#8a93a6
activeNameColorcolor#ffffff
activeTimeColorcolor#4c8dff
accentColorcolor#1b74e4
radiusint14
avatarSizeint44

Signals​

Signal
clicked()

Methods​

MethodDescription
accentColor(*args, **kwargs)Accent color.
active(*args, **kwargs)Active.
activeColor(*args, **kwargs)Active color.
activeNameColor(*args, **kwargs)Active name color.
activeTimeColor(*args, **kwargs)Active time color.
avatarSize(*args, **kwargs)Avatar size.
clicked(...)Clicked.
muted(*args, **kwargs)Muted.
name(*args, **kwargs)Name.
nameColor(*args, **kwargs)Name color.
online(*args, **kwargs)Online.
preview(*args, **kwargs)Preview.
previewColor(*args, **kwargs)Preview color.
radius(*args, **kwargs)Radius.
setAvatarImage(image)Set the avatar image.
setName(text)Set the name.
setPreview(text)Set the preview.
setTime(text)Set the time.
time(*args, **kwargs)Time.
timeColor(*args, **kwargs)Time color.
unread(*args, **kwargs)Unread.

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