change datetime format in chatmodel
This commit is contained in:
@@ -117,27 +117,22 @@ void ChatModel::renderChatBox(Ui::MainWindow* ui, QListView *view)
|
||||
(p.getPartnerAddress() == c.second.getAddress())
|
||||
|
||||
)
|
||||
{
|
||||
|
||||
// for (auto &p : AddressBook::getInstance()->getAllAddressLabels())
|
||||
|
||||
|
||||
// {
|
||||
// if ((ui->checkBox->isChecked() == true) && (p.getCid() != c.second.getCid()))
|
||||
|
||||
// {
|
||||
|
||||
// }
|
||||
|
||||
{
|
||||
|
||||
QStandardItem* Items = new QStandardItem(c.second.toChatLine());
|
||||
Items->setData("Incoming", Qt::UserRole +1);
|
||||
myModel->appendRow(Items);
|
||||
qDebug()<<Items->text();
|
||||
ui->listChat->setModel(myModel);
|
||||
ui->listChat->setMinimumSize(200,350);
|
||||
ui->listChat->setItemDelegate(new ListViewDelegate());
|
||||
ui->listChat->show();
|
||||
|
||||
|
||||
ui->listChat->setResizeMode(QListView::Adjust);
|
||||
ui->listChat->setWordWrap(true);
|
||||
ui->listChat->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
ui->listChat->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
ui->listChat->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
ui->listChat->setModel(myModel);
|
||||
ui->listChat->setMinimumSize(200,350);
|
||||
ui->listChat->setItemDelegate(new ListViewDelegate());
|
||||
ui->listChat->show();
|
||||
}
|
||||
|
||||
|
||||
@@ -155,6 +150,12 @@ void ChatModel::renderChatBox(Ui::MainWindow* ui, QListView *view)
|
||||
myModel->appendRow(Items1);
|
||||
qDebug()<<Items1->text();
|
||||
}
|
||||
|
||||
ui->listChat->setResizeMode(QListView::Adjust);
|
||||
ui->listChat->setWordWrap(true);
|
||||
ui->listChat->setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
|
||||
ui->listChat->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
ui->listChat->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
|
||||
ui->listChat->setModel(myModel);
|
||||
ui->listChat->setMinimumSize(200,350);
|
||||
ui->listChat->setItemDelegate(new ListViewDelegate());
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include "settings.h"
|
||||
#include "camount.h"
|
||||
|
||||
|
||||
class ListViewDelegate : public QAbstractItemDelegate
|
||||
{
|
||||
int d_radius;
|
||||
@@ -267,8 +268,8 @@ class ChatItem
|
||||
{
|
||||
QDateTime myDateTime;
|
||||
myDateTime.setTime_t(_timestamp);
|
||||
QString line = QString("[") + myDateTime.toString("dd.MM.yyyy hh:mm:ss ") + QString("] ");
|
||||
line += QString(_memo) + QString("\n");
|
||||
QString line = QString("[") + myDateTime.toString("d.M.yy hh:mm") + QString("] ") ;
|
||||
line += QString("") + QString(_memo) + QString("\n\n");
|
||||
return line;
|
||||
}
|
||||
|
||||
|
||||
@@ -1484,19 +1484,6 @@
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="Line" name="line_6">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>340</x>
|
||||
<y>430</y>
|
||||
<width>911</width>
|
||||
<height>31</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
Reference in New Issue
Block a user