diff options
| author | Martin Smith <martin.smith@digia.com> | 2015-06-03 14:18:51 +0200 |
|---|---|---|
| committer | Martin Smith <martin.smith@digia.com> | 2015-06-10 12:47:02 +0000 |
| commit | d884420b94abc637b2fcef6585a1fb5c93b69c2c (patch) | |
| tree | bb229430f4c1ec3b986423994ca4bd04ef6e8fa4 /src/tools/qdoc/generator.cpp | |
| parent | 9b58fe5c264cabe6912bb4fb7b045c2aecd98cb7 (diff) | |
qdoc: Improve documentation for properties
This update changes how qdoc handles getter, setter, resetter,
and notifier functions for properties. With this update, if you
provide documentation for any of these functions associated with
a property, links to that function will go to the documentation
for that function, instead of to the associated property.
Additionally, the documentation for the function will have a note
added, e.g. "Note: Notifier signal for property fubar," where the
fubar property name is a link to the documentation for property
fubar.
Change-Id: I1f821fd4a6c2de142da4718ef3bdde314dc59627
Task-number: QTBUG-45620
Reviewed-by: Venugopal Shivashankar <venugopal.shivashankar@digia.com>
Reviewed-by: Topi Reiniƶ <topi.reinio@digia.com>
Diffstat (limited to 'src/tools/qdoc/generator.cpp')
| -rw-r--r-- | src/tools/qdoc/generator.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp index 4f44adc68d2..831d975591d 100644 --- a/src/tools/qdoc/generator.cpp +++ b/src/tools/qdoc/generator.cpp @@ -564,20 +564,19 @@ QString Generator::fullDocumentLocation(const Node *node, bool useSubdir) break; case Node::Function: { - const FunctionNode *functionNode = - static_cast<const FunctionNode *>(node); + const FunctionNode *fn = static_cast<const FunctionNode *>(node); - if (functionNode->metaness() == FunctionNode::Dtor) - anchorRef = "#dtor." + functionNode->name().mid(1); + if (fn->metaness() == FunctionNode::Dtor) + anchorRef = "#dtor." + fn->name().mid(1); - else if (functionNode->associatedProperty()) - return fullDocumentLocation(functionNode->associatedProperty()); + else if (fn->hasOneAssociatedProperty() && fn->doc().isEmpty()) + return fullDocumentLocation(fn->firstAssociatedProperty()); - else if (functionNode->overloadNumber() > 0) - anchorRef = QLatin1Char('#') + cleanRef(functionNode->name()) - + QLatin1Char('-') + QString::number(functionNode->overloadNumber()); + else if (fn->overloadNumber() > 0) + anchorRef = QLatin1Char('#') + cleanRef(fn->name()) + + QLatin1Char('-') + QString::number(fn->overloadNumber()); else - anchorRef = QLatin1Char('#') + cleanRef(functionNode->name()); + anchorRef = QLatin1Char('#') + cleanRef(fn->name()); break; } /* |
