From 05b2584fa4d773f5a88ed3ce98f5dd8304e11c34 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Mon, 12 Jun 2023 23:47:17 +0200 Subject: First commit --- conversation.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 conversation.cpp (limited to 'conversation.cpp') diff --git a/conversation.cpp b/conversation.cpp new file mode 100644 index 0000000..fdf88de --- /dev/null +++ b/conversation.cpp @@ -0,0 +1,19 @@ +#include "conversation.h" + +Conversation::Conversation(const QString &from, const QString &to, + QListWidget *const list, const QString &msg, const QDateTime &dt) : + from(from), + to(to) +{ + ui.setupUi(this); + ui.account->setText(from); + ui.contact->setText(to); + ui.message->setText(msg); + + if (!dt.isNull()) + ui.time->setText(dt.toString("ddd MMMM d yyyy hh:mm:ss")); + + QListWidgetItem::setSizeHint(QWidget::sizeHint()); + list->addItem(this); + list->setItemWidget(this, this); +} -- cgit v1.2.3