Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
Merge pull request #11 from dkormalev/harmattan
Harmattan fixes
  • Loading branch information
dkormalev committed Feb 20, 2012
2 parents ac50804 + 16852a9 commit 345a8b2fd3d68f5758a0cae0cbfe01ba6af7061d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 16 deletions.
@@ -23,7 +23,7 @@ greaterThan(QT_MAJOR_VERSION, 4) {
qml/cordova_wrapper.js

QT += declarative
CONFIG += mobility
CONFIG += mobility qdeclarative-boostable
MOBILITY += feedback location systeminfo sensors
} else {
OTHER_FILES += qml/main.qml \
@@ -4,8 +4,8 @@ Version=1.0
Type=Application
Terminal=false
Name=cordova-qt
Exec=/usr/bin/single-instance /opt/cordova-qt/bin/cordova-qt
Icon=/usr/share/icons/hicolor/80x80/apps/cordova-qt80.png
Exec=/usr/bin/invoker --type=d -s /opt/cordovaqt/bin/cordovaqt
Icon=/usr/share/icons/hicolor/80x80/apps/cordovaqt80.png
X-Window-Icon=
X-HildonDesk-ShowInToolbar=true
X-Osso-Type=application/x-executable
@@ -29,27 +29,45 @@
#include <QDeclarativeEngine>
#include <qplatformdefs.h>

#ifdef MEEGO_EDITION_HARMATTAN
# include <MDeclarativeCache>
#endif

#ifdef MEEGO_EDITION_HARMATTAN
Q_DECL_EXPORT int main(int argc, char *argv[])
#else
int main(int argc, char *argv[])
#endif
{
QApplication app(argc, argv);

#if QT_VERSION < 0x050000
QDeclarativeView view;
view.setResizeMode(QDeclarativeView::SizeRootObjectToView);
view.rootContext()->setContextProperty("cordova", Cordova::instance());
#ifdef MEEGO_EDITION_HARMATTAN
view.setSource(QUrl(QString("%1/qml/main_harmattan.qml").arg(Cordova::instance()->workingDir())));
QScopedPointer<QApplication> app(MDeclarativeCache::qApplication(argc, argv));
#else
view.setSource(QUrl(QString("%1/qml/main.qml").arg(Cordova::instance()->workingDir())));
QScopedPointer<QApplication> app(new QApplication(argc, argv));
#endif
view.show();
#else

#if QT_VERSION < 0x050000
# ifdef MEEGO_EDITION_HARMATTAN
QScopedPointer<QDeclarativeView> view(MDeclarativeCache::qDeclarativeView());
# else
QScopedPointer<QDeclarativeView> view(new QDeclarativeView());
# endif
view->setResizeMode(QDeclarativeView::SizeRootObjectToView);
view->rootContext()->setContextProperty("cordova", Cordova::instance());
# ifdef MEEGO_EDITION_HARMATTAN
view->setSource(QUrl(QString("%1/qml/main_harmattan.qml").arg(Cordova::instance()->workingDir())));
view->showFullScreen();
# else
view->setSource(QUrl(QString("%1/qml/main.qml").arg(Cordova::instance()->workingDir())));
view->show();
# endif
#else // QT_VERSION >= 0x050000
QQuickView view;
view.setResizeMode(QQuickView::SizeRootObjectToView);
view.rootContext()->setContextProperty("cordova", Cordova::instance());
view.setSource(QUrl(QString("%1/qml/main_qt5.qml").arg(Cordova::instance()->workingDir())));
view.show();
#endif

return app.exec();
return app->exec();
}
@@ -1,8 +1,10 @@
import QtQuick 1.1
import com.nokia.meego 1.0
import com.nokia.meego 1.1
import QtWebKit 1.0
import "cordova_wrapper.js" as CordovaWrapper



PageStackWindow {
id: appWindow
initialPage: mainPage
@@ -15,8 +17,7 @@ PageStackWindow {

id: webView
anchors.fill: parent
//TODO: remove it later when toolbar problem will be fixed
anchors.topMargin: 16

url: cordova.mainUrl
settings.javascriptEnabled: true
settings.localStorageDatabaseEnabled: true

0 comments on commit 345a8b2

Please sign in to comment.