Looking at the standard built-in digital clock for our phone, it seems really boring, isn’t it? Now that Qt/S60 Tower edition has been released, I thought it’s time to get my hands dirty and write few little useful (or useless, depending on your point of view) demos to be enjoyed by millions of loyal S60-based phone users. So here it is, the first Graphics Dojo example designed with S60 platform in mind (of course, it works fine on the desktop, afterall it’s just a normal Qt program). Taking the inspiration from some flipping effect (that I stumbled upon, thanks to YouTube) from another digital clock, here it is:
Except of course the screenshot does not capture the beauty of the animation. So Alessandro decided to show-off his fantastic video-making skill and get us the following:
The code is available from the usual repository, check out the digiflip subdirectory. You can give it a try on a desktop, but nothing is more exciting than putting it on your phone. See the S60 instructions page on how to do that, but basically if you have Qt/S60 binary package installed (and other requirements), it’s a matter of:
qmake make make release-gcce createpackage -i digiflip_gcce_urel.pkg
I included three animation effects: Slide, Flip, and Rotate (all in 400 lines of Qt/C++ code). You can switch between them using the softkey (see the source code to know how easy it is to add simplistic softkey feature to your application) or using D-pad (only for non-touch devices).
7 Responses to “Digital clock in a phone”
… because you’re 13:37!!! Awesome!!!
I changed the time.showMaximized() to time.showFullScreen() to have a fullscreen clock on my 5800 XM in landscape mode in the desk stand.
However, the numbers disappear in landscape mode and the console says:
[Qt Message] QPainter::begin: Paint device returned engine == 0, type: 2
[Qt Message] QPainter::setFont: Painter not active
[Qt Message] QPainter::setPen: Painter not active
[Qt Message] QPainter::end: Painter not active, aborted
[Qt Message] QPixmap::scaleWidth: Pixmap is a null pixmap
(many times)
This seems only to happen in landscape mode, in portrait everything works fine.
Also the numbers are too small in landscape mode. It does not look like on the first picture.
I’m using the newest Qt tech preview on my phone.
Anyway it is quite. If these issues could be sorted out, there is now an application than can run all the time when the device sits in the desk stand.
@Axel: It looks like a font rendering problem. Can’t reproduce it, though. Or perhaps a race condition with the off-screen pixmap.
Guys,
This is amazing! But I want to scream to your bosses at Nokia “hurry up!”. As a Qt developer and fanboy I was a long-term Nokia guy who recently switched to a Google Android phone. And I must say: they did a very, very impressive job. Nokia by no means can compete with this! Don’t get me wrong, the Qt based user interface surely can, but the problem is the underlying OS: Symbian by no means can compete with Linux as with Android.
So when I read these blogs about the Qt S60 port I’m:
- excited about the progress and again the prove what a great toolkit Qt is
- sad, because I think Nokia is too late. At least if they hang on to Symbian. If they release a Linux based smartphone with a Qt based user interface this year… they may have a chance.
@Axel: I just committed a fix (commit 3d3d3d38) for the digits painting. Tested on N97, it should look fine now. Could you give it another try and let me know the result? Thanks!
Hi,
everything works as expected now.
I always wanted a flip clock on my phone. looks awesome
