demko.ca

<< Back to Posts

Qt goes LGPL!

Aleksander Demko, February, 2009

In about a month, Nokia, owners of Troll Tech, makers of the Qt widget library will release Qt 4.5 under the LGPL license. In a web centric world desktop application programming may seem unhip and uninteresting but rest assured, this is huge news, especially for desktop app developers and potentially mobile app developers (Nokia's primary intent here is to build a platform, after all).

Qt, for those that don't know is a very nice, well polished, comprehensive graphical application building toolkit. It's a complete C++ toolkit done right: multi-platform, easy to use and well thought out. It shows to the Java/C#/etc crowd that C++ development can be fun again, it just needed a unified, nice and easy to use "standard library" that covers ALL of the things developers want to do, on all platforms. The C++ "Standard Library" only covers the most basic of things, like strings and files, leaving the C++ developer to go hunt down other libraries to fill in that last 90%.

Prior to the LGPL version, you had to use either the GPL version (requiring your software to be also under the GPL, i.e. free) or you had to buy some commercial licenses, that aren't cheap (a few thousand dollars, usually). The LGPL basically lets you have your cake and eat it too: use the free downloadable library to make applications under any license, for free. This will undoubtedly destroy Troll Tech's income, but the mothership (Nokia) views this as a cheap sacrifice, if it gets them developer mindshare.

As a Linux (well really, multi-platform) desktop app developer, this is a godsend.

Unless you were willing to cough up the dough for the expensive commercial Qt licenses, you where left with few choices, each with their own downsides:

GTK+: poor support under Windows, missing lots of mature features, verbose/cumbersome API and worst off all: it's a C library. Now, I know it's cool to hate on C++, especially from people who don't know the language (especially C programmers who've just dipped their toes in the language), but C++ is still the best way to write compiled-to-native code across multiple platforms with full performance. Period. Full stop. GTK+ programming tends to be so tedious, that everyone seems to do their own light C++ wrappers around the core classes, which has to tell you something. Heck, the GNOME desktop people are trying to push Mono (i.e. C# & GTK) as the new solution, because even they admit C & GTK+ is too messy. For the record, even though I like and use the GNOME desktop, the developer side of me hates the GTK+ library API.

GTK--: a C++ wrapper around GTK+. Good idea, but it's still cumbersome under Windows and dealing with a framework around another framework is frought with issues. It's also not that popular, leading to less community support, application examples, testing, etc. You don't want to commit your large application to a toolkit that isn't supported, well tested, etc.

FLTK: never used it personally, but it seems small (in community and support), similar to GTK--.

wxWidgets: After getting fed up with GTK+, I moved to wxWidgets. wxWidgets is a decent library, that seems to work for the most part with a few rough edges, nothing that can't be worked around. These rough edges, a few missing features (database support, for example) and slower development progress is all simply a result of it being a fully volunteer effort. It's a great library, and I'd still be using it if Qt wasn't going LGPL.

So to sum up, Qt is awesome. It's multi-platform, well documented, wildly adopted, broad in features and is joy to use. LGPL licensing will boost the quality and quantity of apps on the Linux desktop: by lowering the barrier to entry and by ported applications coming from Windows. Windows application developers will now be enticed with a free toolkit, which they can then later use to quickly bring their applications to Linux or Mac OS X. Finally, this same API can be used on mobile phones, making Nokia's dream of "Qt Everywhere" come true.