Qt 4 raises the bar for cross-platform app dev tools

Cross-platform toolkits have always been a market unto themselves. In the heyday of Unix, products such as Galaxy, XVT, and Zinc provided a solution for IT and for ISVs that could not afford to rewrite code for all flavors of OSes. When Java took over much of the cross-platform workload, these tools were relegated to the sidelines.

But, as years passed, it became evident that Java was not ideally suited to developing client-facing applications, and a new generation of GUI toolkits arose with strong open source roots.

One of those toolkits, Trolltech's Qt, has evolved into a far more comprehensive library that provides robust support in such disparate areas as database access, XML processing, threading, network programming, and advanced data structures.

Backed by a commercial venture that offers a commercial license, Qt comes in three versions: the new Console Edition, a server-oriented package that bundles the non-GUI classes with a text-based front end; Desktop Light Edition, primarily the GUI toolkit; and Desktop Edition, which combines the two versions -- server back end with GUI front end -- and provides the most comprehensive libraries.

I looked at the Desktop Edition of the new Qt 4 release, and I found that improved graphics and multithreading support, as well as integration in Visual Studio .Net, make this toolkit significantly better.

The GUI Bits

Qt's GUI toolkit is unique in that it uses the underlying operating system's widget set to provide the interface. As a result, applications have a native look and feel. The set of widgets is remarkably complete. Beyond the standard controls, the library has toolbars, tool tips, grids into which images and rich text can be placed, drag-and-drop support, floating menu bars, and more.

A bundled visual design tool, Qt Designer, enables interactive GUI design. Qt Designer generates an XML metafile from which a utility generates the necessary C++ source code. To the widget set, Qt adds a complete, high-end rendering system including sophisticated drawing functions, OpenGL graphics, rich text, and imaging.

The rich text capabilities are particularly impressive: Qt automatically accesses the fonts available on the execution platform. Fonts can be chosen by name and characteristics; if the specified font is unavailable, Qt intelligently finds the closest matching typeface and size. You can combine letters from many fonts to provide true rich text.

The system also supports Unicode fonts, so all forms of foreign characters work correctly. Text can be wrapped around embedded graphics, and other rarely found text-rendering capabilities are built in, including 2-D and 3-D graphics, animation, and interchangeable paint engines (OpenGL, PostScript, and so on).

The non-GUI portions of Qt 4 handle some of portability's most irritating details, the worst of which are parallel processing and the use of threads. Qt's library abstracts the underlying threads' resources and gives them a sane organization that borrows conceptually from both Windows threads and Pthreads.

Qt 4 also abstracts sockets, greatly simplifying network programming. It provides plenary support for HTTP, FTP, TCP, and UDP (User Datagram Protocol), and if you use your own protocol, Qt will support that, too.

Because different platforms might rely on differing implementations of standard templates, Qt provides an entirely portable set of data structures, including all the usual containers, as well as sophisticated items such as LRU (least recently used) caches. The product also has classes for database access (via embedded SQL) and for XML processing, with support for DOM and SAX2. A bundled XML parser can be used if other access is necessary.

Feeling Your Way

Using any app dev toolkit requires a commitment. You must understand how the library is laid out and its fundamental design, and then learn how to make use of it. Qt makes this process straightforward with extensive documentation, including numerous detailed examples. If you get into a jam, you can tap the large Qt user community. This community grew up around Qt because the toolkit is the basis of KDE, one of the two major UIs for desktop Linux. Hence, there is a lot of public domain code that uses Qt.

Unlike the APIs used in OSes (Win32 or POSIX), Qt did not grow organically. Rather, developers who made sure that calling conventions and syntax stayed uniform tended it, so Qt is far easier to use than most other large API sets. After a few weeks of using Qt, it becomes easy to guess the names of APIs you need when entering into a new programming domain.

The commercial Qt 4 product (but not the open source version) includes a new integration utility for Visual Studio .Net users. It plugs Qt Designer into the Microsoft IDE, loads Qt documentation into the Visual Studio help system, provides code completion, and bundles Visual Studio .Net templates for Qt projects. This is a useful feature that lets you design, code, and test Qt apps without leaving the environment.

The library's largest failing, in my opinion, is that it works only with C++ . However, rather than force developers to know recondite aspects of the language, the Qt APIs and functions require only basic knowledge of C++. Any C or Java programmer will quickly figure out how to use the library.

Cross-Platform Quality

After years of testing cross-platform toolkits, I can say that none approach Qt's breadth of functionality or quality of implementation. I recommend Qt even for single-platform projects, as Qt is easier to learn than most OS API sets; it is much better designed, and its interfaces change less frequently. The easy portability is an added bonus.

My only reservations about Qt 4 are minor: The lack of bindings other than C++ is a bit of a handicap (Trolltech is working on this issue for future versions). Also, the highest level of tech support provides only e-mail responses to inquiries. My tests show that answers arrive within 24 hours, and I can set up a phone conference by special arrangement, but there is no standard phone offering.

These are trivial complaints; Qt users have known for a long time that they enjoy an excellent library at a terrific price. With Qt 4, an already great product makes another leap forward.

BOTTOM LINE: Trolltech Qt 4

Company: Trolltech, http://www.trolltech.com/
Verbal Score: Excellent Numeric Score: 9.2 out of 10

Join the newsletter!

Or
Error: Please check your email address.
Rocket to Success - Your 10 Tips for Smarter ERP System Selection
Keep up with the latest tech news, reviews and previews by subscribing to the Good Gear Guide newsletter.

Andrew Binstock

InfoWorld
Show Comments

Essentials

Mobile

Victorinox Werks Professional Executive 17 Laptop Case

Learn more >

Sansai 6-Outlet Power Board + 4-Port USB Charging Station

Learn more >

Exec

Budget

Back To Business Guide

Click for more ›

Brand Post

Most Popular Reviews

Latest Articles

Resources

PCW Evaluation Team

Andrew Teoh

Brother MFC-L9570CDW Multifunction Printer

Touch screen visibility and operation was great and easy to navigate. Each menu and sub-menu was in an understandable order and category

Louise Coady

Brother MFC-L9570CDW Multifunction Printer

The printer was convenient, produced clear and vibrant images and was very easy to use

Edwina Hargreaves

WD My Cloud Home

I would recommend this device for families and small businesses who want one safe place to store all their important digital content and a way to easily share it with friends, family, business partners, or customers.

Walid Mikhael

Brother QL-820NWB Professional Label Printer

It’s easy to set up, it’s compact and quiet when printing and to top if off, the print quality is excellent. This is hands down the best printer I’ve used for printing labels.

Ben Ramsden

Sharp PN-40TC1 Huddle Board

Brainstorming, innovation, problem solving, and negotiation have all become much more productive and valuable if people can easily collaborate in real time with minimal friction.

Sarah Ieroianni

Brother QL-820NWB Professional Label Printer

The print quality also does not disappoint, it’s clear, bold, doesn’t smudge and the text is perfectly sized.

Featured Content

Product Launch Showcase

Latest Jobs

Don’t have an account? Sign up here

Don't have an account? Sign up now

Forgot password?