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. How to document QML and C++ code?
QtWS25 Last Chance

How to document QML and C++ code?

Scheduled Pinned Locked Moved QML and Qt Quick
qt documentatioqml documentatic++ and qml coddocumentationqdoc
5 Posts 3 Posters 2.3k 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.
  • vishnuV Offline
    vishnuV Offline
    vishnu
    wrote on last edited by vishnu
    #1

    I would like to document my QML and C++ code. Can any one suggest me the best way to do it?
    When i googled it. I got to know the plugin Doxygen but i think its only for c++(I am not sure whether it can generate for QML code as well).
    I have drawn class diagrams for c++ and qml . please have a look here. you can also edit and comment.

    p3c0P 1 Reply Last reply
    0
    • vishnuV vishnu

      I would like to document my QML and C++ code. Can any one suggest me the best way to do it?
      When i googled it. I got to know the plugin Doxygen but i think its only for c++(I am not sure whether it can generate for QML code as well).
      I have drawn class diagrams for c++ and qml . please have a look here. you can also edit and comment.

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @vishnu Did you try QDoc ?
      QML too is supported. See following:
      http://doc.qt.io/qt-5/qtwritingstyle-qml.html
      http://doc.qt.io/qt-5/qdoc-componentset-example.html

      157

      vishnuV 1 Reply Last reply
      0
      • p3c0P p3c0

        @vishnu Did you try QDoc ?
        QML too is supported. See following:
        http://doc.qt.io/qt-5/qtwritingstyle-qml.html
        http://doc.qt.io/qt-5/qdoc-componentset-example.html

        vishnuV Offline
        vishnuV Offline
        vishnu
        wrote on last edited by vishnu
        #3

        @p3c0
        I didn't know about QDoc. Thanks for that but I am unable to understand the description.
        How should i generate QDoc configuration file? i see the description here here. but not able to understand it. It is given that
        To run qdoc, the project configuration file is supplied as an argument.
        qdoc project.qdocconf
        where should i provide the argument?
        Specifying the path to the source directories allow QDoc to find sources and generate documentation.
        where should i specify ? In .pro file or where exactly ?

        where should i run the cmd prompt in windows?
        eg: all my project files are in this location C:\Qt\Lely\LelyUI4> and i opened a cmd promt here. now what to do ? . Can you please describe step wise?

        Also they claim that with Qt5.5 it saves time suing single execution mode. here it is .I didn't understand where should i run thi cmd
        /Users/me/qt5/qtbase/bin/qdoc -outputdir /Users/me/qt5/qtbase/doc -installdir /Users/me/qt5/qtbase/doc /Users/me/qt5/master.qdocconf -single-exec
        Thanks a lot.

        p3c0P C 2 Replies Last reply
        0
        • vishnuV vishnu

          @p3c0
          I didn't know about QDoc. Thanks for that but I am unable to understand the description.
          How should i generate QDoc configuration file? i see the description here here. but not able to understand it. It is given that
          To run qdoc, the project configuration file is supplied as an argument.
          qdoc project.qdocconf
          where should i provide the argument?
          Specifying the path to the source directories allow QDoc to find sources and generate documentation.
          where should i specify ? In .pro file or where exactly ?

          where should i run the cmd prompt in windows?
          eg: all my project files are in this location C:\Qt\Lely\LelyUI4> and i opened a cmd promt here. now what to do ? . Can you please describe step wise?

          Also they claim that with Qt5.5 it saves time suing single execution mode. here it is .I didn't understand where should i run thi cmd
          /Users/me/qt5/qtbase/bin/qdoc -outputdir /Users/me/qt5/qtbase/doc -installdir /Users/me/qt5/qtbase/doc /Users/me/qt5/master.qdocconf -single-exec
          Thanks a lot.

          p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          @vishnu Unfortunately I too haven't used the tool myself. Perhaps you to create your own qdocconf configuration file depending upon your requirement. The docs seems to be explaining all the required stuff. Try out the sample conf file mentioned on that page. The tool can be run from anywhere as long as the tool path and conf file path and project paths are valid.

          157

          1 Reply Last reply
          0
          • vishnuV vishnu

            @p3c0
            I didn't know about QDoc. Thanks for that but I am unable to understand the description.
            How should i generate QDoc configuration file? i see the description here here. but not able to understand it. It is given that
            To run qdoc, the project configuration file is supplied as an argument.
            qdoc project.qdocconf
            where should i provide the argument?
            Specifying the path to the source directories allow QDoc to find sources and generate documentation.
            where should i specify ? In .pro file or where exactly ?

            where should i run the cmd prompt in windows?
            eg: all my project files are in this location C:\Qt\Lely\LelyUI4> and i opened a cmd promt here. now what to do ? . Can you please describe step wise?

            Also they claim that with Qt5.5 it saves time suing single execution mode. here it is .I didn't understand where should i run thi cmd
            /Users/me/qt5/qtbase/bin/qdoc -outputdir /Users/me/qt5/qtbase/doc -installdir /Users/me/qt5/qtbase/doc /Users/me/qt5/master.qdocconf -single-exec
            Thanks a lot.

            C Offline
            C Offline
            coffee247
            wrote on last edited by
            #5

            @vishnu In a project called RBIMS, I created a text docuemt called RBIMS.qdocconf which contained the following text:

            include(compat.qdocconf)
            
            project = RBIMS
            outputdir   += ./html
            
            headerdirs  += .
            sourcedirs  += .
            exampledirs = .
            imagedirs   = ./images
            
            headers.fileextensions = "*.h *.ch *.h++ *.hh *.hpp *.hxx"
            sources.fileextensions = "*.cpp *.qdoc *.mm *.qml"
            

            I used the following command (executed from within my project folder) at the command line:

            ~/Qt/5.15.0/gcc_64/bin/qdoc /home/jim/Qt_Projects/RBIMS/RBIMS.qdocconf
            

            This produced an XML file in the html folder inside my project.

            <?xml version="1.0" encoding="UTF-8"?>
            <!DOCTYPE QDOCINDEX>
            <INDEX url="" title="RBIMS Reference Documentation" version="" project="RBIMS">
                <namespace name="" status="active" access="public" module="rbims">
            ... 
            ...  Code removed for brevity
            ...
            virtual="non" const="false" static="false" final="false" override="false" type="bool" signature="bool createDatabase()"/>
                        <function name="database" fullname="database::database" href="database.html#database" status="active" access="public" location="database.h" filepath="/home/jim/Qt_Projects/RBIMS/database.h" lineno="36" documented="true" meta="constructor" virtual="non" const="false" static="false" final="false" override="false" type="" brief="Database::database test constructor doc  parent" signature="database(int *parent)">
                            <parameter type="int *" name="parent" default="nullptr"/>
                        </function>
            

            You can see (toward the end) that ....

            brief="Database::database test constructor doc  parent"
            

            is created, which was a

            /*!
             * \brief database::database test constructor doc
             * \param parent
             */
            

            Qdoc comment in my code.

            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