From: Jerome Pasion Date: Mon, 13 May 2013 11:11:05 +0000 (+0200) Subject: Doc: Fixed a bunch of missing snippets. X-Git-Url: http://git.silmor.de/gitweb/?a=commitdiff_plain;h=ec57778b5d500bb12cc4ec678745f764a33f129d;p=konrad%2Fqtdeclarative.git Doc: Fixed a bunch of missing snippets. -moved delegate model related snippets from Qt Quick to Qt QML. -corrected snippet paths Change-Id: If688f97fb9317def16f343d5502a6a54d6761e95 Reviewed-by: Geir Vattekar --- diff --git a/src/quick/doc/snippets/qml/visualdatagroup.qml b/src/qml/doc/snippets/delegatemodel/visualdatagroup.qml similarity index 100% rename from src/quick/doc/snippets/qml/visualdatagroup.qml rename to src/qml/doc/snippets/delegatemodel/visualdatagroup.qml diff --git a/src/quick/doc/snippets/qml/visualdatamodel.qml b/src/qml/doc/snippets/delegatemodel/visualdatamodel.qml similarity index 100% rename from src/quick/doc/snippets/qml/visualdatamodel.qml rename to src/qml/doc/snippets/delegatemodel/visualdatamodel.qml diff --git a/src/quick/doc/snippets/qml/visualdatamodel_rootindex/main.cpp b/src/qml/doc/snippets/delegatemodel/visualdatamodel_rootindex/main.cpp similarity index 100% rename from src/quick/doc/snippets/qml/visualdatamodel_rootindex/main.cpp rename to src/qml/doc/snippets/delegatemodel/visualdatamodel_rootindex/main.cpp diff --git a/src/quick/doc/snippets/qml/visualdatamodel_rootindex/view.qml b/src/qml/doc/snippets/delegatemodel/visualdatamodel_rootindex/view.qml similarity index 100% rename from src/quick/doc/snippets/qml/visualdatamodel_rootindex/view.qml rename to src/qml/doc/snippets/delegatemodel/visualdatamodel_rootindex/view.qml diff --git a/src/qml/doc/src/qmllanguageref/modules/cppplugins.qdoc b/src/qml/doc/src/qmllanguageref/modules/cppplugins.qdoc index af2a36c..7ac1d40 100644 --- a/src/qml/doc/src/qmllanguageref/modules/cppplugins.qdoc +++ b/src/qml/doc/src/qmllanguageref/modules/cppplugins.qdoc @@ -68,7 +68,7 @@ as a new QML type. It provides the current time through \c hour and \c minute properties. - \snippet qml/plugins/plugin.cpp 0 + \snippet plugins/plugin.cpp 0 \dots To make this type available, we create a plugin class named \c QExampleQmlPlugin @@ -78,7 +78,7 @@ definition to register the plugin with the Qt meta object system using a unique identifier for the plugin. - \snippet qml/plugins/plugin.cpp plugin + \snippet plugins/plugin.cpp plugin The \c TimeModel class receives a \c{1.0} version of this plugin library, as a QML type called \c Time. The Q_ASSERT() macro can ensure the type namespace is @@ -111,13 +111,13 @@ that is built by the project (as shown above in the \c .pro file) so both of these need to be specified in the \c qmldir file: - \quotefile qml/plugins/imports/TimeExample/qmldir + \quotefile plugins/imports/TimeExample/qmldir Once the project is built and installed, the new \c Time component is accessible by any QML component that imports the \c TimeExample module - \snippet qml/plugins/plugins.qml 0 + \snippet plugins/plugins.qml 0 The full source code is available in the \l {qml/plugins}{plugins example}. diff --git a/src/qml/qml/qqmlextensionplugin.cpp b/src/qml/qml/qqmlextensionplugin.cpp index b87c16c..f77b176 100644 --- a/src/qml/qml/qqmlextensionplugin.cpp +++ b/src/qml/qml/qqmlextensionplugin.cpp @@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE These extensions allow custom QML types to be made available to the QML engine. To write a QML extension plugin: - + \list \li Subclass QQmlExtensionPlugin, implement registerTypes() method to register types using qmlRegisterType(), and export the class using the Q_PLUGIN_METADATA() macro @@ -77,7 +77,7 @@ QT_BEGIN_NAMESPACE as a new QML element. It provides the current time through \c hour and \c minute properties, like this: - \snippet qml/plugins/plugin.cpp 0 + \snippet plugins/plugin.cpp 0 \dots To make this class available as a QML type, create a plugin that registers @@ -85,7 +85,7 @@ QT_BEGIN_NAMESPACE module will be named \c TimeExample (as defined in the project file further below). - \snippet qml/plugins/plugin.cpp plugin + \snippet plugins/plugin.cpp plugin This registers the \c TimeModel class with the 1.0 version of this plugin library, as a QML type called \c Time. The Q_ASSERT statement @@ -109,12 +109,12 @@ QT_BEGIN_NAMESPACE should be bundled with the plugin, so it needs to be specified in the \c qmldir file: - \quotefile qml/plugins/imports/TimeExample/qmldir + \quotefile plugins/imports/TimeExample/qmldir Once the project is built and installed, the new \c Time element can be used by any QML component that imports the \c TimeExample module: - \snippet qml/plugins/plugins.qml 0 + \snippet plugins/plugins.qml 0 The full source code is available in the \l {qml/plugins}{plugins example}. diff --git a/src/qml/types/qqmldelegatemodel.cpp b/src/qml/types/qqmldelegatemodel.cpp index 5e36be1..06ee588 100644 --- a/src/qml/types/qqmldelegatemodel.cpp +++ b/src/qml/types/qqmldelegatemodel.cpp @@ -157,7 +157,7 @@ QQmlDelegateModelParts::QQmlDelegateModelParts(QQmlDelegateModel *parent) The example below illustrates using a DelegateModel with a ListView. - \snippet qml/visualdatamodel.qml 0 + \snippet delegatemodel/visualdatamodel.qml 0 */ QQmlDelegateModelPrivate::QQmlDelegateModelPrivate(QQmlContext *ctxt) @@ -397,10 +397,10 @@ void QQmlDelegateModel::setDelegate(QQmlComponent *delegate) the new directory's contents. \c main.cpp: - \snippet qml/visualdatamodel_rootindex/main.cpp 0 + \snippet delegatemodel/visualdatamodel_rootindex/main.cpp 0 \c view.qml: - \snippet qml/visualdatamodel_rootindex/view.qml 0 + \snippet delegatemodel/visualdatamodel_rootindex/view.qml 0 If the \l model is a QAbstractItemModel subclass, the delegate can also reference a \c hasModelChildren property (optionally qualified by a @@ -604,7 +604,7 @@ QQmlDelegateModelGroup *QQmlDelegateModelPrivate::group_at( The following example illustrates using groups to select items in a model. - \snippet qml/visualdatagroup.qml 0 + \snippet delegatemodel/visualdatagroup.qml 0 */ QQmlListProperty QQmlDelegateModel::groups()