qdoc: Fixed broken links for abstract QML types
When a QML base type is abstract, the documentation for its properties is supposed to appear on the reference page for each QML type that inherits the abstract type. And then links to those properties from within the property documentation must refer to the documentation for that property on the reference page for the particular inheriting QML type. These links were dead, but this fix corrects the problem. Change-Id: Icaf01d67edf44567099f5a6a59fd6348de8df380 Task-number: QTBUG-43200 Reviewed-by: Nico Vertriest <nico.vertriest@digia.com> Reviewed-by: Tero Kojo <tero.kojo@digia.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
This commit is contained in:
parent
70ed7c727a
commit
1bbcad9e5e
@ -96,6 +96,7 @@ Generator::QDocPass Generator::qdocPass_ = Generator::Neither;
|
||||
bool Generator::qdocSingleExec_ = false;
|
||||
bool Generator::qdocWriteQaPages_ = false;
|
||||
bool Generator::useOutputSubdirs_ = true;
|
||||
QmlClassNode* Generator::qmlTypeContext_ = 0;
|
||||
|
||||
void Generator::startDebugging(const QString& message)
|
||||
{
|
||||
|
@ -101,6 +101,8 @@ public:
|
||||
static QString defaultModuleName() { return project_; }
|
||||
static void resetUseOutputSubdirs() { useOutputSubdirs_ = false; }
|
||||
static bool useOutputSubdirs() { return useOutputSubdirs_; }
|
||||
static void setQmlTypeContext(QmlClassNode* t) { qmlTypeContext_ = t; }
|
||||
static QmlClassNode* qmlTypeContext() { return qmlTypeContext_; }
|
||||
|
||||
protected:
|
||||
virtual void beginSubPage(const InnerNode* node, const QString& fileName);
|
||||
@ -221,6 +223,7 @@ private:
|
||||
static bool qdocSingleExec_;
|
||||
static bool qdocWriteQaPages_;
|
||||
static bool useOutputSubdirs_;
|
||||
static QmlClassNode* qmlTypeContext_;
|
||||
|
||||
void generateReimplementedFrom(const FunctionNode *func, CodeMarker *marker);
|
||||
|
||||
|
@ -1532,6 +1532,7 @@ void HtmlGenerator::generateClassLikeNode(InnerNode* inner, CodeMarker* marker)
|
||||
*/
|
||||
void HtmlGenerator::generateQmlTypePage(QmlClassNode* qcn, CodeMarker* marker)
|
||||
{
|
||||
Generator::setQmlTypeContext(qcn);
|
||||
SubTitleSize subTitleSize = LargeSubTitle;
|
||||
QList<Section>::const_iterator s;
|
||||
QString htmlTitle = qcn->fullTitle() + " QML Type";
|
||||
@ -1595,6 +1596,7 @@ void HtmlGenerator::generateQmlTypePage(QmlClassNode* qcn, CodeMarker* marker)
|
||||
++s;
|
||||
}
|
||||
generateFooter(qcn);
|
||||
Generator::setQmlTypeContext(0);
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -3894,8 +3896,9 @@ QString HtmlGenerator::getAutoLink(const Atom *atom, const Node *relative, const
|
||||
QString ref;
|
||||
|
||||
*node = qdb_->findNodeForAtom(atom, relative, ref);
|
||||
if (!(*node))
|
||||
if (!(*node)) {
|
||||
return QString();
|
||||
}
|
||||
|
||||
QString link = (*node)->url();
|
||||
if (link.isEmpty()) {
|
||||
@ -3933,21 +3936,9 @@ QString HtmlGenerator::linkForNode(const Node *node, const Node *relative)
|
||||
return QString();
|
||||
|
||||
QString fn = fileName(node);
|
||||
if (node && relative && node->parent() != relative) {
|
||||
if (node->parent()->isQmlType() && relative->isQmlType()) {
|
||||
if (node->parent()->isAbstract()) {
|
||||
/*
|
||||
This is a bit of a hack. What we discover with
|
||||
the three 'if' statements immediately above,
|
||||
is that node's parent is marked \qmlabstract
|
||||
but the link appears in a qdoc comment for a
|
||||
subclass of the node's parent. This means the
|
||||
link should refer to the file for the relative
|
||||
node, not the file for node.
|
||||
*/
|
||||
fn = fileName(relative);
|
||||
}
|
||||
}
|
||||
if (node && node->parent() && node->parent()->isQmlType() && node->parent()->isAbstract()) {
|
||||
if (Generator::qmlTypeContext())
|
||||
fn = fileName(Generator::qmlTypeContext());
|
||||
}
|
||||
QString link = fn;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user