Regular Expressions:
Qt provides full support for perl-compatible regular expression. This goes
far beyound the simple \'?\' and \'*\' meta-characters. Regular Expressions are a
very powerful tool, to parse documents, to grep patterns inside documents, to
build filters, to define masks for edit controls.
Multi-platform:
Qt 3 is multi-platform. It works on Windows (any of them), Unix (any of them),
MacOs X and embedded platforms. You just have to recompile your code to get it
working on a different platform. Except for the compiler adjustments (or
limitations), you don\'t have to touch your code.
Template classes:
Qt provides useful classes to handle lists, files, dictionnaries, strings,
threads, ... All of them are very powerful and very handy; more than the STL
and the MFC equivalents.
Memory management:
Qt has many facilities that makes memory management a no-brainer. Qt objects
are automatically destroyed when their parent is destroyed. Many classes have
an implicit sharing mechanism that relieves you from the pain of managing
destruction and copy of these objects.
Network API:
Qt features classes to help programming with Network programming: socket, dns,
ftp, http, ...
Database API:
Qt features classes for seamless database integration : Data aware wigets,
database connection, SQL queries, ...
OpenGL API:
Qt provides classes for seamless integration with OpenGL (3D accelearted)
libraries.
Canvas:
Qt provides classes optimised for handling quickly moving 2d objects, usually
known as sprites.
Styles:
It is possible to fully customize the rendering of all the Qt controls. That
way, Qt emulates the style of all the available toolkits: Motif, MFC,
NextStep, ...
What about Codejock ?
The many drawbacks of MFC have left room for companies to sell MFC wrappers,
which help to actually build applications easely. We have been using the
CodeJock library. How does CodeJock + MFC compares to Qt ?
CodeJock is a wrapper around MFC which is a wrapper around the windows API.
Adding more wrappers to hide problems is usually not a good solution. All the
cited problems still exist (resources, templates for doc/view, messages,
unicode, internationalisation, ...)
The classes provided by CodeJock allow easier use of MFC controles (simpler
methods or more methods, added features). It it then possible for example to
create a multi-tab view while it is _Mission Impossible_ with MFC.
However, the library is very limited, providing only a few more classes than
MFC, not a full set. We are closer to the set of patches than to a wrapper.
The quality of the library is poor. Many bugs are left, new are added.
During the first 6 month of 2002, there was 3 releases (1.9.2.1, 1.9.2.2,
1.9.3.0), every of them correcting more than fifty bugs, including major ones.
The library is actually neither stable nor tested. This is not a professional
quality tool. Users are alpha testers. Also note that the API changes between
releases, and you must sometime alter your own code to adapt the new versions.
This is a hint of the poor design.
Reading the code (unfortunately unavoidable for codejock, given certain
strange behaviours) reveals tons of horrors: methods with more than 500 lines,
with some redundant code and plenty of return in the middle of nowhere, very
few comments and many many hacks. Many classes members are declared public
where they should indeed be protected and so on.
Documentation is sparse, or void in certain cases (the method is present in
the documentation, with no explanation of anything). Documenting doesn\'t look
like a priority given its absence of progress in the last releases.
There are no features present in CodeJock that you can not find in Qt.
Except for the hexadecimal editor, which unfortunately is buggy as hell and that
you can easily do in Qt (examples already exist).
Qt\'s code quality is very good. The library is always stable and robust.
During the last 6 years, the source and binary compatibility was broken only
twice, to add major features. And only in once case (Qt1 to Qt2) would this
break require substantial code alteration.
Conclusion
The conclusion drawn from our personal experience is obvious. Qt is far better
than MFC. You\'ll produce better programs with less hassle.
Some people complained that this article is biased toward Qt and does not
present any MFC advantage. This is simply our experience : we had tons of
problems with MFC, and almost none with Qt. Programming with Qt was always
simple, documented and efficient. If MFC has good points, we have
not found them, apart from being delivered free with Visual Studio.
We are of course open to feedback: for suggestions, improvements,
remarks and flames,
[email=phil%20at%20freehackers.org]mail us[/email]
!
I would like to include quotes of people who have used both MFC and Qt. If you
have done so, please drop me a mail.