Sharing information related to Qt, Maemo development and some other information

Sunday, September 4, 2011

Porting Qt app to Harmattan

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.

Hi, when I use the "showStatusBar: false" property i always get a random peice of the status bar with the battery and wifi indicator still shown in the top left hadn corner of the screen, did this happen for you too??