'PyQt5: How can I have separate username and message areas for my GUI chat client?
In the attached image (from HexChat), the wrapped message never goes to the same level as [21:44:03] -Global-, anyone have any idea how I can implement this in my GUI program? Preferably with PyQt5 but just a general idea on how to implement it would also be great.
One thing I have thought of is creating a whole new widget of two widgets: a QLabel for the name and another QLabel with setWordWrap(True) for the message, and adding it to a layout or to a QListView every time a new message appears:
# Each box is a new widget
___________________________________________
| name_widget_1|text_wrapped_message_widget |
| |text_wrapped_message_widget |
| |text_wrapped_message_widget |
| |text_wrapped_message_widget |
-------------------------------------------
___________________________________________
| name_widget_2|text_wrapped_message_widget |
| |text_wrapped_message_widget |
| |text_wrapped_message_widget |
-------------------------------------------
, but that will probably be memory heavy? Or not? Maybe that's how it's typically done?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|

