#include "ui_widget/widget.h"#include <QApplication>#include <QDebug>#include "log/TSpdlog.h"#include "helper/DirHelper.h"#include <QQmlApplicationEngine>#define USE_QML#include "Application.h"int main(int argc, char *argv[]){if (!Application::init()) {return -1;}if (Application::setSingleApp("QtApp.lock")) {return -1;}Application app(argc, argv);qDebug() << DirHelper::getInstance()->getCurrentDirPath();if (!app.addTranslation()) {TSpdlog::getInstance()->otherError("translator error");}// int a = 0;// qDebug() << 1/a;#ifdef USE_QML/* 如果不使用qml则移除pro文件、头文件等,这样可以减少dll依赖 */QQmlApplicationEngine engine;const QUrl url(QStringLiteral("qrc:/qml/main.qml"));QObject::connect(&engine, &QQmlApplicationEngine::objectCreated,&app, [url](QObject *obj, const QUrl &objUrl) {if (!obj && url == objUrl)QCoreApplication::exit(-1);}, Qt::QueuedConnection);engine.load(url);#endifWidget w;w.show();return app.exec();}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。