Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Some inconsistencies with the book qt5_cadaques
Forum Updated to NodeBB v4.3 + New Features

Some inconsistencies with the book qt5_cadaques

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
9 Posts 2 Posters 1.8k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • tomyT Offline
    tomyT Offline
    tomy
    wrote on last edited by tomy
    #1

    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

    Thanks.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

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

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      tomyT 1 Reply Last reply
      2
      • SGaistS SGaist

        Hi,

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

        tomyT Offline
        tomyT Offline
        tomy
        wrote on last edited by tomy
        #3

        @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?

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • tomyT Offline
            tomyT Offline
            tomy
            wrote on last edited by tomy
            #5

            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.

            1 Reply Last reply
            0
            • tomyT Offline
              tomyT Offline
              tomy
              wrote on last edited by
              #6

              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?

              1 Reply Last reply
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Which project are you referring to exactly ?

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • tomyT Offline
                  tomyT Offline
                  tomy
                  wrote on last edited by tomy
                  #8

                  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?

                  1 Reply Last reply
                  0
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

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

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    1

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved