How to analyse a big code and understand it completely



  • Hi,

    I hope you all have written the book C++-GUI-Programming-with-Qt-4-2nd Edition. I'm at the beginning of chapter 5 and the prior four chapters were fine. Chapters 1 and 2 were rather easy to understand and I could write a good QUI Calculator application.
    Chapters 3 and 4 were a long jump! For a learner of Qt, been taught only the first two chapters, it was a too complicated program to offer! There is a spreadsheet program with more than 1500 lines of code. (!!)

    The book supplies codes for each chapter and did it for chapters 3 and 4 as well. Using the code and also having some modifications, I build a project and ran and created also an installer for it. They all work well.

    But I should understand the code completely. Having C++ experience (and working with console applications) makes me not fear the code, although it's complicated and have many header and cpp files.
    Here it is.

    Now the book exists and I can read chapters 3 and 4 and looking at the code together to find all aspects of the code out. "But", is it the correct way? (Besides, the book I think doesn't provide explanation for each part of code, and I may have to create threads for them)

    So, what have each of you done in these situations?
    There may be several ways to master a code, but which is the greatest one, please?
    Thanks for your guide.



  • @tomy
    Hi,
    If you feel something complicated, then refer the same topic in Qt Assistant for brief information and also look at Qt examples on that topic provided in Qt creator.



  • For 9 years working with qt .. but now with version 5 I still have to learn the differences as in dialects there are some great differences ...
    In fact qt4 is a little prehistoric now ... just yesterday i found it the same file opened with (std :: ifstream :: open) goes 2 milliseconds and with qfile open 50 milliseconds .. a qt4 book does not help much, much better Practice practical practice and read the documentation .. see things with your own eyes ...



  • I don't think you should look at the whole of the code at this stage. There are things in there that you will not understand until chapter 10 and later. Just follow the book and focus on the snippets it shows you. You'll get the bigger picture when you complete the manual



  • Thank you very much, but I have to parse and figure it out as much as I can.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.