新二维码/条形码编辑逻辑
This commit is contained in:
+242
-300
@@ -13,7 +13,7 @@
|
||||
#include <QSettings>
|
||||
|
||||
#ifndef LOGINFOFILE_DIR
|
||||
#define LOGINFOFILE_DIR "/home/plg/loginfo/"
|
||||
#define LOGINFOFILE_DIR "/home/plg/loginfo/"
|
||||
#endif
|
||||
#define UDISK_LOGINFO_ROOT_DIR "/udisk/log/"
|
||||
|
||||
@@ -28,7 +28,7 @@ LogInfo::LogInfo(QWidget *parent) :
|
||||
textEdit->verticalScrollBar()->setStyleSheet("QScrollBar:vertical { width: 40px; }");
|
||||
textEdit2 = ui->textEditRunStatus_2;
|
||||
//textEdit2->verticalScrollBar()->setStyleSheet("QScrollBar:vertical { width: 40px; }");
|
||||
textEdit2->verticalScrollBar()->setStyleSheet("QScrollBar:vertical { width: 40px; }");
|
||||
textEdit2->verticalScrollBar()->setStyleSheet("QScrollBar:vertical { width: 40px; }");
|
||||
|
||||
|
||||
textEditMachInfo = ui->machinInformation;
|
||||
@@ -64,15 +64,15 @@ LogInfo::LogInfo(QWidget *parent) :
|
||||
|
||||
LogInfo::~LogInfo()
|
||||
{
|
||||
textEdit = 0;
|
||||
textEdit2 = 0;
|
||||
textEditMachInfo = 0;
|
||||
if(fileDialog)
|
||||
delete fileDialog;
|
||||
textEdit = 0;
|
||||
textEdit2 = 0;
|
||||
textEditMachInfo = 0;
|
||||
if(fileDialog)
|
||||
delete fileDialog;
|
||||
delete ui;
|
||||
|
||||
disconnect(timerLogdel, SIGNAL(timeout()), this, SLOT(deleteOldLog()));
|
||||
timerLogdel->stop();
|
||||
disconnect(timerLogdel, SIGNAL(timeout()), this, SLOT(deleteOldLog()));
|
||||
timerLogdel->stop();
|
||||
}
|
||||
|
||||
void LogInfo::init()
|
||||
@@ -91,7 +91,9 @@ void LogInfo::init()
|
||||
QTabBar::tab:selected {background-color: rgb(255, 170, 127);height:70px;}\
|
||||
QTabBar::tab:!selected {margin-top: 5px;}\
|
||||
QTabBar::scroller{ width:80px;}";
|
||||
// this->setStyleSheet(style_main2);
|
||||
// this->setStyleSheet(style_main2);
|
||||
if (ctrl_loginfo == nullptr) ctrl_loginfo = LogInfoCtrl::instance();
|
||||
connect(ctrl_loginfo, &LogInfoCtrl::sig_cleanOver, this, &LogInfo::slt_cleanOver);
|
||||
}
|
||||
|
||||
void LogInfo::buttonClickedSlot()
|
||||
@@ -119,19 +121,19 @@ void LogInfo::showMachineInformation(QString Mac,QString SerialNum, QString Vern
|
||||
{
|
||||
QString machInfo;
|
||||
machInfo = "Mac:" + Mac + "\n";
|
||||
// machInfo += "Serial Number:" + SerialNum + "\n";
|
||||
// machInfo += "Serial Number:" + SerialNum + "\n";
|
||||
machInfo += "VernonBach Ver:" + VernonBachVer + "\n";
|
||||
machInfo += "FPGA Ver:" + FpgaVer;
|
||||
// QFile kernelVer("/proc/version");
|
||||
// if (kernelVer.open(QFile::ReadOnly | QFile::Text)) {
|
||||
// QTextStream in(&kernelVer);
|
||||
// QString kernelVer=in.readLine();
|
||||
// QStringList list=kernelVer.split(" ");
|
||||
// QStringList list2=kernelVer.split("#");
|
||||
// machInfo = machInfo + "Kernel: ";
|
||||
// machInfo = machInfo + list.at(2);
|
||||
// machInfo = machInfo + "(" + list2.at(1) + ")";
|
||||
// }
|
||||
// QFile kernelVer("/proc/version");
|
||||
// if (kernelVer.open(QFile::ReadOnly | QFile::Text)) {
|
||||
// QTextStream in(&kernelVer);
|
||||
// QString kernelVer=in.readLine();
|
||||
// QStringList list=kernelVer.split(" ");
|
||||
// QStringList list2=kernelVer.split("#");
|
||||
// machInfo = machInfo + "Kernel: ";
|
||||
// machInfo = machInfo + list.at(2);
|
||||
// machInfo = machInfo + "(" + list2.at(1) + ")";
|
||||
// }
|
||||
|
||||
textEditMachInfo->setText(machInfo);
|
||||
}
|
||||
@@ -141,10 +143,10 @@ void LogInfo::showVerionInformation(QString Mac,QString VernonBachVer, QString F
|
||||
static bool flag = false;
|
||||
if(!flag){
|
||||
QString machInfo;
|
||||
machInfo = "Mac:" + Mac + "\n";
|
||||
machInfo = "Mac:" + Mac + "\n";
|
||||
machInfo += "VernonBach Ver:" + VernonBachVer +"|"+STM32Ver+ "\n";
|
||||
machInfo += "FPGA Ver: NO" + FpgaVer + "\n";
|
||||
// machInfo += "PowerOnMode: " + QString::number(powerOnMode) + "\n";
|
||||
// machInfo += "PowerOnMode: " + QString::number(powerOnMode) + "\n";
|
||||
textEditMachInfo->append(machInfo);
|
||||
}
|
||||
}
|
||||
@@ -193,7 +195,7 @@ void LogInfo::readRunStatusText()
|
||||
QDir dir1;
|
||||
dir1.setPath(LOGINFOFILE_DIR);
|
||||
if(!dir1.exists())
|
||||
dir1.mkdir(QString ("/home/plg/loginfo/"));
|
||||
dir1.mkdir(QString ("/home/plg/loginfo/"));
|
||||
fileName=QString("/home/plg/loginfo/")+QDate::currentDate().toString("yyyyMMdd")+"_1.txt";
|
||||
QFile file(fileName);
|
||||
if(file.exists()){
|
||||
@@ -231,7 +233,7 @@ void LogInfo::on_pushButtonExportFile_pressed()
|
||||
//QString dirPath = ui->radioButtonLocal->isChecked()?DOC_ROOT_DIR:UDISK_LOGINFO_ROOT_DIR;
|
||||
QDir dir(UDISK_LOGINFO_ROOT_DIR);
|
||||
if(!dir.exists()){
|
||||
// system((char *)((QString("mkdir -p %1").arg(UDISK_LOGINFO_ROOT_DIR)).toLatin1().data()));
|
||||
// system((char *)((QString("mkdir -p %1").arg(UDISK_LOGINFO_ROOT_DIR)).toLatin1().data()));
|
||||
system((char *)((QString("mkdir -p %1").arg(UDISK_LOGINFO_ROOT_DIR)).toLocal8Bit().data()));
|
||||
}
|
||||
|
||||
@@ -246,7 +248,7 @@ void LogInfo::on_pushButtonExportFile_pressed()
|
||||
return;
|
||||
}
|
||||
|
||||
// system((char *)((QString("cp -r %1/* %2/").arg(LOGINFOFILE_DIR).arg(UDISK_LOGINFO_ROOT_DIR)).toLatin1().data()));
|
||||
// system((char *)((QString("cp -r %1/* %2/").arg(LOGINFOFILE_DIR).arg(UDISK_LOGINFO_ROOT_DIR)).toLatin1().data()));
|
||||
system((char *)((QString("cp -r %1/* %2/").arg(LOGINFOFILE_DIR).arg(UDISK_LOGINFO_ROOT_DIR)).toLocal8Bit().data()));
|
||||
//refreshListView(EditMode);
|
||||
system("sync");
|
||||
@@ -268,13 +270,13 @@ void LogInfo::on_pushButtonPreState_pressed(){
|
||||
//qDebug()<<"3333";
|
||||
if(openFileName.isEmpty()) textEdit2->clear();
|
||||
if(fileDialog) {
|
||||
// qDebug()<<"4444";
|
||||
// qDebug()<<"4444";
|
||||
disconnect(fileDialog,SIGNAL(accepted()),0,0); // 如果对话框已经定义,则删除控件关联,否则也会出错。
|
||||
|
||||
}
|
||||
else {//qDebug()<<"5";
|
||||
fileDialog = new MyFileDialog(0);
|
||||
//qDebug()<<"6";
|
||||
//qDebug()<<"6";
|
||||
}
|
||||
//qDebug()<<"7";
|
||||
QDir dir1;
|
||||
@@ -285,7 +287,7 @@ void LogInfo::on_pushButtonPreState_pressed(){
|
||||
if(fileDialog){
|
||||
//qDebug()<<"8";
|
||||
|
||||
if(fileDialog->directory().path()!="/home/plg/loginfo")
|
||||
if(fileDialog->directory().path()!="/home/plg/loginfo")
|
||||
fileDialog->setDirectory(QDir("/home/plg/loginfo"));
|
||||
|
||||
|
||||
@@ -296,7 +298,7 @@ void LogInfo::on_pushButtonPreState_pressed(){
|
||||
//qDebug()<<"read File 5";
|
||||
}
|
||||
//else qDebug()<<"read File:"<<dir1.path();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -355,6 +357,7 @@ void LogInfo::on_pushButtonClearCurrent_pressed()
|
||||
runStatusTextIndex=0;
|
||||
}
|
||||
}
|
||||
|
||||
void LogInfo::onReadRecorder()
|
||||
{
|
||||
QString fileName = ":/buge_record.txt";
|
||||
@@ -367,66 +370,66 @@ void LogInfo::onReadRecorder()
|
||||
else{
|
||||
QTextStream in (&file);
|
||||
textEditMachInfo->setText(in.readAll());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LogInfo::deleteDirectoryContents(const QDir &directory) {
|
||||
QList<QFileInfo> entries = directory.entryInfoList(
|
||||
QDir::NoDotAndDotDot | QDir::AllEntries);
|
||||
QString today = QDate::currentDate().toString(Qt::ISODate);
|
||||
// 使用传统的 for 循环遍历所有条目
|
||||
for (int i = 0; i < entries.size(); ++i) {
|
||||
QFileInfo entryInfo = entries.at(i);
|
||||
QString dirName=entryInfo.baseName();
|
||||
if(today==dirName)
|
||||
continue;
|
||||
QString fullPath = entryInfo.absoluteFilePath();
|
||||
QDir::NoDotAndDotDot | QDir::AllEntries);
|
||||
QString today = QDate::currentDate().toString(Qt::ISODate);
|
||||
// 使用传统的 for 循环遍历所有条目
|
||||
for (int i = 0; i < entries.size(); ++i) {
|
||||
QFileInfo entryInfo = entries.at(i);
|
||||
QString dirName=entryInfo.baseName();
|
||||
if(today==dirName)
|
||||
continue;
|
||||
QString fullPath = entryInfo.absoluteFilePath();
|
||||
|
||||
if (entryInfo.isFile() || entryInfo.isSymLink()) {
|
||||
// 如果是文件或符号链接,尝试删除
|
||||
if (!QFile::remove(fullPath)) {
|
||||
qDebug() << "Failed to remove file or symlink:" << fullPath;
|
||||
}
|
||||
} else if (entryInfo.isDir()) {
|
||||
// 如果是目录,递归调用以删除其内容
|
||||
QDir subDir(fullPath);
|
||||
deleteDirectoryContents(subDir);
|
||||
if (entryInfo.isFile() || entryInfo.isSymLink()) {
|
||||
// 如果是文件或符号链接,尝试删除
|
||||
if (!QFile::remove(fullPath)) {
|
||||
qDebug() << "Failed to remove file or symlink:" << fullPath;
|
||||
}
|
||||
} else if (entryInfo.isDir()) {
|
||||
// 如果是目录,递归调用以删除其内容
|
||||
QDir subDir(fullPath);
|
||||
deleteDirectoryContents(subDir);
|
||||
|
||||
// 目录现在应该是空的,尝试删除它
|
||||
if (!QDir().rmdir(fullPath)) {
|
||||
qDebug() << "Failed to remove directory:" << fullPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
// 目录现在应该是空的,尝试删除它
|
||||
if (!QDir().rmdir(fullPath)) {
|
||||
qDebug() << "Failed to remove directory:" << fullPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 删除指定文件夹超过七天的文件
|
||||
void LogInfo::deleteOldLog(const QString folderPath,int days){
|
||||
QDir dir(folderPath); // 创建一个QDir对象用于操作传入的文件夹路径
|
||||
if (!dir.exists()) { // 判断传入文件夹是否存在
|
||||
qDebug() << "文件夹不存在";
|
||||
return;
|
||||
}
|
||||
QDateTime currentDateTime = QDateTime::currentDateTime(); // 获取当前时间
|
||||
QDateTime sevenDaysAgo = currentDateTime.addDays(-days); // 计算days天前的日期时间
|
||||
// 目录下的文件和子目录的信息列表,列出所有文件和子目录并按照最后修改时间排序
|
||||
QFileInfoList fileInfoList = dir.entryInfoList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot, QDir::Time);
|
||||
foreach (QFileInfo fileInfo ,fileInfoList) {
|
||||
if (!fileInfo.isDir()){
|
||||
QString fileExtension = fileInfo.suffix().toLower(); // 获取文件的扩展名并确保它是小写的
|
||||
// 选择删除那种图片类型
|
||||
if (fileExtension == "txt") {
|
||||
if (fileInfo.lastModified() < sevenDaysAgo && fileInfo.fileName().indexOf('_')!=-1) { // 获取最后一个文件夹修改时间和days传入的时间最对比
|
||||
if (QFile::remove(fileInfo.absoluteFilePath())) { // 删除满足条件的文件的绝对路径
|
||||
qDebug() << "删除成功" << fileInfo.absoluteFilePath();
|
||||
} else {
|
||||
qDebug() << "文件删除失败" << fileInfo.absoluteFilePath();
|
||||
}
|
||||
if (!dir.exists()) { // 判断传入文件夹是否存在
|
||||
qDebug() << "文件夹不存在";
|
||||
return;
|
||||
}
|
||||
QDateTime currentDateTime = QDateTime::currentDateTime(); // 获取当前时间
|
||||
QDateTime sevenDaysAgo = currentDateTime.addDays(-days); // 计算days天前的日期时间
|
||||
// 目录下的文件和子目录的信息列表,列出所有文件和子目录并按照最后修改时间排序
|
||||
QFileInfoList fileInfoList = dir.entryInfoList(QDir::Files | QDir::Dirs | QDir::NoDotAndDotDot, QDir::Time);
|
||||
foreach (QFileInfo fileInfo ,fileInfoList) {
|
||||
if (!fileInfo.isDir()){
|
||||
QString fileExtension = fileInfo.suffix().toLower(); // 获取文件的扩展名并确保它是小写的
|
||||
// 选择删除那种图片类型
|
||||
if (fileExtension == "txt") {
|
||||
if (fileInfo.lastModified() < sevenDaysAgo && fileInfo.fileName().indexOf('_')!=-1) { // 获取最后一个文件夹修改时间和days传入的时间最对比
|
||||
if (QFile::remove(fileInfo.absoluteFilePath())) { // 删除满足条件的文件的绝对路径
|
||||
qDebug() << "删除成功" << fileInfo.absoluteFilePath();
|
||||
} else {
|
||||
qDebug() << "文件删除失败" << fileInfo.absoluteFilePath();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LogInfo::deleteOldLog()
|
||||
@@ -442,7 +445,7 @@ void LogInfo::truncatelog()
|
||||
const QString fileNameL=QString(LOGINFOFILE_DIR)+dts +"_1.txt";
|
||||
QFile file(fileNameL);
|
||||
|
||||
if(file.size()>204800)//文件大小
|
||||
if(file.size()>204800)//文件大小
|
||||
{
|
||||
QSettings settings("MySoft", "MyApp");
|
||||
int filenum=settings.value(dts,2).toInt();
|
||||
@@ -457,29 +460,29 @@ void LogInfo::truncatelog()
|
||||
|
||||
void LogInfo::setScrollBar(){
|
||||
QString styleSheet = "\n\
|
||||
QTextEdit QScrollBar:vertical {\n\
|
||||
width: 50px; /* 设置垂直滚动条的宽度 */\n\
|
||||
background: rgba(0, 0, 0, 0); /* 滚动条背景透明 */\n\
|
||||
margin: 20px 0 20px 0; /* 为按钮留出空间 */\n\
|
||||
}\n\
|
||||
QTextEdit QScrollBar::handle:vertical {\n\
|
||||
background: rgb(125, 170, 177); /* 滑块颜色 */\n\
|
||||
border-radius: 5px; /* 滑块圆角 */\n\
|
||||
min-height: 40px; /* 滑块最小高度 */\n\
|
||||
}\n\
|
||||
QTextEdit QScrollBar::add-line:vertical {\n\
|
||||
height: 40px; /* 设置向下按钮的高度 */\n\
|
||||
background: rgb(255, 170, 127); /* 按钮颜色 */\n\
|
||||
subcontrol-position: bottom;\n\
|
||||
subcontrol-origin: margin;\n\
|
||||
}\n\
|
||||
QTextEdit QScrollBar::sub-line:vertical {\n\
|
||||
height: 40px; /* 设置向上按钮的高度 */\n\
|
||||
background: rgb(255, 170, 127); /* 按钮颜色 */\n\
|
||||
subcontrol-position: top;\n\
|
||||
subcontrol-origin: margin;\n\
|
||||
}";
|
||||
ui->textEditRunStatus->setStyleSheet(styleSheet);
|
||||
QTextEdit QScrollBar:vertical {\n\
|
||||
width: 50px; /* 设置垂直滚动条的宽度 */\n\
|
||||
background: rgba(0, 0, 0, 0); /* 滚动条背景透明 */\n\
|
||||
margin: 20px 0 20px 0; /* 为按钮留出空间 */\n\
|
||||
}\n\
|
||||
QTextEdit QScrollBar::handle:vertical {\n\
|
||||
background: rgb(125, 170, 177); /* 滑块颜色 */\n\
|
||||
border-radius: 5px; /* 滑块圆角 */\n\
|
||||
min-height: 40px; /* 滑块最小高度 */\n\
|
||||
}\n\
|
||||
QTextEdit QScrollBar::add-line:vertical {\n\
|
||||
height: 40px; /* 设置向下按钮的高度 */\n\
|
||||
background: rgb(255, 170, 127); /* 按钮颜色 */\n\
|
||||
subcontrol-position: bottom;\n\
|
||||
subcontrol-origin: margin;\n\
|
||||
}\n\
|
||||
QTextEdit QScrollBar::sub-line:vertical {\n\
|
||||
height: 40px; /* 设置向上按钮的高度 */\n\
|
||||
background: rgb(255, 170, 127); /* 按钮颜色 */\n\
|
||||
subcontrol-position: top;\n\
|
||||
subcontrol-origin: margin;\n\
|
||||
}";
|
||||
ui->textEditRunStatus->setStyleSheet(styleSheet);
|
||||
ui->textEditRunStatus_2->setStyleSheet(styleSheet);
|
||||
}
|
||||
|
||||
@@ -503,234 +506,173 @@ void LogInfo::updateSysStatusToUI(const AlarmStatus& alarmStatus){
|
||||
ui->labOscVol->setText(alarmStatus.highVol);
|
||||
ui->label_size->setText(alarmStatus.dataSize);
|
||||
|
||||
// 获取总状态
|
||||
getGeneralState(alarmStatus);
|
||||
|
||||
}
|
||||
|
||||
void LogInfo::getGeneralState(AlarmStatus status)
|
||||
void LogInfo::bindSysPara(SysPara *sysPara)
|
||||
{
|
||||
// 有红则红,全绿则绿,红>黄>绿
|
||||
// 检查从后往前判断,因为取最后一个状态QString
|
||||
bool isRed = checkRed(status);
|
||||
if (isRed) {
|
||||
m_stateColor = DEV_STATUS_RED;
|
||||
} else {
|
||||
bool isYellow = checkYellow(status);
|
||||
if (isYellow) {
|
||||
m_stateColor = DEV_STATUS_YELLOW;
|
||||
} else {
|
||||
m_stateColor = DEV_STATUS_GREEN;
|
||||
m_stateStr= tr("正常");
|
||||
}
|
||||
}
|
||||
emit sig_updateGeneralState(m_stateColor, m_stateStr);
|
||||
this->sysPara = sysPara;
|
||||
}
|
||||
|
||||
bool LogInfo::checkRed(AlarmStatus &status)
|
||||
void LogInfo::checkState()
|
||||
{
|
||||
if (status.highVoltageFault == DEV_STATUS_RED) {
|
||||
m_stateStr = tr("高压故障");
|
||||
return true;
|
||||
}
|
||||
if (status.chargeFault == DEV_STATUS_RED) {
|
||||
m_stateStr = tr("相位故障");
|
||||
return true;
|
||||
}
|
||||
if (status.viscosityWarn == DEV_STATUS_RED) {
|
||||
m_stateStr = tr("粘度故障");
|
||||
return true;
|
||||
}
|
||||
if (status.recycleWarn == DEV_STATUS_RED) {
|
||||
m_stateStr = tr("回收故障");
|
||||
return true;
|
||||
}
|
||||
if (status.solveLevelWarn == DEV_STATUS_RED) {
|
||||
m_stateStr = tr("溶液液位");
|
||||
return true;
|
||||
}
|
||||
if (status.inkWaterLevel == DEV_STATUS_RED) {
|
||||
m_stateStr = tr("墨水液位");
|
||||
return true;
|
||||
}
|
||||
if (status.inkLeak == DEV_STATUS_RED) {
|
||||
m_stateStr = tr("墨水缸满");
|
||||
return true;
|
||||
}
|
||||
if (status.inkSwint == DEV_STATUS_RED) {
|
||||
m_stateStr = tr("墨线开关");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LogInfo::checkYellow(AlarmStatus &status)
|
||||
{
|
||||
if (status.highVoltageFault == DEV_STATUS_YELLOW) {
|
||||
m_stateStr = tr("高压故障");
|
||||
return true;
|
||||
}
|
||||
if (status.chargeFault == DEV_STATUS_YELLOW) {
|
||||
m_stateStr = tr("相位故障");
|
||||
return true;
|
||||
}
|
||||
if (status.viscosityWarn == DEV_STATUS_YELLOW) {
|
||||
m_stateStr = tr("粘度故障");
|
||||
return true;
|
||||
}
|
||||
if (status.recycleWarn == DEV_STATUS_YELLOW) {
|
||||
m_stateStr = tr("回收故障");
|
||||
return true;
|
||||
}
|
||||
if (status.solveLevelWarn == DEV_STATUS_YELLOW) {
|
||||
m_stateStr = tr("溶液液位");
|
||||
return true;
|
||||
}
|
||||
if (status.inkWaterLevel == DEV_STATUS_YELLOW) {
|
||||
m_stateStr = tr("墨水液位");
|
||||
return true;
|
||||
}
|
||||
if (status.inkLeak == DEV_STATUS_YELLOW) {
|
||||
m_stateStr = tr("墨水缸满");
|
||||
return true;
|
||||
}
|
||||
if (status.inkSwint == DEV_STATUS_YELLOW) {
|
||||
m_stateStr = tr("墨线开关");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
ui->tabWidget->setCurrentIndex(3);
|
||||
}
|
||||
|
||||
void LogInfo::applyStyleSheet()
|
||||
{
|
||||
QString styleSheet = R"(
|
||||
QTabWidget {
|
||||
border: none;
|
||||
background-color: #7B838E;
|
||||
}
|
||||
QTabWidget::pane {
|
||||
border: 1px solid #dddddd;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
QTabWidget::tab-bar {
|
||||
background-color: #7B838E;
|
||||
alignment: left;
|
||||
height: 80px;
|
||||
margin: 0;
|
||||
}
|
||||
QTabWidget::tab-bar {
|
||||
top: -3px;
|
||||
left: 10px;
|
||||
}
|
||||
|
||||
QTabBar {
|
||||
background-color: #7B838E;
|
||||
border: none;
|
||||
width: 100%;
|
||||
min-width: 100%;
|
||||
height: 80px;
|
||||
padding: 0;
|
||||
}
|
||||
QTabBar::tab {
|
||||
min-width: 90px;
|
||||
min-height: 45px;
|
||||
padding: 4px 10px;
|
||||
margin-right: 4px;
|
||||
border: 1px solid #dddddd;
|
||||
border-bottom: none;
|
||||
border-top-left-radius: 4px;
|
||||
border-top-right-radius: 4px;
|
||||
background-color: #5396C1;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
QTabBar::tab {
|
||||
width: 140px;
|
||||
height: 80px;
|
||||
font-size: 16px;
|
||||
font-weight: bold;
|
||||
color: #000000;
|
||||
border: none;
|
||||
border-top-left-radius: 10px;
|
||||
border-top-right-radius: 10px;
|
||||
alignment: center bottom;
|
||||
padding-top: 0;
|
||||
}
|
||||
QTabBar::tab {
|
||||
margin-left: 10px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
QTabBar::tab:!selected {
|
||||
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
|
||||
stop:0 #6E757F, stop:1 #96A0A9);
|
||||
border: 2px solid #63535D;
|
||||
border-bottom: none;
|
||||
position: relative;
|
||||
bottom: 0px;
|
||||
}
|
||||
QTabBar::tab:selected {
|
||||
background-color: #6bb1e0;
|
||||
color: #ffffff;
|
||||
box-shadow: 0 -3px 8px rgba(44, 125, 232, 0.25);
|
||||
}
|
||||
|
||||
QTabBar::tab:selected {
|
||||
background: qlineargradient(x1:0, y1:0, x2:0, y2:1,
|
||||
stop:0 #95B2D4, stop:1 #F0F0F0);
|
||||
border: none;
|
||||
position: relative;
|
||||
bottom: 0px;
|
||||
}
|
||||
QWidget#buttonWidget {
|
||||
background-color: #95989D;
|
||||
}
|
||||
|
||||
QTabWidget::pane {
|
||||
border: none;
|
||||
background-color: #f0f0f0;
|
||||
top: -12px;
|
||||
}
|
||||
QPushButton#closeBtn1,QPushButton#closeBtn2,QPushButton#closeBtn3,QPushButton#closeBtn4 {
|
||||
background-color: #E6F7FF;
|
||||
border: 1px solid #87CEEB;
|
||||
border-radius: 4px;
|
||||
font-size: 24px;
|
||||
color: #228B22;
|
||||
}
|
||||
|
||||
QWidget#buttonWidget {
|
||||
background-color: #95989D;
|
||||
}
|
||||
QPushButton#closeBtn1:hover,QPushButton#closeBtn2:hover,QPushButton#closeBtn3:hover, QPushButton#closeBtn4:hover{
|
||||
background-color: #D1E9FF;
|
||||
}
|
||||
|
||||
QPushButton#closeBtn1,QPushButton#closeBtn2,QPushButton#closeBtn3,QPushButton#closeBtn4 {
|
||||
background-color: #E6F7FF;
|
||||
border: 1px solid #87CEEB;
|
||||
border-radius: 4px;
|
||||
font-size: 24px;
|
||||
color: #228B22;
|
||||
}
|
||||
QPushButton#closeBtn1:pressed,QPushButton#closeBtn2:pressed,QPushButton#closeBtn3:pressed, QPushButton#closeBtn4:pressed{
|
||||
background-color: #BAE7FF;
|
||||
}
|
||||
|
||||
QPushButton#closeBtn1:hover,QPushButton#closeBtn2:hover,QPushButton#closeBtn3:hover, QPushButton#closeBtn4:hover{
|
||||
background-color: #D1E9FF;
|
||||
}
|
||||
QCheckBox {
|
||||
font-size: 18px;
|
||||
color: #000000;
|
||||
font-weight:500;
|
||||
}
|
||||
|
||||
QPushButton#closeBtn1:pressed,QPushButton#closeBtn2:pressed,QPushButton#closeBtn3:pressed, QPushButton#closeBtn4:pressed{
|
||||
background-color: #BAE7FF;
|
||||
}
|
||||
QCheckBox::indicator {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border: 1px solid #96A0A9;
|
||||
border-radius: 10px;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
|
||||
QCheckBox {
|
||||
font-size: 18px;
|
||||
color: #000000;
|
||||
font-weight:500;
|
||||
}
|
||||
QCheckBox::indicator:checked {
|
||||
background-color: #95B2D4;
|
||||
border-color: #95B2D4;
|
||||
image: url(:/Demo/image/select.png);
|
||||
}
|
||||
|
||||
QCheckBox::indicator {
|
||||
width: 18px;
|
||||
height: 18px;
|
||||
border: 1px solid #96A0A9;
|
||||
border-radius: 10px;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
QLabel {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
QCheckBox::indicator:checked {
|
||||
background-color: #95B2D4;
|
||||
border-color: #95B2D4;
|
||||
image: url(:/Demo/image/select.png);
|
||||
}
|
||||
QPushButton {
|
||||
background-color: #5396C1;
|
||||
color: #ffffff;
|
||||
border: 1px solid #000000;
|
||||
border-radius: 3px;
|
||||
font-size: 18px;
|
||||
font-weight:500;
|
||||
}
|
||||
|
||||
QLabel {
|
||||
font-size: 15px;
|
||||
}
|
||||
QPushButton:hover {
|
||||
background-color: #5396C1;
|
||||
}
|
||||
|
||||
QPushButton {
|
||||
background-color: #5396C1;
|
||||
color: #ffffff;
|
||||
border: 1px solid #000000;
|
||||
border-radius: 3px;
|
||||
font-size: 18px;
|
||||
font-weight:500;
|
||||
}
|
||||
QPushButton:disabled {
|
||||
background-color: #7C828E;
|
||||
color: #606060;
|
||||
border-color: #808080;
|
||||
}
|
||||
|
||||
QPushButton:hover {
|
||||
background-color: #5396C1;
|
||||
}
|
||||
|
||||
QPushButton:disabled {
|
||||
background-color: #7C828E;
|
||||
color: #606060;
|
||||
border-color: #808080;
|
||||
}
|
||||
|
||||
QWidget#fileTab, QWidget#extraTab, QWidget#settingsTab, QWidget#serviceTab {
|
||||
background-color: #E3E7EC;
|
||||
}
|
||||
)";
|
||||
QWidget#fileTab, QWidget#extraTab, QWidget#settingsTab, QWidget#serviceTab {
|
||||
background-color: #E3E7EC;
|
||||
}
|
||||
)";
|
||||
|
||||
this->setStyleSheet(styleSheet);
|
||||
}
|
||||
|
||||
void LogInfo::on_btn_clean_clicked()
|
||||
{
|
||||
if (ctrl_loginfo) ctrl_loginfo->emitSigClean();
|
||||
}
|
||||
|
||||
void LogInfo::slt_cleanOver(bool flag)
|
||||
{
|
||||
if (flag) {
|
||||
lockUI();
|
||||
} else {
|
||||
unlockUI();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LogInfo::lockUI()
|
||||
{
|
||||
ui->closeBtn4->setEnabled(false);
|
||||
ui->gl_state->setEnabled(false);
|
||||
ui->gridLayout_7->setEnabled(false);
|
||||
ui->tabWidget->setTabEnabled(0,false);
|
||||
ui->tabWidget->setTabEnabled(1,false);
|
||||
ui->tabWidget->setTabEnabled(2,false);
|
||||
ui->lb_clean->setText(tr("清洗中,界面锁死"));
|
||||
}
|
||||
|
||||
void LogInfo::unlockUI()
|
||||
{
|
||||
ui->closeBtn4->setEnabled(true);
|
||||
ui->gl_state->setEnabled(true);
|
||||
ui->gridLayout_7->setEnabled(true);
|
||||
ui->tabWidget->setTabEnabled(0,true);
|
||||
ui->tabWidget->setTabEnabled(1,true);
|
||||
ui->tabWidget->setTabEnabled(2,true);
|
||||
ui->lb_clean->setText(tr(""));
|
||||
}
|
||||
|
||||
void LogInfo::showEvent(QShowEvent *event)
|
||||
{
|
||||
// 先执行父类事件
|
||||
QWidget::showEvent(event);
|
||||
// 更新UI和状态
|
||||
if (sysPara) {
|
||||
if(!sysPara->para.isCheckMagnet)
|
||||
{
|
||||
ui->btn_clean->setEnabled( (sysPara->status.currReclaimTankPos<70)
|
||||
&& (sysPara->status.statWarn & WARN_STATUS_HDINT));
|
||||
}
|
||||
else
|
||||
{
|
||||
ui->btn_clean->setEnabled( (sysPara->status.currReclaimTankPos<70) );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user