Skip to main content

QCustomChatInput

QCustomChatInput

A message composer bar.

The bottom "Write something…" row: attach + mic buttons, a text field, an emoji button and a send button, wired to signals (sendMessage(text) on Enter or send-click, plus attachClicked / micClicked / emojiClicked). The buttons carry stable objectNames (attachBtn / micBtn / emojiBtn / sendBtn / messageField) so their icons and colours are set from QSS (#sendBtn { qproperty-icon: url(theme-icons:…) }) — Python only reacts to the signals. Designer-droppable, so the whole bar is one widget in the form.

At a glance

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

Quick start

from Custom_Widgets.QCustomChatInput import QCustomChatInput

widget = QCustomChatInput()
widget.placeholder = "Write a message..."
widget.setText("Sounds good - shipping it today")

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.

QCustomChatInput in dark theme

Properties

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

PropertyTypeDefault
frameShapeQFrame::Shape
frameShadowQFrame::Shadow
lineWidthint
midLineWidthint
frameWidthint
frameRectQRect
placeholderstring Write something..
clearOnSendboolTrue
showAttachboolTrue
showMicboolTrue
showEmojiboolTrue
iconSizeint19

Signals

Signal
attachClicked()
emojiClicked()
micClicked()
sendMessage(QString)
textChanged(QString)

Methods

MethodDescription
attachClicked(...)Attach clicked.
clearOnSend(*args, **kwargs)Clear the on send.
emojiButton()Emoji button.
emojiClicked(...)Emoji clicked.
field()Field.
iconSize(*args, **kwargs)Icon size.
insertText(t)Insert a text.
micClicked(...)Mic clicked.
placeholder(*args, **kwargs)Placeholder.
sendButton()Send button.
sendMessage(...)Send message.
setText(t)Set the text.
showAttach(*args, **kwargs)Show the attach.
showEmoji(*args, **kwargs)Show the emoji.
showMic(*args, **kwargs)Show the mic.
text()Text.
textChanged(...)Text changed.

Theming

Colours come from the design tokens, so they follow the active theme. Roles used: accent.

See Design tokens.

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