-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
25 lines (20 loc) · 723 Bytes
/
Copy pathmain.cpp
File metadata and controls
25 lines (20 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <QGuiApplication>
#include <QIcon>
#include <QQmlApplicationEngine>
#include "SoundpadController.h"
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine;
app.setWindowIcon(QIcon(":/assets/icons/app.ico"));
SoundpadController *soundController = new SoundpadController(&app);
qmlRegisterSingletonInstance("com.company.SoundpadController", 1, 0, "SoundpadController", soundController);
QObject::connect(
&engine,
&QQmlApplicationEngine::objectCreationFailed,
&app,
[]() { QCoreApplication::exit(-1); },
Qt::QueuedConnection);
engine.loadFromModule("CustomSoundpad", "Main");
return app.exec();
}