July 21, 2011

absfrm absfrm
Lab Rat
338 posts

Learning Qt Step by step

 

hi to all
i found too Qt training file. but i cant found a good step by step (good training index) for learning
now,could you help me?
i wanna to learn Qt so good and advance.
thanks

 Signature 

If You Want You Can!

11 replies

July 21, 2011

yan bellavance yan bellavance
Lab Rat
50 posts

a good starting point would be here:

how to learn qt [doc.qt.nokia.com]

or here:

getting started [doc.qt.nokia.com]

July 21, 2011

Zlatomir Zlatomir
Ant Farmer
367 posts

You can try a book, for some of us the books (even if Qt ones are somehow out-dated) are the best way to “get into” an framework – the books usually presents the topics in some organized way and it seems to me that you need exactly that, here [developer.qt.nokia.com] you can find some descriptions of Qt related books.

//if i remember correctly the first edition of C++ GUI Programming with Qt 4 is available for free download – even if that one uses Qt 4.1 is still a good start, because you can switch to documentation site after you get the basic concepts used by Qt framework.

Also this [doc.qt.nokia.com] documentation page can be used to read about specific Qt “patterns” – so might be a good start.

July 22, 2011

absfrm absfrm
Lab Rat
338 posts

oh
thanks for your answer

 Signature 

If You Want You Can!

July 23, 2011

Stavros Filippidis Stavros Filippidis
Lab Rat
392 posts

I would also suggest Qt in Education course material [qt.nokia.com]

July 23, 2011

Edico Edico
Lab Rat
25 posts

There are some strategies:
1. A good book is C++ GUI Programming with Qt4. Here is the useful documentation you’ll need http://doc.qt.nokia.com/4.7/index.html
2 . Plan for a project to realize in Qt and work to it while you read Qt documentation.
3. My strategy: I planed to read all. I’ve devided my time in two parts: reading part and working to my project part.
a) Reading part: I read a section from the book, then I complete the knowledge I’ve accumulated with the documentation from here http://doc.qt.nokia.com/4.7/index.html . Ex. I read about Widgets in the book, then I read about Widgets in the documentation site, then I read the exercises code from Widgets section. Of course I write the exercises from the book, compile and execute them; I compile and execute the exercises from the site, I modify the code when I want to see some behaviour and so one … I also plan when I finish the exercises to head for Demonstrations.
b) Working on my project part. This is the most beautiful part and I like it the most.
4. My strategy is not the best. Many people don’t read all the stuff but jump to the parts relevant to their project. Some don’t even bother too much to search for documentation, they post a topic in forum with something that they want to realize and receive the links to the relevant documentation. Looks they are more efficient. They complete their projects faster than me.

August 3, 2011

absfrm absfrm
Lab Rat
338 posts

Hi
Thanks for your complete answer Edico. ;)

 Signature 

If You Want You Can!

August 5, 2011

aureshinite aureshinite
Lab Rat
38 posts

I don’t think a book is necessary. You first have to understand (or at least know ) some of the design practices and specifics mechanisms of the framework. For example, you have to understand signal and slots mechanisms or the parent-child hierarchy of QObjects. The best way is to read the dedicated articles on the website or watch the videos as suggested earlier. Then there is 2 methods which complement each other: Reading the Examples source gives the advantage to see exactly the code and the results (and even to see how it behaves differently when you modify the source); Reading the documentation every time you want to do anything :). You want to read a file? First search “read a file “ on this forum and see which responses are given by the gurus or people which seems to know what they talk about.

quick note: I started my first day at work with 0 knowledge of Qt and had to learn while building my application… So really don’t miss the first step because I did.

August 5, 2011

amban amban
Lab Rat
46 posts

Hi,
If you want to headstart…the videos posted on this youtube channel http://www.youtube.com/user/VoidRealms really helped me. I started from scratch here. He covers the basic elements very well and once you reach tutorial 30 ….you feel pretty confident to move on on your own and of course with the help of this amazing group of people contributing to the development forums.

August 5, 2011

bobby bobby
Lab Rat
32 posts

Cool videos amban. Have you looked at some of the previous summit talks available on this site? Check them out [developer.qt.nokia.com]

 Signature 

“Linux is not user-friendly.” It _is_ user-friendly. It is not ignorant-friendly and idiot-friendly.
—-Source unknown

July 5, 2012

xie_jiuan008 xie_jiuan008
Lab Rat
5 posts

These codes is not enough , where is the other codes? Could you Email me the other codes?

[COPY FROM Your text to link here… [qt-project.org]]
Let us look at the code:

5 class Notepad : public QWidget 6 { 7 Q_OBJECT 8 9 public: 10 Notepad(); 11 12 private slots: 13 void quit(); 14 15 private: 16 QTextEdit *textEdit; 17 QPushButton *quitButton; 18 };The Q_OBJECT macro must be first in the class definition, and declares our class as a QObject (Naturally, it must also inherit from QObject). A QObject adds several abilities to a normal C++ class. Notably, the class name and slot names can be queried at run-time. It is also possible to query a slot’s parameter types and invoke it.

Line 13 declares the slot quit(). This is easy using the slots macro. The quit() slot can now be connected to signals. We will do that later.

Instead of setting up the GUI and connecting the slot in the main() function, we now use Notepad’s constructor.

20 Notepad::Notepad() 21 { 22 textEdit = new QTextEdit; 23 quitButton = new QPushButton(tr(“Quit”)); 24 25 connect(quitButton, SIGNAL), this, SLOT)); 26 27 QVBoxLayout *layout = new QVBoxLayout; 28 layout->addWidget(textEdit); 29 layout->addWidget(quitButton); 30 31 setLayout(layout); 32 33 setWindowTitle(tr(“Notepad”)); 34 }As you saw in the class definition, we use pointers to our QObjects (textEdit and quitButton). As a rule, you should always allocate QObjects on the heap and never copy them.

We now use the function tr() around our user visible strings. This function is necessary when you want to provide your application in more than one language (e.g. English and Chinese). We will not go into details here, but you can follow the Qt Linguist link from the learn more table.

Here is the quit() slot:

75 void Notepad::quit() 76 { 77 QMessageBox messageBox; 78 messageBox.setWindowTitle(tr(“Notepad”)); 79 messageBox.setText(tr(“Do you really want to quit?”)); 80 messageBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); 81 messageBox.setDefaultButton(QMessageBox::No); 82 if (messageBox.exec() == QMessageBox::Yes) 83 qApp->quit(); 84 }
yan bellavance wrote:
a good starting point would be here: how to learn qt [doc.qt.nokia.com] or here: getting started [doc.qt.nokia.com]

July 5, 2012

absfrm absfrm
Lab Rat
338 posts

sorry
this topic posted one year ago!!

 Signature 

If You Want You Can!

 
  ‹‹ Parsing input and performance of QRegExp      Bug with QPushButton hit-testing under OS X. ››

You must log in to post a reply. Not a member yet? Register here!