1 Star 0 Fork 0

dodofung/DemoCloudMusicPlayer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
main.cpp 1.21 KB
一键复制 编辑 原始数据 按行查看 历史
dodofung 提交于 2024-12-11 23:48 . playNext/prev
#include <QGuiApplication>
#include <QQmlApplicationEngine>
#include <QIcon>
#include <QQuickStyle>
#include "HttpApiUtils.h"
int main(int argc, char *argv[])
{
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
qDebug()<<"QSslSocket="<<QSslSocket::sslLibraryBuildVersionString();
qDebug() << "OpenSSL支持情况:" << QSslSocket::supportsSsl();
qmlRegisterType<HttpApiUtils>("HttpApi",1,0,"HttpApiUtils");
// QString styleName = (platform == "android")
// ? "Material"
// : (platform == "windows")
// ? "Universal"
// : "Fusion";
QQuickStyle::setStyle("Universal");
QGuiApplication app(argc, argv);
app.setWindowIcon(QIcon(":/images/music.png"));
QQmlApplicationEngine engine;
const QUrl url(QStringLiteral("qrc:/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);
return app.exec();
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/dodofung/demo-cloud-music-player.git
git@gitee.com:dodofung/demo-cloud-music-player.git
dodofung
demo-cloud-music-player
DemoCloudMusicPlayer
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385