diff options
| author | Martin Smith <[email protected]> | 2014-07-28 14:21:37 +0200 |
|---|---|---|
| committer | Martin Smith <[email protected]> | 2014-08-20 21:59:23 +0200 |
| commit | a2c432e97818ec16ead9be0d0aee3e43cf10929e (patch) | |
| tree | 200d7aab7de7bda12ae46303a131920d6fe325dd /src/tools/qdoc/atom.cpp | |
| parent | 0da4ddfcc59a639b014296a4544c8aff5d91f3f9 (diff) | |
qdoc: Allow choice of linking to QML or CPP
This update enables using QML or CPP as the parameter
in square brackets for the \l command. You will use this
when, for example, there exist both a C++ class named
QWidget and a QML type named QWidget and your \l {QWidget}
links to the wrong one.
Suppose you write \l {QWidget} expecting it to link
to the QML type named QWidget, but it links to the C++
class named QWidget. Then write this instead:
\l [QML] {QWidget}
Or if you wrote \l {QWidget} expecting it to link to
the C++ class, but it links to the QML type, write this
instead:
\l [CPP] {QWidget}
A qdoc warning is printed if qdoc can not recognize the
parameter in square brackets.
There will be a further update to complete this task for
implementing the other type of parameter that can be in
the square brackets.
Task-number: QTBUG-39221
Change-Id: I5dd85478f968025ecbe337a8aabcc31d8b12a86d
Reviewed-by: Topi Reiniƶ <[email protected]>
Diffstat (limited to 'src/tools/qdoc/atom.cpp')
| -rw-r--r-- | src/tools/qdoc/atom.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/src/tools/qdoc/atom.cpp b/src/tools/qdoc/atom.cpp index 5c699b05469..0c17a38e51e 100644 --- a/src/tools/qdoc/atom.cpp +++ b/src/tools/qdoc/atom.cpp @@ -369,12 +369,15 @@ void Atom::dump() const } /*! - The only constructor for LinkAtom. It only create an Atom - of type Atom::Link with \a p1 being the link text. \a p2 - contains some search parameters. + The only constructor for LinkAtom. It creates an Atom of + type Atom::Link. \a p1 being the link target. \a p2 is the + parameters in square brackets. Normally there is just one + word in the square brackets, but there can be up to three + words separated by spaces. The constructor splits \a p2 on + the space character. */ LinkAtom::LinkAtom(const QString& p1, const QString& p2) - : Atom(p1), genus_(DontCare), goal_(Node::NoType), domain_(0) + : Atom(p1), genus_(Node::DontCare), goal_(Node::NoType), domain_(0) { QStringList params = p2.toLower().split(QLatin1Char(' ')); foreach (const QString& p, params) { @@ -388,10 +391,15 @@ LinkAtom::LinkAtom(const QString& p1, const QString& p2) if (goal_ != Node::NoType) continue; } - if (p == "qml") - genus_ = QML; - else if (p == "cpp") - genus_ = CPP; + if (p == "qml") { + genus_ = Node::QML; + continue; + } + if (p == "cpp") { + genus_ = Node::CPP; + continue; + } + break; } } |
