ledset增加走点保存
This commit is contained in:
parent
898fcb8133
commit
1c61ae8216
|
@ -5,12 +5,14 @@
|
||||||
#include <QRadioButton>
|
#include <QRadioButton>
|
||||||
#include <QPushButton>
|
#include <QPushButton>
|
||||||
#include <QButtonGroup>
|
#include <QButtonGroup>
|
||||||
#include <QComboBox>
|
|
||||||
#include <QHeaderView>
|
#include <QHeaderView>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QLineEdit>
|
#include <QLineEdit>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
|
#include <QJsonObject>
|
||||||
|
#include <QJsonArray>
|
||||||
|
#include <QJsonDocument>
|
||||||
|
|
||||||
ExpertSmartPointSetWin::ExpertSmartPointSetWin(QWidget *parent) : BaseWin{parent} {
|
ExpertSmartPointSetWin::ExpertSmartPointSetWin(QWidget *parent) : BaseWin{parent} {
|
||||||
setWindowModality(Qt::WindowModal);
|
setWindowModality(Qt::WindowModal);
|
||||||
|
@ -51,7 +53,7 @@ ExpertSmartPointSetWin::ExpertSmartPointSetWin(QWidget *parent) : BaseWin{parent
|
||||||
|
|
||||||
fdModuleWidth = new QSpinBox;
|
fdModuleWidth = new QSpinBox;
|
||||||
fdModuleWidth->setRange(0, 9999);
|
fdModuleWidth->setRange(0, 9999);
|
||||||
fdModuleWidth->setValue(moduleWidth);
|
fdModuleWidth->setValue(ModuleWidth);
|
||||||
hhhh->addWidget(fdModuleWidth);
|
hhhh->addWidget(fdModuleWidth);
|
||||||
|
|
||||||
vvv->addLayout(hhhh);
|
vvv->addLayout(hhhh);
|
||||||
|
@ -63,7 +65,7 @@ ExpertSmartPointSetWin::ExpertSmartPointSetWin(QWidget *parent) : BaseWin{parent
|
||||||
|
|
||||||
fdModuleHeight = new QSpinBox;
|
fdModuleHeight = new QSpinBox;
|
||||||
fdModuleHeight->setRange(0, 9999);
|
fdModuleHeight->setRange(0, 9999);
|
||||||
fdModuleHeight->setValue(moduleHeight);
|
fdModuleHeight->setValue(ModuleHeight);
|
||||||
hhhh->addWidget(fdModuleHeight);
|
hhhh->addWidget(fdModuleHeight);
|
||||||
|
|
||||||
vvv->addLayout(hhhh);
|
vvv->addLayout(hhhh);
|
||||||
|
@ -73,10 +75,10 @@ ExpertSmartPointSetWin::ExpertSmartPointSetWin(QWidget *parent) : BaseWin{parent
|
||||||
lb = new QLabel("数据组数: ");
|
lb = new QLabel("数据组数: ");
|
||||||
hhhh->addWidget(lb);
|
hhhh->addWidget(lb);
|
||||||
|
|
||||||
fdGrpCnt = new QSpinBox;
|
fdGroupNum = new QSpinBox;
|
||||||
fdGrpCnt->setRange(0, 9999);
|
fdGroupNum->setRange(0, 9999);
|
||||||
fdGrpCnt->setValue(grpCnt);
|
fdGroupNum->setValue(GroupNum);
|
||||||
hhhh->addWidget(fdGrpCnt);
|
hhhh->addWidget(fdGroupNum);
|
||||||
|
|
||||||
vvv->addLayout(hhhh);
|
vvv->addLayout(hhhh);
|
||||||
vvv->addStretch();
|
vvv->addStretch();
|
||||||
|
@ -91,9 +93,9 @@ ExpertSmartPointSetWin::ExpertSmartPointSetWin(QWidget *parent) : BaseWin{parent
|
||||||
lb = new QLabel("驱动芯片: ");
|
lb = new QLabel("驱动芯片: ");
|
||||||
hhhh->addWidget(lb);
|
hhhh->addWidget(lb);
|
||||||
|
|
||||||
auto fdChip = new QComboBox;
|
fdChipType = new QComboBox;
|
||||||
fdChip->addItem("ICND2153");
|
fdChipType->addItem("ICND2153");
|
||||||
hhhh->addWidget(fdChip);
|
hhhh->addWidget(fdChipType);
|
||||||
|
|
||||||
vvv->addLayout(hhhh);
|
vvv->addLayout(hhhh);
|
||||||
vvv->addSpacing(30);
|
vvv->addSpacing(30);
|
||||||
|
@ -102,7 +104,7 @@ ExpertSmartPointSetWin::ExpertSmartPointSetWin(QWidget *parent) : BaseWin{parent
|
||||||
lb = new QLabel("译码方式: ");
|
lb = new QLabel("译码方式: ");
|
||||||
hhhh->addWidget(lb);
|
hhhh->addWidget(lb);
|
||||||
|
|
||||||
auto fdDecodeMode = new QComboBox;
|
fdDecodeMode = new QComboBox;
|
||||||
fdDecodeMode->addItem("138译码");
|
fdDecodeMode->addItem("138译码");
|
||||||
hhhh->addWidget(fdDecodeMode);
|
hhhh->addWidget(fdDecodeMode);
|
||||||
|
|
||||||
|
@ -113,12 +115,12 @@ ExpertSmartPointSetWin::ExpertSmartPointSetWin(QWidget *parent) : BaseWin{parent
|
||||||
lb = new QLabel("分组方式: ");
|
lb = new QLabel("分组方式: ");
|
||||||
hhhh->addWidget(lb);
|
hhhh->addWidget(lb);
|
||||||
|
|
||||||
auto fdGrping = new QComboBox;
|
fdGroupMode = new QComboBox;
|
||||||
fdGrping->addItem("三线并行");
|
fdGroupMode->addItem("三线并行");
|
||||||
fdGrping->addItem("三色1点串");
|
fdGroupMode->addItem("三色1点串");
|
||||||
fdGrping->addItem("三色8点串");
|
fdGroupMode->addItem("三色8点串");
|
||||||
fdGrping->addItem("三色16点串");
|
fdGroupMode->addItem("三色16点串");
|
||||||
hhhh->addWidget(fdGrping);
|
hhhh->addWidget(fdGroupMode);
|
||||||
|
|
||||||
vvv->addLayout(hhhh);
|
vvv->addLayout(hhhh);
|
||||||
vvv->addStretch();
|
vvv->addStretch();
|
||||||
|
@ -386,7 +388,7 @@ ExpertSmartPointSetWin::ExpertSmartPointSetWin(QWidget *parent) : BaseWin{parent
|
||||||
if(row < 0) return;
|
if(row < 0) return;
|
||||||
auto item = table->item(row, col);
|
auto item = table->item(row, col);
|
||||||
if(item) return;
|
if(item) return;
|
||||||
if(lines.isEmpty()) {
|
if(scans.isEmpty()) {
|
||||||
auto cnt = tableRow->columnCount() + 1;
|
auto cnt = tableRow->columnCount() + 1;
|
||||||
tableRow->setColumnCount(cnt);
|
tableRow->setColumnCount(cnt);
|
||||||
tableRow->setItem(0, cnt-1, new QTableWidgetItem(QString::number(cnt)));
|
tableRow->setItem(0, cnt-1, new QTableWidgetItem(QString::number(cnt)));
|
||||||
|
@ -396,16 +398,16 @@ ExpertSmartPointSetWin::ExpertSmartPointSetWin(QWidget *parent) : BaseWin{parent
|
||||||
auto realCnt = cnt - virtualCnt;
|
auto realCnt = cnt - virtualCnt;
|
||||||
item = new QTableWidgetItem(QString::number(realCnt));
|
item = new QTableWidgetItem(QString::number(realCnt));
|
||||||
table->setItem(row, col, item);
|
table->setItem(row, col, item);
|
||||||
if(realCnt==moduleWidth) {
|
if(realCnt==ModuleWidth) {
|
||||||
lines.append({col, row});
|
scans.append({col, row});
|
||||||
QMessageBox::information(this, "提示", "列走完");
|
QMessageBox::information(this, "提示", "列走完");
|
||||||
}
|
}
|
||||||
} else if(lines.size() < scanCnt) {
|
} else if(scans.size() < ScanNum) {
|
||||||
lines.append({col, row});
|
scans.append({col, row});
|
||||||
auto size = lines.size();
|
auto size = scans.size();
|
||||||
item = new QTableWidgetItem("S"+QString::number(size));
|
item = new QTableWidgetItem("S"+QString::number(size));
|
||||||
table->setItem(row, col, item);
|
table->setItem(row, col, item);
|
||||||
if(size==scanCnt) {
|
if(size==ScanNum) {
|
||||||
QMessageBox::information(this, "提示", "行走完");
|
QMessageBox::information(this, "提示", "行走完");
|
||||||
save();
|
save();
|
||||||
}
|
}
|
||||||
|
@ -452,13 +454,16 @@ ExpertSmartPointSetWin::ExpertSmartPointSetWin(QWidget *parent) : BaseWin{parent
|
||||||
connect(btnNext, &QPushButton::clicked, this, [this, stack, btnPrev, btnNext] {
|
connect(btnNext, &QPushButton::clicked, this, [this, stack, btnPrev, btnNext] {
|
||||||
auto idx = stack->currentIndex();
|
auto idx = stack->currentIndex();
|
||||||
if(idx==0) {
|
if(idx==0) {
|
||||||
moduleWidth = fdModuleWidth->value();
|
ModuleWidth = fdModuleWidth->value();
|
||||||
moduleHeight = fdModuleHeight->value();
|
ModuleHeight = fdModuleHeight->value();
|
||||||
grpCnt = fdGrpCnt->value();
|
GroupNum = fdGroupNum->value();
|
||||||
scanCnt = (moduleHeight + 1) / grpCnt;
|
ScanNum = (ModuleHeight + 1) / GroupNum;
|
||||||
|
ChipType = fdChipType->currentText();
|
||||||
|
DecodeMode = fdDecodeMode->currentText();
|
||||||
|
GroupMode = fdGroupMode->currentText();
|
||||||
} else if(idx==2) {
|
} else if(idx==2) {
|
||||||
table->setColumnCount(moduleWidth);
|
table->setColumnCount(ModuleWidth);
|
||||||
table->setRowCount(moduleHeight);
|
table->setRowCount(ModuleHeight);
|
||||||
}
|
}
|
||||||
stack->setCurrentIndex(++idx);
|
stack->setCurrentIndex(++idx);
|
||||||
btnPrev->setEnabled(idx > 0);
|
btnPrev->setEnabled(idx > 0);
|
||||||
|
@ -473,6 +478,34 @@ ExpertSmartPointSetWin::ExpertSmartPointSetWin(QWidget *parent) : BaseWin{parent
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExpertSmartPointSetWin::save() {
|
void ExpertSmartPointSetWin::save() {
|
||||||
|
auto file = QFileDialog::getSaveFileName(this, "保存文件", QApplication::applicationDirPath()+QString("/ModuleFiles/1X2_3扫.module").arg(ModuleWidth).arg(ModuleHeight).arg(ScanNum));
|
||||||
|
if(file.isEmpty()) return;
|
||||||
|
QFile qFile(file);
|
||||||
|
if(! qFile.open(QFile::WriteOnly)) return;
|
||||||
|
QJsonObject obj;
|
||||||
|
obj.insert("ModuleWidth", ModuleWidth);
|
||||||
|
obj.insert("ModuleHeight", ModuleHeight);
|
||||||
|
obj.insert("GroupNum", GroupNum);
|
||||||
|
obj.insert("ScanNum", ScanNum);
|
||||||
|
obj.insert("ChipType", ChipType);
|
||||||
|
obj.insert("DecodeMode", DecodeMode);
|
||||||
|
obj.insert("GroupMode", GroupMode);
|
||||||
|
QJsonArray Points;
|
||||||
|
for(int i=0; i<tableRow->columnCount(); i++) {
|
||||||
|
auto data = tableRow->item(1, i)->data(Qt::UserRole);
|
||||||
|
if(! data.isValid()) Points.append(-1);
|
||||||
|
Points.append(data.toPoint().x());
|
||||||
|
}
|
||||||
|
obj.insert("Points", Points);
|
||||||
|
QJsonArray Scans;
|
||||||
|
foreach(QPoint scan, scans) Scans.append(scan.y());
|
||||||
|
obj.insert("Scans", Scans);
|
||||||
|
qFile.write(QJsonDocument(obj).toJson(QJsonDocument::Indented));
|
||||||
|
qFile.close();
|
||||||
|
QMessageBox::information(this, "保存成功", "保存成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
void ExpertSmartPointSetWin::save2() {
|
||||||
auto dlg = new BaseDlg(this);
|
auto dlg = new BaseDlg(this);
|
||||||
dlg->setWindowTitle("保存设置");
|
dlg->setWindowTitle("保存设置");
|
||||||
|
|
||||||
|
@ -485,17 +518,33 @@ void ExpertSmartPointSetWin::save() {
|
||||||
vBox->addSpacing(20);
|
vBox->addSpacing(20);
|
||||||
hBox = new HBox(vBox);
|
hBox = new HBox(vBox);
|
||||||
hBox->addWidget(new QLabel("文件名称: "));
|
hBox->addWidget(new QLabel("文件名称: "));
|
||||||
hBox->addWidget(new QLineEdit(QString("1X2_3扫").arg(moduleWidth).arg(moduleHeight).arg(scanCnt)));
|
hBox->addWidget(new QLineEdit(QString("1X2_3扫").arg(ModuleWidth).arg(ModuleHeight).arg(ScanNum)));
|
||||||
|
|
||||||
vBox->addSpacing(20);
|
vBox->addSpacing(20);
|
||||||
hBox = new HBox(vBox);
|
hBox = new HBox(vBox);
|
||||||
hBox->addWidget(new QLabel("保存路径: "));
|
hBox->addWidget(new QLabel("保存路径: "));
|
||||||
auto fdPath = new QLineEdit(QApplication::applicationDirPath()+"/ModuleFiles");
|
|
||||||
fdPath->setMinimumWidth(400);
|
auto dir = QApplication::applicationDirPath()+"/ModuleFiles";
|
||||||
hBox->addWidget(fdPath);
|
QDir(dir).mkpath(".");
|
||||||
|
auto fdDir = new QLineEdit(dir);
|
||||||
|
fdDir->setMinimumWidth(400);
|
||||||
|
hBox->addWidget(fdDir);
|
||||||
|
|
||||||
auto btnChoose = new QPushButton("选择路径");
|
auto btnChoose = new QPushButton("选择路径");
|
||||||
connect(btnChoose, &QPushButton::clicked, this, [this, fdPath] {
|
connect(btnChoose, &QPushButton::clicked, this, [this, fdDir] {
|
||||||
auto dir = QFileDialog::getExistingDirectory(this, "选择存储文件的目录", fdPath->text());
|
QFileInfo info(fdDir->text());
|
||||||
|
QFileDialog dlg(this, "选择存储文件的目录", info.path());
|
||||||
|
auto font = dlg.font();
|
||||||
|
font.setPixelSize(12);
|
||||||
|
dlg.setFont(font);
|
||||||
|
dlg.setFileMode(QFileDialog::Directory);
|
||||||
|
dlg.setOptions(QFileDialog::ShowDirsOnly);
|
||||||
|
dlg.selectFile(info.fileName());
|
||||||
|
dlg.exec();
|
||||||
|
auto dir = dlg.selectedFiles();
|
||||||
|
if(! dir.isEmpty()) fdDir->setText(dir[0]);
|
||||||
|
//auto dir = QFileDialog::getExistingDirectory(this, "选择存储文件的目录", fdDir->text());
|
||||||
|
//if(! dir.isEmpty()) fdDir->setText(dir);
|
||||||
});
|
});
|
||||||
hBox->addWidget(btnChoose);
|
hBox->addWidget(btnChoose);
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "basewin.h"
|
#include "basewin.h"
|
||||||
#include <QSpinBox>
|
#include <QSpinBox>
|
||||||
#include <QTableWidget>
|
#include <QTableWidget>
|
||||||
|
#include <QComboBox>
|
||||||
|
|
||||||
class PointTable : public QTableWidget {
|
class PointTable : public QTableWidget {
|
||||||
public:
|
public:
|
||||||
|
@ -20,12 +21,17 @@ class ExpertSmartPointSetWin : public BaseWin {
|
||||||
public:
|
public:
|
||||||
explicit ExpertSmartPointSetWin(QWidget *parent = nullptr);
|
explicit ExpertSmartPointSetWin(QWidget *parent = nullptr);
|
||||||
void save();
|
void save();
|
||||||
|
void save2();
|
||||||
|
|
||||||
QSpinBox *fdModuleWidth, *fdModuleHeight, *fdGrpCnt;
|
|
||||||
PointTable *table, *tableRow;
|
PointTable *table, *tableRow;
|
||||||
int virtualCnt = 0;
|
int virtualCnt = 0;
|
||||||
QList<QPoint> lines;
|
QList<QPoint> scans;
|
||||||
int moduleWidth{16}, moduleHeight{8}, grpCnt{2}, scanCnt{4};
|
|
||||||
|
QSpinBox *fdModuleWidth, *fdModuleHeight, *fdGroupNum;
|
||||||
|
QComboBox *fdChipType, *fdDecodeMode, *fdGroupMode;
|
||||||
|
|
||||||
|
int ModuleWidth{16}, ModuleHeight{8}, GroupNum{2}, ScanNum{4};
|
||||||
|
QString ChipType, DecodeMode, GroupMode;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // EXPERTSMARTPOINTSETWIN_H
|
#endif // EXPERTSMARTPOINTSETWIN_H
|
||||||
|
|
|
@ -133,13 +133,10 @@ QTabBar::tab:selected {margin-top: 0; border-bottom: none; color: #acf; backgrou
|
||||||
{
|
{
|
||||||
auto vBox = new QVBoxLayout(receivePanel);
|
auto vBox = new QVBoxLayout(receivePanel);
|
||||||
auto gBox = new QGroupBox("模组信息");
|
auto gBox = new QGroupBox("模组信息");
|
||||||
gBox->setForegroundRole(QPalette::Text);
|
|
||||||
vBox->addWidget(gBox);
|
vBox->addWidget(gBox);
|
||||||
|
|
||||||
auto hhh = new QHBoxLayout(gBox);
|
auto hhh = new QHBoxLayout(gBox);
|
||||||
|
auto vvv = new VBox(hhh);
|
||||||
auto vvv = new QVBoxLayout();
|
|
||||||
hhh->addLayout(vvv);
|
|
||||||
|
|
||||||
auto lb = new QLabel("驱动芯片: ");
|
auto lb = new QLabel("驱动芯片: ");
|
||||||
vvv->addWidget(lb);
|
vvv->addWidget(lb);
|
||||||
|
@ -147,8 +144,7 @@ QTabBar::tab:selected {margin-top: 0; border-bottom: none; color: #acf; backgrou
|
||||||
lb = new QLabel("译码方式: ");
|
lb = new QLabel("译码方式: ");
|
||||||
vvv->addWidget(lb);
|
vvv->addWidget(lb);
|
||||||
|
|
||||||
vvv = new QVBoxLayout();
|
vvv = new VBox(hhh);
|
||||||
hhh->addLayout(vvv);
|
|
||||||
|
|
||||||
lb = new QLabel("驱动芯片");
|
lb = new QLabel("驱动芯片");
|
||||||
vvv->addWidget(lb);
|
vvv->addWidget(lb);
|
||||||
|
@ -157,8 +153,7 @@ QTabBar::tab:selected {margin-top: 0; border-bottom: none; color: #acf; backgrou
|
||||||
vvv->addWidget(lb);
|
vvv->addWidget(lb);
|
||||||
|
|
||||||
hhh->addSpacing(20);
|
hhh->addSpacing(20);
|
||||||
vvv = new QVBoxLayout();
|
vvv = new VBox(hhh);
|
||||||
hhh->addLayout(vvv);
|
|
||||||
|
|
||||||
lb = new QLabel("模组宽度: ");
|
lb = new QLabel("模组宽度: ");
|
||||||
vvv->addWidget(lb);
|
vvv->addWidget(lb);
|
||||||
|
@ -166,8 +161,7 @@ QTabBar::tab:selected {margin-top: 0; border-bottom: none; color: #acf; backgrou
|
||||||
lb = new QLabel("模组高度: ");
|
lb = new QLabel("模组高度: ");
|
||||||
vvv->addWidget(lb);
|
vvv->addWidget(lb);
|
||||||
|
|
||||||
vvv = new QVBoxLayout();
|
vvv = new VBox(hhh);
|
||||||
hhh->addLayout(vvv);
|
|
||||||
|
|
||||||
lb = new QLabel("模组宽度");
|
lb = new QLabel("模组宽度");
|
||||||
vvv->addWidget(lb);
|
vvv->addWidget(lb);
|
||||||
|
@ -176,8 +170,7 @@ QTabBar::tab:selected {margin-top: 0; border-bottom: none; color: #acf; backgrou
|
||||||
vvv->addWidget(lb);
|
vvv->addWidget(lb);
|
||||||
|
|
||||||
hhh->addSpacing(20);
|
hhh->addSpacing(20);
|
||||||
vvv = new QVBoxLayout();
|
vvv = new VBox(hhh);
|
||||||
hhh->addLayout(vvv);
|
|
||||||
|
|
||||||
lb = new QLabel("扫描数: ");
|
lb = new QLabel("扫描数: ");
|
||||||
vvv->addWidget(lb);
|
vvv->addWidget(lb);
|
||||||
|
@ -185,8 +178,7 @@ QTabBar::tab:selected {margin-top: 0; border-bottom: none; color: #acf; backgrou
|
||||||
lb = new QLabel("数据数组: ");
|
lb = new QLabel("数据数组: ");
|
||||||
vvv->addWidget(lb);
|
vvv->addWidget(lb);
|
||||||
|
|
||||||
vvv = new QVBoxLayout();
|
vvv = new VBox(hhh);
|
||||||
hhh->addLayout(vvv);
|
|
||||||
|
|
||||||
lb = new QLabel("扫描数");
|
lb = new QLabel("扫描数");
|
||||||
vvv->addWidget(lb);
|
vvv->addWidget(lb);
|
||||||
|
@ -195,8 +187,7 @@ QTabBar::tab:selected {margin-top: 0; border-bottom: none; color: #acf; backgrou
|
||||||
vvv->addWidget(lb);
|
vvv->addWidget(lb);
|
||||||
|
|
||||||
hhh->addSpacing(20);
|
hhh->addSpacing(20);
|
||||||
vvv = new QVBoxLayout();
|
vvv = new VBox(hhh);
|
||||||
hhh->addLayout(vvv);
|
|
||||||
|
|
||||||
lb = new QLabel("数据线颜色: ");
|
lb = new QLabel("数据线颜色: ");
|
||||||
vvv->addWidget(lb);
|
vvv->addWidget(lb);
|
||||||
|
@ -204,15 +195,13 @@ QTabBar::tab:selected {margin-top: 0; border-bottom: none; color: #acf; backgrou
|
||||||
lb = new QLabel("模组抽行设置");
|
lb = new QLabel("模组抽行设置");
|
||||||
vvv->addWidget(lb);
|
vvv->addWidget(lb);
|
||||||
|
|
||||||
vvv = new QVBoxLayout();
|
vvv = new VBox(hhh);
|
||||||
hhh->addLayout(vvv);
|
|
||||||
|
|
||||||
lb = new QLabel("数据线颜色");
|
lb = new QLabel("数据线颜色");
|
||||||
vvv->addWidget(lb);
|
vvv->addWidget(lb);
|
||||||
|
|
||||||
hhh->addStretch();
|
hhh->addStretch();
|
||||||
vvv = new QVBoxLayout();
|
vvv = new VBox(hhh);
|
||||||
hhh->addLayout(vvv);
|
|
||||||
|
|
||||||
auto btn = new QPushButton("模组选择");
|
auto btn = new QPushButton("模组选择");
|
||||||
vvv->addWidget(btn);
|
vvv->addWidget(btn);
|
||||||
|
@ -223,6 +212,21 @@ QTabBar::tab:selected {margin-top: 0; border-bottom: none; color: #acf; backgrou
|
||||||
});
|
});
|
||||||
vvv->addWidget(btn);
|
vvv->addWidget(btn);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
gBox = new QGroupBox("单卡带载");
|
||||||
|
vBox->addWidget(gBox);
|
||||||
|
|
||||||
|
auto tab = new QTabWidget;
|
||||||
|
tab->setTabPosition(QTabWidget::West);
|
||||||
|
vBox->addWidget(tab);
|
||||||
|
|
||||||
|
auto normalPanel = new QWidget;
|
||||||
|
tab->addTab(normalPanel, "常规设计");
|
||||||
|
|
||||||
|
auto advancedPanel = new QWidget;
|
||||||
|
tab->addTab(advancedPanel, "高级设计");
|
||||||
|
|
||||||
vBox->addStretch();
|
vBox->addStretch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,33 +43,36 @@ int main(int argc, char *argv[]) {
|
||||||
QPalette plt = a.palette();
|
QPalette plt = a.palette();
|
||||||
plt.setBrush(QPalette::Window, QColor(0x333333));
|
plt.setBrush(QPalette::Window, QColor(0x333333));
|
||||||
plt.setBrush(QPalette::WindowText, QColor(0xffffff));
|
plt.setBrush(QPalette::WindowText, QColor(0xffffff));
|
||||||
plt.setBrush(QPalette::Base, QColor(0x444444));
|
plt.setBrush(QPalette::Base, QColor(0x222222));
|
||||||
plt.setBrush(QPalette::AlternateBase, QColor(0x555555));
|
plt.setBrush(QPalette::AlternateBase, QColor(0x333333));
|
||||||
plt.setBrush(QPalette::Text, QColor(0xffffff));
|
plt.setBrush(QPalette::Text, QColor(0xffffff));
|
||||||
plt.setBrush(QPalette::Button, QColor(0x222222));
|
plt.setBrush(QPalette::Button, QColor(0x444444));
|
||||||
plt.setBrush(QPalette::ButtonText, QColor(0xffffff));
|
plt.setBrush(QPalette::ButtonText, QColor(0xffffff));
|
||||||
plt.setBrush(QPalette::ToolTipBase, QColor(0x444466));
|
plt.setBrush(QPalette::ToolTipBase, QColor(0x444466));
|
||||||
plt.setBrush(QPalette::ToolTipText, QColor(0xffffff));
|
plt.setBrush(QPalette::ToolTipText, QColor(0xffffff));
|
||||||
plt.setBrush(QPalette::Light, QColor(0x444444));
|
plt.setBrush(QPalette::Light, QColor(0x444444));
|
||||||
plt.setBrush(QPalette::Midlight, QColor(0x666666));
|
plt.setBrush(QPalette::Midlight, QColor(0x555555));
|
||||||
plt.setBrush(QPalette::Mid, QColor(0x888888));
|
plt.setBrush(QPalette::Mid, QColor(0x666666));
|
||||||
plt.setBrush(QPalette::Dark, QColor(0xaaaaaa));
|
plt.setBrush(QPalette::Dark, QColor(0x777777));
|
||||||
plt.setBrush(QPalette::BrightText, QColor(0,0,0));
|
plt.setBrush(QPalette::BrightText, QColor(0,0,0));
|
||||||
plt.setBrush(QPalette::Shadow, QColor(0xaaaaaa));
|
plt.setBrush(QPalette::Shadow, QColor(0xaaaaaa));
|
||||||
a.setPalette(plt);
|
a.setPalette(plt);
|
||||||
a.setWindowIcon(QIcon(":/128.ico"));
|
a.setWindowIcon(QIcon(":/128.ico"));
|
||||||
|
|
||||||
a.setStyleSheet(R"rrr(
|
a.setStyleSheet(R"rrr(
|
||||||
QMessageBox {background: #444;}
|
QMessageBox {background: #333;}
|
||||||
QGroupBox::title {color: #fff;}
|
|
||||||
|
QGroupBox {border: 1px solid #777; border-radius: 3px; margin-top: 1.2ex; padding-top: 1ex;}
|
||||||
|
QGroupBox::title {color: #fff; subcontrol-origin: margin; position: relative; left: 1.4ex;}
|
||||||
|
|
||||||
QLineEdit, QComboBox, QSpinBox, QPushButton, QAbstractScrollArea {border: 1px solid #888;}
|
QLineEdit, QComboBox, QSpinBox, QPushButton, QAbstractScrollArea {border: 1px solid #888;}
|
||||||
QLineEdit, QComboBox, QSpinBox {border-radius: 2px; padding: 2px; background: #222;}
|
QLineEdit, QComboBox, QSpinBox {border-radius: 2px; padding: 2px; background: #222;}
|
||||||
|
|
||||||
QPushButton{border-radius: 4px; padding: 2px 6px; background: #222;}
|
QPushButton{border-radius: 4px; padding: 2px 6px; background: #444;}
|
||||||
QPushButton:hover {background: #444;}
|
QPushButton:hover {background: #555;}
|
||||||
QPushButton:pressed {background: #666;}
|
QPushButton:pressed {background: #666;}
|
||||||
QPushButton:checked {background: #026; border-color: #06f;}
|
QPushButton:checked {background: #026; border-color: #06f;}
|
||||||
|
QPushButton:!enabled {background: #666; color: #777;}
|
||||||
|
|
||||||
QPushButton[ss="min"]{border-radius: 4px; padding: 0; width: 30px; height: 25px; background: #07c;}
|
QPushButton[ss="min"]{border-radius: 4px; padding: 0; width: 30px; height: 25px; background: #07c;}
|
||||||
QPushButton[ss="close"]{border-radius: 4px; padding: 0; width: 30px; height: 25px; background: #e22;}
|
QPushButton[ss="close"]{border-radius: 4px; padding: 0; width: 30px; height: 25px; background: #e22;}
|
||||||
|
@ -77,10 +80,10 @@ QPushButton[ss="close"]{border-radius: 4px; padding: 0; width: 30px; height: 25p
|
||||||
QRadioButton::indicator {border-image: url(:/imgs/radio-un.png); width: 14px; height: 14px;}
|
QRadioButton::indicator {border-image: url(:/imgs/radio-un.png); width: 14px; height: 14px;}
|
||||||
QRadioButton::indicator:checked {border-image: url(:/imgs/radio-check.png);}
|
QRadioButton::indicator:checked {border-image: url(:/imgs/radio-check.png);}
|
||||||
|
|
||||||
QAbstractScrollArea QScrollBar {background: #555;}
|
QAbstractScrollArea QScrollBar {background: #222;}
|
||||||
|
|
||||||
QTableView {gridline-color:#888;}
|
QTableView {gridline-color:#777;}
|
||||||
QHeaderView::section, QTableCornerButton:section {background: #555;}
|
QHeaderView::section, QTableCornerButton:section {background: #444;}
|
||||||
|
|
||||||
QSlider::horizontal {height: 16px;}
|
QSlider::horizontal {height: 16px;}
|
||||||
QSlider::groove {background: transparent;}
|
QSlider::groove {background: transparent;}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user