code_production/app/HGProductionTool/form_texttips.cpp

49 lines
882 B
C++
Raw Normal View History

2022-12-14 06:39:22 +00:00
#include "form_texttips.h"
#include "ui_form_texttips.h"
2023-03-06 09:44:08 +00:00
#define TEXT_COLOR_RED(STRING) " <font color=red> " STRING " </font> " " <font color=black> </font> "
2022-12-14 06:39:22 +00:00
Form_textTips::Form_textTips(QWidget *parent)
: QWidget(parent)
, ui(new Ui::Form_textTips)
{
ui->setupUi(this);
QFont ft;
2022-12-28 06:57:00 +00:00
ft.setPointSize(20);
2022-12-14 06:39:22 +00:00
ui->textBrowser->setFont(ft);
2022-12-14 06:39:22 +00:00
}
Form_textTips::~Form_textTips()
{
delete ui;
}
2022-12-14 12:28:25 +00:00
void Form_textTips::setViewContent(QString content)
2022-12-14 06:39:22 +00:00
{
2022-12-14 12:28:25 +00:00
ui->textBrowser->setText(content);
2022-12-14 06:39:22 +00:00
}
2023-03-06 09:44:08 +00:00
void Form_textTips::addContent(QString content, bool isNormal)
{
2023-03-06 09:44:08 +00:00
if (isNormal)
ui->textBrowser->insertPlainText(content);
else
{
ui->textBrowser->setTextColor(Qt::red);
ui->textBrowser->insertPlainText(content);
}
ui->textBrowser->moveCursor(QTextCursor::End);
2023-03-06 09:44:08 +00:00
ui->textBrowser->setTextColor(Qt::black);
}
2022-12-14 06:39:22 +00:00
2022-12-14 12:28:25 +00:00