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
| Tier | Free (GPLv3) |
| Import | from Custom_Widgets.QCustomChatListItem import QCustomChatListItem |
| Qt Designer | Yes — 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.
Properties
Every property below is settable in code and in Qt Designer.
| Property | Type | Default |
|---|---|---|
frameShape | QFrame::Shape | — |
frameShadow | QFrame::Shadow | — |
lineWidth | int | — |
midLineWidth | int | — |
frameWidth | int | — |
frameRect | QRect | — |
name | string | Ricky Smith |
preview | string | YOU: Okay, let's get the file over to... |
time | string | 1min ago |
unread | int | 0 |
online | bool | True |
active | bool | False |
muted | bool | False |
activeColor | color | #12203a |
nameColor | color | #1f2430 |
previewColor | color | #8a93a6 |
timeColor | color | #8a93a6 |
activeNameColor | color | #ffffff |
activeTimeColor | color | #4c8dff |
accentColor | color | #1b74e4 |
radius | int | 14 |
avatarSize | int | 44 |
Signals
| Signal |
|---|
clicked() |
Methods
| Method | Description |
|---|---|
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. |
Theming
Colours come from the design tokens, so they follow the active theme. Roles used: accent.
See Design tokens.
Related
QCustomChatBubble · QCustomChatDivider · QCustomChatInput · QCustomChatList · QCustomChatThread · QCustomMessageStatus · QCustomReactionBar · QCustomTypingIndicator