qt_demoe/tool/comtool/main.cpp

34 lines
1.0 KiB
C++
Raw Permalink Normal View History

2019-09-29 03:06:55 +00:00
#include "frmcomtool.h"
2023-10-17 03:31:58 +00:00
#include "qthelper.h"
2019-09-29 03:06:55 +00:00
int main(int argc, char *argv[])
{
2022-01-13 03:27:55 +00:00
#if (QT_VERSION >= QT_VERSION_CHECK(5,0,0))
QApplication::setAttribute(Qt::AA_Use96Dpi);
#endif
2021-11-28 01:09:15 +00:00
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
QApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Floor);
#endif
2022-01-13 03:27:55 +00:00
2019-09-29 03:06:55 +00:00
QApplication a(argc, argv);
a.setWindowIcon(QIcon(":/main.ico"));
//设置编码以及加载中文翻译文件
2023-10-17 03:31:58 +00:00
QtHelper::initAll();
2021-11-17 07:33:19 +00:00
//读取配置文件
2023-10-17 03:31:58 +00:00
AppConfig::ConfigFile = QString("%1/%2.ini").arg(QtHelper::appPath()).arg(QtHelper::appName());
2021-04-13 01:36:22 +00:00
AppConfig::readConfig();
AppData::Intervals << "1" << "10" << "20" << "50" << "100" << "200" << "300" << "500" << "1000" << "1500" << "2000" << "3000" << "5000" << "10000";
AppData::readSendData();
AppData::readDeviceData();
2019-09-29 03:06:55 +00:00
frmComTool w;
2023-10-17 03:31:58 +00:00
w.setWindowTitle("串口调试助手 V2023 (QQ: 517216493 WX: feiyangqingyun)");
2021-11-17 07:33:19 +00:00
w.resize(900, 650);
2023-10-17 03:31:58 +00:00
QtHelper::setFormInCenter(&w);
2019-09-29 03:06:55 +00:00
w.show();
return a.exec();
}