更新代码

master
feiyangqingyun 2021-07-08 15:40:48 +08:00
parent 40a3a2a543
commit 6e474f699b
16 changed files with 146 additions and 32 deletions

BIN
bin/comtool.exe Normal file

Binary file not shown.

22
bin/comtool.ini Normal file
View File

@ -0,0 +1,22 @@
[ComConfig]
PortName=COM1
BaudRate=9600
DataBit=8
Parity=\x65e0
StopBit=1
HexSend=false
HexReceive=false
Debug=false
AutoClear=false
AutoSend=false
SendInterval=1000
AutoSave=false
SaveInterval=5000
[NetConfig]
Mode=Tcp_Client
ServerIP=127.0.0.1
ServerPort=6000
ListenPort=6000
SleepTime=100
AutoConnect=false

BIN
bin/netserver.exe Normal file

Binary file not shown.

9
bin/netserver.ini Normal file
View File

@ -0,0 +1,9 @@
[AppConfig]
ListenPort1=6907
CmdStart1=76
CmdLen1=12
HexData1=false
ListenPort2=6908
CmdStart2=76
CmdLen2=12
HexData2=false

BIN
bin/nettool.exe Normal file

Binary file not shown.

59
bin/nettool.ini Normal file
View File

@ -0,0 +1,59 @@
[AppConfig]
CurrentIndex=0
[TcpClientConfig]
HexSendTcpClient=false
HexReceiveTcpClient=false
DebugTcpClient=false
AutoSendTcpClient=false
IntervalTcpClient=1000
TcpServerIP=127.0.0.1
TcpServerPort=6000
[TcpServerConfig]
HexSendTcpServer=false
HexReceiveTcpServer=false
DebugTcpServer=false
AutoSendTcpServer=false
IntervalTcpServer=1000
TcpListenIP=127.0.0.1
TcpListenPort=6000
SelectAllTcpServer=true
[UdpClientConfig]
HexSendUdpClient=false
HexReceiveUdpClient=false
DebugUdpClient=false
AutoSendUdpClient=false
IntervalUdpClient=1000
UdpServerIP=127.0.0.1
UdpServerPort=6000
[UdpServerConfig]
HexSendUdpServer=false
HexReceiveUdpServer=false
DebugUdpServer=false
AutoSendUdpServer=false
IntervalUdpServer=1000
UdpListenIP=127.0.0.1
UdpListenPort=6000
SelectAllUdpServer=false
[WebClientConfig]
HexSendWebClient=false
HexReceiveWebClient=false
DebugWebClient=false
AutoSendWebClient=false
IntervalWebClient=1000
WebServerIP=ws://127.0.0.1
WebServerPort=6000
[WebServerConfig]
HexSendWebServer=false
HexReceiveWebServer=false
DebugWebServer=false
AutoSendWebServer=false
IntervalWebServer=1000
WebListenIP=127.0.0.1
WebListenPort=6000
SelectAllWebServer=true

View File

@ -10,7 +10,6 @@ RC_FILE = other/main.rc
SOURCES += main.cpp
HEADERS += head.h
RESOURCES += other/main.qrc
CONFIG += warn_off
INCLUDEPATH += $$PWD
INCLUDEPATH += $$PWD/api
@ -24,11 +23,3 @@ include ($$PWD/../core_qui/core_qui.pri)
INCLUDEPATH += $$PWD/../3rd_qextserialport
include ($$PWD/../3rd_qextserialport/3rd_qextserialport.pri)
unix:!macx {
contains(arma7, DEFINES) {
INCLUDEPATH += /usr/local/openssl-1.0.2m-h3-gcc-4.9.2/include
LIBS += -L/usr/local/openssl-1.0.2m-h3-gcc-4.9.2/lib -lssl -lcrypto
LIBS += -L/usr/local/h3_rootfsv -lXdmcp
}}

View File

@ -1,3 +1,25 @@
#指定编译产生的文件分门别类放到对应目录
MOC_DIR = temp/moc
RCC_DIR = temp/rcc
UI_DIR = temp/ui
OBJECTS_DIR = temp/obj
#指定编译生成的可执行文件放到源码上一级目录下的bin目录
!android {
!wasm {
DESTDIR = $$PWD/../bin
}}
#把所有警告都关掉眼不见为净
CONFIG += warn_off
#开启大资源支持
CONFIG += resources_big
#开启后会将打印信息用控制台输出
#CONFIG += console
#引入全志H3芯片依赖
include ($$PWD/h3.pri)
HEADERS += \
$$PWD/iconhelper.h \
$$PWD/quiconfig.h \
@ -21,10 +43,5 @@ SOURCES += \
$$PWD/quitipbox.cpp \
$$PWD/quiwidget.cpp
!contains(DEFINES, no_qui_qm) {
RESOURCES += $$PWD/source/qm.qrc
}
!contains(DEFINES, no_qui_ttf) {
RESOURCES += $$PWD/source/ttf.qrc
}

6
core_qui/h3.pri Normal file
View File

@ -0,0 +1,6 @@
unix:!macx {
contains(DEFINES, arma7) {
INCLUDEPATH += /usr/local/openssl-1.0.2m-h3-gcc-4.9.2/include
LIBS += -L/usr/local/openssl-1.0.2m-h3-gcc-4.9.2/lib -lssl -lcrypto
LIBS += -L/usr/local/h3_rootfsv -lXdmcp
}}

