qdoc: Change name of node type
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>
This commit is contained in:
parent
be6c50a251
commit
fdbf3bec30
@ -641,7 +641,7 @@ QString CodeMarker::macName(const Node *node, const QString &name)
|
||||
/*!
|
||||
Returns an empty list of documentation sections.
|
||||
*/
|
||||
QList<Section> CodeMarker::qmlSections(QmlClassNode* , SynopsisStyle , Status )
|
||||
QList<Section> CodeMarker::qmlSections(QmlTypeNode* , SynopsisStyle , Status )
|
||||
{
|
||||
return QList<Section>();
|
||||
}
|
||||
|
@ -48,11 +48,11 @@ QT_BEGIN_NAMESPACE
|
||||
class Config;
|
||||
|
||||
typedef QMultiMap<QString, Node*> MemberMap; // the string is the member signature
|
||||
typedef QPair<const QmlClassNode*, MemberMap> ClassMap; // the node is the QML type
|
||||
typedef QPair<const QmlTypeNode*, MemberMap> ClassMap; // the node is the QML type
|
||||
typedef QList<ClassMap*> ClassMapList;
|
||||
|
||||
typedef QPair<QStringList, NodeList> KeysAndNodes;
|
||||
typedef QPair<const QmlClassNode*, KeysAndNodes> ClassKeysNodes;
|
||||
typedef QPair<const QmlTypeNode*, KeysAndNodes> ClassKeysNodes;
|
||||
typedef QList<ClassKeysNodes*> ClassKeysNodesList;
|
||||
|
||||
struct Section
|
||||
@ -146,7 +146,7 @@ public:
|
||||
virtual QList<Section> sections(const InnerNode *inner,
|
||||
SynopsisStyle style,
|
||||
Status status) = 0;
|
||||
virtual QList<Section> qmlSections(QmlClassNode* qmlClassNode,
|
||||
virtual QList<Section> qmlSections(QmlTypeNode* qmlClassNode,
|
||||
SynopsisStyle style,
|
||||
Status status = Okay);
|
||||
virtual QStringList macRefsForNode(Node* node);
|
||||
|
@ -50,6 +50,7 @@ QT_BEGIN_NAMESPACE
|
||||
#define COMMAND_INGROUP Doc::alias(QLatin1String("ingroup"))
|
||||
#define COMMAND_INMODULE Doc::alias(QLatin1String("inmodule")) // ### don't document
|
||||
#define COMMAND_INQMLMODULE Doc::alias(QLatin1String("inqmlmodule"))
|
||||
#define COMMAND_INJSMODULE Doc::alias(QLatin1String("injsmodule"))
|
||||
#define COMMAND_INTERNAL Doc::alias(QLatin1String("internal"))
|
||||
#define COMMAND_MAINCLASS Doc::alias(QLatin1String("mainclass"))
|
||||
#define COMMAND_NONREENTRANT Doc::alias(QLatin1String("nonreentrant"))
|
||||
|
@ -1085,7 +1085,7 @@ QString CppCodeMarker::addMarkUp(const QString &in,
|
||||
the list of documentation sections for the children of the
|
||||
\a qmlClassNode.
|
||||
*/
|
||||
QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisStyle style, Status status)
|
||||
QList<Section> CppCodeMarker::qmlSections(QmlTypeNode* qmlClassNode, SynopsisStyle style, Status status)
|
||||
{
|
||||
QList<Section> sections;
|
||||
if (qmlClassNode) {
|
||||
@ -1126,7 +1126,7 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt
|
||||
"method",
|
||||
"methods");
|
||||
|
||||
QmlClassNode* qcn = qmlClassNode;
|
||||
QmlTypeNode* qcn = qmlClassNode;
|
||||
while (qcn != 0) {
|
||||
NodeList::ConstIterator c = qcn->childNodes().constBegin();
|
||||
while (c != qcn->childNodes().constEnd()) {
|
||||
@ -1165,7 +1165,7 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt
|
||||
++c;
|
||||
}
|
||||
if (qcn->qmlBaseNode() != 0) {
|
||||
qcn = static_cast<QmlClassNode*>(qcn->qmlBaseNode());
|
||||
qcn = static_cast<QmlTypeNode*>(qcn->qmlBaseNode());
|
||||
if (!qcn->isAbstract())
|
||||
qcn = 0;
|
||||
}
|
||||
@ -1191,7 +1191,7 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt
|
||||
FastSection qmlmethods(qmlClassNode,"Method Documentation","qmlmeth","member","members");
|
||||
FastSection qmlattachedmethods(qmlClassNode,"Attached Method Documentation","qmlattmeth",
|
||||
"member","members");
|
||||
QmlClassNode* qcn = qmlClassNode;
|
||||
QmlTypeNode* qcn = qmlClassNode;
|
||||
while (qcn != 0) {
|
||||
NodeList::ConstIterator c = qcn->childNodes().constBegin();
|
||||
while (c != qcn->childNodes().constEnd()) {
|
||||
@ -1229,7 +1229,7 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt
|
||||
++c;
|
||||
}
|
||||
if (qcn->qmlBaseNode() != 0) {
|
||||
qcn = static_cast<QmlClassNode*>(qcn->qmlBaseNode());
|
||||
qcn = static_cast<QmlTypeNode*>(qcn->qmlBaseNode());
|
||||
if (!qcn->isAbstract())
|
||||
qcn = 0;
|
||||
}
|
||||
@ -1251,7 +1251,7 @@ QList<Section> CppCodeMarker::qmlSections(QmlClassNode* qmlClassNode, SynopsisSt
|
||||
*/
|
||||
ClassMap* classMap = 0;
|
||||
FastSection all(qmlClassNode,QString(),QString(),"member","members");
|
||||
QmlClassNode* current = qmlClassNode;
|
||||
QmlTypeNode* current = qmlClassNode;
|
||||
while (current != 0) {
|
||||
/*
|
||||
If the QML type is abstract, do not create
|
||||
|
@ -70,7 +70,7 @@ public:
|
||||
virtual QList<Section> sections(const InnerNode *innerNode,
|
||||
SynopsisStyle style,
|
||||
Status status) Q_DECL_OVERRIDE;
|
||||
virtual QList<Section> qmlSections(QmlClassNode* qmlClassNode,
|
||||
virtual QList<Section> qmlSections(QmlTypeNode* qmlClassNode,
|
||||
SynopsisStyle style,
|
||||
Status status = Okay) Q_DECL_OVERRIDE;
|
||||
|
||||
|
@ -544,7 +544,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
|
||||
tr("Also used here: %1").arg(other));
|
||||
}
|
||||
#endif
|
||||
QmlClassNode* qcn = new QmlClassNode(qdb_->primaryTreeRoot(), names[0]);
|
||||
QmlTypeNode* qcn = new QmlTypeNode(qdb_->primaryTreeRoot(), names[0]);
|
||||
qcn->setClassNode(classNode);
|
||||
qcn->setLocation(doc.startLocation());
|
||||
return qcn;
|
||||
@ -562,7 +562,7 @@ Node* CppCodeParser::processTopicCommand(const Doc& doc,
|
||||
QString qmlType;
|
||||
QString type;
|
||||
if (splitQmlMethodArg(arg.first,type,module,qmlType)) {
|
||||
QmlClassNode* qmlClass = qdb_->findQmlType(module,qmlType);
|
||||
QmlTypeNode* qmlClass = qdb_->findQmlType(module,qmlType);
|
||||
if (qmlClass) {
|
||||
bool attached = false;
|
||||
Node::Type nodeType = Node::QmlMethod;
|
||||
@ -740,7 +740,7 @@ void CppCodeParser::processQmlProperties(const Doc& doc, NodeList& nodes, DocLis
|
||||
QString qmlType;
|
||||
QString property;
|
||||
QmlPropertyNode* qpn = 0;
|
||||
QmlClassNode* qmlClass = 0;
|
||||
QmlTypeNode* qmlClass = 0;
|
||||
QmlPropertyGroupNode* qpgn = 0;
|
||||
|
||||
Topic qmlPropertyGroupTopic;
|
||||
@ -932,9 +932,9 @@ void CppCodeParser::processOtherMetaCommand(const Doc& doc,
|
||||
if (node->name() == arg)
|
||||
doc.location().warning(tr("%1 tries to inherit itself").arg(arg));
|
||||
else if (node->isQmlType()) {
|
||||
QmlClassNode *qmlClass = static_cast<QmlClassNode*>(node);
|
||||
QmlTypeNode *qmlClass = static_cast<QmlTypeNode*>(node);
|
||||
qmlClass->setQmlBaseName(arg);
|
||||
QmlClassNode::addInheritedBy(arg,node);
|
||||
QmlTypeNode::addInheritedBy(arg,node);
|
||||
}
|
||||
}
|
||||
else if (command == COMMAND_QMLINSTANTIATES) {
|
||||
|
@ -234,6 +234,11 @@ protected:
|
||||
#define COMMAND_LICENSEDESCRIPTION Doc::alias("licensedescription")
|
||||
#define COMMAND_RELEASEDATE Doc::alias("releasedate")
|
||||
#define COMMAND_QTVARIABLE Doc::alias("qtvariable")
|
||||
#define COMMAND_JSTYPE Doc::alias("jstype")
|
||||
#define COMMAND_JSPROPERTY Doc::alias("jsproperty")
|
||||
#define COMMAND_JSMETHOD Doc::alias("jsmethod")
|
||||
#define COMMAND_JSSIGNAL Doc::alias("jssignal")
|
||||
#define COMMAND_JSMODULE Doc::alias("jsmodule")
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
|
@ -3146,7 +3146,7 @@ void Doc::initialize(const Config& config)
|
||||
DocParser::sourceDirs = config.getCanonicalPathList(CONFIG_SOURCEDIRS);
|
||||
DocParser::quoting = config.getBool(CONFIG_QUOTINGINFORMATION);
|
||||
|
||||
QmlClassNode::qmlOnly = config.getBool(CONFIG_QMLONLY);
|
||||
QmlTypeNode::qmlOnly = config.getBool(CONFIG_QMLONLY);
|
||||
QStringMap reverseAliasMap;
|
||||
config_ = &config;
|
||||
|
||||
|
@ -95,7 +95,7 @@ Generator::QDocPass Generator::qdocPass_ = Generator::Neither;
|
||||
bool Generator::qdocSingleExec_ = false;
|
||||
bool Generator::qdocWriteQaPages_ = false;
|
||||
bool Generator::useOutputSubdirs_ = true;
|
||||
QmlClassNode* Generator::qmlTypeContext_ = 0;
|
||||
QmlTypeNode* Generator::qmlTypeContext_ = 0;
|
||||
|
||||
void Generator::startDebugging(const QString& message)
|
||||
{
|
||||
@ -963,9 +963,6 @@ void Generator::generateInherits(const ClassNode *classe, CodeMarker *marker)
|
||||
|
||||
/*!
|
||||
Recursive writing of HTML files from the root \a node.
|
||||
|
||||
\note DitaXmlGenerator overrides this function, but
|
||||
HtmlGenerator does not.
|
||||
*/
|
||||
void Generator::generateInnerNode(InnerNode* node)
|
||||
{
|
||||
@ -1003,7 +1000,7 @@ void Generator::generateInnerNode(InnerNode* node)
|
||||
}
|
||||
if (node->isQmlType()) {
|
||||
beginSubPage(node, fileName(node));
|
||||
QmlClassNode* qcn = static_cast<QmlClassNode*>(node);
|
||||
QmlTypeNode* qcn = static_cast<QmlTypeNode*>(node);
|
||||
generateQmlTypePage(qcn, marker);
|
||||
endSubPage();
|
||||
}
|
||||
@ -1084,12 +1081,12 @@ void Generator::generateMaintainerList(const InnerNode* node, CodeMarker* marker
|
||||
Output the "Inherit by" list for the QML element,
|
||||
if it is inherited by any other elements.
|
||||
*/
|
||||
void Generator::generateQmlInheritedBy(const QmlClassNode* qcn,
|
||||
void Generator::generateQmlInheritedBy(const QmlTypeNode* qcn,
|
||||
CodeMarker* marker)
|
||||
{
|
||||
if (qcn) {
|
||||
NodeList subs;
|
||||
QmlClassNode::subclasses(qcn->name(),subs);
|
||||
QmlTypeNode::subclasses(qcn->name(),subs);
|
||||
if (!subs.isEmpty()) {
|
||||
Text text;
|
||||
text << Atom::ParaLeft << "Inherited by ";
|
||||
@ -1102,7 +1099,7 @@ void Generator::generateQmlInheritedBy(const QmlClassNode* qcn,
|
||||
|
||||
/*!
|
||||
*/
|
||||
void Generator::generateQmlInherits(QmlClassNode* , CodeMarker* )
|
||||
void Generator::generateQmlInherits(QmlTypeNode* , CodeMarker* )
|
||||
{
|
||||
// stub.
|
||||
}
|
||||
@ -1924,7 +1921,7 @@ void Generator::terminate()
|
||||
imageFiles.clear();
|
||||
imageDirs.clear();
|
||||
outDir_.clear();
|
||||
QmlClassNode::terminate();
|
||||
QmlTypeNode::terminate();
|
||||
}
|
||||
|
||||
void Generator::terminateGenerator()
|
||||
|
@ -101,8 +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_; }
|
||||
static void setQmlTypeContext(QmlTypeNode* t) { qmlTypeContext_ = t; }
|
||||
static QmlTypeNode* qmlTypeContext() { return qmlTypeContext_; }
|
||||
|
||||
protected:
|
||||
virtual void beginSubPage(const InnerNode* node, const QString& fileName);
|
||||
@ -114,7 +114,7 @@ protected:
|
||||
virtual int generateAtom(const Atom *atom, const Node *relative, CodeMarker *marker);
|
||||
virtual void generateBody(const Node *node, CodeMarker *marker);
|
||||
virtual void generateClassLikeNode(InnerNode* inner, CodeMarker* marker);
|
||||
virtual void generateQmlTypePage(QmlClassNode* , CodeMarker* ) { }
|
||||
virtual void generateQmlTypePage(QmlTypeNode* , CodeMarker* ) { }
|
||||
virtual void generateQmlBasicTypePage(QmlBasicTypeNode* , CodeMarker* ) { }
|
||||
virtual void generateDocNode(DocNode* dn, CodeMarker* marker);
|
||||
virtual void generateCollectionNode(CollectionNode* cn, CodeMarker* marker);
|
||||
@ -122,8 +122,8 @@ protected:
|
||||
virtual void generateInherits(const ClassNode *classe, CodeMarker *marker);
|
||||
virtual void generateInnerNode(InnerNode* node);
|
||||
virtual void generateMaintainerList(const InnerNode* node, CodeMarker* marker);
|
||||
virtual void generateQmlInheritedBy(const QmlClassNode* qcn, CodeMarker* marker);
|
||||
virtual void generateQmlInherits(QmlClassNode* qcn, CodeMarker* marker);
|
||||
virtual void generateQmlInheritedBy(const QmlTypeNode* qcn, CodeMarker* marker);
|
||||
virtual void generateQmlInherits(QmlTypeNode* qcn, CodeMarker* marker);
|
||||
virtual bool generateQmlText(const Text& text,
|
||||
const Node *relative,
|
||||
CodeMarker *marker,
|
||||
@ -223,7 +223,7 @@ private:
|
||||
static bool qdocSingleExec_;
|
||||
static bool qdocWriteQaPages_;
|
||||
static bool useOutputSubdirs_;
|
||||
static QmlClassNode* qmlTypeContext_;
|
||||
static QmlTypeNode* qmlTypeContext_;
|
||||
|
||||
void generateReimplementedFrom(const FunctionNode *func, CodeMarker *marker);
|
||||
|
||||
|
@ -1530,7 +1530,7 @@ void HtmlGenerator::generateClassLikeNode(InnerNode* inner, CodeMarker* marker)
|
||||
Generate the HTML page for a QML type. \qcn is the QML type.
|
||||
\marker is the code markeup object.
|
||||
*/
|
||||
void HtmlGenerator::generateQmlTypePage(QmlClassNode* qcn, CodeMarker* marker)
|
||||
void HtmlGenerator::generateQmlTypePage(QmlTypeNode* qcn, CodeMarker* marker)
|
||||
{
|
||||
Generator::setQmlTypeContext(qcn);
|
||||
SubTitleSize subTitleSize = LargeSubTitle;
|
||||
@ -2218,7 +2218,7 @@ void HtmlGenerator::generateRequisites(InnerNode *inner, CodeMarker *marker)
|
||||
Lists the required imports and includes in a table.
|
||||
The number of rows is known, so this path is simpler than the generateSection() path.
|
||||
*/
|
||||
void HtmlGenerator::generateQmlRequisites(QmlClassNode *qcn, CodeMarker *marker)
|
||||
void HtmlGenerator::generateQmlRequisites(QmlTypeNode *qcn, CodeMarker *marker)
|
||||
{
|
||||
if (!qcn)
|
||||
return;
|
||||
@ -2280,7 +2280,7 @@ void HtmlGenerator::generateQmlRequisites(QmlClassNode *qcn, CodeMarker *marker)
|
||||
}
|
||||
|
||||
//add the inherits to the map
|
||||
QmlClassNode* base = qcn->qmlBaseNode();
|
||||
QmlTypeNode* base = qcn->qmlBaseNode();
|
||||
while (base && base->isInternal()) {
|
||||
base = base->qmlBaseNode();
|
||||
}
|
||||
@ -2297,7 +2297,7 @@ void HtmlGenerator::generateQmlRequisites(QmlClassNode *qcn, CodeMarker *marker)
|
||||
|
||||
//add the inherited-by to the map
|
||||
NodeList subs;
|
||||
QmlClassNode::subclasses(qcn->name(), subs);
|
||||
QmlTypeNode::subclasses(qcn->name(), subs);
|
||||
if (!subs.isEmpty()) {
|
||||
text.clear();
|
||||
text << Atom::ParaLeft;
|
||||
@ -2541,7 +2541,7 @@ QString HtmlGenerator::generateListOfAllMemberFile(const InnerNode *inner,
|
||||
the members of QML class \a qml_cn, including the inherited
|
||||
members. The \a marker is used for formatting stuff.
|
||||
*/
|
||||
QString HtmlGenerator::generateAllQmlMembersFile(QmlClassNode* qml_cn, CodeMarker* marker)
|
||||
QString HtmlGenerator::generateAllQmlMembersFile(QmlTypeNode* qml_cn, CodeMarker* marker)
|
||||
{
|
||||
QList<Section> sections;
|
||||
QList<Section>::ConstIterator s;
|
||||
@ -2564,7 +2564,7 @@ QString HtmlGenerator::generateAllQmlMembersFile(QmlClassNode* qml_cn, CodeMarke
|
||||
if (!cknl.isEmpty()) {
|
||||
for (int i=0; i<cknl.size(); i++) {
|
||||
ClassKeysNodes* ckn = cknl[i];
|
||||
const QmlClassNode* qcn = ckn->first;
|
||||
const QmlTypeNode* qcn = ckn->first;
|
||||
KeysAndNodes& kn = ckn->second;
|
||||
QStringList& keys = kn.first;
|
||||
NodeList& nodes = kn.second;
|
||||
@ -2690,7 +2690,7 @@ QString HtmlGenerator::generateLowStatusMemberFile(InnerNode *inner,
|
||||
Note that this function currently only handles correctly the
|
||||
case where \a status is \c {CodeMarker::Obsolete}.
|
||||
*/
|
||||
QString HtmlGenerator::generateQmlMemberFile(QmlClassNode* qcn,
|
||||
QString HtmlGenerator::generateQmlMemberFile(QmlTypeNode* qcn,
|
||||
CodeMarker *marker,
|
||||
CodeMarker::Status status)
|
||||
{
|
||||
@ -4345,11 +4345,11 @@ void HtmlGenerator::generateDetailedQmlMember(Node *node,
|
||||
Output the "Inherits" line for the QML element,
|
||||
if there should be one.
|
||||
*/
|
||||
void HtmlGenerator::generateQmlInherits(QmlClassNode* qcn, CodeMarker* marker)
|
||||
void HtmlGenerator::generateQmlInherits(QmlTypeNode* qcn, CodeMarker* marker)
|
||||
{
|
||||
if (!qcn)
|
||||
return;
|
||||
QmlClassNode* base = qcn->qmlBaseNode();
|
||||
QmlTypeNode* base = qcn->qmlBaseNode();
|
||||
while (base && base->isInternal()) {
|
||||
base = base->qmlBaseNode();
|
||||
}
|
||||
@ -4372,7 +4372,7 @@ void HtmlGenerator::generateQmlInherits(QmlClassNode* qcn, CodeMarker* marker)
|
||||
If there is no class node, or if the class node status
|
||||
is set to Node::Internal, do nothing.
|
||||
*/
|
||||
void HtmlGenerator::generateQmlInstantiates(QmlClassNode* qcn, CodeMarker* marker)
|
||||
void HtmlGenerator::generateQmlInstantiates(QmlTypeNode* qcn, CodeMarker* marker)
|
||||
{
|
||||
ClassNode* cn = qcn->classNode();
|
||||
if (cn && (cn->status() != Node::Internal)) {
|
||||
@ -4409,7 +4409,7 @@ void HtmlGenerator::generateQmlInstantiates(QmlClassNode* qcn, CodeMarker* marke
|
||||
void HtmlGenerator::generateInstantiatedBy(ClassNode* cn, CodeMarker* marker)
|
||||
{
|
||||
if (cn && cn->status() != Node::Internal && cn->qmlElement() != 0) {
|
||||
const QmlClassNode* qcn = cn->qmlElement();
|
||||
const QmlTypeNode* qcn = cn->qmlElement();
|
||||
Text text;
|
||||
text << Atom::ParaLeft;
|
||||
text << Atom(Atom::LinkNode,CodeMarker::stringForNode(cn));
|
||||
|
@ -96,7 +96,7 @@ protected:
|
||||
const Node *relative,
|
||||
CodeMarker *marker) Q_DECL_OVERRIDE;
|
||||
virtual void generateClassLikeNode(InnerNode* inner, CodeMarker* marker) Q_DECL_OVERRIDE;
|
||||
virtual void generateQmlTypePage(QmlClassNode* qcn, CodeMarker* marker) Q_DECL_OVERRIDE;
|
||||
virtual void generateQmlTypePage(QmlTypeNode* qcn, CodeMarker* marker) Q_DECL_OVERRIDE;
|
||||
virtual void generateQmlBasicTypePage(QmlBasicTypeNode* qbtn, CodeMarker* marker) Q_DECL_OVERRIDE;
|
||||
virtual void generateDocNode(DocNode* dn, CodeMarker* marker) Q_DECL_OVERRIDE;
|
||||
virtual void generateCollectionNode(CollectionNode* cn, CodeMarker* marker) Q_DECL_OVERRIDE;
|
||||
@ -139,7 +139,7 @@ private:
|
||||
void generateFooter(const Node *node = 0);
|
||||
void generateRequisites(InnerNode *inner,
|
||||
CodeMarker *marker);
|
||||
void generateQmlRequisites(QmlClassNode *qcn,
|
||||
void generateQmlRequisites(QmlTypeNode *qcn,
|
||||
CodeMarker *marker);
|
||||
void generateBrief(const Node *node,
|
||||
CodeMarker *marker,
|
||||
@ -151,11 +151,11 @@ private:
|
||||
void generateSidebar();
|
||||
QString generateListOfAllMemberFile(const InnerNode *inner,
|
||||
CodeMarker *marker);
|
||||
QString generateAllQmlMembersFile(QmlClassNode* qml_cn, CodeMarker* marker);
|
||||
QString generateAllQmlMembersFile(QmlTypeNode* qml_cn, CodeMarker* marker);
|
||||
QString generateLowStatusMemberFile(InnerNode *inner,
|
||||
CodeMarker *marker,
|
||||
CodeMarker::Status status);
|
||||
QString generateQmlMemberFile(QmlClassNode* qcn,
|
||||
QString generateQmlMemberFile(QmlTypeNode* qcn,
|
||||
CodeMarker *marker,
|
||||
CodeMarker::Status status);
|
||||
void generateClassHierarchy(const Node *relative, NodeMap &classMap);
|
||||
@ -183,8 +183,8 @@ private:
|
||||
void generateDetailedQmlMember(Node *node,
|
||||
const InnerNode *relative,
|
||||
CodeMarker *marker);
|
||||
void generateQmlInherits(QmlClassNode* qcn, CodeMarker* marker) Q_DECL_OVERRIDE;
|
||||
void generateQmlInstantiates(QmlClassNode* qcn, CodeMarker* marker);
|
||||
void generateQmlInherits(QmlTypeNode* qcn, CodeMarker* marker) Q_DECL_OVERRIDE;
|
||||
void generateQmlInstantiates(QmlTypeNode* qcn, CodeMarker* marker);
|
||||
void generateInstantiatedBy(ClassNode* cn, CodeMarker* marker);
|
||||
|
||||
void generateRequisitesTable(const QStringList& requisitesOrder, QMap<QString, Text>& requisites);
|
||||
|
@ -594,7 +594,6 @@ int main(int argc, char **argv)
|
||||
QmlCodeMarker qmlMarker;
|
||||
|
||||
HtmlGenerator htmlGenerator;
|
||||
//DitaXmlGenerator ditaxmlGenerator;
|
||||
|
||||
QCommandLineParser parser;
|
||||
parser.setApplicationDescription(QCoreApplication::translate("qdoc", "Qt documentation generator"));
|
||||
|
@ -628,14 +628,14 @@ QString Node::guid() const
|
||||
If it is a child of a QML class node, return a pointer to
|
||||
the QML class node. Otherwise, return 0;
|
||||
*/
|
||||
QmlClassNode* Node::qmlClassNode()
|
||||
QmlTypeNode* Node::qmlClassNode()
|
||||
{
|
||||
if (isQmlNode()) {
|
||||
Node* n = this;
|
||||
while (n && !n->isQmlType())
|
||||
n = n->parent();
|
||||
if (n && n->isQmlType())
|
||||
return static_cast<QmlClassNode*>(n);
|
||||
return static_cast<QmlTypeNode*>(n);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -649,7 +649,7 @@ QmlClassNode* Node::qmlClassNode()
|
||||
*/
|
||||
ClassNode* Node::declarativeCppNode()
|
||||
{
|
||||
QmlClassNode* qcn = qmlClassNode();
|
||||
QmlTypeNode* qcn = qmlClassNode();
|
||||
if (qcn)
|
||||
return qcn->classNode();
|
||||
return 0;
|
||||
@ -1614,9 +1614,9 @@ PropertyNode* ClassNode::findPropertyNode(const QString& name)
|
||||
finds one, it returns the pointer to that QML element. If
|
||||
it doesn't find one, it returns null.
|
||||
*/
|
||||
QmlClassNode* ClassNode::findQmlBaseNode()
|
||||
QmlTypeNode* ClassNode::findQmlBaseNode()
|
||||
{
|
||||
QmlClassNode* result = 0;
|
||||
QmlTypeNode* result = 0;
|
||||
const QList<RelatedClass>& bases = baseClasses();
|
||||
|
||||
if (!bases.isEmpty()) {
|
||||
@ -2133,14 +2133,14 @@ QString PropertyNode::qualifiedDataType() const
|
||||
}
|
||||
}
|
||||
|
||||
bool QmlClassNode::qmlOnly = false;
|
||||
QMultiMap<QString,Node*> QmlClassNode::inheritedBy;
|
||||
bool QmlTypeNode::qmlOnly = false;
|
||||
QMultiMap<QString,Node*> QmlTypeNode::inheritedBy;
|
||||
|
||||
/*!
|
||||
Constructs a Qml class node. The new node has the given
|
||||
\a parent and \a name.
|
||||
*/
|
||||
QmlClassNode::QmlClassNode(InnerNode *parent, const QString& name)
|
||||
QmlTypeNode::QmlTypeNode(InnerNode *parent, const QString& name)
|
||||
: InnerNode(QmlType, parent, name),
|
||||
abstract_(false),
|
||||
cnodeRequired_(false),
|
||||
@ -2161,7 +2161,7 @@ QmlClassNode::QmlClassNode(InnerNode *parent, const QString& name)
|
||||
/*!
|
||||
Needed for printing a debug messages.
|
||||
*/
|
||||
QmlClassNode::~QmlClassNode()
|
||||
QmlTypeNode::~QmlTypeNode()
|
||||
{
|
||||
// nothing.
|
||||
}
|
||||
@ -2170,7 +2170,7 @@ QmlClassNode::~QmlClassNode()
|
||||
Clear the static maps so that subsequent runs don't try to use
|
||||
contents from a previous run.
|
||||
*/
|
||||
void QmlClassNode::terminate()
|
||||
void QmlTypeNode::terminate()
|
||||
{
|
||||
inheritedBy.clear();
|
||||
}
|
||||
@ -2179,7 +2179,7 @@ void QmlClassNode::terminate()
|
||||
Record the fact that QML class \a base is inherited by
|
||||
QML class \a sub.
|
||||
*/
|
||||
void QmlClassNode::addInheritedBy(const QString& base, Node* sub)
|
||||
void QmlTypeNode::addInheritedBy(const QString& base, Node* sub)
|
||||
{
|
||||
if (inheritedBy.constFind(base,sub) == inheritedBy.constEnd()) {
|
||||
inheritedBy.insert(base,sub);
|
||||
@ -2189,7 +2189,7 @@ void QmlClassNode::addInheritedBy(const QString& base, Node* sub)
|
||||
/*!
|
||||
Loads the list \a subs with the nodes of all the subclasses of \a base.
|
||||
*/
|
||||
void QmlClassNode::subclasses(const QString& base, NodeList& subs)
|
||||
void QmlTypeNode::subclasses(const QString& base, NodeList& subs)
|
||||
{
|
||||
subs.clear();
|
||||
if (inheritedBy.count(base) > 0) {
|
||||
@ -2220,7 +2220,7 @@ void QmlModuleNode::setQmlModuleInfo(const QString& arg)
|
||||
}
|
||||
}
|
||||
|
||||
QmlClassNode* QmlClassNode::qmlBaseNode()
|
||||
QmlTypeNode* QmlTypeNode::qmlBaseNode()
|
||||
{
|
||||
if (!qmlBaseNode_ && !qmlBaseName_.isEmpty()) {
|
||||
qmlBaseNode_ = QDocDatabase::qdocDB()->findQmlType(qmlBaseName_);
|
||||
@ -2233,7 +2233,7 @@ QmlClassNode* QmlClassNode::qmlBaseNode()
|
||||
return the fully qualified name of that QML
|
||||
type, i.e. <QML-module-name>::<QML-type-name>.
|
||||
*/
|
||||
QString QmlClassNode::qmlFullBaseName() const
|
||||
QString QmlTypeNode::qmlFullBaseName() const
|
||||
{
|
||||
QString result;
|
||||
if (qmlBaseNode_) {
|
||||
@ -2247,7 +2247,7 @@ QString QmlClassNode::qmlFullBaseName() const
|
||||
module name from the QML module node. Otherwise, return the
|
||||
empty string.
|
||||
*/
|
||||
QString QmlClassNode::qmlModuleName() const
|
||||
QString QmlTypeNode::qmlModuleName() const
|
||||
{
|
||||
return (qmlModule_ ? qmlModule_->qmlModuleName() : QString());
|
||||
}
|
||||
@ -2257,7 +2257,7 @@ QString QmlClassNode::qmlModuleName() const
|
||||
module version from the QML module node. Otherwise, return
|
||||
the empty string.
|
||||
*/
|
||||
QString QmlClassNode::qmlModuleVersion() const
|
||||
QString QmlTypeNode::qmlModuleVersion() const
|
||||
{
|
||||
return (qmlModule_ ? qmlModule_->qmlModuleVersion() : QString());
|
||||
}
|
||||
@ -2267,7 +2267,7 @@ QString QmlClassNode::qmlModuleVersion() const
|
||||
module identifier from the QML module node. Otherwise, return
|
||||
the empty string.
|
||||
*/
|
||||
QString QmlClassNode::qmlModuleIdentifier() const
|
||||
QString QmlTypeNode::qmlModuleIdentifier() const
|
||||
{
|
||||
return (qmlModule_ ? qmlModule_->qmlModuleIdentifier() : QString());
|
||||
}
|
||||
@ -2285,9 +2285,9 @@ QmlBasicTypeNode::QmlBasicTypeNode(InnerNode *parent,
|
||||
|
||||
/*!
|
||||
Constructor for the Qml property group node. \a parent is
|
||||
always a QmlClassNode.
|
||||
always a QmlTypeNode.
|
||||
*/
|
||||
QmlPropertyGroupNode::QmlPropertyGroupNode(QmlClassNode* parent, const QString& name)
|
||||
QmlPropertyGroupNode::QmlPropertyGroupNode(QmlTypeNode* parent, const QString& name)
|
||||
: InnerNode(QmlPropertyGroup, parent, name)
|
||||
{
|
||||
idNumber_ = -1;
|
||||
@ -2347,7 +2347,7 @@ bool QmlPropertyNode::isWritable()
|
||||
if (readOnly_ != FlagValueDefault)
|
||||
return !fromFlagValue(readOnly_, false);
|
||||
|
||||
QmlClassNode* qcn = qmlClassNode();
|
||||
QmlTypeNode* qcn = qmlClassNode();
|
||||
if (qcn) {
|
||||
if (qcn->cppClassRequired()) {
|
||||
if (qcn->classNode()) {
|
||||
@ -2381,7 +2381,7 @@ PropertyNode* QmlPropertyNode::findCorrespondingCppProperty()
|
||||
while (n && !n->isQmlType())
|
||||
n = n->parent();
|
||||
if (n) {
|
||||
QmlClassNode* qcn = static_cast<QmlClassNode*>(n);
|
||||
QmlTypeNode* qcn = static_cast<QmlTypeNode*>(n);
|
||||
ClassNode* cn = qcn->classNode();
|
||||
if (cn) {
|
||||
/*
|
||||
|
@ -51,7 +51,7 @@ class ClassNode;
|
||||
class InnerNode;
|
||||
class ExampleNode;
|
||||
class TypedefNode;
|
||||
class QmlClassNode;
|
||||
class QmlTypeNode;
|
||||
class QDocDatabase;
|
||||
class FunctionNode;
|
||||
class PropertyNode;
|
||||
@ -300,7 +300,7 @@ public:
|
||||
virtual void setClassNode(ClassNode* ) { }
|
||||
virtual const Node* applyModuleName(const Node* ) const { return 0; }
|
||||
virtual QString idNumber() { return "0"; }
|
||||
QmlClassNode* qmlClassNode();
|
||||
QmlTypeNode* qmlClassNode();
|
||||
ClassNode* declarativeCppNode();
|
||||
const QString& outputSubdirectory() const { return outSubDir_; }
|
||||
void setOutputSubdirectory(const QString& t) { outSubDir_ = t; }
|
||||
@ -493,12 +493,12 @@ public:
|
||||
|
||||
QString serviceName() const { return sname; }
|
||||
void setServiceName(const QString& value) { sname = value; }
|
||||
QmlClassNode* qmlElement() { return qmlelement; }
|
||||
void setQmlElement(QmlClassNode* qcn) { qmlelement = qcn; }
|
||||
QmlTypeNode* qmlElement() { return qmlelement; }
|
||||
void setQmlElement(QmlTypeNode* qcn) { qmlelement = qcn; }
|
||||
virtual bool isAbstract() const Q_DECL_OVERRIDE { return abstract_; }
|
||||
virtual void setAbstract(bool b) Q_DECL_OVERRIDE { abstract_ = b; }
|
||||
PropertyNode* findPropertyNode(const QString& name);
|
||||
QmlClassNode* findQmlBaseNode();
|
||||
QmlTypeNode* findQmlBaseNode();
|
||||
|
||||
private:
|
||||
QList<RelatedClass> bases_;
|
||||
@ -508,7 +508,7 @@ private:
|
||||
bool wrapper_;
|
||||
QString sname;
|
||||
QString obsoleteLink_;
|
||||
QmlClassNode* qmlelement;
|
||||
QmlTypeNode* qmlelement;
|
||||
};
|
||||
|
||||
class DocNode : public InnerNode
|
||||
@ -578,11 +578,11 @@ struct ImportRec {
|
||||
|
||||
typedef QList<ImportRec> ImportList;
|
||||
|
||||
class QmlClassNode : public InnerNode
|
||||
class QmlTypeNode : public InnerNode
|
||||
{
|
||||
public:
|
||||
QmlClassNode(InnerNode* parent, const QString& name);
|
||||
virtual ~QmlClassNode();
|
||||
QmlTypeNode(InnerNode* parent, const QString& name);
|
||||
virtual ~QmlTypeNode();
|
||||
virtual bool isQmlNode() const Q_DECL_OVERRIDE { return true; }
|
||||
virtual bool isQmlType() const Q_DECL_OVERRIDE { return true; }
|
||||
virtual bool isQtQuickNode() const Q_DECL_OVERRIDE { return (qmlModuleName() == QLatin1String("QtQuick")); }
|
||||
@ -607,8 +607,8 @@ public:
|
||||
const QString& qmlBaseName() const { return qmlBaseName_; }
|
||||
void setQmlBaseName(const QString& name) { qmlBaseName_ = name; }
|
||||
bool qmlBaseNodeNotSet() const { return (qmlBaseNode_ == 0); }
|
||||
QmlClassNode* qmlBaseNode();
|
||||
void setQmlBaseNode(QmlClassNode* b) { qmlBaseNode_ = b; }
|
||||
QmlTypeNode* qmlBaseNode();
|
||||
void setQmlBaseNode(QmlTypeNode* b) { qmlBaseNode_ = b; }
|
||||
void requireCppClass() { cnodeRequired_ = true; }
|
||||
bool cppClassRequired() const { return cnodeRequired_; }
|
||||
static void addInheritedBy(const QString& base, Node* sub);
|
||||
@ -627,7 +627,7 @@ private:
|
||||
QString qmlBaseName_;
|
||||
QString obsoleteLink_;
|
||||
QmlModuleNode* qmlModule_;
|
||||
QmlClassNode* qmlBaseNode_;
|
||||
QmlTypeNode* qmlBaseNode_;
|
||||
ImportList importList_;
|
||||
};
|
||||
|
||||
@ -645,7 +645,7 @@ public:
|
||||
class QmlPropertyGroupNode : public InnerNode
|
||||
{
|
||||
public:
|
||||
QmlPropertyGroupNode(QmlClassNode* parent, const QString& name);
|
||||
QmlPropertyGroupNode(QmlTypeNode* parent, const QString& name);
|
||||
virtual ~QmlPropertyGroupNode() { }
|
||||
virtual bool isQmlNode() const Q_DECL_OVERRIDE { return true; }
|
||||
virtual bool isQtQuickNode() const Q_DECL_OVERRIDE { return parent()->isQtQuickNode(); }
|
||||
|
@ -734,9 +734,9 @@ void QDocDatabase::initializeDB()
|
||||
Looks up the QML type node identified by the qualified Qml
|
||||
type \a name and returns a pointer to the QML type node.
|
||||
*/
|
||||
QmlClassNode* QDocDatabase::findQmlType(const QString& name)
|
||||
QmlTypeNode* QDocDatabase::findQmlType(const QString& name)
|
||||
{
|
||||
QmlClassNode* qcn = forest_.lookupQmlType(name);
|
||||
QmlTypeNode* qcn = forest_.lookupQmlType(name);
|
||||
if (qcn)
|
||||
return qcn;
|
||||
return 0;
|
||||
@ -750,11 +750,11 @@ QmlClassNode* QDocDatabase::findQmlType(const QString& name)
|
||||
If the QML module id is empty, it looks up the QML type by
|
||||
\a name only.
|
||||
*/
|
||||
QmlClassNode* QDocDatabase::findQmlType(const QString& qmid, const QString& name)
|
||||
QmlTypeNode* QDocDatabase::findQmlType(const QString& qmid, const QString& name)
|
||||
{
|
||||
if (!qmid.isEmpty()) {
|
||||
QString t = qmid + "::" + name;
|
||||
QmlClassNode* qcn = forest_.lookupQmlType(t);
|
||||
QmlTypeNode* qcn = forest_.lookupQmlType(t);
|
||||
if (qcn)
|
||||
return qcn;
|
||||
}
|
||||
@ -762,7 +762,7 @@ QmlClassNode* QDocDatabase::findQmlType(const QString& qmid, const QString& name
|
||||
QStringList path(name);
|
||||
Node* n = forest_.findNodeByNameAndType(path, Node::QmlType);
|
||||
if (n && n->isQmlType())
|
||||
return static_cast<QmlClassNode*>(n);
|
||||
return static_cast<QmlTypeNode*>(n);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -772,7 +772,7 @@ QmlClassNode* QDocDatabase::findQmlType(const QString& qmid, const QString& name
|
||||
QML type \a name and returns a pointer to the QML type node.
|
||||
If a QML type node is not found, 0 is returned.
|
||||
*/
|
||||
QmlClassNode* QDocDatabase::findQmlType(const ImportRec& import, const QString& name)
|
||||
QmlTypeNode* QDocDatabase::findQmlType(const ImportRec& import, const QString& name)
|
||||
{
|
||||
if (!import.isEmpty()) {
|
||||
QStringList dotSplit;
|
||||
@ -784,7 +784,7 @@ QmlClassNode* QDocDatabase::findQmlType(const ImportRec& import, const QString&
|
||||
qmName = import.importUri_;
|
||||
for (int i=0; i<dotSplit.size(); ++i) {
|
||||
QString qualifiedName = qmName + "::" + dotSplit[i];
|
||||
QmlClassNode* qcn = forest_.lookupQmlType(qualifiedName);
|
||||
QmlTypeNode* qcn = forest_.lookupQmlType(qualifiedName);
|
||||
if (qcn)
|
||||
return qcn;
|
||||
}
|
||||
@ -1398,9 +1398,9 @@ void QDocDatabase::resolveQmlInheritance(InnerNode* root)
|
||||
// Do we need recursion?
|
||||
foreach (Node* child, root->childNodes()) {
|
||||
if (child->isQmlType()) {
|
||||
QmlClassNode* qcn = static_cast<QmlClassNode*>(child);
|
||||
QmlTypeNode* qcn = static_cast<QmlTypeNode*>(child);
|
||||
if (qcn->qmlBaseNodeNotSet() && !qcn->qmlBaseName().isEmpty()) {
|
||||
QmlClassNode* bqcn = static_cast<QmlClassNode*>(previousSearches.value(qcn->qmlBaseName()));
|
||||
QmlTypeNode* bqcn = static_cast<QmlTypeNode*>(previousSearches.value(qcn->qmlBaseName()));
|
||||
if (bqcn)
|
||||
qcn->setQmlBaseNode(bqcn);
|
||||
else {
|
||||
|
@ -177,10 +177,10 @@ class QDocForest
|
||||
return 0;
|
||||
}
|
||||
|
||||
QmlClassNode* lookupQmlType(const QString& name)
|
||||
QmlTypeNode* lookupQmlType(const QString& name)
|
||||
{
|
||||
foreach (Tree* t, searchOrder()) {
|
||||
QmlClassNode* qcn = t->lookupQmlType(name);
|
||||
QmlTypeNode* qcn = t->lookupQmlType(name);
|
||||
if (qcn)
|
||||
return qcn;
|
||||
}
|
||||
@ -255,9 +255,9 @@ class QDocDatabase
|
||||
void addExampleNode(ExampleNode* n) { primaryTree()->addExampleNode(n); }
|
||||
ExampleNodeMap& exampleNodeMap() { return primaryTree()->exampleNodeMap(); }
|
||||
|
||||
QmlClassNode* findQmlType(const QString& name);
|
||||
QmlClassNode* findQmlType(const QString& qmid, const QString& name);
|
||||
QmlClassNode* findQmlType(const ImportRec& import, const QString& name);
|
||||
QmlTypeNode* findQmlType(const QString& name);
|
||||
QmlTypeNode* findQmlType(const QString& qmid, const QString& name);
|
||||
QmlTypeNode* findQmlType(const ImportRec& import, const QString& name);
|
||||
|
||||
private:
|
||||
void findAllClasses(InnerNode *node);
|
||||
|
@ -208,7 +208,7 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
|
||||
node->setAbstract(abstract);
|
||||
}
|
||||
else if (element.nodeName() == "qmlclass") {
|
||||
QmlClassNode* qcn = new QmlClassNode(parent, name);
|
||||
QmlTypeNode* qcn = new QmlTypeNode(parent, name);
|
||||
qcn->setTitle(element.attribute("title"));
|
||||
QString qmlModuleName = element.attribute("qml-module-name");
|
||||
if (!qmlModuleName.isEmpty())
|
||||
@ -241,7 +241,7 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
|
||||
node = qbtn;
|
||||
}
|
||||
else if (element.nodeName() == "qmlpropertygroup") {
|
||||
QmlClassNode* qcn = static_cast<QmlClassNode*>(parent);
|
||||
QmlTypeNode* qcn = static_cast<QmlTypeNode*>(parent);
|
||||
QmlPropertyGroupNode* qpgn = new QmlPropertyGroupNode(qcn, name);
|
||||
if (element.hasAttribute("location"))
|
||||
name = element.attribute("location", QString());
|
||||
@ -261,7 +261,7 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
|
||||
readonly = true;
|
||||
QmlPropertyNode* qpn = 0;
|
||||
if (parent->isQmlType()) {
|
||||
QmlClassNode* qcn = static_cast<QmlClassNode*>(parent);
|
||||
QmlTypeNode* qcn = static_cast<QmlTypeNode*>(parent);
|
||||
qpn = new QmlPropertyNode(qcn, name, type, attached);
|
||||
}
|
||||
else if (parent->isQmlPropertyGroup()) {
|
||||
@ -881,7 +881,7 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
|
||||
break;
|
||||
case Node::QmlType:
|
||||
{
|
||||
const QmlClassNode* qcn = static_cast<const QmlClassNode*>(node);
|
||||
const QmlTypeNode* qcn = static_cast<const QmlTypeNode*>(node);
|
||||
writer.writeAttribute("title", qcn->title());
|
||||
writer.writeAttribute("fulltitle", qcn->fullTitle());
|
||||
writer.writeAttribute("subtitle", qcn->subTitle());
|
||||
|
@ -371,9 +371,9 @@ void QmlDocVisitor::applyMetacommands(QQmlJS::AST::SourceLocation,
|
||||
if (node->name() == args[0].first)
|
||||
doc.location().warning(tr("%1 tries to inherit itself").arg(args[0].first));
|
||||
else if (node->isQmlType()) {
|
||||
QmlClassNode *qmlClass = static_cast<QmlClassNode*>(node);
|
||||
QmlTypeNode *qmlClass = static_cast<QmlTypeNode*>(node);
|
||||
qmlClass->setQmlBaseName(args[0].first);
|
||||
QmlClassNode::addInheritedBy(args[0].first,node);
|
||||
QmlTypeNode::addInheritedBy(args[0].first,node);
|
||||
}
|
||||
}
|
||||
else if (command == COMMAND_QMLDEFAULT) {
|
||||
@ -452,12 +452,12 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiObjectDefinition *definition)
|
||||
nestingLevel++;
|
||||
|
||||
if (current->type() == Node::Namespace) {
|
||||
QmlClassNode *component = new QmlClassNode(current, name);
|
||||
QmlTypeNode *component = new QmlTypeNode(current, name);
|
||||
component->setTitle(name);
|
||||
component->setImportList(importList);
|
||||
importList.clear();
|
||||
if (applyDocumentation(definition->firstSourceLocation(), component)) {
|
||||
QmlClassNode::addInheritedBy(type, component);
|
||||
QmlTypeNode::addInheritedBy(type, component);
|
||||
component->setQmlBaseName(type);
|
||||
}
|
||||
current = component;
|
||||
@ -533,7 +533,7 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiPublicMember *member)
|
||||
case QQmlJS::AST::UiPublicMember::Signal:
|
||||
{
|
||||
if (current->isQmlType()) {
|
||||
QmlClassNode *qmlClass = static_cast<QmlClassNode *>(current);
|
||||
QmlTypeNode *qmlClass = static_cast<QmlTypeNode *>(current);
|
||||
if (qmlClass) {
|
||||
|
||||
QString name = member->name.toString();
|
||||
@ -556,7 +556,7 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiPublicMember *member)
|
||||
QString type = member->memberType.toString();
|
||||
QString name = member->name.toString();
|
||||
if (current->isQmlType()) {
|
||||
QmlClassNode *qmlClass = static_cast<QmlClassNode *>(current);
|
||||
QmlTypeNode *qmlClass = static_cast<QmlTypeNode *>(current);
|
||||
if (qmlClass) {
|
||||
QString name = member->name.toString();
|
||||
QmlPropertyNode* qmlPropNode = qmlClass->hasQmlProperty(name);
|
||||
@ -600,7 +600,7 @@ bool QmlDocVisitor::visit(QQmlJS::AST::FunctionDeclaration* fd)
|
||||
return true;
|
||||
}
|
||||
if (current->isQmlType()) {
|
||||
QmlClassNode* qmlClass = static_cast<QmlClassNode*>(current);
|
||||
QmlTypeNode* qmlClass = static_cast<QmlTypeNode*>(current);
|
||||
if (qmlClass) {
|
||||
QString name = fd->name.toString();
|
||||
FunctionNode* qmlMethod = new FunctionNode(Node::QmlMethod, current, name, false);
|
||||
@ -655,7 +655,7 @@ bool QmlDocVisitor::visit(QQmlJS::AST::UiScriptBinding* )
|
||||
if (current->isQmlType()) {
|
||||
QString handler = sb->qualifiedId->name.toString();
|
||||
if (handler.length() > 2 && handler.startsWith("on") && handler.at(2).isUpper()) {
|
||||
QmlClassNode* qmlClass = static_cast<QmlClassNode*>(current);
|
||||
QmlTypeNode* qmlClass = static_cast<QmlTypeNode*>(current);
|
||||
if (qmlClass) {
|
||||
FunctionNode* qmlSH = new FunctionNode(Node::QmlSignalHandler,current,handler,false);
|
||||
applyDocumentation(sb->firstSourceLocation(), qmlSH);
|
||||
|
@ -188,7 +188,7 @@ FunctionNode* Tree::findFunctionNode(const QStringList& parentPath, const Functi
|
||||
at the root of the tree. Only a Qml type node named <\a path is
|
||||
acceptible. If one is not found, 0 is returned.
|
||||
*/
|
||||
QmlClassNode* Tree::findQmlTypeNode(const QStringList& path)
|
||||
QmlTypeNode* Tree::findQmlTypeNode(const QStringList& path)
|
||||
{
|
||||
/*
|
||||
If the path contains one or two double colons ("::"),
|
||||
@ -199,11 +199,11 @@ QmlClassNode* Tree::findQmlTypeNode(const QStringList& path)
|
||||
class node.
|
||||
*/
|
||||
if (path.size() >= 2 && !path[0].isEmpty()) {
|
||||
QmlClassNode* qcn = qdb_->findQmlType(path[0], path[1]);
|
||||
QmlTypeNode* qcn = qdb_->findQmlType(path[0], path[1]);
|
||||
if (qcn)
|
||||
return qcn;
|
||||
}
|
||||
return static_cast<QmlClassNode*>(findNodeRecursive(path, 0, root(), Node::QmlType));
|
||||
return static_cast<QmlTypeNode*>(findNodeRecursive(path, 0, root(), Node::QmlType));
|
||||
}
|
||||
|
||||
/*!
|
||||
@ -221,12 +221,12 @@ const FunctionNode* Tree::findFunctionNode(const QStringList& path,
|
||||
{
|
||||
if (path.size() == 3 && !path[0].isEmpty() &&
|
||||
((genus == Node::QML) || (genus == Node::DontCare))) {
|
||||
QmlClassNode* qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
|
||||
QmlTypeNode* qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
|
||||
if (!qcn) {
|
||||
QStringList p(path[1]);
|
||||
Node* n = findNodeByNameAndType(p, Node::QmlType);
|
||||
if (n && n->isQmlType())
|
||||
qcn = static_cast<QmlClassNode*>(n);
|
||||
qcn = static_cast<QmlTypeNode*>(n);
|
||||
}
|
||||
if (qcn)
|
||||
return static_cast<const FunctionNode*>(qcn->findFunctionNode(path[2]));
|
||||
@ -490,7 +490,7 @@ void Tree::resolveCppToQmlLinks()
|
||||
|
||||
foreach (Node* child, root_.childNodes()) {
|
||||
if (child->isQmlType()) {
|
||||
QmlClassNode* qcn = static_cast<QmlClassNode*>(child);
|
||||
QmlTypeNode* qcn = static_cast<QmlTypeNode*>(child);
|
||||
ClassNode* cn = const_cast<ClassNode*>(qcn->classNode());
|
||||
if (cn)
|
||||
cn->setQmlElement(qcn);
|
||||
@ -731,7 +731,7 @@ const Node* Tree::findNodeForTarget(const QStringList& path,
|
||||
int path_idx = 0;
|
||||
if (((genus == Node::QML) || (genus == Node::DontCare)) &&
|
||||
(path.size() >= 2) && !path[0].isEmpty()) {
|
||||
QmlClassNode* qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
|
||||
QmlTypeNode* qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
|
||||
if (qcn) {
|
||||
current = qcn;
|
||||
if (path.size() == 2) {
|
||||
@ -876,7 +876,7 @@ const Node* Tree::findNode(const QStringList& path,
|
||||
*/
|
||||
if (((genus == Node::QML) || (genus == Node::DontCare)) &&
|
||||
(path.size() >= 2) && !path[0].isEmpty()) {
|
||||
QmlClassNode* qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
|
||||
QmlTypeNode* qcn = lookupQmlType(QString(path[0] + "::" + path[1]));
|
||||
if (qcn) {
|
||||
node = qcn;
|
||||
if (path.size() == 2)
|
||||
@ -1374,7 +1374,7 @@ QmlModuleNode* Tree::addToQmlModule(const QString& name, Node* node)
|
||||
qmn->addMember(node);
|
||||
node->setQmlModule(qmn);
|
||||
if (node->isQmlType()) {
|
||||
QmlClassNode* n = static_cast<QmlClassNode*>(node);
|
||||
QmlTypeNode* n = static_cast<QmlTypeNode*>(node);
|
||||
for (int i=0; i<qmid.size(); ++i) {
|
||||
QString key = qmid[i] + "::" + node->name();
|
||||
insertQmlType(key, n);
|
||||
@ -1387,7 +1387,7 @@ QmlModuleNode* Tree::addToQmlModule(const QString& name, Node* node)
|
||||
If the QML type map does not contain \a key, insert node
|
||||
\a n with the specified \a key.
|
||||
*/
|
||||
void Tree::insertQmlType(const QString& key, QmlClassNode* n)
|
||||
void Tree::insertQmlType(const QString& key, QmlTypeNode* n)
|
||||
{
|
||||
if (!qmlTypeMap_.contains(key))
|
||||
qmlTypeMap_.insert(key,n);
|
||||
@ -1396,8 +1396,6 @@ void Tree::insertQmlType(const QString& key, QmlClassNode* n)
|
||||
/*!
|
||||
Split \a target on "::" and find the function node with that
|
||||
path.
|
||||
|
||||
Called in HtmlGenerator, DitaXmlGenerator, and QdocDatabase.
|
||||
*/
|
||||
const Node* Tree::findFunctionNode(const QString& target, const Node* relative, Node::Genus genus)
|
||||
{
|
||||
|
@ -81,7 +81,7 @@ struct TargetLoc
|
||||
|
||||
typedef QMultiMap<QString, TargetRec*> TargetMap;
|
||||
typedef QMultiMap<QString, DocNode*> DocNodeMultiMap;
|
||||
typedef QMap<QString, QmlClassNode*> QmlTypeMap;
|
||||
typedef QMap<QString, QmlTypeNode*> QmlTypeMap;
|
||||
typedef QMultiMap<QString, const ExampleNode*> ExampleNodeMap;
|
||||
typedef QVector<TargetLoc*> TargetList;
|
||||
typedef QMap<QString, TargetList*> TargetListMap;
|
||||
@ -132,7 +132,7 @@ class Tree
|
||||
int findFlags, // = 0,
|
||||
Node::Genus genus) const; // = Node::DontCare) const;
|
||||
|
||||
QmlClassNode* findQmlTypeNode(const QStringList& path);
|
||||
QmlTypeNode* findQmlTypeNode(const QStringList& path);
|
||||
|
||||
Node* findNodeByNameAndType(const QStringList& path, Node::Type type) const;
|
||||
InnerNode* findRelatesNode(const QStringList& path);
|
||||
@ -196,8 +196,8 @@ class Tree
|
||||
ModuleNode* addToModule(const QString& name, Node* node);
|
||||
QmlModuleNode* addToQmlModule(const QString& name, Node* node);
|
||||
|
||||
QmlClassNode* lookupQmlType(const QString& name) const { return qmlTypeMap_.value(name); }
|
||||
void insertQmlType(const QString& key, QmlClassNode* n);
|
||||
QmlTypeNode* lookupQmlType(const QString& name) const { return qmlTypeMap_.value(name); }
|
||||
void insertQmlType(const QString& key, QmlTypeNode* n);
|
||||
void addExampleNode(ExampleNode* n) { exampleNodeMap_.insert(n->title(), n); }
|
||||
ExampleNodeMap& exampleNodeMap() { return exampleNodeMap_; }
|
||||
const Node* checkForCollision(const QString& name);
|
||||
|
Loading…
Reference in New Issue
Block a user