Home Porting Qt Application To MeeGo Harmattan

Porting Qt Application To MeeGo Harmattan

Qt-Logo-code-less-deploy-more-200
From the Blog: Qt Maemo And Some Other Stuff:
As I received Nokia N9 Dev kit from Qt Ambassador program, I started working on porting my existing Maemo 5 application to Maemo 6 (Harmattan/Meego) platform.
It seems from documentation that preferred way to create Meego application is by using QML and com.meego components. In order to make my Qt and QML application to work correctly on meego I needed to make quite a few changes.
First thing I noticed is that, Qt Widget are available on harmattan but that just for backword compatiblity and dose not provide native look and feel for Harmattan platform. That mean Qt Widget library are kind of useless on harmattan. We need to use meego touch library or meego QML component.
Some of my application were QWidget based or some were Graphics View based. I ported most of application to use QML and If i can not port to use QML then I used QDeclarativeItem to load that component to QML.
For some of my application I was locking orientation, using “WA_Maemo5PortraitOrientation” flag in view.setAttribute(Qt::WA_Maemo5PortraitOrientation, true); API call, But on Harmattan I need to use following code in QML page.
Page{
orientationLock: PageOrientation.LockPortrait
To make application full screen, I need to disable statusbar and toolbar from PageStackWindow. I used following code
PageStackWindow
showStatusBar: false
showToolBar: false

In one of my application I was using GraphicsView framework, I loaded graphics view to QML using QDeclarativeItem and QGraphicsProxyWidget. Visit following link for more info.
But after GraphicsView loaded to QML, view was displaying some white area that initially I was not able to remove. After a white I realized it was frame for graphics view. I removed it by using setFrameStyle API.
setFrameStyle(QFrame::NoFrame);
Desktop file also needs to be changed to locate icon correctly and to launch only single instance of application.
[Desktop Entry] Encoding=UTF-8
Version=0.1
Name=appname
GenericName=app name
Comment=some comment
Exec=/usr/bin/single-instance /usr/bin/appname
Terminal=false
Type=Application
Icon=/usr/share/icons/hicolor/64x64/apps/icon.png

Also in control file, to make your application user application and not system component, we need to add following flag.
Maemo-Flags: visible
I used following in my project file to transfer icon file to proper location.
unix
#VARIABLES
isEmpty(PREFIX)
PREFIX = /usr

BINDIR = $$PREFIX/bin
DATADIR =$$PREFIX/share
DEFINES += DATADIR=\”$$DATADIR\” PKGDATADIR=\”$$PKGDATADIR\”
INSTALLS += target desktop icon64
target.path =$$BINDIR
desktop.path = $$DATADIR/applications
desktop.files += ./image/$${TARGET}.desktop
icon64.path = /usr/share/icons/hicolor/64×64/apps/
icon64.files += ./image/$${TARGET}.png
I also faced segmentation fault while testing Webview with emulator, but on device it works fine.
That’s all, most of my experience was smooth while porting and did not struggled much.
Source Qt Maemo And Some Other Stuff
 

About ReadWrite’s Editorial Process

The ReadWrite Editorial policy involves closely monitoring the tech industry for major developments, new product launches, AI breakthroughs, video game releases and other newsworthy events. Editors assign relevant stories to staff writers or freelance contributors with expertise in each particular topic area. Before publication, articles go through a rigorous round of editing for accuracy, clarity, and to ensure adherence to ReadWrite's style guidelines.

Get the biggest tech headlines of the day delivered to your inbox

    By signing up, you agree to our Terms and Privacy Policy. Unsubscribe anytime.

    Tech News

    Explore the latest in tech with our Tech News. We cut through the noise for concise, relevant updates, keeping you informed about the rapidly evolving tech landscape with curated content that separates signal from noise.

    In-Depth Tech Stories

    Explore tech impact in In-Depth Stories. Narrative data journalism offers comprehensive analyses, revealing stories behind data. Understand industry trends for a deeper perspective on tech's intricate relationships with society.

    Expert Reviews

    Empower decisions with Expert Reviews, merging industry expertise and insightful analysis. Delve into tech intricacies, get the best deals, and stay ahead with our trustworthy guide to navigating the ever-changing tech market.