tags:

views:

1643

answers:

4

Does someone know of a book or tutorial explaining Qt for Delphi / C++ Builder / VCL developers?

What would be the best approach for a developer with that background to learn Qt? I'm particulary interested in how to accomplish things that I know how to do in Delphi with Qt.

For example, what is the Qt equivalent to Delphi Frames? What about Forms/Frames inheritance? Should I use Qt Designer, Qt Creator or hand code for such tasks?

Another thing is Qt Widgets and objects life cycle. Does Qt take care of widgets and objects destruction or shoul the programmer do it manually? Or may be Qt does that for some types of objects but not for other types?

As a side note I do know C++, so the language itself is not an issue. I'm concerned with the library.

+1  A: 

the easiest and fastest way to learn something new is to put all the old things aside. don't try to think in Delphi when developing in C++.

first learn some C++ (it's not hard, really) then pick Qt. you don't have to know ALL of C++ and STL to get to speed with Qt, just get comfortable with the syntax and fundamental concepts (like pointers, structs vs. classes, these kind of things).

Javier
I know C++ so it´s not a issue for me. What I'm willing is to learn the mapping between my knowledge of the VCL and Qt.
that's the wrong part. don't search for the mapping, go for the real thing
Javier
+2  A: 

To further what Javier says - concepts from one windowing toolkit to another map even less well than languages. It's especially confusing since there are only so many words (frame,window,widget etc) that get reused.

I would go through the (excellent) examples and tutorials included in the QT distribution (you might have to download the source dist) and then think - how would I have done that in VCL?

Martin Beckett
+6  A: 

One way might be to study the source for the FreeCLX open source project. It contains an implementation of the VCL using Qt. So if you are curious which Qt widget maps to a VCL type, that should get you on your way. Note, however, that Qt 2.x.x used multiple inheritance (no longer true in current Qt), so the FreeCLX interfaces to Qt via a special library to flatten this out.

Craig Stuntz
"Note, however, that Qt uses multiple inheritance" That's not quite true anymore. The latest version Qt (4.5.0) has done away with a lot of the MI that was in the Qt 2.x.x series on which CLX was based.
Allen Bauer
Thanks, Allen; I didn't know. I'll update the post.
Craig Stuntz
So does Lazarus' LCL btw. for QT4.
Marco van de Voort
+2  A: 

If I remember correctly, Qt Assistant has some good beginner tutorials, which step you through the basic structure of an increasingly complex Qt GUI app. You also get introduced to the parent/child hierarchy, the signal/slot event system, both of which are key to understanding Qt applications.

I'm with the others who say not to try to map Delphi metaphors to Qt metaphors. However, you will likely find many similarities along the way where your Delphi experience will give you perspective.

Good luck!

EDIT: QtCentre is the best online forum for Qt development in my opinion. You'll find many knowledgeable people there.

JimDaniel