1 Star 0 Fork 1

AmumuI/swupdate_progress

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
main.cpp 805 Bytes
一键复制 编辑 原始数据 按行查看 历史
xiefu 提交于 2024-09-05 11:20 +08:00 . first commit.
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include "swupdate.h"
#include <QQmlContext>
#include <QLockFile>
#include <QDebug>
#include <QDir>
int main(int argc, char *argv[])
{
QString tempPath = QDir::temp().absoluteFilePath("Swupdate_progress.lock");
QLockFile lockfile_(tempPath);
if(!lockfile_.tryLock(0)){
qDebug()<<"This program has been runing,please check it.";
return 1;
}
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QGuiApplication app(argc, argv);
SWUpdate swupdate;
QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty("Swupdate",&swupdate);
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
if (engine.rootObjects().isEmpty())
return -1;
return app.exec();
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/AmumuL/swupdate_progress.git
git@gitee.com:AmumuL/swupdate_progress.git
AmumuL
swupdate_progress
swupdate_progress
master

搜索帮助