summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/doc.cpp
Commit message (Collapse)AuthorAgeFilesLines
* qdoc: Change name of node typeMartin Smith2015-01-221-1/+1
| | | | | | | | | | | | QmlClassNode is renamed to QmlTypeNode. This is done in preparation for implementing qdoc support for documenting javascript code. Next, QmlTypeNode will be renamed to JsTypeNode, and a new QmlTypeNode will be declared that will inherit JsTypeNode. Change-Id: Ia5d0c367d06c26cb43f887927bbcb096afcb7301 Task-number: QTBUG-43715 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* qdoc: Remove CR from command parametersMartin Smith2014-11-121-1/+4
| | | | | | | | | | | | | | | | Although it is not recommended, it is allowed to have a carriage return in a qdoc command parameter that is enclosed in curly braces. qdoc is supposed to use QString::simplified() to sanitize the string so that all whitespace is replaced by a single ' '. But in at least one case, this didn't work, and the carriage return was left in the string, which caused qdoc to report that it couldn't find links that have the carriage return in them. The problem has been fixed by replacing the carriage return with a ' ' right when and where it is detected. Change-Id: I31c31f19a1e4150b2e27613ecbac260c46a7109b Task-number: QTBUG-42449 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* qdoc: no longer autolinks symbols that begin with "__"Martin Smith2014-11-121-4/+6
| | | | | | | | | | | qdoc no longer tries to autolink symbols that begin with two underscores. There may be other cases where qdoc should not try to autolink. They should be handled in this same place. Change-Id: I5a39ea2bb0edec2289b8a4b1a9af1f33534093a1 Task-number: QTBUG-42441 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* qdoc: Generate \keyword anchors at the top of the pageMartin Smith2014-11-121-3/+6
| | | | | | | | | | | | | | | | Currently, qdoc processes \keyword and \target the same way. The negative effect of this is that when either command appears at the top of a qdoc comment, the anchor it generates in the html file is just above the details section on the html page. This is usually wrong, especially for \keyword commands, where the anchor generated should always be at the top of the page/text where the \keyword appears. This update implements that. \target anchors are meant to be used when the anchor should appear somewhere in the middle of the page/text, exactly where the \target command appears. Change-Id: Ibbbf1087562a977ff74ccd98febfe9310ecba8f0 Task-number: QTBUG-42290 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* qdoc: Generate cross-module links-to-links pagesMartin Smith2014-11-111-2/+2
| | | | | | | | | | | | | | | The cross-module link report is modified so that each module listed in the table is a link to a subpage on which all the links from the current module to that module are listed. To check that these links go to the correct place, click on one to be taken to the actual link. The actual link is marked with red asterisks. Click on that link to check that the link goes to the correct page. Repeat this process for all the links in the table. Change-Id: Ifddf7108ed7ef090c4063909fdbd10dac1f2566b Task-number: QTBUG-41850 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* qdoc: qdoc was too slowMartin Smith2014-10-171-12/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The hard-coded search order is now removed. The search order is now constructed from the depends variable in the qdocconf file. The basic idea is that qdoc is run once. It gets a list of all the qdocconf files for the modules in Qt5. First, qdoc runs in -prepare mode for each qdocconf file in the list. It generates the index file for each module, but these index files are never used. At the end of the -prepare phase for each module, qdoc keeps the tree structure for the module in a collection of trees. Second, qdoc runs in -generate mode for each qdocconf file in the list. But now it uses the existing tree for that module, so it doesn't have to read the sources files again, and it doesn't have to read any index files. Now it generates the docs for each module. The runtime for qdoc has been reduced by 90% when running qdoc for all of Qt5 on a not so new iMac. Before this update, qdoc took about 10 minutes to generate docs for Qt5. Now it takes a little over 1 minute. The new way to run qdoc is described in the Qt bug report referenced here. Note that running qdoc this new (old) way also generates fewer qdoc errors than when running qdoc the old way. This indicates that the index files qdoc uses when running the old way are incomplete. Note also that the old way of running qdoc is not affected by this update. The old way is still required for running qdoc in the current qmake/make system. That process must be changed to be able to use the faster qdoc. The details are provided in the Qt bug report. Change-Id: Ibec41d6fbaa9fc8cd070a05d04357bd02c4478f0 Task-number: QTBUG-41705 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* qdoc: Fix output of \br commandTopi Reinio2014-08-261-1/+1
| | | | | | | | | | | | | | | | Since the \br was promoted from a macro to a QDoc command, its output has been enclosed in extra paragraph end/start tags, adding to the visible vertical space. This change fixes the issue by not closing the paragraph when QDoc encounters a \br command. Also removes the now-obsolete \br and \hr macros, as they are both proper commands. \BR and \HR substitute macros are kept. Task-number: QTBUG-37361 Change-Id: Iabbefb6e79268419792ccba42386f6342ccd175d Reviewed-by: Martin Smith <martin.smith@digia.com>
* qdoc: Report error in square bracket parameterMartin Smith2014-08-221-0/+10
| | | | | | | | | This update makes qdoc report an error, when it can't recognize a parameter in square brackets. Change-Id: I45d31ec875ac533736ee4a565ff3f217353068dd Task-number: QTBUG-39221 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* qdoc: Give documenter more control of linkingMartin Smith2014-06-261-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This update enables using the module name as the parameter in square brackets for the \l command. You will use this when your link goes to the wrong page. e.g. Suppose this link command went to a page in QtGui instead of the page where it is meant to go in QtQuick: \l { mytarget } { the text for my link } When a link goes to a page in the wrong module, it means the target exists in more than one module and because qdoc searches the modules in sequence and stops when it finds a match, it might match the wrong target. This would be a collision in the single tree version of qdoc, but now qdoc builds a separate tree for each module. Since you know which module you want your link to go to, put the module name in square brackets as the first parameter, like this: \l [QtQuick] { mytarget } { the text for my link } Now qdoc will only search for mytarget in the tree for the QtQuick module. The \target command can now be used anywhere. It has not been tested in all possible locations, but it works in the places where people have asked why it doesn't work there. There will be a further update to complete this task for implementing the other types of parameters that can be in the square brackets. Task-number: QTBUG-39221 Change-Id: I2db4fdd0319ff272ec1d2fa9dc396f14599d80f9 Reviewed-by: Martin Smith <martin.smith@digia.com>
* qdoc: Give documenter more control of linkingMartin Smith2014-06-011-5/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | This update is preparation for implementing the actual task described in the bug. To implement it required converting the QML type node and the QML basic type node to be first order tree nodes instead of subtypes of the documentation node. This cleans up a lot of messy logic in some places. It was also necessary to split the getLink() function in the html output generator into two functions, one still called getLink(), which handles the \l command, and one called qetAutoLink() which is called for generating auto links. This should make qdoc run faster. The basic infrastructure was also added for parsing the string in the square brackets for the \l command. There will be a further update to complete this task. Note that some autolinks might not be generated due to this change. I haven't seen any yet, but I believe there will be some. This can be fixed later, if it is a problem. Task-number: QTBUG-39221 Change-Id: I8135229984398408205ba901b9ef95ceac74683c Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* qdoc: Added 2nd argument to \generate list classes commandMartin Smith2014-05-021-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | The qdoc command \generatelist has an argument that tells qdoc which list to generate. When the argument is "classes" qdoc generates the "All C++ Classes" list. qdoc looks for a common prefix for all the members of the list and sorts the members of the list using the character that follows the common prefix. The problem was that the common prefix "Q" was hardcoded in qdoc. This update allows the \generate list command to have a second argument, which is the common prefix. If the common prefix is not provided, qdoc sorts the members of the list on the first character. There is only one use of the \generatelist command with the classes argument in Qt5. It is changed to be \generatelist classes Q, and the qdoc user manual is updated to reflect this change. Task-number: QTBUG-38226 Change-Id: Ie1011d728819a1e5598bbdf73b7444009377d231 Reviewed-by: Martin Smith <martin.smith@digia.com>
* qdoc: Simplify config code for reading file pathsTopi Reinio2014-05-021-4/+4
| | | | | | | | | | | | | | | | | | | | This change greatly simplifies the code used for reading paths from config files: near-identical functions Config::getCanonicalPathList() and Config::getPathList() are combined into one, and the use of Config::getCleanPathList() is replaced with the above. Effectively, all paths read from the config files are now converted into canonical ones. It also adds support for absolute paths in config files. Task-number: QTBUG-36193 Change-Id: I2dc1ee6a67a400e056404ec1c09c6e81f643aa77 Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* qdoc: Teach qdoc to use multiple trees (part 2)Martin Smith2014-03-311-32/+32
| | | | | | | | | | | | | | | | | | | qdoc now knows how to search the forrest of node trees in an optimal order. But there remain some problems with specific searches that cross module boundaries. These include group membership and C++ and QML module membership, as well ass C++ base class resolution. Part 3 will be concerned with fixing these remaining bugs. With this update, qdoc now takes less time to generate the docs for Qt 5. Testing indicates that qdoc run time has dropped from about 14 minutes to about 7.5 minutes on an iMac. Task-number: QTBUG-35377 Change-Id: I6bded6ef54124b4f6e5914cad4548f0b600209b0 Reviewed-by: Martin Smith <martin.smith@digia.com>
* QDoc: properly initialize a memberGiuseppe D'Angelo2013-09-131-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | Spotted by valgrind: ==14189== Conditional jump or move depends on uninitialised value(s) ==14189== at 0x47B3FD: DocParser::parse(QString const&, DocPrivate*, QSet<QString> const&, QSet<QString> const&) (doc.cpp:1627) ==14189== by 0x4818AC: Doc::Doc(Location const&, Location const&, QString const&, QSet<QString> const&, QSet<QString> const&) (doc.cpp:2755) ==14189== by 0x4E6C3D: PureDocParser::processQdocComments() (puredocparser.cpp:140) ==14189== by 0x4E6A9E: PureDocParser::parseSourceFile(Location const&, QString const&) (puredocparser.cpp:109) ==14189== by 0x4D2E4C: processQdocconfFile(QString const&) (main.cpp:473) ==14189== by 0x4D3B3C: main (main.cpp:656) ==14189== Uninitialised value was created by a heap allocation ==14189== at 0x4C2B1C7: operator new(unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==14189== by 0x474378: DocPrivate::constructExtra() (doc.cpp:415) ==14189== by 0x47B975: DocParser::insertTarget(QString const&, bool) (doc.cpp:1676) ==14189== by 0x476B52: DocParser::parse(QString const&, DocPrivate*, QSet<QString> const&, QSet<QString> const&) (doc.cpp:956) ==14189== by 0x4818AC: Doc::Doc(Location const&, Location const&, QString const&, QSet<QString> const&, QSet<QString> const&) (doc.cpp:2755) ==14189== by 0x4E6C3D: PureDocParser::processQdocComments() (puredocparser.cpp:140) ==14189== by 0x4E6A9E: PureDocParser::parseSourceFile(Location const&, QString const&) (puredocparser.cpp:109) ==14189== by 0x4D2E4C: processQdocconfFile(QString const&) (main.cpp:473) ==14189== by 0x4D3B3C: main (main.cpp:656) Change-Id: I5c50c6611a1d901cc19d12bc3757977c36b2a73b Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
* qdoc: Fix the qdoc \include commandMartin Smith2013-08-221-4/+10
| | | | | | | | | | | | | | | | qdoc's \include command now works as expected. This command is only for including a file that contains qdoc comments that contain qdoc commands to be processed by qdoc. The file to be included should have the .qdocinc suffix, although qdoc will accept any suffix now. The file must be in one of the directories specified by the sourcedirs variable in the qdocconf file. Task-number: QTBUG-33046 Change-Id: I45ea08932b4218aae369469968117fb5132f764b Reviewed-by: Alex Blasche <alexander.blasche@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Sergio Ahumada2013-07-241-2/+2
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-07-231-2/+2
| |\ | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/dbus/qdbusabstractinterface/tst_qdbusabstractinterface.cpp Change-Id: I18a9d83fc14f4a9afdb1e40523ec51e3fa1d7754
| | * Fix typo in qdoc's messages.Takumi Asaki2013-07-171-2/+2
| | | | | | | | | | | | | | | | | | Change-Id: I837eaef4fb114c20a75ffc188b49aa612f07f507 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Martin Smith <martin.smith@digia.com>
* | | doc: Ensure page name does not changeMartin Smith2013-07-231-42/+0
|/ / | | | | | | | | | | | | | | | | | | | | | | This fix ensures that the page name is set only once. Also included are a few internal documentation changes that bring qdoc's internal terminology up to date. Task-number: QTBUG-31578 Change-Id: Ib52a5a9024533d5a695cee0055bf2bc4d9bc2af9 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* / qdoc: Implement better handling of QML property groupsMartin Smith2013-07-111-4/+6
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | The \qmlpropertygroup command is added, and qdoc is taught to generate better output for it. The format is, e.g.: \qmlpropertygroup QtQuick2::Item::anchors \qmlproperty AnchorLine QtQuick2::Item::anchors.top \qmlproperty AnchorLine QtQuick2::Item::anchors.bottom \qmlproperty AnchorLine QtQuick2::Item::anchors.left \qmlproperty AnchorLine QtQuick2::Item::anchors.right \qmlproperty AnchorLine QtQuick2::Item::anchors.horizontalCenter \qmlproperty AnchorLine QtQuick2::Item::anchors.verticalCenter \qmlproperty AnchorLine QtQuick2::Item::anchors.baseline \qmlproperty Item QtQuick2::Item::anchors.fill \qmlproperty Item QtQuick2::Item::anchors.centerIn \qmlproperty real QtQuick2::Item::anchors.margins \qmlproperty real QtQuick2::Item::anchors.topMargin \qmlproperty real QtQuick2::Item::anchors.bottomMargin \qmlproperty real QtQuick2::Item::anchors.leftMargin \qmlproperty real QtQuick2::Item::anchors.rightMargin \qmlproperty real QtQuick2::Item::anchors.horizontalCenterOffset \qmlproperty real QtQuick2::Item::anchors.verticalCenterOffset \qmlproperty real QtQuick2::Item::anchors.baselineOffset \qmlproperty bool QtQuick2::Item::anchors.alignWhenCentered Task-number: QTBUG-32341 Change-Id: I4b06a3a061b23680e663e8d4e82ac9863ffd4ecb Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Silence warning by Apple Clang 4.2 about adding an integer to a stringThiago Macieira2013-03-261-1/+1
| | | | | | | | | | | | | | | | It gives a good suggestion on what to do and even shows us how to do it. doc.cpp:2681:34: error: adding 'int' to a string does not append to the string [-Werror,-Wstring-plus-int] result += " " + (column % tabSize); ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~ doc.cpp:2681:34: note: use array indexing to silence this warning result += " " + (column % tabSize); ^ & [ ] Change-Id: Idd2157ab04cd2a3e37a1336bb5e8926ddc14823a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Fix warnings reported by ICC in qdocThiago Macieira2013-03-011-1/+1
| | | | | | | | doc.cpp(3292): error #68: integer conversion resulted in a change of sign generator.cpp(363): error #68: integer conversion resulted in a change of sign Change-Id: Ie714ffcb4098debc701ce3fb6fa444154ac02ae5 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* qdoc: Fix translation contexts.Friedemann Kleint2013-02-071-0/+2
| | | | | | | | | | | Put all translations into the namespace QDoc and fix warnings about invalid tr()-usage by removing the free tr()-function from tr.h. Provide QCoreApplication::translate() for bootstrap builds. Change-Id: I2b6931188346f290e80e14b84adff8892d8a860f Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Use QStringList::join(QChar) overload where applicable [tools]Marc Mutz2012-09-231-1/+1
| | | | | | | | | | This is an automated change performing the following replacements: join\("(.)"\) -> join('\1') join\(QLatin1String\("(.)"\)\) -> join(QLatin1Char('\1')) join\(QStringLiteral\("(.)"\)\) -> join(QLatin1Char('\1')) Change-Id: Ia087beb886bbaec1a0976cd924440d8904044879 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* qdoc: Refactoring of qdoc data structuresMartin Smith2012-09-141-31/+2
| | | | | | | | | | | | | | | | | | This commit is the beginning of a significant overhaul of qdoc. A new class, QDocDatabase, is added, which will eventually encapsulate all the data structures used by qdoc. In this commit, the Tree class is made private and only accessible from QDocDatabase. Several maps structures are also moved into QDocDatabase from other classes. Much dead code and unused parameters were removed. Further simplification will follow. Change-Id: I237411c50f3ced0d2fc8d3b0fbfdf4e55880f8e9 Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* Use QString() instead of "".Frederik Gladhorn2012-09-011-4/+4
| | | | | Change-Id: I42c55344663808b8362e2c9185273a00fc1c70b0 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* qdoc: Removed several #if 0 blocks.Martin Smith2012-07-061-10/+0
| | | | | | | Removed a lot of dead code. Change-Id: I237521efab7dd046d3a47ab92a6a0e083c59ab55 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: The \br macro is promoted to a qdoc commandMartin Smith2012-07-051-0/+6
| | | | | | | | | | | The \br macro, which is used to insert a line break in the output text, is now promoted to be a qdoc command. For html, it outputs a <br/>. For DITA XML it does nothing. Task Nr: QTBUG-26435 Change-Id: Ie0542c9053f68473ccaa2f50ace74baa30f78dd0 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Better error messages for QML command errorsMartin Smith2012-06-121-0/+20
| | | | | | | | | | | | Some error messages were not clear for these qdoc commands: \qmlclass, \qmlmodule, \inqmlmodule, and \qmlproperty. They have been made clearer now. Also, qdoc now parses input files in the same order all the time now. The order is alphabetic now. This might not be the optimal order. Change-Id: Id53a5ec8105009c71f4bbd41973a54aed7821099 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Make qdoc compile with QT_STRICT_ITERATORSThiago Macieira2012-05-291-12/+12
| | | | | Change-Id: I2923315678d1aef516b35a8c83fe734367723a28 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Fix some QString usage issues (Krazy warnings).Friedemann Kleint2012-05-161-6/+6
| | | | | | | | - Avoid single-character constants. - Use QString() instead of "". Change-Id: If04eff389e7b6d4a18201365b711708fdf545d00 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Removed some obsolete ifdefsMartin Smith2012-05-101-5/+0
| | | | | | | Also removed a few useless comments. Change-Id: I62a52bb826c1299ea9da3f0f3c23f267703c6509 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Fixed qdoc error messagesMartin Smith2012-05-091-5/+7
| | | | | | | | | | | qdoc prints many error messages without including the source file path and the line number for where the error occurs. This makes it difficult to find the place to fix the error. This update corrects some of those error messages. Further updates will fix the others. Change-Id: I9c0eed96482c61643a2d83c5135368413e63ae52 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QDoc: Remove the unused \expire command.Casper van Donderen2012-05-081-43/+0
| | | | | Change-Id: I17108dee0a619cbff7627c86cddb8391857e169c Reviewed-by: Martin Smith <martin.smith@nokia.com>
* qdoc: Add the \hr commandMartin Smith2012-04-021-0/+6
| | | | | | | | Now you can out put a horizontal line anywhere in your text. Change-Id: I9b8bbbd6aa312e8386fb1a3b165876d76057f784 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Implement \uicontrol command.Casper van Donderen2012-03-281-0/+5
| | | | | Change-Id: I10381cd69d32352c590ec5a7d4041465af57b88b Reviewed-by: Martin Smith <martin.smith@nokia.com>
* Move qdoc into qtbase and bootstrap itLars Knoll2012-03-081-0/+3393
We need qdoc in qtbase to be able to properly modularize our documentation and build it when building the different Qt modules. qdoc does contain a copy of the qml parser from qmldevtools, but this is the lesser evil compared to how we are currently forced to genereate our docs (and the fact that no developer can run qdoc and check the docs for their module). Change-Id: I9f748459382a11cf5d5153d1ee611d7a5d3f4ac1 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com> Reviewed-by: Martin Smith <martin.smith@nokia.com>