The Qt SDK allows you to create apps for Symbian, Maemo and soon MeeGo devices, as well as desktop computers. One of its key features is that repurposing apps for different devices is made extremely easy. Qt SDK 1.1 is based on Qt 4.7 with the addition of several APIs (Application Programming Interfaces) for mobile development. It also sees the arrival of Qt Quick, an app-creation component that combines visual tools like Qt Creator 2.1 with the new QML language.
QML is similar to JavaScript and is easier and faster to code than the existing C++ provision. Users who are familiar with JavaScript will find that it’s easy to read and understand the code, and that it works intuitively. C++ remains for more ambitious projects, of course.
QML is estimated to allow 70 per cent fewer lines of code than C++ for a typical app, halving development times. Here’s a “hello world” program written in QML, for example:
import QtQuick 1.0 Rectangle { id: page width: 500; height: 200 color: "lightgray" Text { id: helloText text: "Hello world!" y: 30 anchors.horizontalCenter: page.horizontalCenter font.pointSize: 24; font.bold: true } }
Even a complete novice can see that this creates a grey rectangle in the first part, then puts the text ‘Hello World’ in the middle of it in the second part. There’s full tutorial documentation (from which we borrowed this code) here and also in the application itself.
This simplicity and readability isn’t just about saving time: it also means developers and designers can work together throughout the process of creating user interfaces – resulting in better, tighter designs.
This is the Qt Creator code editor. You can click on these images for more legible versions.
Here’s the Qt Designer tools.
And here’s a small portion of the inline help documentation…
The new APIs allow access to the hardware features of mobile devices. These include imaging, to allow interaction with the camera and photo gallery; map and navigation features including GPS positioning; and access to the device calendar.
If you want to get your hands on the new Qt SDK, it’s available for free from Forum Nokia. We’ll be really interested to see what you can make.