If you have developped an app for Maemo and then you want to deploy it on desktop (or backwards) you may have found that it looks weird, that's mainly for two reasons, first of all Qt for desktop (X11, Windows or MAC) renders widgets diferent from Qt for Maemo, also tmaemomaemohe resolution is something to have in mind, the N900 is 480x800 or 800x480 (depends on how you look at it).. and it's just 3.5" so you have to make everything bigger for easy reading..
If you are like me and you use Qt Designer to create your UI you may have run into trouble when targetting both desktop and mobile platforms, one solution (I don't know if it's the best) is to create another class for your mainwindow, so you have 2 (maybe if you targett 4 diferent platforms this isn't any good) classes, MainWindowDesktop and MainWindowMaemo, then you define your UI using Qt Designer, then you can make an specific desing for maemo and another for desktop, this saves you some trouble but the disadvantage is that you have to "write" te code twice (Of course you can copy and paste). If you have another idea don't hesitate to say it..
In main.cpp you have to write something like this
#ifdef Q_WS_MAEMO_5
MainWindowMaemo mainWindowMaemo;
mainWindowMaemo.setOrientation(MainWindowMaemo::ScreenOrientationAuto);
mainWindowMaemo.showExpanded();
#else
MainWindowDesktop mainWindowDesktop;
mainWindowDesktop.show();
#endif
I hope you find it useful :D
No hay comentarios:
Publicar un comentario