forked from Venji10/fmradio-volla
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
41 lines (32 loc) · 930 Bytes
/
main.cpp
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <QGuiApplication>
#include <QCoreApplication>
#include <QUrl>
#include <QString>
#include <QQuickView>
#include <QQmlEngine>
class FMRadioApplication : public QGuiApplication {
public:
FMRadioApplication(int &argc, char **argv);
virtual ~FMRadioApplication() override;
private:
QQuickView *m_view;
};
FMRadioApplication::FMRadioApplication(int &argc, char **argv)
: QGuiApplication(argc, argv), m_view(nullptr) {
auto *view = new QQuickView();
QObject::connect(view->engine(), SIGNAL(quit()), SLOT(quit()));
view->setSource(QUrl("qrc:/Main.qml"));
view->setResizeMode(QQuickView::SizeRootObjectToView);
view->show();
}
FMRadioApplication::~FMRadioApplication() {
delete m_view;
}
int main(int argc, char** argv)
{
FMRadioApplication application(argc, argv);
QGuiApplication::setApplicationName("FM Radio");
qDebug() << "Starting app from main.cpp";
int ret = QGuiApplication::exec();
return ret;
}