From a26169d4bcff370b7ac1d7c119c4f43a70540ccf Mon Sep 17 00:00:00 2001 From: Bryant <bwmairs@ucsc.edu> Date: Thu, 20 Feb 2014 13:54:26 -0800 Subject: [PATCH 1/7] QGCMessageView: Extensive code cleanup and bug fixing. Right-click menu works cleaner. Coloring of output text is correct. Output text now handles all severities of messages. --- src/ui/uas/QGCMessageView.cc | 145 +++++++++++++++++++++++++++++++------------ src/ui/uas/QGCMessageView.h | 12 +--- src/ui/uas/QGCMessageView.ui | 47 ++++++-------- 3 files changed, 127 insertions(+), 77 deletions(-) diff --git a/src/ui/uas/QGCMessageView.cc b/src/ui/uas/QGCMessageView.cc index 5c583e0..2bf8963 100644 --- a/src/ui/uas/QGCMessageView.cc +++ b/src/ui/uas/QGCMessageView.cc @@ -1,95 +1,158 @@ -#include "QGCMessageView.h" - #include <QMenu> #include <QScrollBar> - +#include "QGCMessageView.h" #include "GAudioOutput.h" #include "QGCUnconnectedInfoWidget.h" #include "UASManager.h" #include "ui_QGCMessageView.h" - QGCMessageView::QGCMessageView(QWidget *parent) : QWidget(parent), activeUAS(NULL), - clearAction(new QAction(tr("Clear Text"), this)), ui(new Ui::QGCMessageView) { - setObjectName("QUICKVIEW_MESSAGE_CONSOLE"); + setObjectName("QUICKVIEW_MESSAGE_CONSOLE") ; ui->setupUi(this); - setStyleSheet("QScrollArea { border: 0px; } QPlainTextEdit { border: 0px }"); + setStyleSheet("QPlainTextEdit { border: 0px }"); // Construct initial widget connectWidget = new QGCUnconnectedInfoWidget(this); ui->horizontalLayout->addWidget(connectWidget); ui->plainTextEdit->hide(); + // Enable the right-click menu for the text editor. This works because the plainTextEdit + // widget has its context menu policy set to its actions list. So we any actions we add + // to this widget's action list will be automatically displayed. + // We only have the clear action right now. + QAction* clearAction = new QAction(tr("Clear Text"), this); + connect(clearAction, SIGNAL(triggered()), ui->plainTextEdit, SLOT(clear())); + ui->plainTextEdit->addAction(clearAction); + + // Connect to the currently active UAS. setActiveUAS(UASManager::instance()->getActiveUAS()); connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS(UASInterface*))); } QGCMessageView::~QGCMessageView() { + // The only thing we need to delete is the ui because it's the only thing not cleaned up automatically + // by the deletion of its parent. delete ui; } void QGCMessageView::setActiveUAS(UASInterface* uas) { - if (!uas) - return; - - if (activeUAS) { - disconnect(uas, SIGNAL(textMessageReceived(int,int,int,QString)), this, SLOT(handleTextMessage(int,int,int,QString))); + // If we were already attached to an autopilot, disconnect it, restoring + // the widget to its initial state as needed. + if (activeUAS) + { + disconnect(activeUAS, SIGNAL(textMessageReceived(int,int,int,QString)), this, SLOT(handleTextMessage(int,int,int,QString))); ui->plainTextEdit->clear(); - } else { - - // First time UI setup, clear layout - ui->horizontalLayout->removeWidget(connectWidget); - connectWidget->deleteLater(); - ui->plainTextEdit->show(); - - connect(clearAction, SIGNAL(triggered()), ui->plainTextEdit, SLOT(clear())); + activeUAS = NULL; } - connect(uas, SIGNAL(textMessageReceived(int,int,int,QString)), this, SLOT(handleTextMessage(int,int,int,QString))); - activeUAS = uas; + // And now if there's an autopilot to follow, set up the UI. + if (uas) + { + // Make sure the UI is configured for showing messages. + // Note that this call is NOT equivalent to `connectWidget->isVisible()`. + if (!connectWidget->isHidden()) + { + connectWidget->hide(); + ui->plainTextEdit->show(); + } + + // And connect to the new UAS. + connect(uas, SIGNAL(textMessageReceived(int,int,int,QString)), this, SLOT(handleTextMessage(int,int,int,QString))); + activeUAS = uas; + } + // But if there's no new autopilot, restore the connect button. + else + { + connectWidget->show(); + ui->plainTextEdit->hide(); + } } void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QString text) { - // XXX color messages according to severity - QPlainTextEdit *msgWidget = ui->plainTextEdit; - //turn off updates while we're appending content to avoid breaking the autoscroll behavior + // Turn off updates while we're appending content to avoid breaking the autoscroll behavior msgWidget->setUpdatesEnabled(false); QScrollBar *scroller = msgWidget->verticalScrollBar(); + // Get all the UAS info. UASInterface *uas = UASManager::instance()->getUASForId(uasid); QString uasName(uas->getUASName()); QString colorName(uas->getColor().name()); - //change styling based on severity - if (160 == severity ) { //TODO where is the constant for "critical" severity? + + // Color the output depending on the message severity. We have 3 distinct cases: + // 1: If we have an ERROR or worse, make it bigger, bolder, and highlight it. + // 2: If we have a warning or notice, just make it bold. + // 3: Otherwise color it the standard color. + + // So first deteremine the styling based on the severity. + QString style; + switch (severity) + { + case MAV_SEVERITY_EMERGENCY: + case MAV_SEVERITY_ALERT: + case MAV_SEVERITY_CRITICAL: + case MAV_SEVERITY_ERROR: + // TODO: Move this audio output to UAS.cc, as it doesn't make sense to put audio output in a message logger widget. GAudioOutput::instance()->say(text.toLower()); - msgWidget->appendHtml(QString("<p style=\"color:#DC143C;background-color:#FFFACD;font-size:large;font-weight:bold\">[%1:%2] %3</p>").arg(uasName).arg(compId).arg(text)); + style = QString("color:#DC143C;font-size:large;font-weight:bold"); + break; + case MAV_SEVERITY_WARNING: + case MAV_SEVERITY_NOTICE: + style = QString("color:%1;font-weight:bold").arg(colorName); + break; + default: + style = QString("color:%1;").arg(colorName); + break; } - else { - msgWidget->appendHtml(QString("<p style=\"color:%1;font-size:smaller\">[%2:%3] %4</p>").arg(colorName).arg(uasName).arg(compId).arg(text)); + + // And determine the text for the severities. + QString severityText(""); + switch (severity) + { + case MAV_SEVERITY_EMERGENCY: + severityText = QString(tr("EMERGENCY")); + break; + case MAV_SEVERITY_ALERT: + severityText = QString(tr("ALERT")); + break; + case MAV_SEVERITY_CRITICAL: + severityText = QString(tr("Critical")); + break; + case MAV_SEVERITY_ERROR: + severityText = QString(tr("Error")); + break; + case MAV_SEVERITY_WARNING: + severityText = QString(tr("Warning")); + break; + case MAV_SEVERITY_NOTICE: + severityText = QString(tr("Notice")); + break; + case MAV_SEVERITY_INFO: + severityText = QString(tr("Info")); + break; + case MAV_SEVERITY_DEBUG: + severityText = QString(tr("Debug")); + break; + default: + severityText = QString(tr("Unknown")); + break; } + // Finally append the properly-styled text. + msgWidget->appendHtml(QString("<p style=\"%1\">[%2:%3] %4 - %5</p>").arg(style).arg(uasName).arg(compId).arg(severityText).arg(text)); + qDebug() << msgWidget->document()->toHtml(); + // Ensure text area scrolls correctly scroller->setValue(scroller->maximum()); msgWidget->setUpdatesEnabled(true); - -} - -void QGCMessageView::contextMenuEvent(QContextMenuEvent* event) -{ - if(activeUAS) { - QMenu menu(this); - menu.addAction(clearAction); - menu.exec(event->globalPos()); - } -} +} \ No newline at end of file diff --git a/src/ui/uas/QGCMessageView.h b/src/ui/uas/QGCMessageView.h index 67c69ce..6504939 100644 --- a/src/ui/uas/QGCMessageView.h +++ b/src/ui/uas/QGCMessageView.h @@ -34,17 +34,11 @@ public slots: */ void handleTextMessage(int uasid, int componentid, int severity, QString text); - /** - * @brief Hand context menu event - * @param event - */ - virtual void contextMenuEvent(QContextMenuEvent* event); - protected: + // Stores the UAS that we're currently receiving messages from. UASInterface* activeUAS; - QVBoxLayout* initialLayout; - QGCUnconnectedInfoWidget *connectWidget; - QAction* clearAction; + // Stores the connect widget that is displayed when no UAS is active. + QGCUnconnectedInfoWidget* connectWidget; private: Ui::QGCMessageView *ui; diff --git a/src/ui/uas/QGCMessageView.ui b/src/ui/uas/QGCMessageView.ui index 069ee2f..2c3b60d 100644 --- a/src/ui/uas/QGCMessageView.ui +++ b/src/ui/uas/QGCMessageView.ui @@ -6,14 +6,17 @@ <rect> <x>0</x> <y>0</y> - <width>305</width> - <height>283</height> + <width>248</width> + <height>249</height> </rect> </property> + <property name="contextMenuPolicy"> + <enum>Qt::NoContextMenu</enum> + </property> <property name="windowTitle"> <string>Form</string> </property> - <layout class="QHBoxLayout" name="horizontalLayout_2"> + <layout class="QHBoxLayout" name="horizontalLayout"> <property name="leftMargin"> <number>0</number> </property> @@ -27,32 +30,22 @@ <number>0</number> </property> <item> - <widget class="QScrollArea" name="scrollArea"> - <property name="widgetResizable"> + <widget class="QPlainTextEdit" name="plainTextEdit"> + <property name="contextMenuPolicy"> + <enum>Qt::ActionsContextMenu</enum> + </property> + <property name="acceptDrops"> + <bool>false</bool> + </property> + <property name="undoRedoEnabled"> + <bool>false</bool> + </property> + <property name="readOnly"> <bool>true</bool> </property> - <widget class="QWidget" name="scrollAreaWidgetContents"> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>303</width> - <height>273</height> - </rect> - </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <property name="margin"> - <number>0</number> - </property> - <item> - <widget class="QPlainTextEdit" name="plainTextEdit"> - <property name="readOnly"> - <bool>true</bool> - </property> - </widget> - </item> - </layout> - </widget> + <property name="plainText"> + <string notr="true"/> + </property> </widget> </item> </layout> From d4a8efbd2c7bbf6ca87036bd49f7caf3bbb7032d Mon Sep 17 00:00:00 2001 From: Bryant <bwmairs@ucsc.edu> Date: Thu, 20 Feb 2014 16:34:00 -0800 Subject: [PATCH 2/7] QGCMessageView: Added timestamps. --- src/ui/uas/QGCMessageView.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ui/uas/QGCMessageView.cc b/src/ui/uas/QGCMessageView.cc index 2bf8963..5e234c6 100644 --- a/src/ui/uas/QGCMessageView.cc +++ b/src/ui/uas/QGCMessageView.cc @@ -148,8 +148,9 @@ void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QStr break; } - // Finally append the properly-styled text. - msgWidget->appendHtml(QString("<p style=\"%1\">[%2:%3] %4 - %5</p>").arg(style).arg(uasName).arg(compId).arg(severityText).arg(text)); + // Finally append the properly-styled text with a timestamp. + QString dateString = QDateTime::currentDateTime().toString(Qt::SystemLocaleShortDate); + msgWidget->appendHtml(QString("<p style=\"%1\">[%2][%3:%4] %5 - %6</p>").arg(style).arg(dateString).arg(uasName).arg(compId).arg(severityText).arg(text)); qDebug() << msgWidget->document()->toHtml(); // Ensure text area scrolls correctly From 5ccea177622f140a542d13228e3598c32e6abfcb Mon Sep 17 00:00:00 2001 From: Bryant <bwmairs@ucsc.edu> Date: Thu, 20 Feb 2014 16:43:32 -0800 Subject: [PATCH 3/7] Message view: Forgot to remove debugging output. --- src/ui/uas/QGCMessageView.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/ui/uas/QGCMessageView.cc b/src/ui/uas/QGCMessageView.cc index 5e234c6..2097bdd 100644 --- a/src/ui/uas/QGCMessageView.cc +++ b/src/ui/uas/QGCMessageView.cc @@ -151,7 +151,6 @@ void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QStr // Finally append the properly-styled text with a timestamp. QString dateString = QDateTime::currentDateTime().toString(Qt::SystemLocaleShortDate); msgWidget->appendHtml(QString("<p style=\"%1\">[%2][%3:%4] %5 - %6</p>").arg(style).arg(dateString).arg(uasName).arg(compId).arg(severityText).arg(text)); - qDebug() << msgWidget->document()->toHtml(); // Ensure text area scrolls correctly scroller->setValue(scroller->maximum()); From ca5c48626014c95e3a52f52cbba29b67fffe7a7d Mon Sep 17 00:00:00 2001 From: Lorenz Meier <lm@inf.ethz.ch> Date: Fri, 21 Feb 2014 12:55:39 +0100 Subject: [PATCH 4/7] Simplified formatting --- src/ui/uas/QGCMessageView.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/uas/QGCMessageView.cc b/src/ui/uas/QGCMessageView.cc index 2097bdd..c8be3cc 100644 --- a/src/ui/uas/QGCMessageView.cc +++ b/src/ui/uas/QGCMessageView.cc @@ -104,11 +104,11 @@ void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QStr case MAV_SEVERITY_ERROR: // TODO: Move this audio output to UAS.cc, as it doesn't make sense to put audio output in a message logger widget. GAudioOutput::instance()->say(text.toLower()); - style = QString("color:#DC143C;font-size:large;font-weight:bold"); + style = QString("color:#DC143C;"); break; case MAV_SEVERITY_WARNING: case MAV_SEVERITY_NOTICE: - style = QString("color:%1;font-weight:bold").arg(colorName); + style = QString("color:%1;").arg(colorName); break; default: style = QString("color:%1;").arg(colorName); @@ -155,4 +155,4 @@ void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QStr // Ensure text area scrolls correctly scroller->setValue(scroller->maximum()); msgWidget->setUpdatesEnabled(true); -} \ No newline at end of file +} From af086fa56a9c298ae36091bf38284e3749052af2 Mon Sep 17 00:00:00 2001 From: Lorenz Meier <lm@inf.ethz.ch> Date: Fri, 21 Feb 2014 13:13:01 +0100 Subject: [PATCH 5/7] message view improvements --- src/ui/uas/QGCMessageView.cc | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/ui/uas/QGCMessageView.cc b/src/ui/uas/QGCMessageView.cc index c8be3cc..5ed1c75 100644 --- a/src/ui/uas/QGCMessageView.cc +++ b/src/ui/uas/QGCMessageView.cc @@ -104,14 +104,14 @@ void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QStr case MAV_SEVERITY_ERROR: // TODO: Move this audio output to UAS.cc, as it doesn't make sense to put audio output in a message logger widget. GAudioOutput::instance()->say(text.toLower()); - style = QString("color:#DC143C;"); + style = QString("color:#DC143C; font-weight:bold"); break; case MAV_SEVERITY_WARNING: case MAV_SEVERITY_NOTICE: - style = QString("color:%1;").arg(colorName); + style = QString("color:%1; font-weight:bold").arg(colorName); break; default: - style = QString("color:%1;").arg(colorName); + style = QString("color:%1; font-weight:bold").arg(colorName); break; } @@ -120,37 +120,37 @@ void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QStr switch (severity) { case MAV_SEVERITY_EMERGENCY: - severityText = QString(tr("EMERGENCY")); + severityText = QString(tr(" EMERGENCY:")); break; case MAV_SEVERITY_ALERT: - severityText = QString(tr("ALERT")); + severityText = QString(tr(" ALERT:")); break; case MAV_SEVERITY_CRITICAL: - severityText = QString(tr("Critical")); + severityText = QString(tr(" Critical:")); break; case MAV_SEVERITY_ERROR: - severityText = QString(tr("Error")); + severityText = QString(tr(" Error:")); break; case MAV_SEVERITY_WARNING: - severityText = QString(tr("Warning")); + severityText = QString(tr(" Warning:")); break; case MAV_SEVERITY_NOTICE: - severityText = QString(tr("Notice")); + severityText = QString(tr(" Notice:")); break; case MAV_SEVERITY_INFO: - severityText = QString(tr("Info")); + severityText = QString(tr(" Info:")); break; case MAV_SEVERITY_DEBUG: - severityText = QString(tr("Debug")); + severityText = QString(tr(" Debug:")); break; default: - severityText = QString(tr("Unknown")); + severityText = QString(tr("")); break; } // Finally append the properly-styled text with a timestamp. QString dateString = QDateTime::currentDateTime().toString(Qt::SystemLocaleShortDate); - msgWidget->appendHtml(QString("<p style=\"%1\">[%2][%3:%4] %5 - %6</p>").arg(style).arg(dateString).arg(uasName).arg(compId).arg(severityText).arg(text)); + msgWidget->appendHtml(QString("<p style=\"color:#CCCCCC\">[%2 - %3:%4]<font style=\"%1\">%5 %6</font></p>").arg(style).arg(dateString).arg(uasName).arg(compId).arg(severityText).arg(text)); // Ensure text area scrolls correctly scroller->setValue(scroller->maximum()); From da19aa2d668540f47850c348498bdffc0d7c92ae Mon Sep 17 00:00:00 2001 From: VArdulov <victor@ardulov.com> Date: Wed, 12 Mar 2014 17:29:31 -0700 Subject: [PATCH 6/7] Fising the Message View and a Comment --- src/ui/uas/QGCMessageView.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ui/uas/QGCMessageView.cc b/src/ui/uas/QGCMessageView.cc index 5ed1c75..10e1d55 100644 --- a/src/ui/uas/QGCMessageView.cc +++ b/src/ui/uas/QGCMessageView.cc @@ -23,7 +23,7 @@ QGCMessageView::QGCMessageView(QWidget *parent) : ui->plainTextEdit->hide(); // Enable the right-click menu for the text editor. This works because the plainTextEdit - // widget has its context menu policy set to its actions list. So we any actions we add + // widget has its context menu policy set to its actions list. So any actions we add // to this widget's action list will be automatically displayed. // We only have the clear action right now. QAction* clearAction = new QAction(tr("Clear Text"), this); @@ -86,7 +86,7 @@ void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QStr // Get all the UAS info. UASInterface *uas = UASManager::instance()->getUASForId(uasid); - QString uasName(uas->getUASName()); + //QString uasName(uas->getUASName()); QString colorName(uas->getColor().name()); // Color the output depending on the message severity. We have 3 distinct cases: @@ -106,12 +106,12 @@ void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QStr GAudioOutput::instance()->say(text.toLower()); style = QString("color:#DC143C; font-weight:bold"); break; - case MAV_SEVERITY_WARNING: case MAV_SEVERITY_NOTICE: + case MAV_SEVERITY_WARNING: style = QString("color:%1; font-weight:bold").arg(colorName); break; default: - style = QString("color:%1; font-weight:bold").arg(colorName); + style = QString("color:white; font-weight:bold").arg(colorName); break; } @@ -149,8 +149,8 @@ void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QStr } // Finally append the properly-styled text with a timestamp. - QString dateString = QDateTime::currentDateTime().toString(Qt::SystemLocaleShortDate); - msgWidget->appendHtml(QString("<p style=\"color:#CCCCCC\">[%2 - %3:%4]<font style=\"%1\">%5 %6</font></p>").arg(style).arg(dateString).arg(uasName).arg(compId).arg(severityText).arg(text)); + QString dateString = QDateTime::currentDateTime().toString("hh:mm:ss.zzz"); + msgWidget->appendHtml(QString("<p style=\"color:#CCCCCC\">[%2 - COMP:%4]<font style=\"%1\">%5 %6</font></p>").arg(style).arg(dateString).arg(compId).arg(severityText).arg(text)); // Ensure text area scrolls correctly scroller->setValue(scroller->maximum()); From c57da0aa94f294b039a8eef0720dcfaa35f6b0ea Mon Sep 17 00:00:00 2001 From: VArdulov <victor@ardulov.com> Date: Fri, 14 Mar 2014 17:50:05 -0700 Subject: [PATCH 7/7] Continued improvements to Message View --- src/ui/uas/QGCMessageView.cc | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/src/ui/uas/QGCMessageView.cc b/src/ui/uas/QGCMessageView.cc index 10e1d55..5e00563 100644 --- a/src/ui/uas/QGCMessageView.cc +++ b/src/ui/uas/QGCMessageView.cc @@ -79,20 +79,15 @@ void QGCMessageView::setActiveUAS(UASInterface* uas) void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QString text) { QPlainTextEdit *msgWidget = ui->plainTextEdit; - + (void)uasid; // Unused variable voided. // Turn off updates while we're appending content to avoid breaking the autoscroll behavior msgWidget->setUpdatesEnabled(false); QScrollBar *scroller = msgWidget->verticalScrollBar(); - // Get all the UAS info. - UASInterface *uas = UASManager::instance()->getUASForId(uasid); - //QString uasName(uas->getUASName()); - QString colorName(uas->getColor().name()); - // Color the output depending on the message severity. We have 3 distinct cases: - // 1: If we have an ERROR or worse, make it bigger, bolder, and highlight it. - // 2: If we have a warning or notice, just make it bold. - // 3: Otherwise color it the standard color. + // 1: If we have an ERROR or worse, make it bigger, bolder, and highlight it red. + // 2: If we have a warning or notice, just make it bold and color it orange. + // 3: Otherwise color it the standard color, white. // So first deteremine the styling based on the severity. QString style; @@ -104,18 +99,19 @@ void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QStr case MAV_SEVERITY_ERROR: // TODO: Move this audio output to UAS.cc, as it doesn't make sense to put audio output in a message logger widget. GAudioOutput::instance()->say(text.toLower()); - style = QString("color:#DC143C; font-weight:bold"); + //Use set RGB values from given color from QGC + style = QString("color: rgb(%1, %2, %3); font-weight:bold").arg(QGC::colorRed.red()).arg(QGC::colorRed.green()).arg(QGC::colorRed.blue()); break; case MAV_SEVERITY_NOTICE: case MAV_SEVERITY_WARNING: - style = QString("color:%1; font-weight:bold").arg(colorName); + style = QString("color: rgb(%1, %2, %3); font-weight:bold").arg(QGC::colorOrange.red()).arg(QGC::colorOrange.green()).arg(QGC::colorOrange.blue()); break; default: - style = QString("color:white; font-weight:bold").arg(colorName); + style = QString("color:white; font-weight:bold"); break; } - // And determine the text for the severities. + // And determine the text for the severitie QString severityText(""); switch (severity) { @@ -150,7 +146,7 @@ void QGCMessageView::handleTextMessage(int uasid, int compId, int severity, QStr // Finally append the properly-styled text with a timestamp. QString dateString = QDateTime::currentDateTime().toString("hh:mm:ss.zzz"); - msgWidget->appendHtml(QString("<p style=\"color:#CCCCCC\">[%2 - COMP:%4]<font style=\"%1\">%5 %6</font></p>").arg(style).arg(dateString).arg(compId).arg(severityText).arg(text)); + msgWidget->appendHtml(QString("<p style=\"color:#CCCCCC\">[%2 - COMP:%3]<font style=\"%1\">%4 %5</font></p>").arg(style).arg(dateString).arg(compId).arg(severityText).arg(text)); // Ensure text area scrolls correctly scroller->setValue(scroller->maximum());