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
| Tier | Free (GPLv3) |
| Import | from Custom_Widgets.QCustomChatInput import QCustomChatInput |
| Qt Designer | Yes — 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.
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 | — |
placeholder | string | Write something.. |
clearOnSend | bool | True |
showAttach | bool | True |
showMic | bool | True |
showEmoji | bool | True |
iconSize | int | 19 |
Signals
| Signal |
|---|
attachClicked() |
emojiClicked() |
micClicked() |
sendMessage(QString) |
textChanged(QString) |
Methods
| Method | Description |
|---|---|
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.
Related
QCustomChatBubble · QCustomChatDivider · QCustomChatList · QCustomChatListItem · QCustomChatThread · QCustomMessageStatus · QCustomReactionBar · QCustomTypingIndicator