diff --git a/LedOK/device/ctrlnetworkpanel.cpp b/LedOK/device/ctrlnetworkpanel.cpp index dcef59e..c729b5e 100644 --- a/LedOK/device/ctrlnetworkpanel.cpp +++ b/LedOK/device/ctrlnetworkpanel.cpp @@ -49,7 +49,10 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { hhh->addWidget(labelIpAddress = new QLabel); fdIP = new QLineEdit; - fdIP->setInputMask("000.000.000.000;_"); + auto ft = fdIP->font(); + ft.setFamilies({"Monaco", "Consolas", "Mono-space"}); + fdIP->setFont(ft); + fdIP->setInputMask("000.000.000.000"); fdIP->setAlignment(Qt::AlignCenter); fdIP->setFixedWidth(160); hhh->addWidget(fdIP); @@ -59,7 +62,8 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { hhh->addWidget(labelMaskAddress = new QLabel); fdMask = new QLineEdit; - fdMask->setInputMask("000.000.000.000;_"); + fdMask->setFont(ft); + fdMask->setInputMask("000.000.000.000"); fdMask->setAlignment(Qt::AlignCenter); fdMask->setFixedWidth(160); hhh->addWidget(fdMask); @@ -69,7 +73,8 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { hhh->addWidget(labelGateway = new QLabel); fdGateWay = new QLineEdit; - fdGateWay->setInputMask("000.000.000.000;_"); + fdGateWay->setFont(ft); + fdGateWay->setInputMask("000.000.000.000"); fdGateWay->setAlignment(Qt::AlignCenter); fdGateWay->setFixedWidth(160); hhh->addWidget(fdGateWay); @@ -79,7 +84,8 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { hhh->addWidget(labelDnsAddress = new QLabel); fdDns = new QLineEdit; - fdDns->setInputMask("000.000.000.000;_"); + fdDns->setFont(ft); + fdDns->setInputMask("000.000.000.000"); fdDns->setAlignment(Qt::AlignCenter); fdDns->setFixedWidth(160); hhh->addWidget(fdDns); diff --git a/LedOK/passwordindlg.cpp b/LedOK/passwordindlg.cpp index 1a46231..4e18ec8 100644 --- a/LedOK/passwordindlg.cpp +++ b/LedOK/passwordindlg.cpp @@ -1,26 +1,24 @@ #include "passwordindlg.h" #include "base/changepasswordform.h" -#include +#include "gutil/qgui.h" #include #include -PasswordInChDlg::PasswordInChDlg(QWidget *parent) : BaseDlg(parent) { - resize(213, 136); - setStyleSheet("QDialog{background-color: #eeeeee;} QLabel{background-color: transparent;}"); - auto vBox = new QVBoxLayout(this); +PasswordInChDlg::PasswordInChDlg(QWidget *parent) : QDialog(parent) { + resize(240, 150); + + auto vBox = new VBox(this); vBox->addStretch(); - auto hBox = new QHBoxLayout(); + auto hBox = new HBox(vBox); hBox->addWidget(new QLabel(tr("Input password"))); fdPassword = new QLineEdit(); fdPassword->setEchoMode(QLineEdit::Password); fdPassword->setFocus(); hBox->addWidget(fdPassword); - vBox->addLayout(hBox); btnChangePassword = new QPushButton(tr("Change Password")); - btnChangePassword->setProperty("ssType", "progManageTool"); vBox->addWidget(btnChangePassword, 0, Qt::AlignRight); connect(btnChangePassword, &QPushButton::clicked, this, [this]() { ChangePasswordForm dlg(this); @@ -28,10 +26,7 @@ PasswordInChDlg::PasswordInChDlg(QWidget *parent) : BaseDlg(parent) { }); vBox->addStretch(); - btnBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel, Qt::Horizontal); - btnBox->button(QDialogButtonBox::Ok)->setProperty("ssType", "progManageTool"); - btnBox->button(QDialogButtonBox::Cancel)->setProperty("ssType", "progManageTool"); - vBox->addWidget(btnBox, 0, Qt::AlignHCenter); + btnBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + vBox->addWidget(btnBox); connect(btnBox, &QDialogButtonBox::rejected, this, &QDialog::reject); - vBox->addStretch(); } diff --git a/LedOK/passwordindlg.h b/LedOK/passwordindlg.h index 79ec393..15eb1ac 100644 --- a/LedOK/passwordindlg.h +++ b/LedOK/passwordindlg.h @@ -1,14 +1,14 @@ #ifndef PASSWORDINDLG_H #define PASSWORDINDLG_H -#include "basedlg.h" +#include #include #include -class PasswordInChDlg : public BaseDlg { +class PasswordInChDlg : public QDialog { Q_OBJECT public: - explicit PasswordInChDlg(QWidget *parent = nullptr); + explicit PasswordInChDlg(QWidget *parent = 0); QLineEdit *fdPassword; QPushButton *btnChangePassword; diff --git a/LedOK/program/sendprogramdialog.cpp b/LedOK/program/sendprogramdialog.cpp index cac842e..d628507 100644 --- a/LedOK/program/sendprogramdialog.cpp +++ b/LedOK/program/sendprogramdialog.cpp @@ -1,17 +1,21 @@ #include "sendprogramdialog.h" #include "tools.h" #include "cfg.h" +#include "gutil/qgui.h" #include #include #include -#include +#include SendProgramDialog::SendProgramDialog(QString progName, QWidget *parent) : QDialog(parent), mProgName(progName) { +#ifdef Q_OS_WINDOWS setWindowFlag(Qt::WindowMaximizeButtonHint); +#endif setWindowTitle(tr("Publish")+" "+mProgName); resize(1024, 700); - auto vBox = new QVBoxLayout(this); - auto hBox = new QHBoxLayout(); + + auto vBox = new VBox(this); + auto hBox = new HBox(vBox); label = new QLabel(tr("success info")); hBox->addWidget(label); @@ -31,7 +35,6 @@ SendProgramDialog::SendProgramDialog(QString progName, QWidget *parent) : QDialo connect(txtSearch,SIGNAL(textChanged(const QString &)),this,SLOT(FilterProgram(const QString &))); hBox->addWidget(txtSearch); - vBox->addLayout(hBox); wDevicePublishList = new LoQTreeWidget(); wDevicePublishList->setProperty("ssType", "topList"); @@ -68,11 +71,11 @@ SendProgramDialog::SendProgramDialog(QString progName, QWidget *parent) : QDialo wDevicePublishList->setColumnWidth(ENUM_DEVICE_PUBLISH_HEADE_PROGRESS, 120); vBox->addWidget(wDevicePublishList); - hBox = new QHBoxLayout(); - hBox->addStretch(); - auto btnPublish = new QPushButton(tr("Publish")); - connect(btnPublish, &QPushButton::clicked, this, [this] { + auto btnBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + btnBox->button(QDialogButtonBox::Ok)->setText(tr("Publish")); + connect(btnBox, &QDialogButtonBox::rejected, this, &QDialog::reject); + connect(btnBox, &QDialogButtonBox::accepted, this, [this] { if(mWaitCnt > 0) return; int cnt = wDevicePublishList->topLevelItemCount(); int sentCnt{0}; @@ -114,15 +117,7 @@ SendProgramDialog::SendProgramDialog(QString progName, QWidget *parent) : QDialo sentCnt++; } }); - btnPublish->setProperty("ssType", "progManageTool"); - hBox->addWidget(btnPublish); - - auto btnCancel = new QPushButton(tr("Cancel")); - connect(btnCancel, &QPushButton::clicked, this, &QWidget::close); - btnCancel->setProperty("ssType", "progManageTool"); - hBox->addWidget(btnCancel); - - vBox->addLayout(hBox); + vBox->addWidget(btnBox); onRefresh();