Monday, 9 March 2009

Qt Revisited

I managed to find some time to play with Qt this weekend. Firstly, I am rather impressed by the new IDE: While not quite as good as eclipse in terms of editing it seems more stable and uses FAR less memory. It is definately more user friendly than my visual studio 2003 and has a nice auto-complete feature that seems to actually work.

The new widgets and libraries are great if a little large and its pretty quick to whip something together. A nice touch in the IDE is the ability to just drag and drop signals to slots right on the visual layout of the form.

Old code that used to compile fine with the normal make didnt want to compile in the IDE without some changes (mostly imports). While this is not a serious complaint it did mean I had to make fresh projects in the IDE to play with things. The moc (meta object compiler) still seemed fine so it's probably just the way I imported the older projects.

Now for the some little negatives:

It is rather large and now consists of a large number of dll's.  Admittedly you dont need to include all of them with your runtime.

Although they claim to have optimized the new Qt I honestly didnt notice any speed improvement. Not that is slow at all for your average application. But if you hook lots of signals together doing complex things it seems to struggle a bit. This is because a slot is really a method on an class and its quite easy to construct a system where this cascades exponentially (probably bad coding practise) resulting in less time for the system to appear responsive. This isnt a major complaint at all. Just remember not to go completely mad with signals and slots :)

Now for a large negative:

Qt has three licensing options. LGPL, GPL and Commercial. Now as I have certain issues with the GPL type licenses (At least for all my current projects) this is not an option. Normally I am quite happy to buy a commercial license. As I am a single home user with one computer they are not normally prohibitively expensive.  For example: VS2008 Standard is about £250.  Flex 3 professional is about £300.  Qt 4.5 Commercial license comes in at a whopping €2995 for a single user license!

Due to the fact that my raytracer is actually a seperate server and just pumps out image streams I could use a GPL version of Qt and then just release the source code of the rendering window. But then I'm limited to running it as a downloadable app - even if the raytracing server is remote*.

After a lot of thinking I'm going to use Flex3 to handle my display and communications to the server. It runs in a web browser / on the desktop (with AIR) and is super quick for drawing things on the screen. In fact using the Flex3 eclipse environment I had an app talking via sockets to my rendering server in about 20 minutes. By no means complete yet it shows that flex is a very viable alternative for a rendering interface.

Please note that even though Qt4.5 may not be suitable for my project at the moment it is actually a very good system and their new IDE is second to none. If I win the lottery I would probably purchase a license :)

*This may seem like a wierd way to run a raytracer, but I only have one machine at home with GPU's in it and prefer to actually code on my laptop. It also allows multiple people to watch the rendering at once.

No comments:

Post a Comment