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. Motivation for not putting documentation comments in headers

Motivation for not putting documentation comments in headers

Scheduled Pinned Locked Moved Unsolved General and Desktop
docs
7 Posts 4 Posters 1.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.
  • K Offline
    K Offline
    Kerndog73
    wrote on 10 Mar 2019, 12:17 last edited by
    #1

    The Qt headers do not contain documentation comments. The documentation is embedded in the sources (but I don't have the sources so I don't know). If I want to know what a function does, I have to leave the IDE and look it up.

    Why does it have to be this way? It's annoying. It slows down my workflow (because I'm still learning how to use Qt). Is there a good reason for doing things differently to other libraries?

    J 1 Reply Last reply 10 Mar 2019, 12:32
    0
    • C Online
      C Online
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 10 Mar 2019, 12:29 last edited by
      #2

      Use Qt creator, mark the class/function you want the help for and press F1. Or wait for the tooltip.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      4
      • K Kerndog73
        10 Mar 2019, 12:17

        The Qt headers do not contain documentation comments. The documentation is embedded in the sources (but I don't have the sources so I don't know). If I want to know what a function does, I have to leave the IDE and look it up.

        Why does it have to be this way? It's annoying. It slows down my workflow (because I'm still learning how to use Qt). Is there a good reason for doing things differently to other libraries?

        J Offline
        J Offline
        JKSH
        Moderators
        wrote on 10 Mar 2019, 12:32 last edited by JKSH 3 Oct 2019, 14:40
        #3

        Hi @Kerndog73, and welcome!

        @Kerndog73 said in Motivation for not putting documentation comments in headers:

        If I want to know what a function does, I have to leave the IDE and look it up.

        You can look it up within the IDE; no need to leave it. Just hover your mouse cursor over the function (in your own code or in the header file) and press F1. When you've finished reading, press Esc to close the documentation pane.

        EDIT: @Christian-Ehrlicher beat me to it!

        The Qt headers do not contain documentation comments. The documentation is embedded in the sources (but I don't have the sources so I don't know)....

        Why does it have to be this way?.... Is there a good reason for doing things differently to other libraries?

        I believe the F1 approach provides a smoother workflow than having to open the header files.

        Also, Qt documentation is extremely comprehensive (see line #1006 onwards, for example: https://code.woboq.org/qt5/qtbase/src/corelib/kernel/qobject.cpp.html#1006 ) Putting all this documentation in the headers would make them absolutely massive.

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

        1 Reply Last reply
        5
        • K Offline
          K Offline
          Kerndog73
          wrote on 10 Mar 2019, 22:05 last edited by
          #4

          I'm not using Qt Creator. I guess I'm gonna have to start using all of the Qt tools like moc, qmake and Qt Creator even though I've been able to get on fine without them.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 10 Mar 2019, 22:18 last edited by
            #5

            Hi,

            Or you can use the online documentation or use Qt's Assistant.

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

            J 1 Reply Last reply 10 Mar 2019, 22:50
            2
            • S SGaist
              10 Mar 2019, 22:18

              Hi,

              Or you can use the online documentation or use Qt's Assistant.

              J Offline
              J Offline
              JKSH
              Moderators
              wrote on 10 Mar 2019, 22:50 last edited by
              #6

              @Kerndog73 said in Motivation for not putting documentation comments in headers:

              I'm not using Qt Creator.

              Sorry, I shouldn't have assumed you were.

              I guess I'm gonna have to start using all of the Qt tools like moc, qmake and Qt Creator even though I've been able to get on fine without them.

              You can use Qt without Qt Creator or qmake, but moc is a core part of Qt: Your ability to subclass QObject-based classes will be limited without moc.

              • The other supported IDE is Visual Studio, via the Qt VS Tools.
              • The other supported build manager is CMake. (There is also Qbs but the Qt Company is no longer actively developing it)
              • There is no replacement for moc

              Do give Qt Creator a try. It has lots of features to improve workflow with Qt-based projects:

              • Integrated documentation
              • Integrated example projects
              • Integrated WYSIWYG editors for GUIs written in both C++ (Qt Widgets) and QML (Qt Quick)
              • Integrated profiler for QML code
              • Various templates for creating new projects or classes
              • Syntax highlighting and code completion for Qt-specific features
              • It automatically runs moc and other Qt tools -- you don't have to run them manually

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

              1 Reply Last reply
              4
              • K Offline
                K Offline
                Kerndog73
                wrote on 11 Mar 2019, 02:34 last edited by
                #7

                @JKSH I installed Qt Creator. I can see the benefits of using this for creating Qt applications. However, switching IDEs is an incredibly jarring experience. Trying to migrate my project to a Qt Creator project was painful. Xcode was working fine and I'm used to it. Using Qt Creator from the beginning would have made a lot more sense.

                I'll definitely use Qt Creator for my next Qt project.

                1 Reply Last reply
                0

                7/7

                11 Mar 2019, 02:34

                • Login

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