Trolltech was very kind to send us over a copy of the recently released "C++ GUI Programming with Qt 3" book, part of "Bruce Perens' Open Source Series". The book weighs in at about 400 pages and comes with a CD-ROM loaded with software not found elsewhere freely.
Permalink for comment
To read all comments associated with this story, please click here.
I used to dislike the Qt way of doing C++, until I really understood why it is the way it is. C++ is a very static language. Its template mechanism, which is the focus of most recent innovations in C++ design, is especially so. GUIs, however, are particularly well suited to a dynamic language. Consider: why are developers so enamoured with Cocoa and Objective C? Its because Objective C is a dynamic language, and Cocoa is a well-designed API that takes advantage of that dynamicity.
Moc buys you a lot of things that C++ just doesn't do. Qt's signals and slots are a lot more flexible and easy to use than a template-based mechanism. Further, moc gives you a general property mechanism (especially useful for things like Qt Designer), extended runtime information, persistance of properties, etc. The explicity hierarchy of objects created by QObject also greatly simplifies memory management. All of these things address some fundemental limitations of C++ as a language for coding GUIs.
I used to dislike the Qt way of doing C++, until I really understood why it is the way it is. C++ is a very static language. Its template mechanism, which is the focus of most recent innovations in C++ design, is especially so. GUIs, however, are particularly well suited to a dynamic language. Consider: why are developers so enamoured with Cocoa and Objective C? Its because Objective C is a dynamic language, and Cocoa is a well-designed API that takes advantage of that dynamicity.
Moc buys you a lot of things that C++ just doesn't do. Qt's signals and slots are a lot more flexible and easy to use than a template-based mechanism. Further, moc gives you a general property mechanism (especially useful for things like Qt Designer), extended runtime information, persistance of properties, etc. The explicity hierarchy of objects created by QObject also greatly simplifies memory management. All of these things address some fundemental limitations of C++ as a language for coding GUIs.
Read the rationale for moc at the TT website:
http://doc.trolltech.com/3.3/object.html
http://doc.trolltech.com/3.3/templates.html