View File

@ -57,20 +57,24 @@ int QUIHelper::deskHeight()
return getScreenRect().height();
}
QWidget *QUIHelper::centerBaseForm = 0;
void QUIHelper::setFormInCenter(QWidget *form)
{
int formWidth = form->width();
int formHeight = form->height();
QRect rect = getScreenRect();
//如果=0表示采用系统桌面屏幕为参照
QRect rect;
if (centerBaseForm == 0) {
rect = getScreenRect();
} else {
rect = centerBaseForm->geometry();
}
int deskWidth = rect.width();
int deskHeight = rect.height();
QPoint movePoint(deskWidth / 2 - formWidth / 2 + rect.x(), deskHeight / 2 - formHeight / 2);
QPoint movePoint(deskWidth / 2 - formWidth / 2 + rect.x(), deskHeight / 2 - formHeight / 2 + rect.y());
form->move(movePoint);
//其他系统自动最大化
#ifndef Q_OS_WIN
QTimer::singleShot(100, form, SLOT(showMaximized()));
#endif
}
QString QUIHelper::appName()
@ -319,8 +323,8 @@ void QUIHelper::setFramelessForm(QWidget *widgetMain, QWidget *widgetTitle,
widgetMain->setProperty("form", true);
widgetMain->setProperty("canMove", true);
//根据设定逐个追加属性
widgetMain->setWindowFlags(Qt::FramelessWindowHint | Qt::X11BypassWindowManagerHint);
//根据设定逐个追加属性 去掉了 Qt::X11BypassWindowManagerHint
widgetMain->setWindowFlags(Qt::FramelessWindowHint);
if (tool) {
widgetMain->setWindowFlags(widgetMain->windowFlags() | Qt::Tool);
}
@ -1206,8 +1210,8 @@ void QUIHelper::initTableView(QTableView *tableView, int rowHeight, bool headVis
tableView->horizontalHeader()->setStretchLastSection(stretchLast);
//行标题最小宽度尺寸
tableView->horizontalHeader()->setMinimumSectionSize(0);
//行标题最大高度
tableView->horizontalHeader()->setMaximumHeight(rowHeight);
//行标题最小高度,等同于和默认行高一致
tableView->horizontalHeader()->setFixedHeight(rowHeight);
//默认行高
tableView->verticalHeader()->setDefaultSectionSize(rowHeight);
//选中时一行整体选中

View File

@ -10,9 +10,13 @@ public:
static int getScreenIndex();
static QRect getScreenRect(bool available = true);
//获取桌面宽度高度+居中显示
//获取桌面宽度高度
static int deskWidth();
static int deskHeight();
//居中显示窗体
//定义标志位指定是以桌面为参照还是主程序界面为参照
static QWidget *centerBaseForm;
static void setFormInCenter(QWidget *form);
//程序文件名称+当前所在路径

View File

@ -228,6 +228,10 @@ void QUIInputBox::setParameter(const QString &title, int type, int closeSec,
} else if (type == 1) {
this->txtValue->setVisible(false);
this->cboxValue->addItems(defaultValue.split("|"));
//回显字符串作为默认的下拉选项
if (!placeholderText.isEmpty()) {
this->cboxValue->setCurrentIndex(this->cboxValue->findText(placeholderText));
}
}
}

View File

@ -4,7 +4,6 @@ QUIWidget::QUIWidget(QWidget *parent) : QDialog(parent)
{
this->initControl();
this->initForm();
QUIHelper::setFormInCenter(this);
}
QUIWidget::~QUIWidget()
@ -66,7 +65,7 @@ QPushButton *QUIWidget::getBtnMenuMax() const
return this->btnMenu_Max;
}
QPushButton *QUIWidget::getBtnMenuMClose() const
QPushButton *QUIWidget::getBtnMenuClose() const
{
return this->btnMenu_Close;
}
@ -396,6 +395,7 @@ void QUIWidget::setMainWidget(QWidget *mainWidget)
//自动设置大小
resize(mainWidget->width(), mainWidget->height() + this->widgetTitle->height());
this->mainWidget = mainWidget;
QUIHelper::setFormInCenter(this);
}
}

View File

@ -55,7 +55,7 @@ public:
QToolButton *getBtnMenu() const;
QPushButton *getBtnMenuMin() const;
QPushButton *getBtnMenuMax() const;
QPushButton *getBtnMenuMClose() const;
QPushButton *getBtnMenuClose() const;
QString getTitle() const;
Qt::Alignment getAlignment() const;

View File

@ -10,7 +10,6 @@ RC_FILE = other/main.rc
SOURCES += main.cpp
HEADERS += head.h
RESOURCES += other/main.qrc
CONFIG += warn_off
INCLUDEPATH += $$PWD
INCLUDEPATH += $$PWD/api

View File

@ -22,7 +22,6 @@ DESTDIR = $$PWD/../bin
SOURCES += main.cpp
HEADERS += head.h
RESOURCES += other/main.qrc
CONFIG += warn_off
INCLUDEPATH += $$PWD
INCLUDEPATH += $$PWD/api