summaryrefslogtreecommitdiffstats
path: root/src/tools/qdoc/cppcodemarker.cpp
Commit message (Collapse)AuthorAgeFilesLines
* qdoc: Part 2 of fix for inheriting abstract QML typesMartin Smith2013-11-011-0/+8
| | | | | | | | | | | | | | | | This fix not only gets the property lists correct but also creates correct links to the property docs. A side effect is that QML properties, methods, and signals whose names begin with "__" are automatically treated as if they are marked \internal. This had been agreed earlier but had not been implemented. It is also required to fix this bug so it is included here. Task-number: QTBUG-33814 Change-Id: I57de1e49774db47cb57c042f181ccc8edec62d13 Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Nico Vertriest <nico.vertriest@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-3/+3
| | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Improve qdoc performance.Jędrzej Nowacki2013-09-211-63/+64
| | | | | | | | | | | Valgrind blamed CppCodeMarker::addMarkUp as slow, the patch improves situation by ~12% Use of QStringLiterals instead of const char* reduce amount of allocations on startup. Change-Id: I8737e02785506bba7e23868ab3952eab09d543d2 Reviewed-by: Martin Smith <martin.smith@digia.com>
* qdoc: Avoid CppCodeMarker crash on abstract QML typesMartin Smith2013-09-121-1/+7
| | | | | | | | | | | | | | | | | | In a while loop, when the first QML type encountered was abstract, qdoc didn't create a class map on the heap, but later in the loop, the class map was used anyway. This caused a crash because of a null pointer to the class map. Now qdoc creates a class map if one hasn't been created yet, even if the QML type is abstract. This might not be correct, but the real problem is probably the order in which qdoc processes the QML types. It should probably always start with a non-abstract type. But this fix will at least avoid the crash. Task-number: QTBUG-33387 Change-Id: Icecb165261469856820f81e3866218b15416ae3b Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* qdoc: Implement better handling of QML property groupsMartin Smith2013-07-111-50/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* qdoc: Show signals inherited from abstract base typesMartin Smith2013-03-261-2/+2
| | | | | | | | | | | | | | | qdoc was not including QML signals in the documentation for a QML type, when the signals were inherited from a QML type that had been marked abstract. This is now fixed. Additionally, the QML type qualifier is not shown in the header for the documentation for a member of a QML type. The type qualifier was redundant information, and it was incorrect for members inherited from abstract base types. Task-number: QTBUG-30111 Change-Id: I73aef40f69a15bca6948bf36596b83800d248b1f Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* qdoc: List of all members subpage redesignedMartin Smith2013-03-221-8/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | The subpage listing all the members of a QML type, including the inherited members, was trying to use an old format that works ok for C++ classes but is not optimal for QML types. The redesigned format for QML types still lists all the members but it lists the members for each base type in a separate list. The members for a QML type that has been marked as abstract are listed with the members of the type that inherits the abstract type. This fix does not fix QTBUG-30111, which will be fixed in a separate commit. This means that some links on the subpage generated by this change will be links to a page that doesn't actually contain any documentation for the linked member. But it will eventually. Task-number: QTBUG-30114 Change-Id: I8ae4227d1eaecdbc24a4ac9b8119f0ced2cdee92 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* doc: QML Inheritance is not resolved correctly.Martin Smith2013-02-221-5/+4
| | | | | | | | | | | | | | | | | | | | | qdoc did not resolve QML Inheritance correctly and the result was that QML inheritance was not shown correctly in the documentation. Part of the problem was that information was missing for QML types in the .index files produced by qdoc. qdoc also did not show inheritance properly when one of its base types was marked internal. These problems have now been fixed. This update also fixes the problem that caused qdoc to slow down to a snail's pace over time. The group members list for certain group pages was getting longer and longer, because qdoc added the same member to the member list an additional time every time qdoc was run in -prepare mode if you didn't clear the index files first. Now, qdoc only adds a member to the member list if it isn't already in the member list. Task-number: QTBUG-29778 Change-Id: Ie4f0458a2ea4ceb1a64cdcd7f60f16b124a20790 Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* qdoc: QML Inheritance is not resolved correctly.Martin Smith2013-02-201-10/+8
| | | | | | | | | | This change adds some QML property, signal, and method data to the .index file. It also provides more robust resolving of QML inheritance for qml types. Task-number: QTBUG-29778 Change-Id: Iaefd64227913a19f427b21e904ca5e32c82d7b29 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* qdoc: inherited members do not show up for QML componentsMartin Smith2013-02-131-5/+5
| | | | | | | | | | | | | | | | | | | | | | | This was a regression bug owing to a big qdoc cleanup for Qt5. But the way QML inheritance had been handled was not a good design, so it has been changed here. When a .qml file is parsed by qdoc, the base type of the QML component is detected, and its name is stored in qdoc's tree node for the component. After qdoc has parsed all the QML files, it traverses the tree, and for each QML component that has a base type name but no base type node pointer yet, it searches the tree for the base type node and stores the pointer to the node in the node for the components. Then when the output generator generates the doc page for the component, it has access to all the inherited members in the base type. Task-number: QTBUG-29569 Change-Id: Ib4958d05f55fa48a572f8ca51ffd57712f29bbc7 Reviewed-by: J-P Nurmi <jpnurmi@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Martin Smith <martin.smith@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>
* QDoc: Fix generated anchors for c++ class signalsTopi Reinio2012-12-111-1/+1
| | | | | | | | | | Add a missing 's' for plural form for signals. This fixes the linking to Signals topic in class references. Task-number: QTBUG-28450 Change-Id: Ic666e608b4b5b40b1f886ea581e54227e1a94678 Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* qdoc: Don't include inherited members in the class refMartin Smith2012-12-051-43/+43
| | | | | | | | | | | | | | | | | | | | | | | | Once upon a time, the inherited functions, signals, slots, etc were not listed on the class reference page, but they were counted and a link to the base class was provided for them, eg: 2 public functions inherited from QAbstractListModel 39 public functions inherited from QAbstractItemModel 31 public functions inherited from QObject Somehow, this got broken, so that all these inherited things were listed on the class reference page as if they were members of the class. But they liunked to the documentation in the base class. This now works correctly again. It simnplifies the class reference pages a lot. Task-number: QTBUG-27496 Change-Id: If493da8cbf81634f1344b12094d9a06f8528e8e5 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> 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-66/+0
| | | | | | | | | | | | | | | | | | 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-33/+33
| | | | | Change-Id: I42c55344663808b8362e2c9185273a00fc1c70b0 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* doc: Replaced FakeNode with DocNodeMartin Smith2012-08-211-6/+5
| | | | | | | | | | | | | | | | | | The name FakeNode was a bad choice. It was used to represent something that wasn't derived from a C++ declaration in a .h file. Any generic page or QML item or any special kind of qdoc construct was stored in a FakeNode. The name was unfortunate because the constructs stored in FakeNodes were just as real as C++ constructs. So FakeNode has been renamed to DocNode, which just refers to a documentation node. The node type Fake has been replaced with node type Document. Change-Id: Ida9de8288b7b8915bf9273fd890ca84aaf05e182 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: No longer prints namespace qualifier twiceMartin Smith2012-08-061-4/+3
| | | | | | | | | | | | enum values in the Qt namespace were being printed as. e.g.: Qt::Qt::AlignLeft. This was due to the presence of a collision node that was not handled properly. Task nr: QTBUG-26628 Change-Id: I54adaba72410b2838f0922f181846bb7e76b61d4 Reviewed-by: Jerome Pasion <jerome.pasion@nokia.com>
* qdoc: Ignore property functions of obsolete propertiesMartin Smith2012-08-021-0/+6
| | | | | | | | | | | Property setter and getter functions are no longer included in the output when the property itself has been marked \obsolete. Task nr: QTBUG-26425 Change-Id: Iac315445d1916467b12be03989bd4513a03a2397 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Make qdoc compile with QT_STRICT_ITERATORSThiago Macieira2012-05-291-38/+38
| | | | | Change-Id: I2923315678d1aef516b35a8c83fe734367723a28 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Fix some QString usage issues (Krazy warnings).Friedemann Kleint2012-05-161-3/+3
| | | | | | | | - Avoid single-character constants. - Use QString() instead of "". Change-Id: If04eff389e7b6d4a18201365b711708fdf545d00 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Don't include internal QML properties in outputMartin Smith2012-05-151-4/+1
| | | | | | | | | QML properties marked internal were still appearing in the the HTML output. Also, the title for QML type pages was not correct in the help project writer. Change-Id: Icaad7cefce77a4af70796bc185c99a3035fb17c8 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* QDoc: Also use the CppCodeMarker for .qtx and .qtt files.Casper van Donderen2012-05-121-0/+2
| | | | | Change-Id: Iff44975bc17fbf1158b373ecd967782b6cb5a3c1 Reviewed-by: Martin Smith <martin.smith@nokia.com>
* qdoc: Fixed a regression bug caused by fixing error messagesMartin Smith2012-05-111-0/+1
| | | | | | | | | | | | | The C++ code marker is the default code marker. The default code marker was being called for .qdoc files. But when the tree nodes were each assigned a location object based on the location in the source file where the node was built, the default code marker was no longer used. Instead, the plain code marker was used. This was wrong. qdoc now knows to use the C++ code marker for all .qdoc files. Change-Id: I15a58168db74cc5aa82a1fbccc5b7ece219ec297 Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Fixed to report read-only QML properties correctlyMartin Smith2012-04-111-1/+13
| | | | | | | | | | | | Now the default for a QML property is writable. If qdoc can't detect the actual read-only status, writable is assumed. There were some cases where qdoc could not determine the actual read-only/writable status for a QML property. In these cases, qdoc reported read-only because the default was read-only, which was not optimal. Change-Id: I55aeb2bedcde92a414f4d48a8d995e5e9dbca5da Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc: Allow documenting a C++ class as a QML type.Martin Smith2012-04-021-40/+17
| | | | | | | | | | | | | | | | | | | Now qdoc can handle the case where a C++ class is documented as a QML type of the same name, or as both a C++ class and a QML type of the same name. And collisions pages are created for both the HTML and the DITA XML output. A collision page is created when two items have the same name. The collision pages will be augmented later to include the list of pages where ambiguous links to one of the items listed on the collision page are actually located, so the writer can go back to those links and add the appropriate qualifier. Change-Id: I5a9632b2d2209e0784392047056bed8962005624 Reviewed-by: Martin Smith <martin.smith@nokia.com> Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* qdoc3: qdoc now handles overloaded methods for QMLMartin Smith2012-03-131-4/+32
| | | | | | | | | | | | When a C++ class is documented as a QML type, it can have overloaded QML methods. These are now handled correctly by qdoc. The method list for QML types is now output with the full method signature. For signals and handlers too. Task-number: QTBUG-24670 Change-Id: If529d4136f5b480373b6ac25d2dceef15e6ea3db Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
* Move qdoc into qtbase and bootstrap itLars Knoll2012-03-081-0/+1354
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>