2022-08-25 18:43:03 +08:00
|
|
|
|
#include "expertsmartpointsetwin.h"
|
|
|
|
|
#include <QStackedLayout>
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
#include <QRadioButton>
|
|
|
|
|
#include <QPushButton>
|
|
|
|
|
#include <QButtonGroup>
|
2022-08-25 22:52:52 +08:00
|
|
|
|
#include <QComboBox>
|
|
|
|
|
#include <QHeaderView>
|
2022-09-07 23:10:35 +08:00
|
|
|
|
#include <QDebug>
|
2022-08-25 18:43:03 +08:00
|
|
|
|
ExpertSmartPointSetWin::ExpertSmartPointSetWin(QWidget *parent) : BaseWin{parent} {
|
|
|
|
|
setWindowModality(Qt::WindowModal);
|
|
|
|
|
setAttribute(Qt::WA_DeleteOnClose);
|
|
|
|
|
setWindowTitle("智能走点参数配置");
|
|
|
|
|
resize(900, 600);
|
|
|
|
|
|
|
|
|
|
auto vBox = new QVBoxLayout(center);
|
|
|
|
|
vBox->setContentsMargins(0,0,0,0);
|
|
|
|
|
vBox->setSpacing(3);
|
|
|
|
|
vBox->addLayout(addBtns(new QHBoxLayout()));
|
|
|
|
|
|
|
|
|
|
auto stack = new QStackedLayout;
|
|
|
|
|
vBox->addLayout(stack);
|
|
|
|
|
|
|
|
|
|
auto page = new QWidget;
|
|
|
|
|
stack->addWidget(page);
|
2022-08-25 22:52:52 +08:00
|
|
|
|
QPalette bkBlue;
|
|
|
|
|
{
|
|
|
|
|
auto vBox = new QVBoxLayout(page);
|
|
|
|
|
vBox->setContentsMargins(50, 50, 6, 6);
|
|
|
|
|
|
|
|
|
|
auto lb = new QLabel("基本参数");
|
|
|
|
|
bkBlue = lb->palette();
|
|
|
|
|
bkBlue.setColor(QPalette::WindowText, QColor(0x5599ff));
|
|
|
|
|
lb->setPalette(bkBlue);
|
|
|
|
|
vBox->addWidget(lb);
|
|
|
|
|
vBox->addSpacing(50);
|
|
|
|
|
|
|
|
|
|
auto hBox = new QHBoxLayout;
|
|
|
|
|
hBox->addStretch();
|
|
|
|
|
{
|
|
|
|
|
auto vvv = new QVBoxLayout;
|
|
|
|
|
auto hhhh = new QHBoxLayout;
|
|
|
|
|
|
|
|
|
|
lb = new QLabel("模组宽度: ");
|
|
|
|
|
hhhh->addWidget(lb);
|
|
|
|
|
|
|
|
|
|
fdModuleWidth = new QSpinBox;
|
|
|
|
|
fdModuleWidth->setRange(0, 9999);
|
|
|
|
|
fdModuleWidth->setValue(128);
|
|
|
|
|
hhhh->addWidget(fdModuleWidth);
|
|
|
|
|
|
|
|
|
|
vvv->addLayout(hhhh);
|
|
|
|
|
vvv->addSpacing(30);
|
|
|
|
|
hhhh = new QHBoxLayout;
|
|
|
|
|
|
|
|
|
|
lb = new QLabel("模组高度: ");
|
|
|
|
|
hhhh->addWidget(lb);
|
|
|
|
|
|
|
|
|
|
fdModuleHeight = new QSpinBox;
|
|
|
|
|
fdModuleHeight->setRange(0, 9999);
|
|
|
|
|
fdModuleHeight->setValue(64);
|
|
|
|
|
hhhh->addWidget(fdModuleHeight);
|
|
|
|
|
|
|
|
|
|
vvv->addLayout(hhhh);
|
|
|
|
|
vvv->addSpacing(30);
|
|
|
|
|
hhhh = new QHBoxLayout;
|
|
|
|
|
|
|
|
|
|
lb = new QLabel("数据组数: ");
|
|
|
|
|
hhhh->addWidget(lb);
|
|
|
|
|
|
|
|
|
|
auto fdGrpCnt = new QSpinBox;
|
|
|
|
|
fdGrpCnt->setRange(0, 9999);
|
|
|
|
|
fdGrpCnt->setValue(1);
|
|
|
|
|
hhhh->addWidget(fdGrpCnt);
|
|
|
|
|
|
|
|
|
|
vvv->addLayout(hhhh);
|
|
|
|
|
vvv->addStretch();
|
|
|
|
|
|
|
|
|
|
hBox->addLayout(vvv);
|
|
|
|
|
}
|
|
|
|
|
hBox->addStretch();
|
|
|
|
|
{
|
|
|
|
|
auto vvv = new QVBoxLayout;
|
|
|
|
|
auto hhhh = new QHBoxLayout;
|
|
|
|
|
|
|
|
|
|
lb = new QLabel("驱动芯片: ");
|
|
|
|
|
hhhh->addWidget(lb);
|
|
|
|
|
|
|
|
|
|
auto fdChip = new QComboBox;
|
|
|
|
|
fdChip->addItem("ICND2153");
|
|
|
|
|
hhhh->addWidget(fdChip);
|
|
|
|
|
|
|
|
|
|
vvv->addLayout(hhhh);
|
|
|
|
|
vvv->addSpacing(30);
|
|
|
|
|
hhhh = new QHBoxLayout;
|
|
|
|
|
|
|
|
|
|
lb = new QLabel("译码方式: ");
|
|
|
|
|
hhhh->addWidget(lb);
|
|
|
|
|
|
|
|
|
|
auto fdDecodeMode = new QComboBox;
|
|
|
|
|
fdDecodeMode->addItem("138译码");
|
|
|
|
|
hhhh->addWidget(fdDecodeMode);
|
|
|
|
|
|
|
|
|
|
vvv->addLayout(hhhh);
|
|
|
|
|
vvv->addSpacing(30);
|
|
|
|
|
hhhh = new QHBoxLayout;
|
|
|
|
|
|
|
|
|
|
lb = new QLabel("分组方式: ");
|
|
|
|
|
hhhh->addWidget(lb);
|
|
|
|
|
|
|
|
|
|
auto fdGrping = new QComboBox;
|
|
|
|
|
fdGrping->addItem("三线并行");
|
|
|
|
|
fdGrping->addItem("三色1点串");
|
|
|
|
|
fdGrping->addItem("三色8点串");
|
|
|
|
|
fdGrping->addItem("三色16点串");
|
|
|
|
|
hhhh->addWidget(fdGrping);
|
|
|
|
|
|
|
|
|
|
vvv->addLayout(hhhh);
|
|
|
|
|
vvv->addStretch();
|
|
|
|
|
|
|
|
|
|
hBox->addLayout(vvv);
|
|
|
|
|
}
|
|
|
|
|
hBox->addStretch();
|
|
|
|
|
vBox->addLayout(hBox);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
page = new QWidget;
|
|
|
|
|
stack->addWidget(page);
|
2022-08-25 18:43:03 +08:00
|
|
|
|
{
|
|
|
|
|
auto vBox = new QVBoxLayout(page);
|
2022-08-25 22:52:52 +08:00
|
|
|
|
vBox->setContentsMargins(50, 50, 6, 6);
|
2022-08-25 18:43:03 +08:00
|
|
|
|
|
|
|
|
|
auto lb = new QLabel("扫描行数");
|
2022-08-25 22:52:52 +08:00
|
|
|
|
lb->setPalette(bkBlue);
|
2022-08-25 18:43:03 +08:00
|
|
|
|
vBox->addWidget(lb);
|
|
|
|
|
vBox->addSpacing(50);
|
|
|
|
|
|
|
|
|
|
auto hBox = new QHBoxLayout;
|
|
|
|
|
vBox->addLayout(hBox);
|
|
|
|
|
hBox->addStretch();
|
|
|
|
|
|
|
|
|
|
auto vvv = new QVBoxLayout;
|
|
|
|
|
hBox->addLayout(vvv);
|
|
|
|
|
|
|
|
|
|
lb = new QLabel("根据亮线的行/列数确定扫描行/列数: ");
|
|
|
|
|
vvv->addWidget(lb);
|
|
|
|
|
vvv->addSpacing(30);
|
|
|
|
|
|
|
|
|
|
auto hhhh = new QHBoxLayout;
|
|
|
|
|
hhhh->addStretch();
|
|
|
|
|
auto fdRow = new QRadioButton("行");
|
|
|
|
|
hhhh->addWidget(fdRow);
|
|
|
|
|
hhhh->addStretch();
|
|
|
|
|
auto fdCol = new QRadioButton("列");
|
|
|
|
|
hhhh->addWidget(fdCol);
|
|
|
|
|
hhhh->addStretch();
|
|
|
|
|
vvv->addLayout(hhhh);
|
|
|
|
|
vvv->addSpacing(20);
|
|
|
|
|
|
|
|
|
|
hhhh = new QHBoxLayout;
|
|
|
|
|
hhhh->addStretch();
|
|
|
|
|
|
|
|
|
|
lb = new QLabel("亮线的行/列数: ");
|
|
|
|
|
hhhh->addWidget(lb);
|
|
|
|
|
|
|
|
|
|
auto fdNum = new QSpinBox;
|
|
|
|
|
fdNum->setRange(0, 9999);
|
|
|
|
|
fdNum->setValue(1);
|
|
|
|
|
hhhh->addWidget(fdNum);
|
|
|
|
|
|
|
|
|
|
hhhh->addStretch();
|
|
|
|
|
vvv->addLayout(hhhh);
|
|
|
|
|
|
|
|
|
|
vvv->addStretch();
|
|
|
|
|
|
|
|
|
|
hBox->addStretch();
|
|
|
|
|
|
|
|
|
|
vvv = new QVBoxLayout;
|
|
|
|
|
hBox->addLayout(vvv);
|
|
|
|
|
|
|
|
|
|
lb = new QLabel("芯片245版本: ");
|
|
|
|
|
vvv->addWidget(lb);
|
|
|
|
|
vvv->addSpacing(30);
|
|
|
|
|
|
|
|
|
|
hhhh = new QHBoxLayout;
|
|
|
|
|
hhhh->addStretch();
|
|
|
|
|
auto fdA = new QRadioButton("A");
|
|
|
|
|
hhhh->addWidget(fdA);
|
|
|
|
|
hhhh->addStretch();
|
|
|
|
|
auto fdD = new QRadioButton("D");
|
|
|
|
|
hhhh->addWidget(fdD);
|
|
|
|
|
hhhh->addStretch();
|
|
|
|
|
vvv->addLayout(hhhh);
|
|
|
|
|
|
|
|
|
|
vvv->addStretch();
|
|
|
|
|
hBox->addStretch();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
page = new QWidget;
|
|
|
|
|
stack->addWidget(page);
|
|
|
|
|
{
|
|
|
|
|
auto vBox = new QVBoxLayout(page);
|
2022-08-25 22:52:52 +08:00
|
|
|
|
vBox->setContentsMargins(50, 50, 6, 6);
|
2022-08-25 18:43:03 +08:00
|
|
|
|
|
|
|
|
|
auto lb = new QLabel("数据线颜色");
|
2022-08-25 22:52:52 +08:00
|
|
|
|
lb->setPalette(bkBlue);
|
2022-08-25 18:43:03 +08:00
|
|
|
|
vBox->addWidget(lb);
|
|
|
|
|
vBox->addSpacing(50);
|
|
|
|
|
|
|
|
|
|
lb = new QLabel("依次点击以下状态, 根据模组颜色选择对应颜色");
|
|
|
|
|
vBox->addWidget(lb, 0, Qt::AlignCenter);
|
|
|
|
|
vBox->addSpacing(30);
|
|
|
|
|
|
|
|
|
|
auto hhhh = new QHBoxLayout;
|
|
|
|
|
hhhh->addStretch();
|
|
|
|
|
auto fdSta1 = new QRadioButton("状态1");
|
2022-09-07 23:10:35 +08:00
|
|
|
|
fdSta1->setChecked(true);
|
2022-08-25 18:43:03 +08:00
|
|
|
|
hhhh->addWidget(fdSta1);
|
|
|
|
|
hhhh->addStretch();
|
|
|
|
|
|
|
|
|
|
auto fdR1 = new QRadioButton("红");
|
2022-09-07 23:10:35 +08:00
|
|
|
|
fdR1->setChecked(true);
|
2022-08-25 18:43:03 +08:00
|
|
|
|
hhhh->addWidget(fdR1);
|
|
|
|
|
hhhh->addSpacing(20);
|
|
|
|
|
|
|
|
|
|
auto fdG1 = new QRadioButton("绿");
|
|
|
|
|
hhhh->addWidget(fdG1);
|
|
|
|
|
hhhh->addSpacing(20);
|
|
|
|
|
|
|
|
|
|
auto fdB1 = new QRadioButton("蓝");
|
|
|
|
|
hhhh->addWidget(fdB1);
|
|
|
|
|
hhhh->addSpacing(20);
|
|
|
|
|
|
|
|
|
|
auto fdNo1 = new QRadioButton("黑");
|
|
|
|
|
hhhh->addWidget(fdNo1);
|
|
|
|
|
hhhh->addStretch();
|
|
|
|
|
|
|
|
|
|
vBox->addLayout(hhhh);
|
|
|
|
|
vBox->addSpacing(20);
|
|
|
|
|
|
|
|
|
|
hhhh = new QHBoxLayout;
|
|
|
|
|
hhhh->addStretch();
|
|
|
|
|
auto fdSta2 = new QRadioButton("状态2");
|
|
|
|
|
hhhh->addWidget(fdSta2);
|
|
|
|
|
hhhh->addStretch();
|
|
|
|
|
|
|
|
|
|
auto fdR2 = new QRadioButton("红");
|
|
|
|
|
hhhh->addWidget(fdR2);
|
|
|
|
|
hhhh->addSpacing(20);
|
|
|
|
|
|
|
|
|
|
auto fdG2 = new QRadioButton("绿");
|
2022-09-07 23:10:35 +08:00
|
|
|
|
fdG2->setChecked(true);
|
2022-08-25 18:43:03 +08:00
|
|
|
|
hhhh->addWidget(fdG2);
|
|
|
|
|
hhhh->addSpacing(20);
|
|
|
|
|
|
|
|
|
|
auto fdB2 = new QRadioButton("蓝");
|
|
|
|
|
hhhh->addWidget(fdB2);
|
|
|
|
|
hhhh->addSpacing(20);
|
|
|
|
|
|
|
|
|
|
auto fdNo2 = new QRadioButton("黑");
|
|
|
|
|
hhhh->addWidget(fdNo2);
|
|
|
|
|
hhhh->addStretch();
|
|
|
|
|
|
|
|
|
|
vBox->addLayout(hhhh);
|
|
|
|
|
vBox->addSpacing(20);
|
|
|
|
|
|
|
|
|
|
hhhh = new QHBoxLayout;
|
|
|
|
|
hhhh->addStretch();
|
|
|
|
|
auto fdSta3 = new QRadioButton("状态3");
|
|
|
|
|
hhhh->addWidget(fdSta3);
|
|
|
|
|
hhhh->addStretch();
|
|
|
|
|
|
|
|
|
|
auto fdR3 = new QRadioButton("红");
|
|
|
|
|
hhhh->addWidget(fdR3);
|
|
|
|
|
hhhh->addSpacing(20);
|
|
|
|
|
|
|
|
|
|
auto fdG3 = new QRadioButton("绿");
|
|
|
|
|
hhhh->addWidget(fdG3);
|
|
|
|
|
hhhh->addSpacing(20);
|
|
|
|
|
|
|
|
|
|
auto fdB3 = new QRadioButton("蓝");
|
2022-09-07 23:10:35 +08:00
|
|
|
|
fdB3->setChecked(true);
|
2022-08-25 18:43:03 +08:00
|
|
|
|
hhhh->addWidget(fdB3);
|
|
|
|
|
hhhh->addSpacing(20);
|
|
|
|
|
|
|
|
|
|
auto fdNo3 = new QRadioButton("黑");
|
|
|
|
|
hhhh->addWidget(fdNo3);
|
|
|
|
|
hhhh->addStretch();
|
|
|
|
|
|
|
|
|
|
vBox->addLayout(hhhh);
|
|
|
|
|
vBox->addStretch();
|
|
|
|
|
|
|
|
|
|
auto btnGrp = new QButtonGroup(page);
|
|
|
|
|
btnGrp->addButton(fdR1);
|
|
|
|
|
btnGrp->addButton(fdG1);
|
|
|
|
|
btnGrp->addButton(fdB1);
|
|
|
|
|
btnGrp->addButton(fdNo1);
|
|
|
|
|
btnGrp = new QButtonGroup(page);
|
|
|
|
|
btnGrp->addButton(fdR2);
|
|
|
|
|
btnGrp->addButton(fdG2);
|
|
|
|
|
btnGrp->addButton(fdB2);
|
|
|
|
|
btnGrp->addButton(fdNo2);
|
|
|
|
|
btnGrp = new QButtonGroup(page);
|
|
|
|
|
btnGrp->addButton(fdR3);
|
|
|
|
|
btnGrp->addButton(fdG3);
|
|
|
|
|
btnGrp->addButton(fdB3);
|
|
|
|
|
btnGrp->addButton(fdNo3);
|
|
|
|
|
}
|
|
|
|
|
|
2022-08-25 22:52:52 +08:00
|
|
|
|
page = new QWidget;
|
|
|
|
|
stack->addWidget(page);
|
|
|
|
|
{
|
|
|
|
|
auto vBox = new QVBoxLayout(page);
|
|
|
|
|
vBox->setContentsMargins(0,0,0,0);
|
|
|
|
|
|
|
|
|
|
auto hhh = new QHBoxLayout;
|
|
|
|
|
|
2022-09-06 23:40:02 +08:00
|
|
|
|
auto btnUndo = new QPushButton("回撤");
|
|
|
|
|
btnUndo->setMinimumSize(90, 30);
|
|
|
|
|
connect(btnUndo, &QPushButton::clicked, this, [this] {
|
2022-09-07 23:10:35 +08:00
|
|
|
|
auto lastIdx = tableRow->columnCount()-1;
|
|
|
|
|
if(lastIdx==-1) return;
|
|
|
|
|
auto last = tableRow->item(1, lastIdx);
|
|
|
|
|
if(last->text()=="×") {
|
|
|
|
|
virtualCnt--;
|
|
|
|
|
} else {
|
|
|
|
|
auto point = last->data(Qt::UserRole).toPoint();
|
|
|
|
|
table->setItem(point.y(), point.x(), 0);
|
|
|
|
|
if(lastIdx==virtualCnt) table->selectionModel()->clearCurrentIndex();
|
|
|
|
|
else {
|
|
|
|
|
for(int i=lastIdx-1; i>-1; i--) {
|
|
|
|
|
auto item = tableRow->item(1, i);
|
|
|
|
|
if(item->text()=="×") continue;
|
|
|
|
|
auto point = item->data(Qt::UserRole).toPoint();
|
|
|
|
|
table->setCurrentCell(point.y(), point.x());
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-09-06 23:40:02 +08:00
|
|
|
|
}
|
2022-09-07 23:10:35 +08:00
|
|
|
|
tableRow->setColumnCount(lastIdx);
|
2022-09-06 23:40:02 +08:00
|
|
|
|
});
|
|
|
|
|
hhh->addWidget(btnUndo);
|
2022-08-25 22:52:52 +08:00
|
|
|
|
|
2022-09-07 23:10:35 +08:00
|
|
|
|
auto btnAddVoid = new QPushButton("插入虚点");
|
|
|
|
|
btnAddVoid->setMinimumSize(90, 30);
|
|
|
|
|
connect(btnAddVoid, &QPushButton::clicked, this, [this] {
|
|
|
|
|
virtualCnt++;
|
|
|
|
|
auto cnt = tableRow->columnCount();
|
|
|
|
|
tableRow->setColumnCount(cnt+1);
|
|
|
|
|
tableRow->setItem(0, cnt, new QTableWidgetItem(QString::number(cnt+1)));
|
|
|
|
|
auto item = new QTableWidgetItem("×");
|
|
|
|
|
tableRow->setItem(1, cnt, item);
|
|
|
|
|
});
|
|
|
|
|
hhh->addWidget(btnAddVoid);
|
|
|
|
|
|
|
|
|
|
auto btnReset = new QPushButton("重新走点");
|
|
|
|
|
btnReset->setMinimumSize(90, 30);
|
|
|
|
|
connect(btnReset, &QPushButton::clicked, this, [this] {
|
|
|
|
|
table->clearContents();
|
|
|
|
|
tableRow->setColumnCount(0);
|
|
|
|
|
virtualCnt = 0;
|
|
|
|
|
});
|
|
|
|
|
hhh->addWidget(btnReset);
|
|
|
|
|
|
2022-08-25 22:52:52 +08:00
|
|
|
|
hhh->addStretch();
|
|
|
|
|
vBox->addLayout(hhh);
|
|
|
|
|
|
|
|
|
|
table = new PointTable;
|
|
|
|
|
table->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
2022-09-07 23:10:35 +08:00
|
|
|
|
table->setSelectionMode(QTableWidget::SingleSelection);
|
2022-08-25 22:52:52 +08:00
|
|
|
|
table->horizontalHeader()->setDefaultSectionSize(40);
|
|
|
|
|
table->horizontalHeader()->setDefaultAlignment(Qt::AlignCenter);
|
|
|
|
|
table->verticalHeader()->setMinimumWidth(40);
|
|
|
|
|
table->verticalHeader()->setDefaultAlignment(Qt::AlignCenter);
|
2022-09-06 23:40:02 +08:00
|
|
|
|
connect(table, &QTableWidget::currentCellChanged, this, [this](int row, int col) {
|
|
|
|
|
if(row < 0) return;
|
|
|
|
|
auto item = table->item(row, col);
|
|
|
|
|
if(item) return;
|
2022-09-07 23:10:35 +08:00
|
|
|
|
auto cnt = tableRow->columnCount() + 1;
|
|
|
|
|
tableRow->setColumnCount(cnt);
|
|
|
|
|
tableRow->setItem(0, cnt-1, new QTableWidgetItem(QString::number(cnt)));
|
|
|
|
|
item = new QTableWidgetItem("√");
|
|
|
|
|
item->setData(Qt::UserRole, QPoint{col, row});
|
|
|
|
|
tableRow->setItem(1, cnt-1, item);
|
|
|
|
|
item = new QTableWidgetItem(QString::number(cnt - virtualCnt));
|
|
|
|
|
table->setItem(row, col, item);
|
2022-08-25 22:52:52 +08:00
|
|
|
|
});
|
|
|
|
|
vBox->addWidget(table);
|
2022-09-07 23:10:35 +08:00
|
|
|
|
|
|
|
|
|
tableRow = new PointTable(2, 0);
|
|
|
|
|
tableRow->setEditTriggers(QAbstractItemView::NoEditTriggers);
|
|
|
|
|
tableRow->setSelectionMode(QTableWidget::NoSelection);
|
|
|
|
|
tableRow->horizontalHeader()->setDefaultSectionSize(40);
|
|
|
|
|
tableRow->horizontalHeader()->setVisible(false);
|
|
|
|
|
tableRow->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed);
|
|
|
|
|
tableRow->verticalHeader()->setMinimumWidth(120);
|
|
|
|
|
tableRow->setMaximumHeight(80);
|
|
|
|
|
auto item = tableRow->verticalHeaderItem(0);
|
|
|
|
|
if(item==0) tableRow->setVerticalHeaderItem(0, item = new QTableWidgetItem());
|
|
|
|
|
item->setText("第一扫灯数:");
|
|
|
|
|
item = tableRow->verticalHeaderItem(1);
|
|
|
|
|
if(item==0) tableRow->setVerticalHeaderItem(1, item = new QTableWidgetItem());
|
|
|
|
|
item->setText("实: 虚:");
|
|
|
|
|
vBox->addWidget(tableRow);
|
2022-08-25 22:52:52 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-08-25 18:43:03 +08:00
|
|
|
|
auto hBox = new QHBoxLayout;
|
|
|
|
|
vBox->addLayout(hBox);
|
|
|
|
|
|
|
|
|
|
hBox->addStretch();
|
|
|
|
|
|
|
|
|
|
auto btnPrev = new QPushButton("上一步");
|
|
|
|
|
btnPrev->setMinimumSize(90, 30);
|
|
|
|
|
hBox->addWidget(btnPrev);
|
|
|
|
|
|
|
|
|
|
auto btnNext = new QPushButton("下一步");
|
|
|
|
|
btnNext->setMinimumSize(90, 30);
|
|
|
|
|
hBox->addWidget(btnNext);
|
|
|
|
|
|
|
|
|
|
connect(btnPrev, &QPushButton::clicked, this, [stack, btnPrev, btnNext] {
|
2022-08-25 22:52:52 +08:00
|
|
|
|
auto idx = stack->currentIndex();
|
|
|
|
|
stack->setCurrentIndex(--idx);
|
2022-08-25 18:43:03 +08:00
|
|
|
|
btnPrev->setVisible(idx > 0);
|
|
|
|
|
btnNext->setVisible(idx < stack->count()-1);
|
|
|
|
|
});
|
2022-08-25 22:52:52 +08:00
|
|
|
|
connect(btnNext, &QPushButton::clicked, this, [this, stack, btnPrev, btnNext] {
|
|
|
|
|
auto idx = stack->currentIndex();
|
|
|
|
|
if(idx==0) {
|
|
|
|
|
moduleWidth = fdModuleWidth->value();
|
|
|
|
|
moduleHeight = fdModuleHeight->value();
|
|
|
|
|
} else if(idx==2) {
|
|
|
|
|
table->setColumnCount(moduleWidth);
|
|
|
|
|
table->setRowCount(moduleHeight);
|
|
|
|
|
}
|
|
|
|
|
stack->setCurrentIndex(++idx);
|
2022-08-25 18:43:03 +08:00
|
|
|
|
btnPrev->setVisible(idx > 0);
|
|
|
|
|
btnNext->setVisible(idx < stack->count()-1);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
auto btnCcl = new QPushButton("取消");
|
|
|
|
|
btnCcl->setMinimumSize(90, 30);
|
|
|
|
|
hBox->addWidget(btnCcl);
|
|
|
|
|
|
|
|
|
|
hBox->addSpacing(30);
|
|
|
|
|
}
|