From 864365e44942a55c37ba3f07b101e576394fa889 Mon Sep 17 00:00:00 2001 From: Martin Smith Date: Tue, 28 Apr 2009 08:54:08 +0200 Subject: qdoc: Corrected a few qdoc warnings. Changed some qDebug() output in qdoc to be real qdoc waqrnings with location information for the user. These were in the qmlproperty command processing. --- src/declarative/fx/qfxevents.cpp | 4 ++-- src/declarative/fx/qfxparticles.cpp | 6 +++--- tools/qdoc3/cppcodeparser.cpp | 25 ++++++++++++++----------- tools/qdoc3/cppcodeparser.h | 9 ++++++--- 4 files changed, 25 insertions(+), 19 deletions(-) diff --git a/src/declarative/fx/qfxevents.cpp b/src/declarative/fx/qfxevents.cpp index 804446b..7d04f5d 100644 --- a/src/declarative/fx/qfxevents.cpp +++ b/src/declarative/fx/qfxevents.cpp @@ -118,8 +118,8 @@ QT_BEGIN_NAMESPACE */ /*! - \qmlproperty int x - \qmlproperty int y + \qmlproperty int MouseEvent::x + \qmlproperty int MouseEvent::y These properties hold the position of the mouse event. */ diff --git a/src/declarative/fx/qfxparticles.cpp b/src/declarative/fx/qfxparticles.cpp index 8b16098..03bd1e0 100644 --- a/src/declarative/fx/qfxparticles.cpp +++ b/src/declarative/fx/qfxparticles.cpp @@ -268,14 +268,14 @@ void QFxParticleMotionGravity::advance(QFxParticle &p, int interval) */ /*! - \qmlproperty QFxParticleMotionWander::xvariance - \qmlproperty QFxParticleMotionWander::yvariance + \qmlproperty int QFxParticleMotionWander::xvariance + \qmlproperty int QFxParticleMotionWander::yvariance These properties set the amount to wander in the x and y directions. */ /*! - \qmlproperty QFxParticleMotionWander::pace + \qmlproperty int QFxParticleMotionWander::pace This property holds how quickly the paricles will move from side to side. */ diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index e271590..7e84c90 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -694,7 +694,7 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc, QString element; QString name; QmlClassNode* qmlClass = 0; - if (splitQmlArg(arg,element,name)) { + if (splitQmlArg(doc,arg,element,name)) { Node* n = tre->findNode(QStringList(element),Node::Fake); if (n && n->subType() == Node::QmlClass) { qmlClass = static_cast(n); @@ -721,7 +721,8 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc, and returns true. If any of the parts isn't found, a debug message is output and false is returned. */ -bool CppCodeParser::splitQmlPropertyArg(const QString& arg, +bool CppCodeParser::splitQmlPropertyArg(const Doc& doc, + const QString& arg, QString& type, QString& element, QString& property) @@ -736,10 +737,10 @@ bool CppCodeParser::splitQmlPropertyArg(const QString& arg, return true; } else - qDebug() << "Missing QML element name or property name"; + doc.location().warning(tr("Missing QML element name or property name")); } else - qDebug() << "Missing QML property type or property path"; + doc.location().warning(tr("Missing QML property type or property path")); return false; } @@ -753,7 +754,8 @@ bool CppCodeParser::splitQmlPropertyArg(const QString& arg, true. If either of the parts isn't found, a debug message is output and false is returned. */ -bool CppCodeParser::splitQmlArg(const QString& arg, +bool CppCodeParser::splitQmlArg(const Doc& doc, + const QString& arg, QString& element, QString& name) { @@ -764,7 +766,7 @@ bool CppCodeParser::splitQmlArg(const QString& arg, return true; } else - qDebug() << "Missing QML element name or signal/method name"; + doc.location().warning(tr("Missing QML element name or signal/method name")); return false; } @@ -773,7 +775,8 @@ bool CppCodeParser::splitQmlArg(const QString& arg, Currently, this function is called only for \e{qmlproperty}. */ -Node *CppCodeParser::processTopicCommandGroup(const QString& command, +Node *CppCodeParser::processTopicCommandGroup(const Doc& doc, + const QString& command, const QStringList& args) { QmlPropGroupNode* qmlPropGroup = 0; @@ -782,7 +785,7 @@ Node *CppCodeParser::processTopicCommandGroup(const QString& command, QString element; QString property; QStringList::ConstIterator arg = args.begin(); - if (splitQmlPropertyArg(*arg,type,element,property)) { + if (splitQmlPropertyArg(doc,(*arg),type,element,property)) { Node* n = tre->findNode(QStringList(element),Node::Fake); if (n && n->subType() == Node::QmlClass) { QmlClassNode* qmlClass = static_cast(n); @@ -794,7 +797,7 @@ Node *CppCodeParser::processTopicCommandGroup(const QString& command, new QmlPropertyNode(qmlPropGroup,property,type); ++arg; while (arg != args.end()) { - if (splitQmlPropertyArg(*arg,type,element,property)) { + if (splitQmlPropertyArg(doc,(*arg),type,element,property)) { new QmlPropertyNode(qmlPropGroup,property,type); } ++arg; @@ -1974,7 +1977,7 @@ bool CppCodeParser::matchDocsAndStuff() #ifdef QDOC_QML if (topic == COMMAND_QMLPROPERTY) { Doc nodeDoc = doc; - Node *node = processTopicCommandGroup(topic, args); + Node *node = processTopicCommandGroup(nodeDoc,topic,args); if (node != 0) { nodes.append(node); docs.append(nodeDoc); @@ -1984,7 +1987,7 @@ bool CppCodeParser::matchDocsAndStuff() QStringList::ConstIterator a = args.begin(); while (a != args.end()) { Doc nodeDoc = doc; - Node *node = processTopicCommand(nodeDoc, topic, *a); + Node *node = processTopicCommand(nodeDoc,topic,*a); if (node != 0) { nodes.append(node); docs.append(nodeDoc); diff --git a/tools/qdoc3/cppcodeparser.h b/tools/qdoc3/cppcodeparser.h index 2eb2fb3..3864990 100644 --- a/tools/qdoc3/cppcodeparser.h +++ b/tools/qdoc3/cppcodeparser.h @@ -92,13 +92,16 @@ class CppCodeParser : public CodeParser const QString& arg); #ifdef QDOC_QML // might need to implement this in QsCodeParser as well. - virtual Node *processTopicCommandGroup(const QString& command, + virtual Node *processTopicCommandGroup(const Doc& doc, + const QString& command, const QStringList& args); - bool splitQmlPropertyArg(const QString& arg, + bool splitQmlPropertyArg(const Doc& doc, + const QString& arg, QString& type, QString& element, QString& property); - bool splitQmlArg(const QString& arg, + bool splitQmlArg(const Doc& doc, + const QString& arg, QString& element, QString& name); #endif -- cgit v0.12