Kate is maemo chief engineer in Forum Nokia,
She has long Linux/Open Source developer background.
kate.alhola | 01 December, 2009 23:42
Implementing User interface that looks and feels like Native Maemo 5 Hildon UI needs more than just basic features like Input method or Hildon styles. In Maemo version before Maemo 5 this basic set was sufficient and most of User Interface was implemented with stantard widgets familiar from desktop.
Maemo Qt follows same path. Qt for Maemo 4 had just this minimun Maemo feature set, Input method, Maemo Menus and Maemo Styles. Maemo 5 had complete UI style renewal. All UI is now finger operable. UI Design has been very successful in this goal. I don't remember when I last time used stylus with M900 despite it has been a long time main devive for my daily use.
The basic widget set from desktop with minimum Maemo additions is no longer sufficient for good Hildonized UI for Maemo 5. The first Maemo 5 Qt released February 2009 was about direct Maemo 4 Qt port for Maemo 5 Alpha SDK. Following releases added more and more Maemo 5 specific UI components. New Maemo 5 app menus, finger scrollable areas, stacked windows, some widgets needed more modifications than was possible to do with just applying style.
Qt 4.5.3 for Maemo 5 with this enhanged Maemo 5 support was relased as beta together with Maemo 5 SDK 1.0 version just before Maemo Summit 2009. Technology preview version of Qt4.6 for Maemo 5 as released about same time. The 4.6 version was in this time just pre-alpha version with just minimum Maemo support, just like Qt4.5.3 was in February.
Now Maemo Qt4.5.3 is settling up for it's final version for PR1.1 release and Qt4.6 is soon ready it's first alha release.
Before this Q4.6 pre-alpha release it was not possible to make any porting guide how to implement Hildonized applications and how nsure maximum portability from 4.5.3 to 4.6. My Maemo Summit 2009 presentation just introduced basic elements needed to implement Hildon style UI with Qt4.5.3. For Maemo Developer days in Copenhagen in November, I had enhanced version of this presentation with many coding examples but porting guide to Qt4.6 was still missin because some important API's for 4.6 was not yet written.
After Qt4.6 pre alpha became available, I updated document to current version, now it shows API's with example code so that it works with both Maemo Qt4.5.3 and Qt4.6. You can find download here maemo_qt_devday_2009_1.2.pdf and dialogtest2.tgz
Short summary: To make Qt Application compatible with Maemu 5 UI you need redesign some parts of UI. Input method and Hildon styles takes care that basic functionality works. In Maemo 5, there is no more hierarchical menus but app menus that can be used with finger. You just need to design flat menu layout with few items that they fit on screen. Menus do not add any new API, you just need to remember to make flat menus. Dialogs should be made as finger scrolled list, not desktop style forms. Remember also that Hildonized widgets are much larger than desktop counterparts. Finger scroll API differs little bit between 4.5.3 and 4.6. You should put one line of code inside #ifdef Q_WS_MAEMO_5 to make your code compatible with both versions. Stacked windows are other key element in Hildon UI. Qt4.5.3 used Multiple QMainWindow instances to create automatically stacked windows. In Qt4.6 you need explicitly set Stacked window atribute. Once again, one line #ifdef solves the problem. My example program is made so that it compiles and works with both Qt versions.
You can safely install Qt4.5.3 and Qt4.6 to same Scratchbox target and in same device. To compile for 4.5.3, just qmake;make and compile for 4.6 /opt/qt4-maemo5/bin/qmake;make .
Happy hacking with Qt!