1. 12 Mar, 2018 - 1 commit
  2. 06 Mar, 2018 - 1 commit
    • Topi Reinio's avatar
      qdoc: Canonicalize include paths · dc10d71b
      Topi Reinio authored
      
      Resolve canonical include paths from the ones passed to QDoc from the
      command line and .qdocconf variable 'includepaths'.
      
      This allows adding include paths that are relative to the documentation
      project (.qdocconf file):
      
        includepaths = -I .
      
      which is useful for modules where we do not have a complete set of
      include paths provided by qmake.
      
      Change-Id: Ieaf0816e8c26857c873e4b521164c70bb1f5e5b3
      Reviewed-by: default avatarMartin Smith <martin.smith@qt.io>
      dc10d71b
  3. 23 Feb, 2018 - 1 commit
    • Martin Smith's avatar
      qdoc: Fix bugs in resolving inheritance and finding overridden functions · 88472204
      Martin Smith authored
      
      A class node must have pointers to the class nodes of its base classes, but these
      pointers might not exist when qdoc creates the class node for the class. They might
      not exist until all the index files and include files have been parsewd. qdoc was
      trying to resolve the base classes too early. This update lets qdoc wait until it
      is known that everything has been built before attempting to resolve inheritance.
      
      This update also delays finding the pointer to the function node for the overridden
      function for a function marked "override" until the pointer is needed. Instead of
      storing the pointer to the node, the qualification path to the function is stored
      as a string, and the string is used to look up the overridden function when it is
      needed, which is only when the \reimp command is processed during output.
      
      The function that resolves the pointer to the overridden function was moved to the
      function node class, where it makes more sense. The way a few qdoc warnings are
      reported was also changed.
      
      Change-Id: Ia54642d11242386ae75139065f481e5d30f79fb5
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      88472204
  4. 19 Feb, 2018 - 1 commit
  5. 08 Feb, 2018 - 1 commit
  6. 05 Feb, 2018 - 1 commit
    • Martin Smith's avatar
      qdoc: Hide clang errors for \fn commands in prepare phase · af023844
      Martin Smith authored
      
      When clang parsing errors were detected in the prepare phase, they were
      being printed without the preceding qdoc warning that shows where they
      occur in the source file. The qdoc warning was not printed because qdoc
      was running in the prepare phase, but the clang errors were printed, and
      that was wrong. This update ensures that the clang parsing errors are only
      printed in the generate phase (or in singleexec mode).
      
      Change-Id: I011fa06626a5e9930fde329113d2bbac8830473b
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      af023844
  7. 01 Feb, 2018 - 1 commit
  8. 31 Jan, 2018 - 2 commits
    • Martin Smith's avatar
      qdoc: Delay ignoring of qt_xxx names until output · de0db5ed
      Martin Smith authored
      
      The ignoreSymbol() function in class ClangVisitor was told
      to return true for every name that starts with "qt_". This
      was too aggressive, so the test is now done at output time.
      If a function name that starts with "qt_" has no documentation,
      qdoc does not warn with "No documentation for qt_..."
      because almost all such names are not to be documented. But
      they can be documented, so that's why the test is performed
      at the last moment.
      
      Change-Id: I2f322bed32dcae43336ead0735490560190d8095
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      de0db5ed
    • Friedemann Kleint's avatar
      qdoc: Add a logging category · 5b205769
      Friedemann Kleint authored
      
      Remove the debug functionality from the Generator class and add
      a logging category instead. Add some debug statements outputting
      the command line arguments and clang arguments.
      
      This makes it possible to obtain logging output by setting for
      example QT_LOGGING_RULES=qt.qdoc.debug=true .
      
      Task-number: PYSIDE-363
      Change-Id: I3ecfe548e14aa3e2d03f19d07fc61a2647b75111
      Reviewed-by: default avatarMartin Smith <martin.smith@qt.io>
      5b205769
  9. 26 Jan, 2018 - 1 commit
    • Martin Smith's avatar
      qdoc: Remove test that skipped parsing \fn commands in prepare phase · a419399c
      Martin Smith authored
      
      It was thought unnecessary to parse the \fn commands during the prepare
      phase, but it is required to determine whether the functions should be
      marked internal and private. Without parsing the \fn commands during
      the prepare phase, the documentation can't be assigned to the function,
      so it looks like it is undocumented and is marked internal and private
      in the index file. That was wrong, so now qdoc calls clang to parse the
      \fn commands, even during the prepare phase. Unfortunately, this slows
      qdoc by a significant amount.
      
      Change-Id: I51ab621bb9d4ffff0a245d3a842d6e7b4558ca84
      Reviewed-by: default avatarMartin Smith <martin.smith@qt.io>
      a419399c
  10. 15 Jan, 2018 - 1 commit
  11. 12 Jan, 2018 - 2 commits
    • Martin Smith's avatar
      qdoc: Correct handling of functions declared in Q_OBJECT · 2eefc8e6
      Martin Smith authored
      
      These functions were being eliminated from the documentation in
      the clang visitor, but this doesn't when the functions actually
      have documentation. This update moves the test for whether they
      should be documented or not to the Generator class.
      
      This update also avoids reporting a qdoc warning for a typedef
      defined in Q_GADGET.
      
      Change-Id: Icca7297ec2123c684203d225d2bda96e50dacd8c
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      2eefc8e6
    • Martin Smith's avatar
      qdoc: Disable clang errors when the class is internal · 0c10a218
      Martin Smith authored
      
      From time to time, we have classes added that are marked both
      \internal and \preliminary in their \class comment. This was a
      race condition that set the status of the class documentation
      to either internal or preliminary depending on the order of the
      \internal and \preliminary commands. But \preliminary should
      only be used when the class is meant to be included in the public
      API marked as preliminary, so users will understand that it might
      be changed before it is stable. So this update lets \internal win
      when both commands appear in the \class comment, regardless of
      their order.
      
      This update also prevents clang parsing errors from being reported
      for \fn commands where the class containing the member function is
      marked \internal. This eliminates a lot of qdoc warnings.
      
      Change-Id: Id1ecec4bdd573ae81fa5d589dfdd4afc4b313825
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      0c10a218
  12. 05 Jan, 2018 - 1 commit
    • Topi Reinio's avatar
      qdoc: Fix processing for \macro and QML method/signal topic commands · d7bafcaf
      Topi Reinio authored
      
      Because processing these commands do not use clang, their implementation
      is moved from ClangCodeParser to CppCodeParser - this ensures
      that these topic commands are processed also when they appear in
      .qdoc files (PureDocParser, used for .qdoc, derives from CppCodeParser).
      
      Also, these functions did nothing when qdoc was running in prepare
      phase which in turn meant that they were not written to .index, thus
      breaking cross-module linking for macros/QML methods/signals. That
      check is now removed and the functions always do their thing.
      
      Change-Id: I8d9333b02092708955b619b573254eda5d82f038
      Reviewed-by: default avatarMartin Smith <martin.smith@qt.io>
      d7bafcaf
  13. 16 Nov, 2017 - 2 commits
    • Martin Smith's avatar
      qdoc: Handle shared comments better · b7a6bbf4
      Martin Smith authored
      
      The shared comment in qdoc was originally meant only for
      use with the \fn command, and only for multiple \fn commands
      in the same class. But it proved to be useful for other things,
      so people started using it in other contexts, even though it
      didn't work there. This update should handle them all.
      
      For example, when listing multiple \fn commands, they no longer
      need be for functions in the same class. Also, multiple \typedef
      commands are handled correctly.
      
      Change-Id: I4be86026a227d74822f5f2295577adf0fe170d49
      Reviewed-by: default avatarMartin Smith <martin.smith@qt.io>
      b7a6bbf4
    • Martin Smith's avatar
      qdoc: Document C++ functions that are invokable · d39f463b
      Martin Smith authored
      
      This update lets clang report to qdoc whenever Q_INVOKABLE
      appears in a C++ function declaration so that qdoc can add
      a note to the function's documentation telling the reader
      that the function is invokable via the meta-object system
      and from QML.
      
      Task-number: QTBUG-59083
      Change-Id: I9b62ba1c9159a1ec43c6a59e576efdb71bff62e5
      Reviewed-by: default avatarMartin Smith <martin.smith@qt.io>
      d39f463b
  14. 14 Nov, 2017 - 1 commit
  15. 11 Oct, 2017 - 1 commit
  16. 18 Sep, 2017 - 2 commits
  17. 08 Sep, 2017 - 1 commit
  18. 06 Sep, 2017 - 2 commits
  19. 10 Aug, 2017 - 17 commits
    • Jędrzej Nowacki's avatar
      Build fix · 29ca3235
      Jędrzej Nowacki authored
      
      clangcodeparser.cpp:1025:39: error: no match for ‘operator+=’ (operand types are ‘QByteArray’ and ‘QChar’).
      
      Change-Id: Ibc6fa1f11996e9ab5805b85b3165da3b1d7b2afb
      Reviewed-by: default avatarMartin Smith <martin.smith@qt.io>
      29ca3235
    • Martin Smith's avatar
      qdoc: Better support for multi-\fn documentation blocks · fd397614
      Martin Smith authored
      
      This change is a partial fix for the multi-\fn documentation concept.
      It outputs the documentation once but listing all the function signatures
      from the \fn commands found in the qdoc comment.
      
      Multiple \since commands are not implemented; the \until command is not
      implemented, and providing text applicable to a specific \fn signature is
      not implemented.
      
      This change requires clang, which means it requires a sequence of other
      updates as well, so you can't test it unless you have all that stuff.
      
      Task-number: QTBUG-60420
      Change-Id: Ib316b6f97fa427ef730c4badfc785101bff55dce
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      fd397614
    • Martin Smith's avatar
      qdoc: Ignore declarations of anonymous structs · 290aeb76
      Martin Smith authored
      
      qdoc doesn't need to see declarations of anonymous structs.
      When it does see one inside a class or struct that is named,
      then the html generator tries to overwrite the html file for
      the outer class or struct. That causes a few qdoc error
      messages and it overwrites the html file for the class
      reference page and the all-members page. This update tells
      clang not to visit the declaration of the anonymous struct,
      so the html generator doesn't see it as something to be
      documented.
      
      Change-Id: Ie8c732e650c39f78c1374523d72a7e0448a31ba3
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      290aeb76
    • Martin Smith's avatar
      qdoc: create the anonymous enum type · 853b1989
      Martin Smith authored
      
      When clangqdoc encounters an unnamed enum type in a class,
      qdoc reports an error that enum type "global" is not found
      in any header file, and then the identifiers in the enum
      type can't be properly documented. This change makes the
      clang qdoc visitor name the unnamed enum type "anonymous"
      and allows it to be documented like a named enum type.
      
      Change-Id: I8b6dbc9bb78adc5f5c39a2a2d73c27ccb4543ceb
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      853b1989
    • Martin Smith's avatar
      qdoc: Add moduleheader as config variable · 2b3798ec
      Martin Smith authored
      
      moduleheader is a new config variable you can add to the
      qdocconf file when the name of the module header file for
      your module is different from the project name. When the
      name of the module header file is different from the
      project name, if you don't tell qdoc what the name of the
      module header file is by setting moduleheader in the
      qdocconf file, then clangqdoc will not find the module
      header file to build the precomiled header with, which
      will result in clang not finding a lot of stuff.
      
      Change-Id: I0da1a0b0be05cb9e6e95e0123583ddeedaf6741d
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      2b3798ec
    • Martin Smith's avatar
      qdoc: Add (qdoc) to qWarning messages · 67f40665
      Martin Smith authored
      
      These messages don't come from the warning() function
      in class Location, so each one must have (qdoc) added.
      
      Change-Id: Id49b979f8b051d8f4661fb3214989c9c959121c6
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      67f40665
    • Martin Smith's avatar
      qdoc: Make qdoc handle ref qualifiers correctly · b86d5597
      Martin Smith authored
      
      This update makes qdoc parse and record the presence of
      ref qualifiers on the end of function declarations. It
      unfortunately increases the number of qdoc errors
      reported in QtBase, but that is because these functions
      are not documented correctly. There will be another
      update to qdoc to allow documenting multiple functions
      with a single comment, which is needed for documenting
      these ref qualified functions but also can be useful in
      other contexts.
      
      Change-Id: If2efb1a71c683a465d66608a20e238d84ea45d9a
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      b86d5597
    • Martin Smith's avatar
      qdoc: Create and Visit the PCH always · 7414d80f
      Martin Smith authored
      
      The PCH for module QtPlatformHeaders was not being built
      because there are no .cpp files there, and clangqdoc was
      only building the PCH when it was asked to parse the first
      .cpp file. Now it builds the PCH by a direct call from the
      main.cpp file, after the headers have been gathered into a
      list, but before the .cpp files are parsed.
      
      This does reduce the qdoc error count by a few, but it does
      not fix the documentation for QtPlatformHeaders. From my
      debugging, it appears that visiting the PCH produces no qdoc
      nodes for the C++ classes and functions, etc in the PCH.
      
      This update also improves the selection of default include
      paths when inadequate include paths are provided. That is
      the case for module QtPlatformHeaders, where no include
      paths are provided. The algorithm for constructing a list
      of reasonable guesses is modified here.
      
      Change-Id: I0dee8dc0279894a4482df30703657558cdb098de
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      7414d80f
    • Martin Smith's avatar
      qdoc: Enable documentation of type alias as typedef · 816b9673
      Martin Smith authored
      
      clangqdoc now handles the type alias declaraction and provides
      the \typealias command for documenting it. It is documented as
      a typedef.
      
      Task-number: QTBUG-58158
      Change-Id: Iee0c8dea66026a89b3625b40b92b056cada893c1
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      816b9673
    • Martin Smith's avatar
      qdoc: fix resolve inheritance bug · 54425fbd
      Martin Smith authored
      
      clangqdoc was unable to find base class nodes,
      when the base class node was in a different module
      from the subclass. This was mostly because the
      fixInheritance() function, which handles base class
      resolution after the headers have been parsed, was
      being called before the headers were parsed. This
      was caused by the new parsing strategy for clangqdoc,
      which is to use the old loop where qdoc used to parse
      the header files only to build up a list of all the
      required header files and to delay parsing the header
      files until clang is called to build the PCH.
      
      The basic fix is to mode the call to resolveInheritance()
      from main.cpp into clangcodeparser.cpp right after the
      PCH is built. There are also a few other minor changes
      in this change that make the base class resolution more
      robust by ensuring that as much useful information as
      possible is retained in the index file and in the base
      class list for a class node.
      
      Change-Id: I51433f618cdf40b37b0687ff1686da03359de111
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      54425fbd
    • Martin Smith's avatar
      qdoc: Match unqualified parameter types · 85ddd7d2
      Martin Smith authored
      
      clangqdoc was unable to tie qdoc comments to their
      function declarations for nested classes, when the
      function had a formal parameter of the nested class
      type. The problem was that findNodeForCursor() didn't
      handle the type name scoping correctly.
      
      Change-Id: I64d81377193447b1af73ecd107f0431fac0d81a7
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      85ddd7d2
    • Martin Smith's avatar
      qdoc: Handle class decls outside the semantic parent · 55e84aa7
      Martin Smith authored
      
      We have the class declaration for QMetaObject::Connection
      in qobjectdefs.h, which is outside the declaration for
      QMetaObject. clangqdoc wasn't handling this correctly. It
      created the class node for Connection with the wrong parent.
      
      This update ensures that the class node for Connection is given
      the class node of QMetaObject as its parent. If the semantic and
      lexical parent cursors of the current cursor are not the same,
      find the Aggregate node for the semantic parent cursor and use
      that node as the parent when the new class node is created.
      
      Change-Id: I40f73dad9879e39452f83bb7c0f514a7ef319208
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      55e84aa7
    • Olivier Goffart's avatar
      qdoc: Parse Friend declarations · 48063f1f
      Olivier Goffart authored
      
      (Requires clang 4.0)
      
      Change-Id: I50240f0e4b9f538c65dbaa0e8d08469676ac9012
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      48063f1f
    • Martin Smith's avatar
      qdoc: Identify special constructors and assignment ops · 0c79d9b1
      Martin Smith authored
      
      This change enables clangqdoc to identify copy constructors,
      move-copy constructors, copy-assignment operators and
      move-assignment operators. Identifying these special member
      functions allows clangqdoc to document them automatically
      if the documentation is missing, which also means fewer qdoc
      error reports.
      
      Change-Id: Ic50822c2939f0a84e707a1b3ff946bc731a0bd85
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      0c79d9b1
    • Martin Smith's avatar
      qdoc: Don't report error for things marked \internal · 02de17ea
      Martin Smith authored
      
      This change allows qdoc to avoid printing warnings about
      a qdoc comment, if the comment contains the \internal
      command. In these cases, the comment will not be
      used in the documentation, so there is no point reporting
      warnings about it. However, if the showinternal option is
      used, warnings about comments marked internal are printed
      anyway.
      
      Change-Id: Idcb329958681523c79e9f6a3a144ae26d44a6906
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      02de17ea
    • Martin Smith's avatar
      qdoc: Add "clangdefines" to Config class · 5b090261
      Martin Smith authored
      
      The qdoc 'defines' config variable lists values
      that contain '*' to represent wildcards, but clang
      doesn't accept them. This change adds a new config
      variable called 'clangdefines' which explicitly
      lists all the defines that match the wildcards.
      It also lists several Qt defines for C++11 stuff,
      because when clangqdoc comes into use, all the
      supported compilers for Qt will support C++11
      constructs.
      
      There might be a few defines listed in clangdefines
      that are unnecessary and maybe a few that we really
      should not include, but we can adjust the list as
      needed.
      
      Also included in this change: Tell clang never to fail
      (i.e. keep parsing no matter how many errors are found),
      and tell clang not to print parsing errors, because they
      obscure the qdoc errors in the output. clangqdoc should
      assume that the source files are correct, but some of the
      include files, especially system level stuff, will not be
      present. clangqdoc doesn't care about these missing files,
      because they aren't part of the documentation.
      
      Change-Id: I84e1cae24d961a82d16ee705333d6f36955d35de
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      5b090261
    • Martin Smith's avatar
      qdoc: Reduce total clang parse time · c9cc240c
      Martin Smith authored
      
      Including the module's private headers in the PCH
      database can reduce the qdoc run time for the module
      by a few minutes. Apparently, including the private
      headers significantly reduces the number of header
      files that must be re-parsed.
      
      This change adds the module's private headers to the
      pre-compiled header database. When it finds the module's
      module header, it copies that module header to the
      temporary directory where it will construct the PCH.
      Then it finds the module's private header subdirectory,
      constructs the path to each header in that directory,
      and appends it to the temporary module header. Then
      it passes this augmented module header to clang to
      construct the PCH.
      
      Change-Id: Ie67485c7070ef7487345db90a8b27c64f5caa0f2
      Reviewed-by: default avatarTopi Reiniö <topi.reinio@qt.io>
      c9cc240c