So here it is:
BackgroundA client of ours, 1st Detect, is developing a miniature chemical detector. This is a fairly cool bit of technology that will help sniff out the nasty stuff in airports, factories, battlefields, etc.
A while back we took the software for that system and converted it to Qt. This was so that a single board computer running the chemical detector could run Linux, while maintaining the option to go back to Windows if they had to. (We also have it running on a Mac)
A nice side effect of this was that mobile platforms became easy. We did a quick proof of concept remote control / view application on a Nokia 5800 phone running Symbian (They of course gave me permission to blog about this):
The app searches for nearby chemical detectors, lets you connect to them, and control them. We've got GPS working now (the test version pops up your location in Google Maps), and we're working on a display that will show you nearby detectors on a map, with their status. All from your phone / mobile device. Nice, eh?
Well... almost. The regular conference goers at 1st Detect don't have Nokia phones. They wanted something that worked on something they had, and they figured that eventually clients will have the same issue. So, we looked into getting the Qt-based app running on a Palm Pre.
After some initial tests, it began to look like this would most likely work.
I thought it'd make an excellent blog post, so I contacted Nokia about it. I wanted to know how serious they were about Qt Everywhere. The intention was that if they weren't too thrilled about Qt on a competitor's phone then we'd simply do 1st Detect's Qt app on the Pre and not really talk about it.
I figured I owed them for releasing Qt as LGPL.
I didn't quite expect the reaction.
They were THRILLED. They were going to the Mobile World Congress the next week, and they really wanted to be able to show that off.
I had 3 days to get some Qt demo apps running on it. I ran out and bought a Pre and got started. It was a lot of fun.
Oh, and here's our client's app running on the Pre (yes, that's WebKit):Mission accomplished.
Here's how.
The Process
First things first... I needed a way to load packages and interact with the Pre. I always prefer VMs for that sort of thing, so I created a VirtualBox Ubuntu 9.10 i386 VM.
The Palm Pre is a very open platform. There's a developer mode, which is enabled with a simple password-like phrase in the search box. A root linux shell is then accessed by simply running a terminal from a Palm-provided package. How cool is that? That is OPEN.
I had a simple Qt app running on the Palm Pre before this, with no screen, keyboard, or touchscreen plugins. This was our initial test. We had to kill the Pre's GUI (Luna) to run it, but it worked. A little investigating showed the keyboard would be fairly easy. A homebrew game on the Pre we were familiar with (Doom) ran fully integrated within Luna using the SDL libraries on the Pre, so we figured this was the way to go.
Over the next day or so, I got the SDL plugin to work. The keyboard plugin was very similar to the one on the Kindle port. The touchscreen turned out to be fairly easy using SDL as well.
Thursday, I started trying to find some Qt demos that would look good, and I started to get them running on the Pre.
Crisis! My laptop came screeching to a halt with an unrecoverable disk error. We keep all source code in source control, but this Palm Pre work hadn't quite made it in yet. (I don't seem to like checking in highly fluid code)
I ran to Fry's and bought a new laptop drive, then used ddrescue to clone it from the old drive and attempt a recover on the bad sectors.
It turns out that only a single 1K block on the disk went bad, somewhere in the Palm Pre VM disk image. I quickly created a new VM (which gave me a chance to test my instructions for Nokia) and I was back in business again.
The whole episode lost me 8 precious hours that beforehand I fully expected to have available (2.5 hours were just driving to Fry's and back in rush hour traffic). So, I ended up sending the instructions and install packages to Nokia at 2am in the morning.
Nokia reported that the install went very smoothly, and everything worked great. They've also mentioned it on the Qt blog.
Get it on PrewareThe Qt libraries and these demo applications are now available on Preware! Keep in mind this is only for the Palm Pre and Palm Pre Plus. It very likely will not work on the Pixi.
Install the "Qt Framework" package there, and any Qt demos you'd like to check out.
The plugin code is now released on the LGPL 2.1 license, to match Qt. It can be found on qt.gitorious.org (git clone git://gitorious.org/~darronb/qt/qt-palm-pre.git).
A Little Evangelism
Qt is an excellent platform, and I find more to like about it every week. Wouldn't it be great if every smartphone ran it? Don't just dream about it. Make it happen!
I just read about MeeGo, the combination of Nokia's Maemo and Intel's Moblin efforts. Qt will be the default UI platform for this... very good news.
Of course, I'm currently mostly doing desktop work with it... so it's awesome for that, too.
Go ahead, get involved! Qt is exploding.

@Zeren Ozturk: Not yet, I don't have one. I am hopefully going to get a TouchPad whenever they release it.
Posted by: darron | 06/06/2011 at 08:18 AM
Did you have any chance of testing your QT port on the new HP TouchPad webos 3.0 tablets?
Posted by: Zeren Ozturk | 06/06/2011 at 07:58 AM
Hello Darron, I'm interested in developing/porting Qt on my Palm Pre, but I have no idea where to start. Could you post a short guide on how to set up a developer environment, write a "Hello World" app, and compile it for the Pre. I would definitely appreciate it!
Posted by: Roberto Sanchez | 10/25/2010 at 09:55 PM
Here's more or less what I've got for a build line for Qt itself:
./configure -D QT_NO_QWS_MULTIPROCESS -prefix /media/cryptofs/apps/usr/palm/applications/net.griffin.qt/qt -rpath -opensource -embedded arm -openssl -make demos -make examples -verbose
Change the applications path to your own, of course.
Posted by: darron | 08/04/2010 at 12:58 AM
I just got your Qt sources from gitorious and did setup the toolchain for cross compiling.
Do I need any special configure parameters for Qt to make it compile the webos specific plugins?
Thanks for all the great efforts!
Posted by: Mueslix | 07/08/2010 at 07:00 AM
Hi, I'm trying to build Qt for the Palm Pre but I'm not sure what flags must I use for the config. Could you assist me with the build process?
I'm very interested in porting and developing Qt apps for the Pre.
Posted by: Auberamz | 06/25/2010 at 08:42 PM
very good job and skill. here in brazil i try this with windows mobile 6 but developer environment comes only in visual studio, so now at this moment i am installing in my notebook virtual box + sdk and after "pascoa" i think my old acer aspire 3100 with debian 5 lenny, will handle with qemu all things. thank you for empowering us with information.
Posted by: Gilberto dos Santos alves | 04/01/2010 at 06:03 PM
@electrofreak66: Not yet. I was looking into that... it doesn't look too bad. So, if I can get around to it I'll give it a shot.
Posted by: darron | 03/08/2010 at 10:37 PM
Thanks for sharing! Does your port include support for QGesture and QTouchEvent?
Posted by: electrofreak66 | 03/08/2010 at 10:20 PM
So I really could not wait... I used terminus and vi to make the griffin.conf file and got it all loaded via preware. Very slick!!
Posted by: Ryanparas | 03/08/2010 at 05:14 PM
Come on over to IRC channel #webos-internals on freenode :)
http://webchat.freenode.net/
Posted by: SilentLaughter | 03/08/2010 at 04:18 PM
I'm currently getting the source code up on gitorious.
I've got developer access now on PreCentral, but the instruction video explaining how to set that up won't play on my Linux box. So, I'll get around to figuring that out in a bit.
I can't think of any technical reason the latest package couldn't be available officially at the Palm App Store. It no longer requires any install or removal scripts.
I'll look into that after it's at least in Preware.
Posted by: darron | 03/08/2010 at 04:11 PM
Incredible work. This is great news. I can't wait to play with this!
Posted by: Ryanparas | 03/08/2010 at 03:30 PM
Don't forget about WebOS Quick Install. With it, you can EASILY add your ipkg feed :)
Also, you may want to consider submitting the apps to PreCentral's homebrew app gallery, or use the upcoming PDK and submit on the App Catalog
Posted by: Jason Robitaille | 03/08/2010 at 02:01 PM
Wow, that is great news! Any idea if this will use the official PDK when it comes out, or will it only be available via Preware?
ps - did you drop by #webos-internals a few days ago asking about this? If not, there is apparently someone else out there with the same idea :-)
Posted by: Nguarracino | 03/08/2010 at 11:06 AM