Skip to content

Commit

Permalink
Merge pull request #1 from locusf/master
Browse files Browse the repository at this point in the history
Qt5 porting
  • Loading branch information
rburchell committed Aug 19, 2013
2 parents e762e46 + a9ed5f8 commit 5af8d5c
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 40 deletions.
11 changes: 10 additions & 1 deletion meegohandsetmaps.pro
@@ -1,7 +1,7 @@
CONFIG += mobility
CONFIG += qdeclarative-boostable
MOBILITY += location
QT+= declarative
QT+= qml quick location
TEMPLATE = app
TARGET = meego-handset-maps
DESTDIR = bin
Expand All @@ -10,3 +10,12 @@ include(src/src.pri)

include(deployment.pri)
qtcAddDeployment()
CONFIG += link_pkgconfig

packagesExist(qdeclarative5-boostable) {
message("Building with qdeclarative5-boostable support")
DEFINES += HAS_BOOSTER
PKGCONFIG += qdeclarative5-boostable
} else {
warning("qdeclarative5-boostable not available; startup times will be slower")
}
19 changes: 11 additions & 8 deletions rpm/qmlmaps.spec
@@ -1,17 +1,20 @@
Name: qmlmaps
Version: 0.1.7
Version: 0.1.8
Release: 1
Summary: Simple and fast maps application for QML. Needs data connection!
Group: User Interface/Desktops
License: GPL v2
URL: https://github.com/nemomobile/qmlmaps
Source0: %{name}-%{version}.tar.bz2
Requires: qt-components
Requires: libdeclarative-location
BuildRequires: pkgconfig(QtCore)
BuildRequires: pkgconfig(QtGui)
BuildRequires: pkgconfig(QtDeclarative)
BuildRequires: pkgconfig(qdeclarative-boostable)
Requires: qt5-qtlocation
Requires: qt5-qtdeclarative-import-location
Requires: qt-components-qt5
Requires: mapplauncherd-booster-qtcomponents-qt5
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5Quick)
BuildRequires: pkgconfig(Qt5Qml)
BuildRequires: pkgconfig(Qt5Location)
BuildRequires: pkgconfig(qdeclarative5-boostable)
Obsoletes: meego-handset-maps < 0.1.7
Provides: meego-handset-maps >= 0.1.7

Expand All @@ -22,7 +25,7 @@ QML Maps - simple and fast maps application. Uses QtMObility and thus needs data
%setup -q -n %{name}-%{version}

%build
%qmake
%qmake5
make %{?jobs:-j%jobs}

%install
Expand Down
2 changes: 1 addition & 1 deletion src/data/meego-handset-maps.desktop
Expand Up @@ -4,5 +4,5 @@ Version=1.0
Type=Application
Terminal=false
Name=Maps
Exec=/usr/bin/invoker --single-instance -r 5 --type=d --splash /usr/share/pixmaps/meego-handset-maps-splash-p-800x480.png /usr/bin/meego-handset-maps
Exec=/usr/bin/invoker --single-instance -r 5 --type=qtcomponents-qt5 --splash /usr/share/pixmaps/meego-handset-maps-splash-p-800x480.png /usr/bin/meego-handset-maps -platform wayland
Icon=icon-l-maps
38 changes: 16 additions & 22 deletions src/main.cpp
@@ -1,30 +1,24 @@
#include <QtGui/QApplication>
#include <QtDeclarative>
#ifdef __arm__
#include <applauncherd/MDeclarativeCache>
#include <QGuiApplication>
#include <QQuickView>
#include <QtQml>
#ifdef HAS_BOOSTER
#include <MDeclarativeCache>
#endif


Q_DECL_EXPORT int main(int argc, char *argv[])
#ifdef HAS_BOOSTER
Q_DECL_EXPORT
#endif
int main(int argc, char *argv[])
{
#ifdef __arm__
QApplication *app = MDeclarativeCache::qApplication(argc, argv);
QDeclarativeView *view = MDeclarativeCache::qDeclarativeView();
view->setSource(QUrl("qrc:/qml/main.qml"));
view->showFullScreen();
#ifdef HAS_BOOSTER
QGuiApplication* app = MDeclarativeCache::qApplication(argc, argv);
QQuickView* view = MDeclarativeCache::qQuickView();
#else
QApplication *app = new QApplication(argc, argv);
QDeclarativeView *view = new QDeclarativeView();
view->setSource(QUrl("qrc:/qml/main.qml"));
view->show();
QGuiApplication* app = new QGuiApplication(argc, argv);
QQuickView* view = new QQuickView;
#endif

view->setWindowTitle("Maps");
//Flickr removal
view->setAttribute(Qt::WA_OpaquePaintEvent);
view->setAttribute(Qt::WA_NoSystemBackground);
view->viewport()->setAttribute(Qt::WA_OpaquePaintEvent);
view->viewport()->setAttribute(Qt::WA_NoSystemBackground);
view->setSource(QUrl("qrc:/qml/main.qml"));
view->showFullScreen();

QObject::connect(view->engine(), SIGNAL(quit()), view, SLOT(close()));

Expand Down
11 changes: 5 additions & 6 deletions src/qml/MainPage.qml
@@ -1,6 +1,6 @@
import QtQuick 1.1
import com.nokia.meego 1.0
import QtMobility.location 1.2
import QtQuick 2.0
import com.nokia.meego 2.0
import QtLocation 5.0

Page {
tools: commonTools
Expand Down Expand Up @@ -55,10 +55,9 @@ Page {
id: map
plugin : Plugin {name : "nokia"}
anchors.fill: parent
size.width: parent.width
size.height: parent.height
width: parent.width
height: parent.height
zoomLevel: 10
center: Coordinate { latitude: 60.169589; longitude: 24.941318} //TODO - cache last position?

PositionSource {
id: positionSource
Expand Down
4 changes: 2 additions & 2 deletions src/qml/main.qml
@@ -1,5 +1,5 @@
import QtQuick 1.1
import com.nokia.meego 1.0
import QtQuick 2.0
import com.nokia.meego 2.0

PageStackWindow {
id: appWindow
Expand Down

0 comments on commit 5af8d5c

Please sign in to comment.