Review:Programming with Qt
The Parrot Book, as this is sure to be known, is excellent for a beginner looking to quickly learn the ins and outs of Qt programming. Some previous experience with GUI programming helps, and previous C++ experience is required.
The Layout:
Programming with Qt starts with a chapter on Qt. It addresses freedom issues, portability issues, and other miscellaneous stuff. You then go through a basic program. The next few chapters introduce lots of different widgets and layout managers. Next come all sorts of other things like focus handling, graphics, working with perl, GUI builders, 2d transformations, etc. Look at the table of contents, it pretty much tells you what's included.
The Good:
Most of it. I personally bought this book having no previous experience with Qt, but familiar with GTK, MFC, etc. Within a day or two I was writing usable programs in Qt. This book is direct and to the point. Moreover, this is NOT just Linux users, Windows coders are definately covered, and portability is addressed extensively. GUI design, plus advanced tips and tricks are addressed. As the table of contents shows, all sorts of topics, both beginner and advanced, are covered.
The Bad:
A little too brief.just in spots. The cover of the book touts, "Covers Qt 1.4x and 2.0". I honestly feel that that is almost false advertising. Qt 2.0 is covered in a sparce 4 pages, with only two lines of code. One other nitpick, alot of lines of code are repeated, when he could just show the new/changed portions of the program. Final Thoughts:
While this book isn't a reference manual, it gets you started, and to the point where you can quickly write programs, use the more advanced features, and have the skills to find what you need in the system documentation. I do wish 2.0 were covered more, and that another unique program or two were written instead of so much code repetition. If your interested in learning Qt, and like dead trees to look at, this is a great buy. Everything you expect from a book with an animal on the cover and O'Reilly on the spine.
Pick this book up at Amazon.
Preface
1: Introduction
2: First Steps in Qt Programming
3: Learning More About Qt
4: A Guided Tour Through the Simple Widgets
5: A Guided Tour Through the Qt Dialogs
6: Using Layout Managers
7: Some Thoughts on GUI Design
8: Container Classes
9: Graphics
10: Text Processing
11: Working with Files and Directories
12: Inter-Application Communication
13: Working with Date and Time Values
14: Writing Your Own Widgets
15: Focus Handling
16: Advanced Event Handling
17: Advanced Signals and Slots
18: Debugging
19: Portability
20: Using GUI Builders
21: Qt Network Programming
22: Interfacing Qt with Other Languages and Libraries
23: Using the Visual C++ IDE for Qt Programs
24: Sample Qt Projects
25: A First Look at Qt 2.0
Please excuse my ignorance but I've previously associated QT with QuickTime. Somehow I dont think that is what is being discussed here...
Could someone please fill me in on what QT is?
And the basis for the Unix K Desktop Environment. Take a look at www.troll.no for Qt and www.kde.org for KDE.
The only reason this book couldn't possibly cover all the issues in the API is that it's too short. I'd gladly pay more money to have a more comprehensive book, something on the order of the order of O'Reilly's Java Swing book (for Java 1.2) for example.
The latter has a tutorial for every significant Java UI widget, something that's very valuable especially for the more complex ones. I was hoping the Qt book would be similar, oh well.
Wow I completely missed that one. I thought I had found a few problems with it before but that is a doozy. It may still work though. It doesn't make much sense.
It should be legal the other way around.
QWidget * myLcdNum = new QLCDNumber (1, mywidget);
since QLCDNumber inherits from QWidget.
Correct me if I am wrong.
dleimbac@falcon.lhup.edu
Dave
Even the GTK-- authors have said this (http://features.linuxtoday.com/stories/6298.html) . Depsite all the hype if you want to do *real* Gnome programming you have to use C. KDE is the only desktop that can really use an object oriented language of any kind.
;-)
Don't listen to the Miguel rhetoric, it has no basis in reality
That is why the interpreter is so large. Where is the Gnome Office Python bindings? Opps, I forgot. Gnome has none.
It's event stuff is crap. Qt is much nicer. What is people's hangup with Gtk oriented stuff. KDE/Qt has a larger user base and if you are a C++ coder it has a much nicer API. They did an excellent job. Just look at the QT tutorials at www.troll.no.
Why rewrite GTK+ in C++. A lot of C programmers like it? For C++ we have Qt and KDE. Both desktops made explicit choices as far as the primary language goes, and Gnome choose not to use an object oriented one. That's fine.
It's getting rather late in my timezone ;-)
hmmm... I think O'Reilly is FOR the
OSS movement.
I have to disagree a bit with this review. I have used the book and while it does start off really well, I find that the best source for learning QT is still the HTML tutorial that comes with it. This small book couldn't possibly address all the issues in the API but does offer some good examples. If you want to learn QT quickly and get off the ground I would still get this book but since the documentation of QT is already pretty awesome I would say it isn't necessary.
Is it just that no one is posting to this? Or have I found a bug?
Yeah, I'm that guy.
: four symbols in your DNA.
: There is no I.
When I first looked at this comment, I noticed that GCAT are not themselves part of your DNA, but merely represent the molecules that do constitute your DNA. Thats when the other meaning of the second sentence hit me. (Insert Hofstadter (The Mind's Eye/GEB) and Dawkins (The Selfish Gene) blather here)
--
Man is most nearly himself when he achieves the seriousness of a child at play.
****Gfx Scrollbar Special case hit!!*****
Try these sites:
www.gnome.org
www.gtk.org
Erlang Developer and podcaster
It's worth noting that G, A, T, and C are the four symbols in your DNA.
There is no I.
--
Marc A. Lepage
Software Developer
IMHO that's precisely what a good book should do; give you enough of a grounding to understand and use the documentation and source code. Don't bury me in hundreds of pages of code; don't duplicate the on-line documentation; do cover the basic design ideas underlying the topic.
I believe the parrot book was "Lingo in a Nutshell," off the top of my head. Could be wrong.
If you'd like to write GTK apps using C++, you might want to try the GTK version of wxWindows. It has a very sensible set of object-oriented bindings, and you get the added bonus of having your program be reasonably portable to Motif, Mac, and Windoze.
Tired of FB/Google censorship? Visit UNCENSORED!
Why is it every time I start a book, slashdot posts a review and I lose the urge to continue ?
But anyway, I was wondering about errors, eg page 27, line 22 of the code
QLCDNumber * mylcdnum = new QWidget(1,mywidget);
surely this should be "new QLCDNumber(...)" (see the rest of the code). Is this an isolated instance, or does it continue ?
As for the "diehard MFC programmers, do they exist" comment of one of the replies, yes, unfortunately they do exist, legions of them. I wrote my first C++ Windows wrapper layer in 1990, before MS released a C++ compiler, and I've refused to use that brain-dead excuse for a class library since. But unfortunately all those superb VB programmers out in the world want to progress, and MFC lets them write VB-quality code in C++ (The horror, the horror...).
I spent a lot of money on booze, birds and fast cars. The rest I just squandered. - George Best
I stand corrected :) I am unfortunately not a biology expert. Oops.
Yep, actually from what I've seen the book looks pretty good. Therre's a /. review of it somewhere.
Erik
I've seen a book from New Rider's Press on Programming with the GTK Toolkit (or something like that). I can't comment on it, however, as I've only just picked it up and skimmed, but I do know that it exists.
I'm not a real programmer, but I do on occassion look into other peoples code and try to make it do something a little different. Recently I tried to look at code for text editors, and I found the source for kedit (part of KDE) a joy to look at and very easy to modify.
I also did the same with kmines, changing minesweeper so that it does a few more fun things.
I did this with no training in C++ (I know only C), and certainly no knowledge of Qt.
There is the GTK+ reference documentation project for documentation on the underlying GUI toolkit, and you can go to the GNOME website for documentation on GNOME. There is a revamped GNOME developer web site in development, so this resource will also be available soon.
That's the joy of object oriented programming.... code that is easy to read and maintain. You take a bit of a performance hit but with todays faster machines, it's worth it...(IMHO). I think that this is why KDE has generally advanced faster than Gnome which is mostly done in C.
In Soviet Russia, hot grits put YOU down THEIR pants.
Ilearned Qt a few weeks ago to start programming in KDE. So my question is what do I use if I want to not use Qt? (the Gnome ver) Do you have any links? Good tutorials? Curius minds wish to know
Benjamin
Do you changes clothes while making the "chee-chee-cha-cha-choh" transformation sound?
Isn't it the TOUCAN book, not the parrot book? :)
Other than that, maybe I'll go buy it. I've been tossing around the idea, and with this B&N coupon I've been saving for a rainy day...
I think it's a great book. My two disappointments are 1) it wasn't bigger, and 2) it only skimmed the surface. When discussing a topic, it only gave examples for "typical" uses. I wanted to know about the atypical uses of certain classes, like all the ins and outs of QWidgetStack, etc.
I've found Qt programming to be a joy. I've been porting over an MFC program of mine to Qt, and I still marvel at the stupid stuff you have to do with MFC.
A Government Is a Body of People, Usually Notably Ungoverned
If you did, you would remember that C++ is a superset of the old C and includes most of it. Language extensions? In MFC? Well this once again shows your ignorance. MFC is a (poor) set of class libraries/class wrappers for the Win32 API (written in your precious C, I beleive) and NOT an extension to the language. I can write perfectly functioning Windows code in ANSI Standard C++ by carefully designing classes. No "extensions" just calls to class libraries (GTK and QT are just class libraries/frameworks and work the same way).
.. except for Pointers in C++, they are almost identical. I don't think C++ is perfect. It could certainly use some improvments, but to call it a "hack" and to state that it doesn't do OO very well just shows ignorance. I don't like C too much, but I won't go off making half-assed remarks about it just because I don't...I know for some things it is a very good language.
I suspect that if you had problems with C++ it was because:
A) You only half learned it and were using C++ syntax in old C-style programming (procedural not OO).
or
B) You never learned proper OO techniques. I suggest a college level course or the Book "Design Patterns" by Gamma et al.
As for your assertion that it is an immature language, well it's been around for 15+ years and is ANSI standardized...which is more than I can say for Scheme and Java (don't get me wrong, I like Java).
BTW if you can program Java, you can program C++
Maybe you should try to do the same.
Never by hatred has hatred been appeased, only by kindness - the Buddha
I'm actually waiting for this title to arrive at Amazon (this and the book on MySQL).
Qt is the coder's equilevelent [sp?] to the WINE Project -- open GUI code betwween platforms.
What a wonderful segue into Linux/UNIX for those diehard MFC programmers (and I'm STILL not convinced they actually exist) !!
"He who questions training trains himself at asking questions." - The Sphinx, Mystery Men (1999)
It is a GUI library, used by many programs including KDE. Just like X Motif, GTK+ and MFC (for Windows).
It's made by Troll Tech
Steven Rostedt
-- Nevermind
I have this book, and I have to say that it is very easy to pick up QT programming using it. This is basically the only really good learning aid for QT I have found, online or off.
You don't really need any experience with GUI programming, though. I haven't much, and I picked things up straight away.
This might be an, er, ambitious project, but what if someone just completely redesigned and built GTK+ in C++? Then all the KDE people might shut up and stop laughing at GTK--. (Nothing against KDE fans, it's just that I like GNOME while conceding its flaws.) After all, a wrapper is kind of pointless if you're going to have to download a new library for it anyway. Just release a new OO GTK+.
...
ugh, I hope I didn't just volunteer myself
Yup, it's a good book -- I'm working my way through it right now. More elaborate examples towards the end would've been nice. Also, I hope they come out with a second edition that really covers Qt 2.0. Maybe a second volume covering more advanced stuff.
---------------------------------------
Stephen Molitor steve_molitor@yahoo.com