forked from Liniyous/ElaWidgetTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathT_LogWidget.cpp
More file actions
30 lines (26 loc) · 909 Bytes
/
T_LogWidget.cpp
File metadata and controls
30 lines (26 loc) · 909 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "T_LogWidget.h"
#include <ElaListView.h>
#include <QVBoxLayout>
#include "ElaLog.h"
#include "T_LogModel.h"
T_LogWidget::T_LogWidget(QWidget* parent)
: QWidget{parent}
{
QVBoxLayout* mainLayout = new QVBoxLayout(this);
mainLayout->setContentsMargins(0, 5, 5, 0);
ElaListView* logView = new ElaListView(this);
logView->setIsTransparent(true);
_logModel = new T_LogModel(this);
logView->setModel(_logModel);
mainLayout->addWidget(logView);
connect(ElaLog::getInstance(), &ElaLog::logMessage, this, [=](QString log) {
_logModel->appendLogList(log);
});
_logModel->appendLogList("测试条例11223344556677889900");
_logModel->appendLogList("测试条例11223344556677889900");
_logModel->appendLogList("测试条例11223344556677889900");
_logModel->appendLogList("测试条例11223344556677889900");
}
T_LogWidget::~T_LogWidget()
{
}