From 944474acd3861be40152243567fae6a36d36166b Mon Sep 17 00:00:00 2001 From: luzh Date: Fri, 13 Oct 2023 14:58:50 +0800 Subject: [PATCH] [fix] log classify and font style. --- ui/zenoedit/res/stylesheet/qlineedit.qss | 2 +- ui/zenoedit/zenoapplication.cpp | 26 +++++++++++++++++++++++- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/ui/zenoedit/res/stylesheet/qlineedit.qss b/ui/zenoedit/res/stylesheet/qlineedit.qss index 974ccaacf2..cd12cbf976 100644 --- a/ui/zenoedit/res/stylesheet/qlineedit.qss +++ b/ui/zenoedit/res/stylesheet/qlineedit.qss @@ -142,7 +142,7 @@ QPlainTextEdit[cssClass="logpanel"] color: #A3B1C0; background-color: rgb(24,29,33); border: 1px solid rgb(18,20,22); - font-weight: 500; + font-family:'Arial' 9pt; } QLineEdit[cssClass = "blackboard_title"] diff --git a/ui/zenoedit/zenoapplication.cpp b/ui/zenoedit/zenoapplication.cpp index b6194f3538..692c6d9fc6 100644 --- a/ui/zenoedit/zenoapplication.cpp +++ b/ui/zenoedit/zenoapplication.cpp @@ -44,7 +44,31 @@ ZenoApplication::~ZenoApplication() void ZenoApplication::onOptixlogReady(const QString& msg) { - qDebug() << msg; + if (msg.startsWith("[")) + { + QMessageLogger logger("zeno", 0, 0); + QChar tip = msg.at(1); + + auto& mgr = GraphsManagment::instance(); + if (tip == 'T') { + mgr.appendLog(QtDebugMsg, "zeno", 0, msg); + } + else if (tip == 'D') { + mgr.appendLog(QtDebugMsg, "zeno", 0, msg); + } + else if (tip == 'I') { + mgr.appendLog(QtInfoMsg, "zeno", 0, msg); + } + else if (tip == 'C') { + mgr.appendLog(QtCriticalMsg, "zeno", 0, msg); + } + else if (tip == 'W') { + mgr.appendLog(QtWarningMsg, "zeno", 0, msg); + } + else if (tip == 'E') { + mgr.appendLog(QtFatalMsg, "zeno", 0, msg); + } + } } QString ZenoApplication::readQss(const QString& qssPath)