Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
×
News Books Media Book Reviews

Review:Programming with Qt 41

ErikSev has graciously submitted a review to Mathias Kalle Dalheimer's latest O'Reilly effort Programming with Qt. For those of you interested, click below to find out more about.
Programming with Qt
author Matthias Kalle Dalheimer
pages 361
publisher O'Reilly
rating 9/10
reviewer ErikSev
ISBN
summary An excellent book on QT programming, and a must buy.
The Scenario:

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

This discussion has been archived. No new comments can be posted.

Review:Programming with Qt

Comments Filter:
  • by Anonymous Coward
    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.

  • by Hemos ( 2 )
    Is it just that no one is posting to this? Or have I found a bug?
  • Posted by King Kludge:

    The Troll Tech C++ based QT GUI toolkit, available for Linux, Win32, and used as the backbone of KDE. Check the home page at
    http://www.troll.no/

    Ciao.
  • : It's worth noting that G, A, T, and C are the
    : 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.

  • Try these sites:

    www.gnome.org [gnome.org]

    www.gtk.org [gtk.org]
  • Put down that crack pipe.

    Guillame pointed out problems with language wrappers in general. Mainly maintenance problems. He said nothing about how good or bad Gtk-- is. In fact Ken Nelson often refers to libsig++, the signal framework of Gtk--, as the most advanced out there (no need for moc like hacks if I understood it correctly).

    /mill - which found the Mico/STL thread on kde-devel hilarious and oh so suiting
  • I also read this book recently, and my capsule review was:
    An introduction to writing GUI programs using the Qt toolkit. The book is almost exactly what I want from a programming book; it gives enough background to get started and to understand the reference documentation, but doesn't lose itself in trivia. Nor does it lose itself in dozens of pages of code; there are only a few examples, and none of inordinate length.

    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.

  • KDE the only one that supports OO languages? Hardly -- the GTk/GNOME module for Python is well-maintained and quite good. A Python Qt/KDE module exists, and is also pretty good, though all the glue code required for Qt -- C++, remember -- results in an extension module that's a startling 5Mb large. (They're working on reducing the code size.) The GNOME modules add up to around 2Mb in all. So it's quite possible to write programs for either toolkit in Python, though documentation is still scarce.
  • 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 [wxwindows.org]. 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.
  • 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...).
  • QT [troll.no] is a "GUI Toolkit" produced by a company called Troll Tech [troll.no]. A GUI Toolkit is a library that contains a framework for developing graphical applications. This prevents programmers from having to reinvent the wheel, so to speak, whenever a programmer needs to create a scrollbar in his/her application. QT is written in C++ and has the benefits that it's free for Open SourceTM use, has the source available, and is fairly handsome.

    QT is the foundation upon which The K Desktop Environment [kde.org] and QT NetHack [troll.no] (of arguably greater importance) are built.


    The following sentence is true.
    The previous sentence is false.
  • by ErikSev ( 10724 )
    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 [gtk.org] for documentation on the underlying GUI toolkit, and you can go to the GNOME website [gnome.org] 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.
  • 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
  • by Quigley ( 18976 )
    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.
  • 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).
    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++ .. 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.
    Maybe you should try to do the same.

  • 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) !!

  • 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 [troll.no]

  • 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.

    ---------------------------------------
  • I won't address the KDE vs Gnome thing for the 100th time. Since this is about a Qt book though, I will say this:

    C++ is a nasty hack. I learnt it, I used it, I got tired of it, and I'm still writing C, Scheme and Java. The limitations of C++ are demonstrated by the inclusion of "moc" in Qt. Since when did I need language extensions to program a GUI? The only other toolkit I'm familiar with that does this is... MFC, which is also based on C++

    Maybe I jump to conclusions too easily, but I think C++ is a poor choice of language for an ostensibly platform-independent GUI. The language is still very immature, and doesn't even show OO techniques very well.

    If you're determined that OO design is "it" then check out GTK+ _and_ Qt before you decide on one or the other based solely on the rhetoric of this book or the Trolls. If you're determined to use C++, check out GTK-- too.

    Disclaimer: I've used GTK+ since 1997

"Why can't we ever attempt to solve a problem in this country without having a 'War' on it?" -- Rich Thomson, talk.politics.misc

Working...