Posts Tagged ‘n900’
QML – The Declarative UI on N900
Saturday, December 12th, 2009It seems that the trend with the modern mobile UI platforms will be based on some kind of web techniques (html, css, javascript) in the future. Even now there are good examples of such an environments like Palm WebOs. Web OS kind of environment for running UI will usually requires some processing power from the device in order to work smoothly with good UX. The benefit of running Web OS might be that you basically don’t need to recompile anything (on UI side) in order to make things work for example in a different device with different display size (in ideal world). Another benefit is that you’ll get the styling quite easy – you can use CSS for theming etc.
Nowadays, many mobile devices have quite much processing power (e.g. N900), so I guess we are not so far from the days when we will have more devices based on web os like techniques. Of course Qt comes to picture here, once again:) As many of you might know, Qt will provide a new module called Declarative UI (not sure if this is the official name) which is already available in qt-kinetic repository at Gitorious. You can checkout a branch: kinetic-declarativeui if you want to test it on action. I guess they will release that module with Qt 4.7, but let’s see that then.
A Proposal for DuiLayout
Monday, November 30th, 2009My last article of Maemo 6 UI Framework was about the layouts and how they work and are designed. In that article, I criticized a bit the implementation because in my opinion they could have used QStateMachine and Qt Animation Framework combination to make the design simpler. One of my principles is that if I criticize something, I need to be able to provide an alternative solution, but it might not be a better than the orignal one:) I guess there’s no sense review anything if you are not able to provide any feedback and alternative ways to do things. So the result speaks most. Here’s a youtube video running animated layouts on N900.
Qt How-To: Listen to Orientation Changes in N900
Saturday, November 21st, 2009Couple days ago I posted a video example of the MVC-model running on N900. Someone asked me that how did I do that thing and I believe that the question was about how to react on orientation changes in Qt application on N900. If you are not familiar with Qt D-Bus Module it’s worth to read the documentation from here first.
The orientation changes in N900 can be listened through a dbus interface. Doing that is pretty straight forward and it requires only couple lines of code:
MyReceiverClass * receiver = new MyReceiverClass(this);
QDBusConnection systemBus = QDBusConnection::systemBus();
systemBus.connect("com.nokia.mce",
"/com/nokia/mce/signal",
"com.nokia.mce.signal",
"sig_device_orientation_ind",
receiver, SLOT(orientationChanged(QString)));
In the code snipplet above I have a basic QObject based class “MyReceiverClass” which have a slot called “orientationChanged(QString)”. This slot takes a QString as an argument. When a signal called “sig_device_orientation_ind” has been send via D-Bus, the receiver’s slot will be called automatically and it can have one of the ”landscape” or “portrait” strings as a literal value. The rest of is up to the developer to decide what to do in the slot.
That’s it. Simple, isn’t it?