diff options
Diffstat (limited to 'tools')
27 files changed, 54 insertions, 41 deletions
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index ae7385e..9f512d3 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -2098,9 +2098,10 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark generateSince(qcn, marker); enterSection("h2","Detailed Description"); generateBody(qcn, marker); - if (cn) + if (cn) { generateQmlText(cn->doc().body(), cn, marker, qcn->name()); - generateAlsoList(cn, marker); + generateAlsoList(cn, marker); + } leaveSection(); leaveSection(); // </apiDesc> diff --git a/tools/qdoc3/doc/config/images/arrow_down.png b/tools/qdoc3/doc/config/images/arrow_down.png Binary files differnew file mode 100644 index 0000000..9d01e97 --- /dev/null +++ b/tools/qdoc3/doc/config/images/arrow_down.png diff --git a/tools/qdoc3/doc/config/images/bg_l.png b/tools/qdoc3/doc/config/images/bg_l.png Binary files differnew file mode 100755 index 0000000..90b1da1 --- /dev/null +++ b/tools/qdoc3/doc/config/images/bg_l.png diff --git a/tools/qdoc3/doc/config/images/bg_l_blank.png b/tools/qdoc3/doc/config/images/bg_l_blank.png Binary files differnew file mode 100755 index 0000000..5a9673d --- /dev/null +++ b/tools/qdoc3/doc/config/images/bg_l_blank.png diff --git a/tools/qdoc3/doc/config/images/bg_ll_blank.png b/tools/qdoc3/doc/config/images/bg_ll_blank.png Binary files differnew file mode 100644 index 0000000..95a1c45 --- /dev/null +++ b/tools/qdoc3/doc/config/images/bg_ll_blank.png diff --git a/tools/qdoc3/doc/config/images/bg_r.png b/tools/qdoc3/doc/config/images/bg_r.png Binary files differnew file mode 100755 index 0000000..f0fb121 --- /dev/null +++ b/tools/qdoc3/doc/config/images/bg_r.png diff --git a/tools/qdoc3/doc/config/images/bg_ul_blank.png b/tools/qdoc3/doc/config/images/bg_ul_blank.png Binary files differnew file mode 100644 index 0000000..7051261 --- /dev/null +++ b/tools/qdoc3/doc/config/images/bg_ul_blank.png diff --git a/tools/qdoc3/doc/config/images/box_bg.png b/tools/qdoc3/doc/config/images/box_bg.png Binary files differnew file mode 100755 index 0000000..3322f92 --- /dev/null +++ b/tools/qdoc3/doc/config/images/box_bg.png diff --git a/tools/qdoc3/doc/config/images/breadcrumb.png b/tools/qdoc3/doc/config/images/breadcrumb.png Binary files differnew file mode 100755 index 0000000..0ded551 --- /dev/null +++ b/tools/qdoc3/doc/config/images/breadcrumb.png diff --git a/tools/qdoc3/doc/config/images/bullet_dn.png b/tools/qdoc3/doc/config/images/bullet_dn.png Binary files differnew file mode 100644 index 0000000..f776247 --- /dev/null +++ b/tools/qdoc3/doc/config/images/bullet_dn.png diff --git a/tools/qdoc3/doc/config/images/bullet_gt.png b/tools/qdoc3/doc/config/images/bullet_gt.png Binary files differnew file mode 100755 index 0000000..7561b4e --- /dev/null +++ b/tools/qdoc3/doc/config/images/bullet_gt.png diff --git a/tools/qdoc3/doc/config/images/bullet_sq.png b/tools/qdoc3/doc/config/images/bullet_sq.png Binary files differnew file mode 100755 index 0000000..a84845e --- /dev/null +++ b/tools/qdoc3/doc/config/images/bullet_sq.png diff --git a/tools/qdoc3/doc/config/images/bullet_up.png b/tools/qdoc3/doc/config/images/bullet_up.png Binary files differnew file mode 100644 index 0000000..7de2f06 --- /dev/null +++ b/tools/qdoc3/doc/config/images/bullet_up.png diff --git a/tools/qdoc3/doc/config/images/feedbackground.png b/tools/qdoc3/doc/config/images/feedbackground.png Binary files differnew file mode 100755 index 0000000..3a38d99 --- /dev/null +++ b/tools/qdoc3/doc/config/images/feedbackground.png diff --git a/tools/qdoc3/doc/config/images/header_bg.png b/tools/qdoc3/doc/config/images/header_bg.png Binary files differnew file mode 100644 index 0000000..a436aa6 --- /dev/null +++ b/tools/qdoc3/doc/config/images/header_bg.png diff --git a/tools/qdoc3/doc/config/images/horBar.png b/tools/qdoc3/doc/config/images/horBar.png Binary files differnew file mode 100755 index 0000000..100fe91 --- /dev/null +++ b/tools/qdoc3/doc/config/images/horBar.png diff --git a/tools/qdoc3/doc/config/images/page.png b/tools/qdoc3/doc/config/images/page.png Binary files differnew file mode 100644 index 0000000..1db151b --- /dev/null +++ b/tools/qdoc3/doc/config/images/page.png diff --git a/tools/qdoc3/doc/config/images/page_bg.png b/tools/qdoc3/doc/config/images/page_bg.png Binary files differnew file mode 100755 index 0000000..9b3bd99 --- /dev/null +++ b/tools/qdoc3/doc/config/images/page_bg.png diff --git a/tools/qdoc3/doc/config/images/spinner.gif b/tools/qdoc3/doc/config/images/spinner.gif Binary files differnew file mode 100644 index 0000000..1ed786f --- /dev/null +++ b/tools/qdoc3/doc/config/images/spinner.gif diff --git a/tools/qdoc3/doc/config/images/sprites-combined.png b/tools/qdoc3/doc/config/images/sprites-combined.png Binary files differnew file mode 100755 index 0000000..3a48b21 --- /dev/null +++ b/tools/qdoc3/doc/config/images/sprites-combined.png diff --git a/tools/qdoc3/puredocparser.cpp b/tools/qdoc3/puredocparser.cpp index c7db1bf..0f21cbc 100644 --- a/tools/qdoc3/puredocparser.cpp +++ b/tools/qdoc3/puredocparser.cpp @@ -55,6 +55,11 @@ PureDocParser::~PureDocParser() { } +QString PureDocParser::language() +{ + return "qdoc"; +} + QStringList PureDocParser::sourceFileNameFilter() { return QStringList("*.qdoc"); diff --git a/tools/qdoc3/puredocparser.h b/tools/qdoc3/puredocparser.h index 7f0434d..814c829 100644 --- a/tools/qdoc3/puredocparser.h +++ b/tools/qdoc3/puredocparser.h @@ -64,6 +64,7 @@ public: PureDocParser(); virtual ~PureDocParser(); + virtual QString language(); virtual QStringList sourceFileNameFilter(); }; diff --git a/tools/qdoc3/qmlvisitor.cpp b/tools/qdoc3/qmlvisitor.cpp index 98e188d..a8886de 100644 --- a/tools/qdoc3/qmlvisitor.cpp +++ b/tools/qdoc3/qmlvisitor.cpp @@ -69,18 +69,30 @@ QmlDocVisitor::~QmlDocVisitor() QDeclarativeJS::AST::SourceLocation QmlDocVisitor::precedingComment(quint32 offset) const { - QDeclarativeJS::AST::SourceLocation currentLoc; + QListIterator<QDeclarativeJS::AST::SourceLocation> it(engine->comments()); + it.toBack(); - foreach (const QDeclarativeJS::AST::SourceLocation &loc, engine->comments()) { - if (loc.begin() >= offset) + while (it.hasPrevious()) { + + QDeclarativeJS::AST::SourceLocation loc = it.previous(); + + if (loc.begin() <= lastEndOffset) + // Return if we reach the end of the preceding structure. break; - else if (loc.begin() > lastEndOffset && loc.end() < offset) - currentLoc = loc; - } - if (currentLoc.isValid()) { - QString comment = document.mid(currentLoc.offset, currentLoc.length); - if (comment.startsWith("!") || comment.startsWith("*")) - return currentLoc; + + else if (usedComments.contains(loc.begin())) + // Return if we encounter a previously used comment. + break; + + else if (loc.begin() > lastEndOffset && loc.end() < offset) { + + // Only examine multiline comments in order to avoid snippet markers. + if (document.mid(loc.offset - 1, 1) == "*") { + QString comment = document.mid(loc.offset, loc.length); + if (comment.startsWith("!") || comment.startsWith("*")) + return loc; + } + } } return QDeclarativeJS::AST::SourceLocation(); @@ -93,20 +105,18 @@ void QmlDocVisitor::applyDocumentation(QDeclarativeJS::AST::SourceLocation locat if (loc.isValid()) { QString source = document.mid(loc.offset, loc.length); - if (source.startsWith(QLatin1String("!")) || - (source.startsWith(QLatin1String("*")) && - source[1] != QLatin1Char('*'))) { - - Location start(filePath); - start.setLineNo(loc.startLine); - start.setColumnNo(loc.startColumn); - Location finish(filePath); - finish.setLineNo(loc.startLine); - finish.setColumnNo(loc.startColumn); - - Doc doc(start, finish, source.mid(1), commands); - node->setDoc(doc); - } + + Location start(filePath); + start.setLineNo(loc.startLine); + start.setColumnNo(loc.startColumn); + Location finish(filePath); + finish.setLineNo(loc.startLine); + finish.setColumnNo(loc.startColumn); + + Doc doc(start, finish, source.mid(1), commands); + node->setDoc(doc); + + usedComments.insert(loc.offset); } } @@ -152,6 +162,11 @@ bool QmlDocVisitor::visit(QDeclarativeJS::AST::UiImportList *imports) return true; } +void QmlDocVisitor::endVisit(QDeclarativeJS::AST::UiImportList *definition) +{ + lastEndOffset = definition->lastSourceLocation().end(); +} + /*! Visits public member declarations, such as signals and properties. These only include custom signals and properties. diff --git a/tools/qdoc3/qmlvisitor.h b/tools/qdoc3/qmlvisitor.h index 1d3a401..28821a9 100644 --- a/tools/qdoc3/qmlvisitor.h +++ b/tools/qdoc3/qmlvisitor.h @@ -57,6 +57,7 @@ public: virtual ~QmlDocVisitor(); bool visit(QDeclarativeJS::AST::UiImportList *imports); + void endVisit(QDeclarativeJS::AST::UiImportList *definition); bool visit(QDeclarativeJS::AST::UiObjectDefinition *definition); void endVisit(QDeclarativeJS::AST::UiObjectDefinition *definition); @@ -77,6 +78,7 @@ private: QString document; QList<QPair<QString, QString> > importList; QSet<QString> commands; + QSet<quint32> usedComments; Tree *tree; InnerNode *current; }; diff --git a/tools/qdoc3/test/qt-cpp-ignore.qdocconf b/tools/qdoc3/test/qt-cpp-ignore.qdocconf index 044eef4..5b41ae3 100644 --- a/tools/qdoc3/test/qt-cpp-ignore.qdocconf +++ b/tools/qdoc3/test/qt-cpp-ignore.qdocconf @@ -73,7 +73,8 @@ Cpp.ignoretokens = QAXFACTORY_EXPORT \ Q_DECLARATIVE_EXPORT \ Q_GADGET \ QWEBKIT_EXPORT \ - Q_INVOKABLE + Q_INVOKABLE \ + Q_DECL_CONSTEXPR Cpp.ignoredirectives = Q_DECLARE_HANDLE \ Q_DECLARE_INTERFACE \ Q_DECLARE_METATYPE \ diff --git a/tools/qdoc3/test/qt-html-templates-online.qdocconf b/tools/qdoc3/test/qt-html-templates-online.qdocconf index 03ed6fa..3584b68 100644 --- a/tools/qdoc3/test/qt-html-templates-online.qdocconf +++ b/tools/qdoc3/test/qt-html-templates-online.qdocconf @@ -181,16 +181,4 @@ HTML.footer = \ " <div id=\"blurpage\">\n" \ " </div>\n" \ "\n" \ - " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n" \ - " <script type=\"text/javascript\">\n" \ - " var _gaq = _gaq || [];\n" \ - " _gaq.push(['_setAccount', 'UA-4457116-5']);\n" \ - " _gaq.push(['_trackPageview']);\n" \ - " (function() {\n" \ - " var ga = document.createElement('script'); " \ - "ga.type = 'text/javascript'; ga.async = true;\n" \ - " ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + " \ - "'.google-analytics.com/ga.js';\n" \ - " var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);\n" \ - " })();\n" \ - " </script>\n" + " <script src=\"scripts/functions.js\" type=\"text/javascript\"></script>\n" diff --git a/tools/qdoc3/test/qt-project.qdocconf b/tools/qdoc3/test/qt-project.qdocconf index fca6545..57bf797 100644 --- a/tools/qdoc3/test/qt-project.qdocconf +++ b/tools/qdoc3/test/qt-project.qdocconf @@ -105,7 +105,7 @@ exampledirs = $QT_SOURCE_TREE/doc/src \ $QT_SOURCE_TREE/examples/tutorials \ $QT_SOURCE_TREE \ $QT_SOURCE_TREE/qmake/examples \ - $QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/docs + $QT_SOURCE_TREE/src/3rdparty/webkit/Source/WebKit/qt/docs imagedirs = $QT_SOURCE_TREE/doc/src/images \ $QT_SOURCE_TREE/examples \ $QT_SOURCE_TREE/doc/src/declarative/pics \ |