forked from linux4sam/application-launcher
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
77 lines (66 loc) · 2.06 KB
/
main.cpp
File metadata and controls
77 lines (66 loc) · 2.06 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
* Copyright (C) 2013-2015 Atmel Corporation.
*
* This file is licensed under the terms of the Atmel LIMITED License Agreement
* as written in the COPYING file that is delivered in the project root directory.
*
* DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
* See the COPYING license file for more details.
*
* Software Author: Timesys Corporation (www.timesys.com)
*/
#include <QtGlobal>
#if (QT_VERSION >= 0x050000)
#include <QApplication>
#else
#include <QtGui/QApplication>
#endif // (QT_VERSION >= 0x050000)
#include <QtDeclarative/qdeclarative.h>
#include <QDeclarativeContext>
#include "qmlapplicationviewer.h"
#include "process.h"
#include "xmlfileprocessor.h"
bool wqvga;
Q_DECL_EXPORT int main(int argc, char *argv[])
{
QString current;
QString currentName;
QString currentVal;
int idxOf=0;
wqvga = false;
/* Parse command line arguments */
for(int i=0; i<argc; i++)
{
current = argv[i];
idxOf = current.indexOf("=");
if(idxOf == -1)
{
currentName = current;
currentVal = QString();
}else{
currentName = current.left(idxOf);
currentVal = current.mid(idxOf+1);
}
if(currentName.count())
{
if(currentName.contains(QString("WQVGA")))
{
wqvga = true;
}
}
}
QScopedPointer<QApplication> app(createApplication(argc, argv));
// When we final release, we can write this file manually
//XMLFileProcessor fProcessor;
//fProcessor.processFiles();
qmlRegisterType<Process>("QtAppProcess", 0, 1, "Process");
QmlApplicationViewer viewer;
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto);
QDeclarativeContext *ctxt = viewer.rootContext();
ctxt->setContextProperty("wqvga", wqvga);
viewer.setMainQmlFile(QLatin1String("qml/ApplicationLauncher/main.qml"));
viewer.showFullScreen();
// viewer.show();
qApp->setOverrideCursor( QCursor( Qt::BlankCursor ) );
return app->exec();
}