mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 03:18:07 +00:00
26 lines
No EOL
591 B
C++
26 lines
No EOL
591 B
C++
#include "App.hpp"
|
|
|
|
#include <QCoreApplication>
|
|
|
|
|
|
App::App(QObject * parent) : QObject(parent) {
|
|
init();
|
|
}
|
|
|
|
|
|
void App::init() {
|
|
// Core
|
|
mCoreModel = QSharedPointer<CoreModel>::create("", this);
|
|
mCoreModel->start();
|
|
// QML
|
|
mEngine = new QQmlApplicationEngine(this);
|
|
mEngine->addImportPath(":/");
|
|
|
|
const QUrl url(u"qrc:/Linphone/view/qml/App/Main.qml"_qs);
|
|
QObject::connect(mEngine, &QQmlApplicationEngine::objectCreated,
|
|
this, [url](QObject *obj, const QUrl &objUrl) {
|
|
if (!obj && url == objUrl)
|
|
QCoreApplication::exit(-1);
|
|
}, Qt::QueuedConnection);
|
|
mEngine->load(url);
|
|
} |