MCPcopy Create free account
hub / github.com/Liniyous/ElaWidgetTools / T_LogWidget

Method T_LogWidget

ElaWidgetToolsExample/ExamplePage/T_LogWidget.cpp:9–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7#include "ElaLog.h"
8#include "T_LogModel.h"
9T_LogWidget::T_LogWidget(QWidget* parent)
10 : QWidget{parent}
11{
12 QVBoxLayout* mainLayout = new QVBoxLayout(this);
13 mainLayout->setContentsMargins(0, 5, 5, 0);
14 ElaListView* logView = new ElaListView(this);
15 logView->setIsTransparent(true);
16 _logModel = new T_LogModel(this);
17 logView->setModel(_logModel);
18 mainLayout->addWidget(logView);
19 connect(ElaLog::getInstance(), &ElaLog::logMessage, this, [=](QString log) {
20 _logModel->appendLogList(log);
21 });
22 _logModel->appendLogList("测试条例11223344556677889900");
23 _logModel->appendLogList("测试条例11223344556677889900");
24 _logModel->appendLogList("测试条例11223344556677889900");
25 _logModel->appendLogList("测试条例11223344556677889900");
26}
27
28T_LogWidget::~T_LogWidget()
29{

Callers

nothing calls this directly

Calls 3

addWidgetMethod · 0.80
appendLogListMethod · 0.80
setIsTransparentMethod · 0.45

Tested by

no test coverage detected