diff options
author | Thiago Macieira <thiago.macieira@nokia.com> | 2009-10-21 20:08:56 (GMT) |
---|---|---|
committer | Thiago Macieira <thiago.macieira@nokia.com> | 2009-10-21 20:08:56 (GMT) |
commit | af92d15b625d2042814323fcebfa41c5bbb6b09d (patch) | |
tree | 13cf3dce4252c2b5ef166860e9a423d72f630da9 /tools | |
parent | 511c434b959be96c992e59f4a2748ac251d5c72a (diff) | |
parent | 26eda5fa33e401a1803b42e6eacf0921ddc6a14e (diff) | |
download | Qt-af92d15b625d2042814323fcebfa41c5bbb6b09d.zip Qt-af92d15b625d2042814323fcebfa41c5bbb6b09d.tar.gz Qt-af92d15b625d2042814323fcebfa41c5bbb6b09d.tar.bz2 |
Merge branch '4.6'
Diffstat (limited to 'tools')
-rw-r--r-- | tools/assistant/lib/qhelpcollectionhandler.cpp | 14 | ||||
-rw-r--r-- | tools/assistant/lib/qhelpsearchquerywidget.cpp | 2 | ||||
-rw-r--r-- | tools/qdoc3/cppcodemarker.cpp | 19 | ||||
-rw-r--r-- | tools/qdoc3/cppcodeparser.cpp | 23 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 6 | ||||
-rw-r--r-- | tools/qdoc3/node.cpp | 14 | ||||
-rw-r--r-- | tools/qdoc3/node.h | 11 |
7 files changed, 65 insertions, 24 deletions
diff --git a/tools/assistant/lib/qhelpcollectionhandler.cpp b/tools/assistant/lib/qhelpcollectionhandler.cpp index f59b227..4aa7ab6 100644 --- a/tools/assistant/lib/qhelpcollectionhandler.cpp +++ b/tools/assistant/lib/qhelpcollectionhandler.cpp @@ -76,7 +76,8 @@ bool QHelpCollectionHandler::isDBOpened() { if (m_dbOpened) return true; - emit error(tr("The collection file is not set up yet!")); + emit error(tr("The collection file '%1' is not set up yet!"). + arg(m_collectionFile)); return false; } @@ -134,7 +135,8 @@ bool QHelpCollectionHandler::copyCollectionFile(const QString &fileName) QFileInfo fi(fileName); if (fi.exists()) { - emit error(tr("The specified collection file already exists!")); + emit error(tr("The collection file '%1' already exists!"). + arg(fileName)); return false; } @@ -281,7 +283,7 @@ bool QHelpCollectionHandler::removeCustomFilter(const QString &filterName) filterNameId = m_query.value(0).toInt(); if (filterNameId < 0) { - emit error(tr("Unknown filter!")); + emit error(tr("Unknown filter '%1'!").arg(filterName)); return false; } @@ -386,7 +388,7 @@ bool QHelpCollectionHandler::registerDocumentation(const QString &fileName) QString ns = reader.namespaceName(); if (ns.isEmpty()) { - emit error(tr("Invalid documentation file!")); + emit error(tr("Invalid documentation file '%1'!").arg(fileName)); return false; } @@ -553,7 +555,7 @@ int QHelpCollectionHandler::registerNamespace(const QString &nspace, const QStri if (m_query.exec()) namespaceId = m_query.lastInsertId().toInt(); if (namespaceId < 1) { - emit error(tr("Cannot register namespace!")); + emit error(tr("Cannot register namespace '%1'!").arg(nspace)); return -1; } return namespaceId; @@ -577,7 +579,7 @@ void QHelpCollectionHandler::optimizeDatabase(const QString &fileName) db.setDatabaseName(fileName); if (!db.open()) { QSqlDatabase::removeDatabase(QLatin1String("optimize")); - emit error(tr("Cannot open database to optimize!")); + emit error(tr("Cannot open database '%1' to optimize!").arg(fileName)); return; } diff --git a/tools/assistant/lib/qhelpsearchquerywidget.cpp b/tools/assistant/lib/qhelpsearchquerywidget.cpp index 361e9ac..f2f40ec 100644 --- a/tools/assistant/lib/qhelpsearchquerywidget.cpp +++ b/tools/assistant/lib/qhelpsearchquerywidget.cpp @@ -289,7 +289,7 @@ private slots: { QList<QHelpSearchQuery> queryList; #if !defined(QT_CLUCENE_SUPPORT) - queryList.append(QHelSearchQuery(QHelpSearchQuery::DEFAULT, + queryList.append(QHelpSearchQuery(QHelpSearchQuery::DEFAULT, QStringList(defaultQuery->text()))); #else diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp index 917faa2..e2322b2 100644 --- a/tools/qdoc3/cppcodemarker.cpp +++ b/tools/qdoc3/cppcodemarker.cpp @@ -1114,6 +1114,10 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, "QML Properties", "property", "properties"); + FastSection qmlattachedproperties(qmlClassNode, + "QML Attached Properties", + "property", + "properties"); FastSection qmlsignals(qmlClassNode, "QML Signals", "signal", @@ -1130,7 +1134,11 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, NodeList::ConstIterator p = qpgn->childNodes().begin(); while (p != qpgn->childNodes().end()) { if ((*p)->type() == Node::QmlProperty) { - insert(qmlproperties,*p,style,Okay); + const QmlPropertyNode* pn = static_cast<const QmlPropertyNode*>(*p); + if (pn->isAttached()) + insert(qmlattachedproperties,*p,style,Okay); + else + insert(qmlproperties,*p,style,Okay); } ++p; } @@ -1144,17 +1152,23 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, ++c; } append(sections,qmlproperties); + append(sections,qmlattachedproperties); append(sections,qmlsignals); append(sections,qmlmethods); } else if (style == Detailed) { FastSection qmlproperties(qmlClassNode,"QML Property Documentation"); + FastSection qmlattachedproperties(qmlClassNode,"QML Attached Property Documentation"); FastSection qmlsignals(qmlClassNode,"QML Signal Documentation"); FastSection qmlmethods(qmlClassNode,"QML Method Documentation"); NodeList::ConstIterator c = qmlClassNode->childNodes().begin(); while (c != qmlClassNode->childNodes().end()) { if ((*c)->subType() == Node::QmlPropertyGroup) { - insert(qmlproperties,*c,style,Okay); + const QmlPropGroupNode* pgn = static_cast<const QmlPropGroupNode*>(*c); + if (pgn->isAttached()) + insert(qmlattachedproperties,*c,style,Okay); + else + insert(qmlproperties,*c,style,Okay); } else if ((*c)->type() == Node::QmlSignal) { insert(qmlsignals,*c,style,Okay); @@ -1165,6 +1179,7 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, ++c; } append(sections,qmlproperties); + append(sections,qmlattachedproperties); append(sections,qmlsignals); append(sections,qmlmethods); } diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index d93e24c..ad43b2b 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -88,6 +88,7 @@ QT_BEGIN_NAMESPACE #ifdef QDOC_QML #define COMMAND_QMLCLASS Doc::alias("qmlclass") #define COMMAND_QMLPROPERTY Doc::alias("qmlproperty") +#define COMMAND_QMLATTACHEDPROPERTY Doc::alias("qmlattachedproperty") #define COMMAND_QMLINHERITS Doc::alias("inherits") #define COMMAND_QMLSIGNAL Doc::alias("qmlsignal") #define COMMAND_QMLMETHOD Doc::alias("qmlmethod") @@ -482,6 +483,7 @@ QSet<QString> CppCodeParser::topicCommands() << COMMAND_VARIABLE << COMMAND_QMLCLASS << COMMAND_QMLPROPERTY + << COMMAND_QMLATTACHEDPROPERTY << COMMAND_QMLSIGNAL << COMMAND_QMLMETHOD; #else @@ -759,32 +761,40 @@ bool CppCodeParser::splitQmlArg(const Doc& doc, /*! Process the topic \a command group with arguments \a args. - Currently, this function is called only for \e{qmlproperty}. + Currently, this function is called only for \e{qmlproperty} + and \e{qmlattachedproperty}. */ Node *CppCodeParser::processTopicCommandGroup(const Doc& doc, const QString& command, const QStringList& args) { QmlPropGroupNode* qmlPropGroup = 0; - if (command == COMMAND_QMLPROPERTY) { + if ((command == COMMAND_QMLPROPERTY) || + (command == COMMAND_QMLATTACHEDPROPERTY)) { QString type; QString element; QString property; + bool attached = (command == COMMAND_QMLATTACHEDPROPERTY); QStringList::ConstIterator arg = args.begin(); 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<QmlClassNode*>(n); if (qmlClass) - qmlPropGroup = new QmlPropGroupNode(qmlClass,property); + qmlPropGroup = new QmlPropGroupNode(qmlClass, + property, + attached); } } if (qmlPropGroup) { - new QmlPropertyNode(qmlPropGroup,property,type); + new QmlPropertyNode(qmlPropGroup,property,type,attached); ++arg; while (arg != args.end()) { if (splitQmlPropertyArg(doc,(*arg),type,element,property)) { - new QmlPropertyNode(qmlPropGroup,property,type); + new QmlPropertyNode(qmlPropGroup, + property, + type, + attached); } ++arg; } @@ -1969,7 +1979,8 @@ bool CppCodeParser::matchDocsAndStuff() There is a topic command. Process it. */ #ifdef QDOC_QML - if (topic == COMMAND_QMLPROPERTY) { + if ((topic == COMMAND_QMLPROPERTY) || + (topic == COMMAND_QMLATTACHEDPROPERTY)) { Doc nodeDoc = doc; Node *node = processTopicCommandGroup(nodeDoc,topic,args); if (node != 0) { diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index c02dc2e..18c7916 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -1240,7 +1240,7 @@ void HtmlGenerator::generateClassLikeNode(const InnerNode *inner, generateHeader(title, inner, marker, true); generateTitle(title, subtitleText, SmallSubTitle, inner, marker); -#ifdef QDOC_QML +#ifdef QDOC_QML if (classe && !classe->qmlElement().isEmpty()) { generateInstantiatedBy(classe,marker); } @@ -3468,12 +3468,12 @@ QString HtmlGenerator::refForNode(const Node *node) } break; case Node::Property: -#ifdef QDOC_QML +#ifdef QDOC_QML case Node::QmlProperty: #endif ref = node->name() + "-prop"; break; -#ifdef QDOC_QML +#ifdef QDOC_QML case Node::QmlSignal: ref = node->name() + "-signal"; break; diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index 558808f..49f2cc9 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -1158,8 +1158,12 @@ QString QmlClassNode::fileBase() const Constructor for the Qml property group node. \a parent is always a QmlClassNode. */ -QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, const QString& name) - : FakeNode(parent, name, QmlPropertyGroup), isdefault(false) +QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, + const QString& name, + bool attached) + : FakeNode(parent, name, QmlPropertyGroup), + isdefault(false), + att(attached) { // nothing. } @@ -1169,11 +1173,13 @@ QmlPropGroupNode::QmlPropGroupNode(QmlClassNode* parent, const QString& name) */ QmlPropertyNode::QmlPropertyNode(QmlPropGroupNode *parent, const QString& name, - const QString& type) + const QString& type, + bool attached) : LeafNode(QmlProperty, parent, name), dt(type), sto(Trool_Default), - des(Trool_Default) + des(Trool_Default), + att(attached) { // nothing. } diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index f933270..fed4ea1 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -369,15 +369,19 @@ class QmlClassNode : public FakeNode class QmlPropGroupNode : public FakeNode { public: - QmlPropGroupNode(QmlClassNode* parent, const QString& name); + QmlPropGroupNode(QmlClassNode* parent, + const QString& name, + bool attached); virtual ~QmlPropGroupNode() { } const QString& element() const { return name(); } void setDefault() { isdefault = true; } bool isDefault() const { return isdefault; } + bool isAttached() const { return att; } private: bool isdefault; + bool att; }; class QmlPropertyNode : public LeafNode @@ -385,7 +389,8 @@ class QmlPropertyNode : public LeafNode public: QmlPropertyNode(QmlPropGroupNode* parent, const QString& name, - const QString& type); + const QString& type, + bool attached); virtual ~QmlPropertyNode() { } void setDataType(const QString& dataType) { dt = dataType; } @@ -396,6 +401,7 @@ class QmlPropertyNode : public LeafNode QString qualifiedDataType() const { return dt; } bool isStored() const { return fromTrool(sto,true); } bool isDesignable() const { return fromTrool(des,false); } + bool isAttached() const { return att; } const QString& element() const { return parent()->name(); } @@ -408,6 +414,7 @@ class QmlPropertyNode : public LeafNode QString dt; Trool sto; Trool des; + bool att; }; class QmlSignalNode : public LeafNode |