-
Notifications
You must be signed in to change notification settings - Fork 0
/
qcmainform.cpp
51 lines (47 loc) · 1.97 KB
/
qcmainform.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
42
43
44
45
46
47
48
49
50
51
#include "qcmainform.h"
QCMainForm::QCMainForm(QObject *parent) : QQmlApplicationEngine(parent) {
this->rootContext()->setContextProperty("QCMainForm", this);
this->load(QUrl(QStringLiteral("qrc:///Qml/main.qml")));
qInfo() << "QCMainForm::QCMainForm()1";
qInfo() << "QCMainForm::QCMainForm()2";
qInfo() << "QCMainForm::QCMainForm()3";
qInfo() << "QCMainForm::QCMainForm()4";
qInfo() << "QCMainForm::QCMainForm()5";
qInfo() << "QCMainForm::QCMainForm()6";
}
QCMainForm::~QCMainForm() {
qInfo() << "QCMainForm::~QCMainForm()1";
qInfo() << "QCMainForm::~QCMainForm()2";
qInfo() << "QCMainForm::~QCMainForm()3";
qInfo() << "QCMainForm::~QCMainForm()4";
qInfo() << "QCMainForm::~QCMainForm()5";
qInfo() << "QCMainForm::~QCMainForm()6";
}
void QCMainForm::serviceStart() {
qInfo() << "QCMainForm::serviceStart()1";
qInfo() << "QCMainForm::serviceStart()2";
qInfo() << "QCMainForm::serviceStart()3";
qInfo() << "QCMainForm::serviceStart()4";
qInfo() << "QCMainForm::serviceStart()5";
qInfo() << "QCMainForm::serviceStart()6";
#ifdef Q_OS_LINUX
#if defined(Q_OS_ANDROID)
QAndroidJniObject::callStaticMethod<void>("it.denisgottardello.qtandroidserviceexternallib.QtAndroidService", "serviceStart", "(Landroid/content/Context;)V", QtAndroid::androidActivity().object());
#else
#endif
#endif
}
void QCMainForm::serviceStop() {
qInfo() << "QCMainForm::serviceStop()1";
qInfo() << "QCMainForm::serviceStop()2";
qInfo() << "QCMainForm::serviceStop()3";
qInfo() << "QCMainForm::serviceStop()4";
qInfo() << "QCMainForm::serviceStop()5";
qInfo() << "QCMainForm::serviceStop()6";
#ifdef Q_OS_LINUX
#if defined(Q_OS_ANDROID)
QAndroidJniObject::callStaticMethod<void>("it.denisgottardello.qtandroidserviceexternallib.QtAndroidService", "serviceStop", "(Landroid/content/Context;)V", QtAndroid::androidActivity().object());
#else
#endif
#endif
}