Qt 4.1 rocks!

Published Thursday December 22nd, 2005
3 Comments on Qt 4.1 rocks!
Posted in Qt

The community reactions to the release of 4.1 were quite encouraging. If you followed some of the discussions, e.g. on http://osnews.com/comment.php?news_id=13042 , you have probably noticed that even the most verbal critics are finally running out of arguments. Basically the only complaint that’s left is that Qt – fasten your seat belts – adds introspection to C++. And it does this by – fasten your seat belts tighter – defining three [sic!] macros: Q_SIGNALS, Q_SLOTS, and Q_EMIT (or for the more pragmatics among us: signals, slots, and emit). Muahuahua, evil Trolls, how dare we extending C/C++ for the benefit of programming? Are we too stupid to realize that C++ should not have introspection, that those who want introspection should use Java or a scripting language, or at the very least code their meta code by hand?

Ironically enough the complaint doesn’t come from C or C++ programmers, those are quite used to macros. The complaint comes from people that prefer other languages, and consequently they dislike Qt for making the life of C++ programmers easier. We wrote Qt, we know it is not a “pure” C++ framework, just like C++ is not a “pure” language. Qt makes use of the C-subset of C++, including the preprocessor. And it makes very good use of it. What made C++ the most successful programming language on the planet is its pragmatic design, and its compatibility with C. It’s a meta language, a language powerful enough to be extended to something as beautiful and easy to work with as Qt.

Seriously, we dislike having to use macros just as much as any other C++ programmers. I wish there was a standard C++ preprocessor that fit better into the language than cpp does, and that understood namespaces. However, if three macros are a big problem for you to trade against a wealth of features, than I really envy you: The rest of the world you live in must be really perfect.

The other thing that’s funny about the whole debate is the fact that Qt – like any other successful real-world C/C++ framework that supports different platforms and compilers – defines many more macros than that. Prominent ones are Q_OBJECT, QT_VERSION, Q_OS_UNIX, Q_WS_X11, Q_DECL_DEPRECATED, Q_DECL_EXPORT, and watch guards around each headerfile like QOBJECT_H, QWIDGET_H, QPUSHBUTTON_H, and so on.

And for those that wonder what real abuse of macros is, have a look at http://cvsweb.xfree86.org/cvsweb/xc/include/X.h?rev=

Can’t wait until 4.2, and 4.3. There will come the point were the last ones not to use Qt will realize that they have bet on the wrong horse. Muahuahua.

Do you like this? Share it
Share on LinkedInGoogle+Share on FacebookTweet about this on Twitter

Posted in Qt


pinky says:

Qt4 look really good. Can’t wait for KDE4 to have the full Qt4 power as user and as programmer. But that would still interest me there are a lot of noise about the comming windows and their API which sould offer an all-in-one solution for GUI, 2D graphics and 3D graphics.
Qt is already great for GUI and for 2D graphics (arthur) but what about 3d? Are their any plans to extend arthur to a gerneral graphic framework with 3d functionallity too or for any other 3d “native-qt” integration in the future? What do you think about the development on the “dark side” (windows) πŸ˜‰ I have heard many people saying that the new windows api would be a “programmers-dream” and the chance to close the gap between GUI programmers and 3d-graphic-programmers.

Ian Monroe says:

Don’t read osnews comments, its bad for your soul. πŸ™‚

Gopher IT says:

I couldn’t disagree at all. I do have one newb question though. Having developed all of my apps on Windows and Linux with QT3 I’ve recently decided to develop on the Mac as well rather than relying on porters and I’m having some odd issues with XCode… any assistance would be great Ettrich. Let me know if you think you can help.

Commenting closed.

Get started today with Qt Download now