Some inconsistencies with the book qt5_cadaques

  • Hi all,

    I was advised to read the book "qt5_cadaques" for being able to write programs for Android and iOS platforms perfectly.
    I started to read it and continued until page 13 of that book (the result of HelloWorld project)

    I acted this way.
    As you see, the result of my project (image 3) is not the same as the one shown in the book!
    Mine is showing "Enter some text" while the book's shows "Hello world" at the middle of the window.

    I don't know if I went the way wrongly or not!
    Would you please tell me what is the reason for this difference.

    My OS: windows 7 x64
    My Qt Creator: 5.8


  • Lifetime Qt Champion


    I never wrote about perfection ;)

    That set aside, your code is also not the same as the one from the book.

    You're setting the title of your MainWindow object to "Hello World" while the example from the book creates a Rectangle which contains a Text element which has its content set to "Hello World".

  • @SGaist
    By perfection I meant, using that book + good experience of C++ + hardworking, I think there would be no way to "not" create apps for those platforms perfectly ;)

    About the code, the book just uses the wizard of Qt Creator for that project and I, too, just used the wizard like them. I think the difference is of the different versions of the Qt Creator I use (5.8) and the one they used in the book (which is of 2015). Is it Not?

  • Lifetime Qt Champion

    It will depends on the choice of project, by the way the current version of Qt Creator is 4.2.1. It's not the same as the Qt version used to build it or that you are currently using to build your application.

    Even so, it is currently not a small difference of code that triggers the difference, you are not using the same QtQuick elements at all.

    So either, replace your code with the one from the example or explore the book/doc a bit more to learn about the elements you got with the project you created.

  • Yes, I use Qt Creator 4.2.1 (and the Qt version is 5.8), I, too, meant this.
    And yes, I don't use the same elements as the book's project and it was not my fault. The book should have told the reader to "replace the content of the file "HelloWorld.qml" to the one offered by the book. Otherwise this would make a confusion for the reader just like what happened for me.

  • I had a glance at the next projects after "HelloWorld" in that book. Although I didn't read them carefully, it appears in none of them the correct instruction of making a given project is mentioned in the book.

    Would you please have a look at the images 1 and 2 posted previously by me above to see if it's the correct way to use for other next projects?

  • Lifetime Qt Champion

    Which project are you referring to exactly ?

  • Please have a look at the section 2.3 to 2.4 or the titles below:

    • 2.3.1. Console Application
      String Handling
      Container Classes
      File IO
    • 2.3.2. Widget Application
      Custom Widgets
      Desktop Widgets
      Drawing Shapes

    • 2.3.3. Adapting Data

    What should I do about these?

    There is no way taught on how to create those various types of projects using Qt Creator!
    If I want to test them, how to create the projects and what specifications the projects should have?

  • Lifetime Qt Champion

    Well, Qt Creator's documentation about project creation is pretty detailed about that.

Log in to reply

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