#include "progcreatedlg.h" #include "gutil/qgui.h" #include "globaldefine.h" #include #include #include ProgCreateDlg::ProgCreateDlg(QString name, int width, int height, QString remarks, QString widths, QWidget *parent) : QDialog(parent) { #ifdef Q_OS_WIN setWindowFlag(Qt::WindowContextHelpButtonHint, 0); #endif setWindowTitle(tr("Solution Information")); auto vBox = new VBox(this); auto hBox = new HBox(vBox); auto label = new QLabel(tr("Solution Name")); label->setMinimumWidth(90); label->setAlignment(Qt::AlignRight | Qt::AlignVCenter); hBox->addWidget(label); hBox->addSpacing(6); fdName = new QLineEdit; if(name.isEmpty()) name = QDateTime::currentDateTime().toString("yyyyMMddhhmmsszzz"); else fdName->setDisabled(true); fdName->setText(name); hBox->addWidget(fdName); hBox = new HBox(vBox); hBox->setSpacing(12); label = new QLabel(tr("Resolution")); label->setMinimumWidth(90); label->setAlignment(Qt::AlignRight | Qt::AlignVCenter); hBox->addWidget(label); hBox->addSpacing(6); auto label_4 = new QLabel(tr("Width")); hBox->addWidget(label_4); fdWidth = new QSpinBox; fdWidth->setMaximum(99999); fdWidth->setValue(width); hBox->addWidget(fdWidth); auto label_5 = new QLabel(tr("Height")); hBox->addWidget(label_5); fdHeight = new QSpinBox; fdHeight->setMaximum(99999); fdHeight->setValue(height); hBox->addWidget(fdHeight); hBox->addStretch(); hBox = new HBox(vBox); label = new QLabel(tr("Remarks")); label->setMinimumWidth(90); label->setAlignment(Qt::AlignRight | Qt::AlignVCenter); hBox->addWidget(label); hBox->addSpacing(6); fdRemark = new QTextEdit(remarks); fdRemark->setFixedSize(300, 80); hBox->addWidget(fdRemark); hBox = new HBox(vBox); auto lbSplitWidth = new QLabel(tr("每段打折宽度 (用空格分隔)")); hBox->addWidget(lbSplitWidth); fdSplitWidths = new QLineEdit(widths); fdSplitWidths->setPlaceholderText("256 256 256 ..."); hBox->addWidget(fdSplitWidths); if(! gWidthSplit) { lbSplitWidth->setVisible(false); fdSplitWidths->setVisible(false); } vBox->addSpacing(6); auto btnBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); connect(btnBox, &QDialogButtonBox::rejected, this, &QDialog::reject); connect(btnBox, &QDialogButtonBox::accepted, this, &QDialog::accept); vBox->addWidget(btnBox); }