|
@@ -9,8 +9,8 @@
|
|
|
#include <QMouseEvent>
|
|
#include <QMouseEvent>
|
|
|
|
|
|
|
|
#include "OneShadowEffect.h"
|
|
#include "OneShadowEffect.h"
|
|
|
-// #include "lhstylemanager.h"
|
|
|
|
|
#include "LHQLogAPI.h"
|
|
#include "LHQLogAPI.h"
|
|
|
|
|
+#include "UIStyleManager.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
Warning::Warning(QWidget *parent) :
|
|
Warning::Warning(QWidget *parent) :
|
|
@@ -22,15 +22,6 @@ Warning::Warning(QWidget *parent) :
|
|
|
this->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint);
|
|
this->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint);
|
|
|
this->setAttribute(Qt::WA_TranslucentBackground);
|
|
this->setAttribute(Qt::WA_TranslucentBackground);
|
|
|
|
|
|
|
|
- /* 加载QSS */
|
|
|
|
|
- // QFile file(":/QSS/QSS/warning_light.qss");
|
|
|
|
|
- // if(file.open(QFile::ReadOnly))
|
|
|
|
|
- // {
|
|
|
|
|
- // QString styleSheet = file.readAll();
|
|
|
|
|
- // this->setStyleSheet(styleSheet);
|
|
|
|
|
- // file.close();
|
|
|
|
|
- // }
|
|
|
|
|
-
|
|
|
|
|
/* 设置文字自动换行 */
|
|
/* 设置文字自动换行 */
|
|
|
ui->label_Warn->setWordWrap(true);
|
|
ui->label_Warn->setWordWrap(true);
|
|
|
/* 设置文本居中 */
|
|
/* 设置文本居中 */
|
|
@@ -50,6 +41,23 @@ Warning::Warning(QWidget *parent) :
|
|
|
connect(ui->pBtn_ok,SIGNAL(clicked()),this,SLOT(do_ok()));
|
|
connect(ui->pBtn_ok,SIGNAL(clicked()),this,SLOT(do_ok()));
|
|
|
/* 注册事件过滤器 */
|
|
/* 注册事件过滤器 */
|
|
|
ui->pBtn_close->installEventFilter(this);
|
|
ui->pBtn_close->installEventFilter(this);
|
|
|
|
|
+
|
|
|
|
|
+ /* 加载QSS */
|
|
|
|
|
+ QString qssPath;
|
|
|
|
|
+ if(UIStyle.getUIStyle() == EUIStyle::UI_Light)
|
|
|
|
|
+ {
|
|
|
|
|
+ qssPath = ":/qss/warning_light.qss";
|
|
|
|
|
+ } else
|
|
|
|
|
+ {
|
|
|
|
|
+ qssPath = ":/qss/warning_dark.qss";
|
|
|
|
|
+ }
|
|
|
|
|
+ QFile file(qssPath);
|
|
|
|
|
+ if(file.open(QFile::ReadOnly))
|
|
|
|
|
+ {
|
|
|
|
|
+ QString styleSheet = file.readAll();
|
|
|
|
|
+ this->setStyleSheet(styleSheet);
|
|
|
|
|
+ file.close();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
Warning::~Warning()
|
|
Warning::~Warning()
|
|
@@ -57,6 +65,13 @@ Warning::~Warning()
|
|
|
delete ui;
|
|
delete ui;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+void Warning::setTitle(const QString& title)
|
|
|
|
|
+{
|
|
|
|
|
+ ui->label_title->setText(title);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
void Warning::setText(const QString &text)
|
|
void Warning::setText(const QString &text)
|
|
|
{
|
|
{
|
|
|
/* 根据文本大小设置高度 */
|
|
/* 根据文本大小设置高度 */
|