From e8f2cc813ba4faf41677f65c51a990eea5df4308 Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Tue, 5 May 2009 14:58:06 +1000 Subject: Improve QML documentation viewing in Assistant. The element pages now load correctly. A separate QML 'book' is also generated, which will be targeted at non-C++ programmers. --- doc/doc.pri | 5 ++- doc/src/declarative/qmlfordesign.qdoc | 42 ------------------- doc/src/declarative/qmlreference.qdoc | 41 +++++++++++++++++++ tools/qdoc3/helpprojectwriter.cpp | 3 ++ tools/qdoc3/test/qml.qdocconf | 77 +++++++++++++++++++++++++++++++++++ tools/qdoc3/tree.cpp | 9 +++- 6 files changed, 131 insertions(+), 46 deletions(-) delete mode 100644 doc/src/declarative/qmlfordesign.qdoc create mode 100644 doc/src/declarative/qmlreference.qdoc create mode 100644 tools/qdoc3/test/qml.qdocconf diff --git a/doc/doc.pri b/doc/doc.pri index a4c77fe..367ef29 100644 --- a/doc/doc.pri +++ b/doc/doc.pri @@ -32,13 +32,14 @@ macx { ADP_DOCS_QDOCCONF_FILE = qt-build-docs.qdocconf } QT_DOCUMENTATION = ($$QDOC qt-api-only.qdocconf assistant.qdocconf designer.qdocconf \ - linguist.qdocconf qmake.qdocconf) && \ + linguist.qdocconf qmake.qdocconf qml.qdocconf) && \ (cd $$QT_BUILD_TREE && \ $$GENERATOR doc-build/html-qt/qt.qhp -o doc/qch/qt.qch && \ $$GENERATOR doc-build/html-assistant/assistant.qhp -o doc/qch/assistant.qch && \ $$GENERATOR doc-build/html-designer/designer.qhp -o doc/qch/designer.qch && \ $$GENERATOR doc-build/html-linguist/linguist.qhp -o doc/qch/linguist.qch && \ - $$GENERATOR doc-build/html-qmake/qmake.qhp -o doc/qch/qmake.qch \ + $$GENERATOR doc-build/html-qmake/qmake.qhp -o doc/qch/qmake.qch && \ + $$GENERATOR doc-build/html-qml/qml.qhp -o doc/qch/qml.qch \ ) win32-g++:isEmpty(QMAKE_SH) { diff --git a/doc/src/declarative/qmlfordesign.qdoc b/doc/src/declarative/qmlfordesign.qdoc deleted file mode 100644 index 35e47df..0000000 --- a/doc/src/declarative/qmlfordesign.qdoc +++ /dev/null @@ -1,42 +0,0 @@ -/*! - \page qmlfordesigners.html - \title Qt Declarative for Designers - - \target qtdeclarativemainpage - - The Qt Declarative module provides a declarative framework for building - highly dynamic and fluid applications. It is targetted at the sorts of user - interface (and the sorts of hardware) in embedded devices such as phones, media - players, and set-top boxes. It is also appropriate for highly custom desktop - user-interfaces, or special elements in more traditional desktop - user-interfaces. - - Building fluid applications is done declaratively, rather than procedurally. - That is, you specify \e what the UI should look like and how it should behave - rather than specifying step-by-step \e how to build it. Specifying a UI declaratively - does not just include the layout of the interface items, but also the way each - individual item looks and behaves and the overall flow of the application. - - Getting Started: - \list - \o \l {qmlexamples}{Examples} - \o \l {tutorial}{Tutorial: 'Hello World'} - \o \l {tutorials-declarative-contacts.html}{Tutorial: 'Introduction to QML'} - \endlist - - Core Features: - \list - \o \l {binding}{Data Binding} - \o \l {anchor-layout}{Layout Anchors} - \o \l {qmlanimation}{Animation} - \o \l {qmleffects}{Visual Effects} - \o \l {components}{Components} - \o \l {qmlmodules}{Modules} - \o \l {qmlfocus}{Keyboard Focus} - \endlist - - QML Reference: - \list - \o \l {elements}{Qml Elements} - \endlist -*/ diff --git a/doc/src/declarative/qmlreference.qdoc b/doc/src/declarative/qmlreference.qdoc new file mode 100644 index 0000000..9a63e50 --- /dev/null +++ b/doc/src/declarative/qmlreference.qdoc @@ -0,0 +1,41 @@ +/*! + \page qmlreference.html + \title Qml Reference + + \target qtdeclarativemainpage + + QML is a language for building highly dynamic and fluid applications. It is targetted at the sorts of user + interface (and the sorts of hardware) in embedded devices such as phones, media + players, and set-top boxes. It is also appropriate for highly custom desktop + user-interfaces, or special elements in more traditional desktop + user-interfaces. + + Building fluid applications is done declaratively, rather than procedurally. + That is, you specify \e what the UI should look like and how it should behave + rather than specifying step-by-step \e how to build it. Specifying a UI declaratively + does not just include the layout of the interface items, but also the way each + individual item looks and behaves and the overall flow of the application. + + Getting Started: + \list + \o \l {qmlexamples}{Examples} + \o \l {tutorial}{Tutorial: 'Hello World'} + \o \l {tutorials-declarative-contacts.html}{Tutorial: 'Introduction to QML'} + \endlist + + Core Features: + \list + \o \l {binding}{Data Binding} + \o \l {anchor-layout}{Layout Anchors} + \o \l {qmlanimation}{Animation} + \o \l {qmleffects}{Visual Effects} + \o \l {components}{Components} + \o \l {qmlmodules}{Modules} + \o \l {qmlfocus}{Keyboard Focus} + \endlist + + QML Reference: + \list + \o \l {elements}{Qml Elements} + \endlist +*/ diff --git a/tools/qdoc3/helpprojectwriter.cpp b/tools/qdoc3/helpprojectwriter.cpp index 85bd898..16ee5f2 100644 --- a/tools/qdoc3/helpprojectwriter.cpp +++ b/tools/qdoc3/helpprojectwriter.cpp @@ -126,6 +126,9 @@ void HelpProjectWriter::readSelectors(SubProject &subproject, const QStringList subTypeHash["module"] = Node::Module; subTypeHash["page"] = Node::Page; subTypeHash["externalpage"] = Node::ExternalPage; +#ifdef QDOC_QML + subTypeHash["qmlclass"] = Node::QmlClass; +#endif QSet allSubTypes = QSet::fromList(subTypeHash.values()); diff --git a/tools/qdoc3/test/qml.qdocconf b/tools/qdoc3/test/qml.qdocconf new file mode 100644 index 0000000..3a7d76a --- /dev/null +++ b/tools/qdoc3/test/qml.qdocconf @@ -0,0 +1,77 @@ +include(compat.qdocconf) +include(macros.qdocconf) +include(qt-cpp-ignore.qdocconf) +include(qt-html-templates.qdocconf) +include(qt-defines.qdocconf) + +project = Qml +description = Qml Reference Documentation +url = http://doc.qtsoftware.com/4.6 + +edition.Console.modules = QtCore QtDBus QtNetwork QtScript QtSql QtXml \ + QtXmlPatterns QtTest +edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript QtSql QtSvg \ + QtWebKit QtXml QtXmlPatterns Qt3Support QtHelp \ + QtDesigner QtAssistant QAxContainer Phonon \ + QAxServer QtUiTools QtTest QtDBus +edition.DesktopLight.modules = QtCore QtDBus QtGui Qt3SupportLight QtTest +edition.DesktopLight.groups = -graphicsview-api + +qhp.projects = Qml + +qhp.Qml.file = qml.qhp +qhp.Qml.namespace = com.trolltech.qml.460 +qhp.Qml.virtualFolder = qdoc +qhp.Qml.indexTitle = Qml Reference + +# Files not referenced in any qdoc file +# See also extraimages.HTML +qhp.Qml.extraFiles = classic.css \ + images/qt-logo.png + +qhp.Qml.filterAttributes = qt 4.6.0 qtrefdoc +qhp.Qml.customFilters.Qt.name = Qt 4.6.0 +qhp.Qml.customFilters.Qt.filterAttributes = qt 4.6.0 +qhp.Qml.subprojects = classes +qhp.Qml.subprojects.classes.title = Elements +qhp.Qml.subprojects.classes.indexTitle = Qml Elements +qhp.Qml.subprojects.classes.selectors = fake:qmlclass +qhp.Qml.subprojects.classes.sortPages = true + +language = Cpp + +headerdirs = $QT_SOURCE_TREE/src/declarative +sourcedirs = $QT_SOURCE_TREE/src/declarative \ + $QT_SOURCE_TREE/doc/src/declarative + +sources += $QT_SOURCE_TREE/doc/src/tutorials/declarative.qdoc + +sources.fileextensions = "*.cpp *.qdoc" +examples.fileextensions = "*.cpp *.h *.js *.qml" + +exampledirs = $QT_SOURCE_TREE/doc/src \ + $QT_SOURCE_TREE/examples \ + $QT_SOURCE_TREE/examples/tutorials \ + $QT_SOURCE_TREE \ + $QT_SOURCE_TREE/qmake/examples \ + $QT_SOURCE_TREE/src/3rdparty/webkit/WebKit/qt/docs +imagedirs = $QT_SOURCE_TREE/doc/src/images \ + $QT_SOURCE_TREE/examples \ + $QT_SOURCE_TREE/doc/src/declarative/pics +outputdir = $QT_BUILD_TREE/doc-build/html-qml +tagfile = $QT_BUILD_TREE/doc-build/html-qml/qt.tags +base = file:$QT_BUILD_TREE/doc/html-qml + +HTML.stylesheets = classic.css + +HTML.postheader = "\n" \ + "\n" \ + "\n" \ + "" \ + "\n" \ + "
" \ + "" \ + "  " \ + "" \ + "Home" \ + "
" diff --git a/tools/qdoc3/tree.cpp b/tools/qdoc3/tree.cpp index 539db51..b91de65 100644 --- a/tools/qdoc3/tree.cpp +++ b/tools/qdoc3/tree.cpp @@ -1901,9 +1901,14 @@ QString Tree::fullDocumentLocation(const Node *node) const else return ""; } - else if (node->type() == Node::Fake) + else if (node->type() == Node::Fake) { +#ifdef QDOC_QML + if (node->subType() == Node::QmlClass) + return "qml-" + node->fileBase() + ".html"; + else +#endif return node->fileBase() + ".html"; - else if (node->fileBase().isEmpty()) + } else if (node->fileBase().isEmpty()) return ""; QString parentName; -- cgit v0.12