-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
42 lines (36 loc) · 1.16 KB
/
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
42
#include <QtGui/QApplication>
#include <QDeclarativeContext>
#include <QGraphicsObject>
#include "qmlapplicationviewer.h"
#include "authorizer.h"
#include "settings.h"
#include "linkedinapi.h"
#include "user.h"
#include "notifier.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
/*classes designed for use in qml*/
Authorizer auth;
Settings settings;
LinkedInAPI api;
User user;
Notifier notifier;
QmlApplicationViewer viewer;
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
viewer.rootContext()->setContextProperty("OAuth", &auth);
viewer.rootContext()->setContextProperty("Settings", &settings);
viewer.rootContext()->setContextProperty("API", &api);
viewer.rootContext()->setContextProperty("User", &user);
viewer.rootContext()->setContextProperty("Notifier", ¬ifier);
viewer.setMainQmlFile(QLatin1String("qml/linkedup/main.qml"));
QObject *rootObject = dynamic_cast<QObject*>(viewer.rootObject());
QObject::connect(&auth, SIGNAL(authorized()), rootObject, SIGNAL(authorized()));
#ifdef Q_WS_MAEMO_5
viewer.showFullScreen();
// viewer.showExpanded();
#else
viewer.showExpanded();
#endif
return app.exec();
}