Commit 03a772a7 authored by Andrew Flegg's avatar Andrew Flegg

First version of SAS check-in app

parents
SAS.pro.user
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Name=SAS
Exec=/opt/SAS/bin/SAS
Icon=SAS64
X-Window-Icon=
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
# Add more folders to ship with the application, here
folder_01.source = qml/SAS
folder_01.target = qml
DEPLOYMENTFOLDERS = folder_01
# Additional import path used to resolve QML modules in Creator's code model
QML_IMPORT_PATH =
symbian:TARGET.UID3 = 0xE7C3F98E
# Allow network access on Symbian
symbian:TARGET.CAPABILITY += NetworkServices
# The .cpp file which was generated for your project. Feel free to hack it.
SOURCES += main.cpp
# Please do not modify the following two lines. Required for deployment.
include(qmlapplicationviewer/qmlapplicationviewer.pri)
qtcAddDeployment()
OTHER_FILES += \
qtc_packaging/debian_harmattan/rules \
qtc_packaging/debian_harmattan/README \
qtc_packaging/debian_harmattan/manifest.aegis \
qtc_packaging/debian_harmattan/copyright \
qtc_packaging/debian_harmattan/control \
qtc_packaging/debian_harmattan/compat \
qtc_packaging/debian_harmattan/changelog
HEADERS += \
applicationdata.h
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" height="80" width="80">
<defs>
<linearGradient id="hicg_overlay_grad" gradientUnits="userSpaceOnUse" x1="39.9995" y1="5.1816" x2="39.9995" y2="58.8019">
<stop offset="0" style="stop-color:#FFFFFF"/>
<stop offset="1" style="stop-color:#000000"/>
</linearGradient>
<filter id="hicg_drop_shadow">
<feOffset in="SourceAlpha" dx="0" dy="4"/>
<feGaussianBlur stdDeviation="4"/>
<feColorMatrix type="matrix" values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.5 0" result="shadow"/>
<feBlend in="SourceGraphic" in2="shadow" mode="normal"/>
</filter>
</defs>
<g>
<path id="hicg_background" fill="#143376" d="M79,40c0,28.893-10.105,39-39,39S1,68.893,1,40C1,11.106,11.105,1,40,1S79,11.106,79,40z"/>
<path id="hicg_highlight" fill="#fff" opacity="0.25" d="M39.999,1C11.105,1,1,11.106,1,40c0,28.893,10.105,39,38.999,39 C68.896,79,79,68.893,79,40C79,11.106,68.896,1,39.999,1z M39.999,78.025C11.57,78.025,1.976,68.43,1.976,40 c0-28.429,9.595-38.024,38.023-38.024c28.43,0,38.024,9.596,38.024,38.024C78.023,68.43,68.429,78.025,39.999,78.025z"/>
<path id="hicg_overlay" opacity="0.4" fill="url(#hicg_overlay_grad)" d="M78.977,40c0,28.893-10.1,39-38.977,39S1.023,68.893,1.023,40c0-28.894,10.1-39,38.977-39S78.977,11.106,78.977,40z"/>
</g>
<g xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" transform="translate(13, 30.1) scale(0.25714285714286)" filter="url(#hicg_drop_shadow)"><metadata xmlns="http://www.w3.org/2000/svg" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" id="metadata35"><rdf:RDF><cc:Work rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/><dc:title/></cc:Work></rdf:RDF></metadata><defs xmlns="http://www.w3.org/2000/svg" id="defs33"/><sodipodi:namedview xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="640" inkscape:window-height="480" id="namedview31" showgrid="false" showguides="true" inkscape:guide-bbox="true" inkscape:zoom="0.78666667" inkscape:cx="106.07434" inkscape:cy="42.156852" inkscape:window-x="7" inkscape:window-y="24" inkscape:window-maximized="0" inkscape:current-layer="Layer_1" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0"><sodipodi:guide orientation="0.70710678,0.70710678" position="-192.146,-147.24993" id="guide3012"/></sodipodi:namedview>
<path xmlns="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" style="fill:#ffffff;fill-rule:evenodd" clip-rule="evenodd" d="M 102.02397,51.394704 H 85.58292 c 0,0 -0.10666,0.0287 -0.18049,-0.0697 -0.0574,-0.10255 0.0615,-0.25022 0.0615,-0.25022 l 21.85577,-28.03348 c 0,0 0.16408,-0.2174 0.34047,-0.2174 0.17229,0 0.11076,0.24202 0.11076,0.24202 l -5.48036,28.10731 c 0,0 -0.0164,0.11896 -0.0697,0.17228 -0.0492,0.0492 -0.1969,0.0492 -0.1969,0.0492 M 137.81854,1.6244237 c -8.31077,0 -19.69809,0.008 -21.23226,0.008 -1.07474,0 -1.51366,0.61531 -1.51366,0.61531 L 56.56085,74.821364 c -0.34047,0.41841 -0.27074,0.84913 0.31996,0.84913 1.34137,0 6.74378,0 8.65944,0 0.86964,0 0.95578,-0.23792 1.11166,-0.45943 l 12.44975,-15.96932 c 0,0 0.1969,-0.29125 0.45533,-0.29125 0.2051,0 20.9082,-0.004 20.9082,-0.004 0,0 0.31586,-0.0164 0.26253,0.29535 -0.0697,0.31586 -3.05603,15.65756 -3.05603,15.65756 -0.041,0.2092 0.0205,0.77119 0.75067,0.77119 2.72787,0 22.38904,-0.008 25.26459,-0.008 0.36098,0 0.48814,-0.11896 0.55788,-0.47584 L 138.47897,2.3875137 c 0,0 0.25433,-0.76299 -0.66043,-0.76299" id="path531" inkscape:connector-curvature="0"/><path xmlns="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" style="fill:#ffffff;fill-rule:evenodd" clip-rule="evenodd" d="m 0.04677393,66.420544 c -0.209205,0.86144 0.262531,1.59981 1.83772197,2.89606 2.957585,2.43662 11.7359921,7.73648 25.6747941,7.73238 25.08819,-0.004 34.18656,-16.21954 31.00746,-29.96965 -0.85323,-3.67544 -5.55419,-22.68849 -6.23513,-25.37123 -1.97309,-7.78571 1.80901,-13.3932303 9.23784,-13.3973303 6.34999,-0.004 10.31668,2.4038103 13.78702,4.5820003 0.65223,0.41431 1.13217,0.63992 1.30446,-0.12306 0.10255,-0.43892 1.25113,-6.3581903 1.25113,-6.3581903 0,0 0.32816,-1.14858 -1.16499,-1.92797 -2.30536,-1.20601 -8.04824,-4.45484002 -20.14932,-4.46304002 -22.49979,-0.008 -32.0781,14.43104032 -28.15653,30.08860032 1.25113,5.00862 6.27205,23.76323 6.28846,27.37715 0.004,1.3906 0.73426,10.9607 -10.796624,10.9607 -10.710478,0 -18.0818781,-7.31397 -20.5718281,-9.84494 -0.410206,-0.42251 -0.959882,-0.1928 -1.21421,0.73427 -0.135368,0.47584 -2.10025397,7.08425 -2.10025397,7.08425" id="path533" inkscape:connector-curvature="0"/><path xmlns="http://www.w3.org/2000/svg" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" style="fill:#ffffff;fill-rule:evenodd" clip-rule="evenodd" d="m 133.10527,66.797934 c -0.2051,0.86554 0.27074,1.59981 1.83773,2.90016 2.96168,2.43662 11.04684,7.32628 24.98564,7.32217 25.0882,-0.004 34.18656,-16.21954 30.99926,-29.96964 -0.84502,-3.67134 -5.55008,-22.68849 -6.22692,-25.36714 -1.97309,-7.78571 1.80901,-13.3932203 9.23373,-13.3973203 6.35409,-0.004 10.32078,2.4038003 13.78702,4.5820003 0.65633,0.41431 1.13628,0.63582 1.30856,-0.12306 0.0985,-0.44303 1.23882,-6.3582003 1.23882,-6.3582003 0,0 0.34458,-1.14447 -1.15267,-1.92796 C 206.81108,3.2529337 201.06409,0.00410368 188.97122,3.6837121e-6 166.47143,-0.01229632 156.89312,14.431044 160.81058,30.084504 c 1.25113,5.01272 6.26795,23.76323 6.28846,27.38125 0.004,1.38649 0.73837,10.9525 -10.79662,10.9525 -10.71458,0.008 -17.78243,-7.05144 -20.28468,-9.5619 -0.56199,-0.55378 -1.3906,-0.34458 -1.50546,0.45943 -0.0697,0.48404 -1.40701,7.48215 -1.40701,7.48215" id="path535" inkscape:connector-curvature="0"/>
</g></svg>
SAS64.png

3.54 KB

SAS80.png

4.43 KB

[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Name=SAS
Exec=/usr/bin/invoker --type=e -s /opt/SAS/bin/SAS
Categories=Utility;
Icon=/usr/share/icons/hicolor/80x80/apps/SAS80.png
X-Window-Icon=
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
#ifndef APPLICATIONDATA_H
#define APPLICATIONDATA_H
#include <QSettings>
class ApplicationData : public QObject
{
Q_OBJECT
Q_PROPERTY(QString lastName READ lastName WRITE setLastName NOTIFY lastNameChanged)
Q_PROPERTY(int cardTypeIndex READ cardTypeIndex WRITE setCardTypeIndex NOTIFY cardTypeIndexChanged)
Q_PROPERTY(QString cardNumber READ cardNumber WRITE setCardNumber NOTIFY cardNumberChanged)
public:
void initialize() {
QSettings settings("jaffa","SAS");
_lastName = settings.value("general/lastName", "").toString();
_cardTypeIndex = settings.value("general/cardTypeIndex", 0).toInt();
_cardNumber = settings.value("general/cardNumber", "").toString();
}
QString lastName() {
return _lastName;
}
int cardTypeIndex() {
return _cardTypeIndex;
}
QString cardNumber() {
return _cardNumber;
}
void setLastName(const QString name) {
if (name != _lastName) {
QSettings settings("jaffa","SAS");
_lastName = name;
settings.setValue("general/lastName", name);
emit lastNameChanged();
}
}
void setCardTypeIndex(const int index) {
if (index != _cardTypeIndex) {
QSettings settings("jaffa","SAS");
_cardTypeIndex = index;
settings.setValue("general/cardTypeIndex", index);
emit cardTypeIndexChanged();
}
}
void setCardNumber(const QString number) {
if (number != _cardNumber) {
QSettings settings("jaffa","SAS");
_cardNumber = number;
settings.setValue("general/cardNumber", number);
emit cardNumberChanged();
}
}
signals:
void lastNameChanged();
void cardTypeIndexChanged();
void cardNumberChanged();
private:
QString _lastName;
int _cardTypeIndex;
QString _cardNumber;
};
#endif //APPLICATIONDATA_H
#include <QtGui/QApplication>
#include "qmlapplicationviewer.h"
#include "applicationdata.h"
#include <QSettings>
#include <QtDeclarative>
Q_DECL_EXPORT int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QmlApplicationViewer viewer; // = QmlApplicationViewer::create();
ApplicationData appData;
appData.initialize();
viewer.setOrientation(QmlApplicationViewer::ScreenOrientationLockPortrait);
viewer.rootContext()->setContextProperty("appData", &appData);
viewer.setMainQmlFile(QLatin1String("qml/SAS/main.qml"));
viewer.showExpanded();
return app.exec();
}
import QtQuick 1.0
import QtWebKit 1.0
/**
* The browser instance which controls the SAS check-in application.
*
* @author Copyright (c) Andrew Flegg 2012. Released under the Artistic Licence.
*/
WebView {
id: webView
transformOrigin: Item.TopLeft
preferredWidth: 240
preferredHeight: parent.height
anchors.fill: parent
scale: parent.width / preferredWidth
smooth: true
property bool autoSubmitted: false
Component.onCompleted: restart()
/**
* Reset the browser and reload the homepage.
*/
function restart() {
webView.stop.trigger()
webView.url = "https://ci.sas.mobi/ci/"
}
/**
* When a page is finished loading, register appropriate handlers.
*/
onLoadFinished: {
console.log("+++ Page [" + url + "] loaded")
evaluateJavaScript("window.qmlbridge.loginPage = document.getElementById('frmCheckin') != null")
evaluateJavaScript("window.qmlbridge.errorMessage = document.getElementById('myError_lblErrorMessage').innerHTML")
if (bridge.loginPage) {
evaluateJavaScript("document.getElementById('rbCheckInPnr').disabled = true")
if (bridge.lastName && bridge.cardTypeIndex && bridge.cardNumber) {
console.log("Populating pre-saved information")
evaluateJavaScript("document.frmCheckin.txtDefaultLastName.value = window.qmlbridge.lastName")
evaluateJavaScript("document.frmCheckin.ddCardTypes.selectedIndex = window.qmlbridge.cardTypeIndex")
evaluateJavaScript("document.frmCheckin.txtSearchCriteria.value = window.qmlbridge.cardNumber")
if (!bridge.errorMessage && !autoSubmitted) {
console.log("Auto-submitting")
evaluateJavaScript("document.frmCheckin.btnContinue.click()")
autoSubmitted = true
return;
}
}
if (autoSubmitted) console.log("Something went wrong...")
console.log("Registering handler to capture details")
evaluateJavaScript("document.getElementById('frmCheckin').onsubmit = window.qmlbridge.onSubmit");
autoSubmitted = false
}
if (bridge.errorMessage) console.log("Error [" + bridge.errorMessage + "]")
bridge.errorMessage = ""
}
onAlert: console.log("JS alert: " + message)
javaScriptWindowObjects: QtObject {
id: bridge
WebView.windowObjectName: "qmlbridge"
property bool loginPage
property string errorMessage
property string lastName: appData.lastName
property int cardTypeIndex: appData.cardTypeIndex
property string cardNumber: appData.cardNumber
/* These don't work, for some reason, see QTBUG-23394 */
// property alias lastName: appData.lastName
// property alias cardTypeIndex: appData.cardTypeIndex
// property alias cardNumber: appData.cardNumber
/**
* Handle submission of the check-in form. This reads the values from
* the form fields, and updates this object.
*/
function onSubmit(event) {
// We need this for some race condition, see QTBUG-23392
webView.evaluateJavaScript("alert(document.frmCheckin.txtDefaultLastName.value)")
// Save off the values
webView.evaluateJavaScript("window.qmlbridge.lastName = document.frmCheckin.txtDefaultLastName.value")
webView.evaluateJavaScript("window.qmlbridge.cardTypeIndex = document.frmCheckin.ddCardTypes.selectedIndex")
webView.evaluateJavaScript("window.qmlbridge.cardNumber = document.frmCheckin.txtSearchCriteria.value")
console.log("Captured - name = [" + lastName + "], card type = [" + cardTypeIndex + "], card number = [" + cardNumber + "]")
webView.updateSettings()
}
}
/**
* Clear saved values and restart.
*/
function clear() {
bridge.lastName = ''
bridge.cardTypeIndex = 0
bridge.cardNumber = ''
updateSettings()
restart()
}
/**
* Copy settings to/from the Bridge and settings.
*/
function updateSettings() {
// Update saved values
appData.lastName = bridge.lastName
appData.cardTypeIndex = bridge.cardTypeIndex
appData.cardNumber = bridge.cardNumber
}
}
import QtQuick 1.1
import com.nokia.meego 1.0
/**
* Harmattan view which provides control facilities for
* SAS Check-In application. This embeds {@link SASCI}, an about
* screen and a busy indicator.
*
* @author Copyright (c) Andrew Flegg 2012. Released under the Artistic Licence.
*/
PageStackWindow {
id: appWindow
showStatusBar: true
initialPage: mainPage
Page {
id: mainPage
tools: commonTools
orientationLock: PageOrientation.LockPortrait
SASCI {
id: webView
}
}
ToolBarLayout {
id: commonTools
visible: true
BusyIndicator {
id: busy
running: false
visible: false
Connections {
target: webView
onLoadStarted: {
busy.running = true
busy.visible = true
}
onLoadFinished: {
busy.running = false
busy.visible = false
}
onLoadFailed: busy.running = false
}
}
ToolIcon {
platformIconId: "toolbar-view-menu"
anchors.right: (parent === undefined) ? undefined : parent.right
onClicked: (menu.status == DialogStatus.Closed) ? menu.open() : menu.close()
}
}
Menu {
id: menu
visualParent: pageStack
MenuLayout {
MenuItem {
text: qsTr("Clear saved data")
onClicked: webView.clear()
// enabled: (about.status == DialogStatus.Closed)
}
MenuItem {
text: qsTr("About");
// onClicked: (about.status == DialogStatus.Closed) ? about.open() : about.close()
}
}
}
/*QueryDialog {
id: about
visualParent: mainPage
titleText: "SAS Check-in"
message: "Quick check-in for SAS flights<br><br>" +
"<small>Copyright &copy; Jaffa Software 2012<br>" +
"Released under the Artistic Licence<br></small><br>" +
"http://www.jaffasoft.co.uk/m/"
acceptButtonText: qsTr("Close")
}*/
}
// checksum 0x78c version 0x60010
/*
This file was generated by the Qt Quick Application wizard of Qt Creator.
QmlApplicationViewer is a convenience class containing mobile device specific
code such as screen orientation handling. Also QML paths and debugging are
handled here.
It is recommended not to modify this file, since newer versions of Qt Creator
may offer an updated version of it.
*/
#include "qmlapplicationviewer.h"
#include <QtCore/QDir>
#include <QtCore/QFileInfo>
#include <QtDeclarative/QDeclarativeComponent>
#include <QtDeclarative/QDeclarativeEngine>
#include <QtDeclarative/QDeclarativeContext>
#include <QtGui/QApplication>
#include <qplatformdefs.h> // MEEGO_EDITION_HARMATTAN
#ifdef HARMATTAN_BOOSTER
#include <MDeclarativeCache>
#endif
#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
#include <qt_private/qdeclarativedebughelper_p.h>
#if !defined(NO_JSDEBUGGER)
#include <jsdebuggeragent.h>
#endif
#if !defined(NO_QMLOBSERVER)
#include <qdeclarativeviewobserver.h>
#endif
// Enable debugging before any QDeclarativeEngine is created
struct QmlJsDebuggingEnabler
{
QmlJsDebuggingEnabler()
{
QDeclarativeDebugHelper::enableDebugging();
}
};
// Execute code in constructor before first QDeclarativeEngine is instantiated
static QmlJsDebuggingEnabler enableDebuggingHelper;
#endif // QMLJSDEBUGGER
class QmlApplicationViewerPrivate
{
QmlApplicationViewerPrivate(QDeclarativeView *view_) : view(view_) {}
QString mainQmlFile;
QDeclarativeView *view;
friend class QmlApplicationViewer;
QString adjustPath(const QString &path);
};
QString QmlApplicationViewerPrivate::adjustPath(const QString &path)
{
#ifdef Q_OS_UNIX
#ifdef Q_OS_MAC
if (!QDir::isAbsolutePath(path))
return QCoreApplication::applicationDirPath()
+ QLatin1String("/../Resources/") + path;
#else
QString pathInInstallDir;
const QString applicationDirPath = QCoreApplication::applicationDirPath();
pathInInstallDir = QString::fromAscii("%1/../%2").arg(applicationDirPath, path);
if (QFileInfo(pathInInstallDir).exists())
return pathInInstallDir;
#endif
#endif
return path;
}
QmlApplicationViewer::QmlApplicationViewer(QWidget *parent)
: QDeclarativeView(parent)
, d(new QmlApplicationViewerPrivate(this))
{
connect(engine(), SIGNAL(quit()), SLOT(close()));
setResizeMode(QDeclarativeView::SizeRootObjectToView);
// Qt versions prior to 4.8.0 don't have QML/JS debugging services built in
#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
#if !defined(NO_JSDEBUGGER)
new QmlJSDebugger::JSDebuggerAgent(d->view->engine());
#endif
#if !defined(NO_QMLOBSERVER)
new QmlJSDebugger::QDeclarativeViewObserver(d->view, d->view);
#endif
#endif
}
QmlApplicationViewer::QmlApplicationViewer(QDeclarativeView *view, QWidget *parent)
: QDeclarativeView(parent)
, d(new QmlApplicationViewerPrivate(view))
{
connect(view->engine(), SIGNAL(quit()), view, SLOT(close()));
view->setResizeMode(QDeclarativeView::SizeRootObjectToView);
// Qt versions prior to 4.8.0 don't have QML/JS debugging services built in
#if defined(QMLJSDEBUGGER) && QT_VERSION < 0x040800
#if !defined(NO_JSDEBUGGER)
new QmlJSDebugger::JSDebuggerAgent(d->view->engine());
#endif
#if !defined(NO_QMLOBSERVER)
new QmlJSDebugger::QDeclarativeViewObserver(d->view, d->view);
#endif
#endif
}
QmlApplicationViewer::~QmlApplicationViewer()
{
delete d;
}
QmlApplicationViewer *QmlApplicationViewer::create()
{
#ifdef HARMATTAN_BOOSTER
return new QmlApplicationViewer(MDeclarativeCache::qDeclarativeView(), 0);
#else
return new QmlApplicationViewer();
#endif
}
void QmlApplicationViewer::setMainQmlFile(const QString &file)
{
d->mainQmlFile = d->adjustPath(file);
d->view->setSource(QUrl::fromLocalFile(d->mainQmlFile));
}
void QmlApplicationViewer::addImportPath(const QString &path)
{
d->view->engine()->addImportPath(d->adjustPath(path));
}
void QmlApplicationViewer::setOrientation(ScreenOrientation orientation)
{
#if defined(Q_OS_SYMBIAN)
// If the version of Qt on the device is < 4.7.2, that attribute won't work
if (orientation != ScreenOrientationAuto) {
const QStringList v = QString::fromAscii(qVersion()).split(QLatin1Char('.'));
if (v.count() == 3 && (v.at(0).toInt() << 16 | v.at(1).toInt() << 8 | v.at(2).toInt()) < 0x040702) {
qWarning("Screen orientation locking only supported with Qt 4.7.2 and above");
return;
}
}
#endif // Q_OS_SYMBIAN
Qt::WidgetAttribute attribute;
switch (orientation) {
#if QT_VERSION < 0x040702
// Qt < 4.7.2 does not yet have the Qt::WA_*Orientation attributes
case ScreenOrientationLockPortrait:
attribute = static_cast<Qt::WidgetAttribute>(128);
break;
case ScreenOrientationLockLandscape:
attribute = static_cast<Qt::WidgetAttribute>(129);
break;
default:
case ScreenOrientationAuto:
attribute = static_cast<Qt::WidgetAttribute>(130);
break;
#else // QT_VERSION < 0x040702
case ScreenOrientationLockPortrait:
attribute = Qt::WA_LockPortraitOrientation;
break;
case ScreenOrientationLockLandscape:
attribute = Qt::WA_LockLandscapeOrientation;
break;
default:
case ScreenOrientationAuto:
attribute = Qt::WA_AutoOrientation;
break;
#endif // QT_VERSION < 0x040702
};
setAttribute(attribute, true);
}
void QmlApplicationViewer::showExpanded()
{
#if defined(Q_OS_SYMBIAN) || defined(MEEGO_EDITION_HARMATTAN) || defined(Q_WS_SIMULATOR)
d->view->showFullScreen();
#elif defined(Q_WS_MAEMO_5)
d->view->showMaximized();
#else
d->view->show();
#endif
}
QApplication *createApplication(int &argc, char **argv)
{
#ifdef HARMATTAN_BOOSTER
return MDeclarativeCache::qApplication(argc, argv);
#else
return new QApplication(argc, argv);
#endif
}
// checksum 0x82ed version 0x60010
/*
This file was generated by the Qt Quick Application wizard of Qt Creator.
QmlApplicationViewer is a convenience class containing mobile device specific
code such as screen orientation handling. Also QML paths and debugging are
handled here.
It is recommended not to modify this file, since newer versions of Qt Creator
may offer an updated version of it.
*/
#ifndef QMLAPPLICATIONVIEWER_H
#define QMLAPPLICATIONVIEWER_H
#include <QtDeclarative/QDeclarativeView>
class QmlApplicationViewer : public QDeclarativeView
{
Q_OBJECT
public:
enum ScreenOrientation {
ScreenOrientationLockPortrait,
ScreenOrientationLockLandscape,
ScreenOrientationAuto
};
explicit QmlApplicationViewer(QWidget *parent = 0);
virtual ~QmlApplicationViewer();
static QmlApplicationViewer *create();
void setMainQmlFile(const QString &file);
void addImportPath(const QString &path);
// Note that this will only have an effect on Symbian and Fremantle.
void setOrientation(ScreenOrientation orientation);
void showExpanded();
private:
explicit QmlApplicationViewer(QDeclarativeView *view, QWidget *parent);
class QmlApplicationViewerPrivate *d;
};
QApplication *createApplication(int &argc, char **argv);
#endif // QMLAPPLICATIONVIEWER_H
# checksum 0x368d version 0x60010
# This file was generated by the Qt Quick Application wizard of Qt Creator.
# The code below adds the QmlApplicationViewer to the project and handles the
# activation of QML debugging.
# It is recommended not to modify this file, since newer versions of Qt Creator
# may offer an updated version of it.
QT += declarative
SOURCES += $$PWD/qmlapplicationviewer.cpp
HEADERS += $$PWD/qmlapplicationviewer.h
INCLUDEPATH += $$PWD
# Include JS debugger library if QMLJSDEBUGGER_PATH is set
!isEmpty(QMLJSDEBUGGER_PATH) {
include($$QMLJSDEBUGGER_PATH/qmljsdebugger-lib.pri)
} else {
DEFINES -= QMLJSDEBUGGER
}
contains(CONFIG,qdeclarative-boostable):contains(MEEGO_EDITION,harmattan) {
DEFINES += HARMATTAN_BOOSTER
}
# This file was generated by an application wizard of Qt Creator.
# The code below handles deployment to Symbian and Maemo, aswell as copying
# of the application data to shadow build directories on desktop.
# It is recommended not to modify this file, since newer versions of Qt Creator
# may offer an updated version of it.
defineTest(qtcAddDeployment) {
for(deploymentfolder, DEPLOYMENTFOLDERS) {
item = item$${deploymentfolder}
itemsources = $${item}.sources
$$itemsources = $$eval($${deploymentfolder}.source)
itempath = $${item}.path
$$itempath= $$eval($${deploymentfolder}.target)
export($$itemsources)
export($$itempath)
DEPLOYMENT += $$item
}
MAINPROFILEPWD = $$PWD
symbian {
isEmpty(ICON):exists($${TARGET}.svg):ICON = $${TARGET}.svg
isEmpty(TARGET.EPOCHEAPSIZE):TARGET.EPOCHEAPSIZE = 0x20000 0x2000000
} else:win32 {
copyCommand =
for(deploymentfolder, DEPLOYMENTFOLDERS) {
source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)
source = $$replace(source, /, \\)
sourcePathSegments = $$split(source, \\)
target = $$OUT_PWD/$$eval($${deploymentfolder}.target)/$$last(sourcePathSegments)
target = $$replace(target, /, \\)
!isEqual(source,$$target) {
!isEmpty(copyCommand):copyCommand += &&
isEqual(QMAKE_DIR_SEP, \\) {
copyCommand += $(COPY_DIR) \"$$source\" \"$$target\"
} else {
source = $$replace(source, \\\\, /)
target = $$OUT_PWD/$$eval($${deploymentfolder}.target)
target = $$replace(target, \\\\, /)
copyCommand += test -d \"$$target\" || mkdir -p \"$$target\" && cp -r \"$$source\" \"$$target\"
}
}
}
!isEmpty(copyCommand) {
copyCommand = @echo Copying application data... && $$copyCommand
copydeploymentfolders.commands = $$copyCommand
first.depends = $(first) copydeploymentfolders
export(first.depends)
export(copydeploymentfolders.commands)
QMAKE_EXTRA_TARGETS += first copydeploymentfolders
}
} else:unix {
maemo5 {
desktopfile.files = $${TARGET}.desktop
desktopfile.path = /usr/share/applications/hildon
icon.files = $${TARGET}64.png
icon.path = /usr/share/icons/hicolor/64x64/apps
} else:!isEmpty(MEEGO_VERSION_MAJOR) {
desktopfile.files = $${TARGET}_harmattan.desktop
desktopfile.path = /usr/share/applications
icon.files = $${TARGET}80.png
icon.path = /usr/share/icons/hicolor/80x80/apps
} else { # Assumed to be a Desktop Unix
copyCommand =
for(deploymentfolder, DEPLOYMENTFOLDERS) {
source = $$MAINPROFILEPWD/$$eval($${deploymentfolder}.source)