Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [CLOSED] How does someone make sense of Qt?

[CLOSED] How does someone make sense of Qt?

Scheduled Pinned Locked Moved General and Desktop
13 Posts 4 Posters 3.4k Views
  • 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.
  • S Offline
    S Offline
    SteveG
    wrote on 31 Dec 2013, 21:48 last edited by
    #1

    In a recent post about the (non-) existence of UML class diagrams for QML types and Qt C++ classes, I indicated that there are 32 different TextField.qml files in the Qt 5.2.0 that I downloaded for Windows 8, ranging in size from 3KB to 21KB. After exploring further, I have no idea which TextField.qml file to use in generating diagrams for QML types, although I can "arbitrarily" select one of the 6 that inherit from FocusScope, or why there are 32 files named TextField.qml. Has anyone heard of common or shared directories?

    To make matters worse, there is no C++ class close in name to TextField and it seems that QLineEdit is the "corresponding" C++ class that one would use. Is this correct?

    In addition, there are 1070 C++ classes listed on the "All Classes":http://qt-project.org/doc/qt-5/classes.html page and 327 QML types listed on the "All QML Types":http://qt-project.org/doc/qt-5/qmltypes.html page. How does anyone get their hands around this and make sense of the "dual ladder" of C++ classes and QML types?

    Thanks.

    Steve

    1 Reply Last reply
    0
    • B Offline
      B Offline
      bootchk
      wrote on 31 Dec 2013, 23:41 last edited by
      #2

      Should there be a corresponence? My limited understanding is that QML is Javascript, which is a 'prototyping' language, different from the 'inheritance' language C++.

      My experience... when I started, I looked at a class diagram for Qt. Then I learned from the documentation (which tells super and subclasses), and haven't looked at the class diagram in a long time. (I use PyQt, read C++ documentation, and don't use QML.)

      The sheer number of classes is not a bad thing. There is an adage: if your code is too complicated, add an object.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        steno
        wrote on 31 Dec 2013, 23:57 last edited by
        #3

        I think picking up Qt with never using it before, I would first look at the examples. If you already know c++, the examples are enough to help you get started. QML and QWidgets are two different technologies with their own pro's and con's.

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SteveG
          wrote on 31 Dec 2013, 23:59 last edited by
          #4

          I have used numerous languages over the years, including JavaScript and C++. I do not regard JavaScript as a prototyping language, especially with node.js and all of the available modules for it. JavaScript allows inheritance in a somewhat more limited sense than C++ and is more powerful and flexible in other ways.

          I am interested in using QML/JavaScript with minimal C++ since it's also a more productive way to develop software (e.g., less error prone, fewer lines of code, etc.).

          I haven't found any UML class diagrams for the Qt C++ classes or the QML types so if you know where they are, please let me know.

          Thanks.

          Steve

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SteveG
            wrote on 1 Jan 2014, 00:03 last edited by
            #5

            I've looked at several of the the examples, code in GitHub and Gitorious (among others), reviewed the documentation, viewed tutorials, looked at forum posts, etc. Despite all this, I'm just starting to get my arms partly around Qt after 3 months.

            Thanks.

            Steve

            1 Reply Last reply
            0
            • B Offline
              B Offline
              bootchk
              wrote on 1 Jan 2014, 10:41 last edited by
              #6

              "An old thread lamenting that class diagrams are outdated.":http://www.qtcentre.org/threads/19730-Is-there-a-qt-4-5-class-pdf-out-there

              An old diagram named qt43-class-chart.pdf can be "downloaded here":http://subversion.assembla.com/svn/robot-polytech-ese/docs/_docs_software/_global/Qt/.

              I agree that QML (and Python) are easier than C++, but don't believe the marketing hype that you will be creating programs easily. Another rule-of-thumb: it takes 10,000 hours of practice to become proficient. Study other GUI frameworks. Unfortunately, some good material is only in printed books.

              1 Reply Last reply
              0
              • J Offline
                J Offline
                JKSH
                Moderators
                wrote on 1 Jan 2014, 12:42 last edited by
                #7

                Hi,

                What would you like to understand through these UML diagrams (if they existed)?

                • "If I were to reimplement this QML app in C++, which classes would I use?"
                • "What are the C++ implementation details of this QML type?"
                • Something else?

                [quote]it seems that QLineEdit is the “corresponding” C++ class that one would use. Is this correct?[/quote]Correct. However, they share no implementation details whatsoever.

                That's because C++ widgets were invented >10 years ago to provide static desktop GUI components (buttons, text input fields, combo boxes, checkboxes, etc.), whereas QML was invented ~3 years ago to provide fluid, heavily-animated smartphone GUI components. TextField and other components in "Qt Quick Controls submodule":http://qt-project.org/doc/qt-5/qtquickcontrols-index.html use new QML technology to mimic traditional widgets.

                [quote]I’ve looked at several of the the examples, code in GitHub and Gitorious (among others), reviewed the documentation, viewed tutorials, looked at forum posts, etc. Despite all this, I’m just starting to get my arms partly around Qt after 3 months.[/quote]I found that I learnt fastest when I jumped into the deep and and started coding, without waiting until I fully understood all the features offered by Qt. The latter would take forever.

                Do you have a project in mind you could try to implement?

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                1 Reply Last reply
                0
                • S Offline
                  S Offline
                  SteveG
                  wrote on 1 Jan 2014, 16:10 last edited by
                  #8

                  bootchk,

                  It's nice to see that there were class diagrams for the Qt 4.3 C++ classes. Unfortunately, they are too old to be of much value and only contain class names (not attributes and methods).

                  I never said it was easy to do software development. I just feel that there are advantages to using QML and JavaScript over C++.

                  I don't know where your "10,000 hours of practice to become proficient" comes from, but this is roughly 5 years since there are approximately 2,000 hours in a year (~50 weeks x 40 hours/week in a light week ;-)).

                  I've used (too) many GUI frameworks in multiple languages. They all have a base of assumptions and take time to understand and properly learn. Unless the goal is to use a specific framework, I find that just studying a framework is a tremendous waste of time.

                  I do agree that some of the best material is in books. That's because they take time to write, are generally written by knowledgeable people and consolidate a lot of material into a (hopefully) readable form.

                  Thanks.

                  Steve

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SteveG
                    wrote on 1 Jan 2014, 17:18 last edited by
                    #9

                    JKSH,

                    The class diagram represents the static view of a system, such as an application framework or library. It's uses include visualizing, describing and documenting different aspects of a system. The class diagram shows a collection of classes, interfaces, associations, collaborations and constraints. It is one of the most widely used of the 14 UML diagrams.

                    I'm interested in a QML class diagram that I can evolve as I develop apps so I will probably have to create one myself. QML types in such a diagram can be tied (e.g., by links) to Qt's QML documentation, etc. I may also create some other UML diagrams with an agile development approach and not just hack away

                    I'm aware that TextEdit and QLineEdit "share no implementation details whatsoever" and have not implied that they do. Since there are over 3 times the number of C++ classes as there are QML types, there will be occassions where I will require the use of C++ functionality within QML types that I develop, such as for 3D graphics. All of the examples that I've seen so far using OpenGL in QML require writing C++ classes - which I'd like to avoid. Looking at C++ examples and documentation such as "All Classes by Module":http://qt-project.org/doc/qt-5/modules-cpp.html and "All Classes":http://qt-project.org/doc/qt-5/classes.html, it's not always "obvious" what C++ class to use and how to use it in QML.

                    I certainly agree with your statement about jumping into the deep as the best way to proceed and have done this over the last 3 months. Baptism by fire can be painful the the alternatives are probably worse. Having forums where people can discuss ideas and problems also helps with the learning curve.

                    Thanks.

                    Steve

                    1 Reply Last reply
                    0
                    • B Offline
                      B Offline
                      bootchk
                      wrote on 1 Jan 2014, 21:42 last edited by
                      #10

                      I read about 10,000 hours in a Malcolm Gladwell book, where an example was the Beatles playing 100 hours a week in clubs for 5 years.

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SteveG
                        wrote on 2 Jan 2014, 05:15 last edited by
                        #11

                        bootchk,

                        Malcolm Gladwell's books, such as Outliers, are interesting but I wouldn't put too much stock in their accuracy.

                        Steve

                        1 Reply Last reply
                        0
                        • J Offline
                          J Offline
                          JKSH
                          Moderators
                          wrote on 25 Jan 2014, 12:36 last edited by
                          #12

                          Hi SteveG,

                          Have a look at this user's work: http://qt-project.org/forums/viewthread/36786/

                          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            SteveG
                            wrote on 25 Jan 2014, 19:20 last edited by
                            #13

                            JKSH,

                            The C++ class diagrams are nice. I've asked some questions in the thread you referenced.

                            Thanks.

                            Steve

                            1 Reply Last reply
                            0

                            • Login

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