From 7f44fd1ca5e3803a21e194375eaf2b05c173d5fd Mon Sep 17 00:00:00 2001 From: gangphon Date: Sun, 23 Apr 2023 14:30:16 +0800 Subject: [PATCH] ledok --- LedOK/LedOK.pro | 10 +++++---- LedOK/device/ctrlnetworkpanel.cpp | 36 +++++++++++++++++-------------- LedOK/program/pageeditor.cpp | 4 ---- LedOK/program/pageeditor.h | 5 +---- 4 files changed, 27 insertions(+), 28 deletions(-) diff --git a/LedOK/LedOK.pro b/LedOK/LedOK.pro index fe363fb..80ed842 100644 --- a/LedOK/LedOK.pro +++ b/LedOK/LedOK.pro @@ -259,7 +259,7 @@ include(./xlsx/qtxlsx.pri) include(./QSimpleUpdater/QSimpleUpdater.pri) -copy.files += $$quote(y50 param) +copydir.files += $$quote(y50 param) win32 { INCLUDEPATH += $$PWD/ffmpeg/include @@ -272,15 +272,17 @@ LIBS += -L$$PWD/ffmpeg/lib/\ -lswresample \ -lswscale -CONFIG += file_copies copy.path = $$OUT_PWD +copydir.path = $$OUT_PWD copy.files += $$files(ffmpeg/bin/*.dll) copy.files += ffmpeg/bin/ffmpeg.exe copy.files += 7z/7z.dll copy.files += 7z/7z.exe # for https requests copy.files += $$files(OpenSSL/*.dll) +CONFIG += file_copies COPIES += copy +COPIES += copydir } osx { INCLUDEPATH += $$PWD/ffmpeg-mac/include @@ -293,6 +295,6 @@ LIBS += -L$$PWD/ffmpeg-mac/lib/\ -lswresample \ -lswscale -copy.path = Contents/MacOS -QMAKE_BUNDLE_DATA += copy +copydir.path = Contents/MacOS +QMAKE_BUNDLE_DATA += copydir } diff --git a/LedOK/device/ctrlnetworkpanel.cpp b/LedOK/device/ctrlnetworkpanel.cpp index 678d26a..ea21778 100644 --- a/LedOK/device/ctrlnetworkpanel.cpp +++ b/LedOK/device/ctrlnetworkpanel.cpp @@ -48,7 +48,8 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { hhh->addWidget(labelIpAddress = new QLabel); fdIP = new QLineEdit; - fdIP->setInputMask("000.000.000.000"); + fdIP->setInputMask("000.000.000.000;_"); + fdIP->setAlignment(Qt::AlignCenter); fdIP->setFixedWidth(160); hhh->addWidget(fdIP); @@ -57,7 +58,8 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { hhh->addWidget(labelMaskAddress = new QLabel); fdMask = new QLineEdit; - fdMask->setInputMask("000.000.000.000"); + fdMask->setInputMask("000.000.000.000;_"); + fdMask->setAlignment(Qt::AlignCenter); fdMask->setFixedWidth(160); hhh->addWidget(fdMask); @@ -66,7 +68,8 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { hhh->addWidget(labelGateway = new QLabel); fdGateWay = new QLineEdit; - fdGateWay->setInputMask("000.000.000.000"); + fdGateWay->setInputMask("000.000.000.000;_"); + fdGateWay->setAlignment(Qt::AlignCenter); fdGateWay->setFixedWidth(160); hhh->addWidget(fdGateWay); @@ -75,7 +78,8 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { hhh->addWidget(labelDnsAddress = new QLabel); fdDns = new QLineEdit; - fdDns->setInputMask("000.000.000.000"); + fdDns->setInputMask("000.000.000.000;_"); + fdDns->setAlignment(Qt::AlignCenter); fdDns->setFixedWidth(160); hhh->addWidget(fdDns); } @@ -94,32 +98,32 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { QMessageBox::information(gMainWin, tr("Tip"), tr("NoSelectedController")); return; } - QString ip = fdIP->text().trimmed(); - QString mask = fdMask->text().trimmed(); - QString gateWay = fdGateWay->text().trimmed(); - QString dns = fdDns->text().trimmed(); + QString ip = fdIP->text(); + QString mask = fdMask->text(); + QString gateWay = fdGateWay->text(); + QString dns = fdDns->text(); if(fdDhcp->isChecked()) { - if(ip.isEmpty()) ip = "0.255.255.255"; - if(mask.isEmpty()) mask = "0.255.255.255"; - if(gateWay.isEmpty()) gateWay = "0.255.255.255"; - if(dns.isEmpty()) dns = "0.255.255.255"; + if(ip=="...") ip = "0.255.255.255"; + if(mask=="...") mask = "0.255.255.255"; + if(gateWay=="...") gateWay = "0.255.255.255"; + if(dns=="...") dns = "0.255.255.255"; } else { - if(ip.isEmpty()) { + if(ip=="...") { QMessageBox::warning(gMainWin, tr("Attention"), tr("Please input IP address!")); fdIP->setFocus(); return; } - if(mask.isEmpty()) { + if(mask=="...") { QMessageBox::warning(gMainWin, tr("Attention"), tr("Please input Mask address!")); fdMask->setFocus(); return; } - if(gateWay.isEmpty()) { + if(gateWay=="...") { QMessageBox::warning(gMainWin, tr("Attention"), tr("Please input Gateway address!")); fdGateWay->setFocus(); return; } - if(dns.isEmpty()) { + if(dns=="...") { QMessageBox::warning(gMainWin, tr("Attention"), tr("Please input DNS address!")); fdDns->setFocus(); return; diff --git a/LedOK/program/pageeditor.cpp b/LedOK/program/pageeditor.cpp index 794cb50..ad1dbd5 100644 --- a/LedOK/program/pageeditor.cpp +++ b/LedOK/program/pageeditor.cpp @@ -116,10 +116,6 @@ void PageEditor::keyReleaseEvent(QKeyEvent *event) { default:break; } } -void PageEditor::wheelEvent(QWheelEvent *e) { - qDebug()<<"angleDelta"<angleDelta().y()<<"pixelDelta"<pixelDelta().y(); - onScale(e->angleDelta().y() / 2); -} QList PageEditor::sortedEles() { QList eles; diff --git a/LedOK/program/pageeditor.h b/LedOK/program/pageeditor.h index b7e53f7..4981ead 100644 --- a/LedOK/program/pageeditor.h +++ b/LedOK/program/pageeditor.h @@ -12,16 +12,13 @@ public: explicit PageEditor(QWidget *parent = nullptr); virtual void keyReleaseEvent(QKeyEvent *event) override; - virtual void wheelEvent(QWheelEvent*event) override; QList sortedEles(); EBase* getElementSelected(); QGraphicsView *graphicsView; QLabel *fdScale; - int curScale = 100; -signals: - void scaleChanged(int); + int curScale{100}; public slots: void onScale(int);