C++ GUI Programming with Qt 3
The first question that came to mind when I got this book - is there any need for it? Qt's Documentation is detailed and extensive with how-to's and an API reference available online for free. I have done GUI development in .NET (with C#) and Tk (with Perl) environments, and even though I've never tried Qt, the site with tutorials looked like a sufficiently good resource to start.
However, after getting through the first few chapters, religiously trying out the code, my opinions on whether a separate book is needed have changed. Jasmin Blanchette and Mark Summerfield's book can take a sufficiently clueless newbie with some C++ knowledge and guide him through the intricacies of GUI building, providing practical advice and some bits of experience on the way. You learn about the practicality of this book by turning to page 3 (with page 1 being the title) and seeing a code example as the second paragraph of the first chapter. Writing a basic GUI application in C++/Qt is attractively easy, to win you over and make you read the rest of the chapter, as well as finish the basic introduction by creating a windowed application with SpinBox and Slider widgets.
The table of contents is available on the publisher's Web site and looks fairly simple. Each chapter takes about 20-30 pages, with screenshots and code examples provided as part of the text. Reading the first 5 chapters, which comprise the "Basic Qt" section and take up 110 pages, should be enough for any C++ developer to build a sufficiently complex GUI application if all that's required is some graphical interface slapped on top of the functionality that's already there.
The rest of the book -- "Intermediate Qt" chapters -- take the reader into the common problems of GUI development, providing some insight into more advanced topics as well. Supporting networking, working with graphics and images, internationalization of the software application, interacting with help, reading XML through SAX and DOM APIs, accessing databases and doing inter-process communication are all covered here. The authors tended to avoid inserting huge amounts of reference material into the book, and, for example, in the XML chapter when working with Unicode you will be told to go online and download the numeric values of the Unicode characters instead of dedicating valuable book pages to it.
The language of the book is simple to follow; there are plenty of code examples (with discussion following each), and when the authors make certain choices, they also explain why. The diagrams and screenshots are clear (although not in color), and the code examples can be easily separated from the text. This is the first official TrollTech guide to Qt 3.2 programming, and the authors promise that the techniques will work with Qt 4.
Perhaps part of the positive impression that this book left is the fact that programming in Qt is easy and straightforward. At the early stages of my education, I started learning GUI programming with MFC, which left an indelible image of complexity and will probably increase psychiatrist bills in the future (to be fair to Microsoft, Windows Forms with .NET is a huge step forward). The book and the Qt library made some complex things sound quite simple and enjoyable to program. As Matthias Ettrich notes in the foreword to this book, the most important point in reasoning why Qt is so popular is "because programmers like it."
The book comes with a CD that contains non-commercial version of Qt 3.2 for Windows/Mac/Linux, Borland C++ 5.5 (Non-Commercial) and trial version of Borland C++ 6.0 compilers, SQLite database engine and book source code. The non-commercial version of Qt 3.2 for Windows can be installed for Borland C++ 5.5, Borland C++ 6.0, Microsoft Visual C++ 6 and Microsoft Visual C++.NET environments. The examples are quite conveniently located in folders with chapter numbers, followed by subfolders with example names.
Whether you're looking for general introduction to GUI development with C++ or trying to learn Qt, having worked with other libraries and toolkits before, this book is a good source of practical information and reference. The book is part of Perens' Open Source Series.
Alex Moskalyuk enjoys reading and reviewing books on programming and tech industry in general. You can read his other reviews on his personal site. You can purchase C++ GUI Programming with Qt 3from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.
Im sure plenty of people here know Java; any insights (especially from people who know more than one programming language)?
Manipulate the moderator system! Mod someone as "overrated" today.
Aye, it was bad to nitpick in a place like this. What you say is correct with the only stipulation being jsps.
Using most app server default settings (you can set them to precompile the pages when you startup), JSPs are compiled the first time any user hits the page (meaning the first time any person ever hits the page, its compiled, everytime after that, the appserver uses the compiled version unless the jsp code has changed since the last compile). But I'm sure this isn't what he meant when he said java files are compiled on each platform.
Good quote, too many chars. Seriously, the slashdot 120 char limit sucks!
Not true in fact. JSPs tend to be compiled once on the server unless they have self generating data that needs to be recompiled. Most JPS servers have a bunch of cached class files that are the results of the JPS pages being run for the first time. In fact, the JSP site tends to run REALY slow until these class files are generated as compiling for each client on each page takes up a LOT of CPU time. The last large JPS project I worked on had an automated testing script that would go through and hit each page to generate the compiled code before we would release a new version. Granted I think there are some better methods to do this these days but JSP is somthing I've been unable to keep up with.
"Have you ever thought about just turning off the TV, sitting down with your kids, and hitting them?"
Aye, it was bad to nitpick in a place like this.
.java file -> .class file -> hotspot internal recompile. The .java file is what is generated on the first page hit and you can find it in a directory maintained by the app server. (It defines a class extending HttpServlet.) A lot of times I had to figure out why a JSP wasn't behaving correctly by checking its .java source file to see what was in it.
Indeed...
JSPs are compiled the first time any user hits the page (meaning the first time any person ever hits the page, its compiled, everytime after that, the appserver uses the compiled version unless the jsp code has changed since the last compile). But I'm sure this isn't what he meant when he said java files are compiled on each platform.
What you say is true for servlets. For JSP you're leaving out a step (or implying it when you say "compiled") unless JSP has changed since I last used it in 2000. The sequence is JSP ->
You can read it, but it's really unfit for human consumption.