Skip to main content

QCustomReactionBar

QCustomReactionBar

A row of emoji reaction chips.

The little pills under a chat message showing who reacted: each chip is an emoji + a count, and an optional trailing "add reaction" button. Feed it data with setReactions([("👍", 3), ("❤️", 1)]) or the reactions Designer property ("👍:3,❤️:1"). Clicking a chip emits reactionClicked(emoji); clicking the add button emits addRequested(). Chips are styled entirely from the app QSS (objectName selectors) so they flip with the theme; the add button's "+" is painted (no glyph/asset).

At a glance​

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

Quick start​

from Custom_Widgets.QCustomReactionBar import QCustomReactionBar

widget = QCustomReactionBar()
widget.setReactions([("\U0001f44d", 12), ("\U0001f525", 4), ("\U0001f389", 2)])

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.

QCustomReactionBar in dark theme

Properties​

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

PropertyTypeDefault
reactionsstring—
showAddboolTrue
addColorcolor#8a93a6

Signals​

Signal
addRequested()
reactionClicked(QString)

Methods​

MethodDescription
addColor(*args, **kwargs)Add a color.
addRequested(...)Add a requested.
reactionClicked(...)Reaction clicked.
reactions(*args, **kwargs)Reactions.
setReactions(reactions)Set the reactions.
showAdd(*args, **kwargs)Show the add.

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