代码拉取完成,页面将自动刷新
#include "mainwindow.h"
#include <QApplication>
#include <QLocale>
#include <QTranslator>
#include <QSysInfo>
#include "define.h"
#include <qt_windows.h>
int main(int argc, char *argv[])
{
qDebug()<<QSysInfo::kernelType()<<QSysInfo::kernelVersion()<<QSysInfo::buildAbi()<<QSysInfo::machineUniqueId()<<QSysInfo::productType()<<QSysInfo::productVersion();
qDebug()<<QSysInfo::productType()<<QSysInfo::productVersion();//"windows" "11"
//禁止缩放(
//QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::Floor);
//高分适配
//QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
//qputenv("QT_ENABLE_HIGHDPI_SCALING", "1");
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
QApplication a(argc, argv);
QTranslator translator;
const QStringList uiLanguages = QLocale::system().uiLanguages();
for (const QString &locale : uiLanguages) {
const QString baseName = "dtUpdateV2_" + QLocale(locale).name();
if (translator.load(":/i18n/" + baseName)) {
a.installTranslator(&translator);
break;
}
}
QString tem="";
for(int i = 1; i< argc;++i)
{
//qDebug()<<i<<argv[i];
if(i<2)
{
tem =QString::fromLocal8Bit(argv[i]);
}else{
tem = tem+" "+QString::fromLocal8Bit(argv[i]);
}
}
if(tem.indexOf("?")>0)//唉
{
qDebug()<<"宽字符传参";
LPWSTR s=GetCommandLineW();
LPWSTR *cmdLineAry=CommandLineToArgvW(s,&argc);
for(int i = 1; i< argc;++i)
{
if(i<2)
{
tem =QString::fromStdWString(cmdLineAry[i]);
}else{
tem = tem+" "+QString::fromStdWString(cmdLineAry[i]);
}
}
}
qDebug().noquote()<<"传参路径:"<<tem;
MainWindow w;
w.setWorkPath(tem);
w.setWindowTitle(mainWindowTitle);
w.show();
return a.exec();
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。