aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorBea Lam <bea.lam@nokia.com>2012-07-03 15:51:04 +1000
committerQt by Nokia <qt-info@nokia.com>2012-07-05 03:34:58 +0200
commit9df0c50fe588df64b65b968cd59f98d06024aad1 (patch)
tree9447f52b9ab365bd9800cd73305bfd4f716ff8d6 /src
parent3f43e7d58f49e55e97281792d32df1595b0e7464 (diff)
Fix various QtQuick.* submodule docs
- Create module index pages for QtQuick.Window, QtQuick.XmlListModel and QtQuick.LocalStorage. - Fix references to module names in docs so that docs for properties and methods are actually generated e.g. use "QtQuick.Window2" instead of "QtQuick2.Window". There's no easy way to document Module APIs at the moment so the QtQuick.LocalStorage documentation has been updated in a hacky way to generate the correct method documentation. Change-Id: I7b34e4b4ac794acffc6d198b98e2115ccf0fa9a6 Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/imports/localstorage/plugin.cpp67
-rw-r--r--src/imports/xmllistmodel/qqmlxmllistmodel.cpp46
-rw-r--r--src/quick/doc/src/concepts/effects/particles.qdoc2
-rw-r--r--src/quick/doc/src/whatsnew.qdoc9
-rw-r--r--src/quick/items/qquickcanvas.cpp16
-rw-r--r--src/quick/items/qquickscreen.cpp10
6 files changed, 107 insertions, 43 deletions
diff --git a/src/imports/localstorage/plugin.cpp b/src/imports/localstorage/plugin.cpp
index b1466a1a73..4f1808f666 100644
--- a/src/imports/localstorage/plugin.cpp
+++ b/src/imports/localstorage/plugin.cpp
@@ -452,12 +452,37 @@ through the data.
/*!
- \qmlclass LocalStorage QQuickLocalStorage
- \inqmlmodule QtQuick.LocalStorage 2
- \since QtQuick 2.0
-
+ \qmlmodule QtQuick.LocalStorage 2
+ \title QML Module QtQuick.LocalStorage 2.0
\brief Provides a JavaScript module API for accessing a local SQLite database
+ This is a module API for reading and writing to SQLite databases.
+
+
+ \section1 Methods
+
+ \list
+ \li object \b{\l{#openDatabaseSync}{openDatabaseSync}}(string name, string version, string description, int estimated_size, jsobject callback(db))
+ \endlist
+
+
+ \section1 Detailed Description
+
+ To use the types in this module, import the module with a namespace and call the
+ relevant functions using the namespace qualifier:
+
+ \code
+ import QtQuick.LocalStorage 2.0 as LS
+ import QtQuick 2.0
+
+ Item {
+ Component.onCompleted: {
+ var db = LS.openDatabaseSync(...)
+ }
+ }
+ \endcode
+
+
These databases are user-specific and QML-specific, but accessible to all QML applications.
They are stored in the \c Databases subdirectory
of QQmlEngine::offlineStoragePath(), currently as SQLite databases.
@@ -538,7 +563,28 @@ It returns a results object, with the following properties:
\endtable
May throw exception with code property SQLException.DATABASE_ERR, SQLException.SYNTAX_ERR, or SQLException.UNKNOWN_ERR.
- */
+
+
+\section1 Method Documentation
+
+\target openDatabaseSync
+\code
+object openDatabaseSync(string name, string version, string description, int estimated_size, jsobject callback(db))
+\endcode
+
+Opens or creates a local storage sql database by the given parameters.
+
+\list
+\li \c name is the database name
+\li \c version is the database version
+\li \c description is the database display name
+\li \c estimated_size is the database's estimated size, in bytes
+\li \c callback is an optional parameter, which is invoked if the database has not yet been created.
+\endlist
+
+Returns the created database object.
+
+*/
class QQuickLocalStorage : public QObject
{
Q_OBJECT
@@ -552,17 +598,6 @@ public:
Q_INVOKABLE void openDatabaseSync(QQmlV8Function* args);
};
-/*!
- * \qmlmethod object LocalStorage::openDatabaseSync(string name, string version, string description, int estimated_size, jsobject callback(db))
- * \brief Open or create a local storage sql database by given parameters.
- *
- * \c name is the database name
- * \c version is the database version
- * \c description is the database display name
- * \c estimated_size is the database's estimated size, in bytes
- * \c callback is an optional parameter, which is invoked if the database has not yet been created.
- * \return the database object
- */
void QQuickLocalStorage::openDatabaseSync(QQmlV8Function *args)
{
#ifndef QT_NO_SETTINGS
diff --git a/src/imports/xmllistmodel/qqmlxmllistmodel.cpp b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
index 41e66b0406..5a06855f1e 100644
--- a/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
+++ b/src/imports/xmllistmodel/qqmlxmllistmodel.cpp
@@ -69,8 +69,22 @@ typedef QPair<int, int> QQuickXmlListRange;
#define XMLLISTMODEL_CLEAR_ID 0
/*!
+ \qmlmodule QtQuick.XmlListModel 2
+ \title QML Module QtQuick.XmlListModel 2.0
+ \brief Contains types for creating models from XML data
+
+ This QML module contains types for creating models from XML data.
+
+ To use the types in this module, import the module with the following line:
+
+ \code
+ import QtQuick.XmlListModel 2.0
+ \endcode
+*/
+
+/*!
\qmlclass XmlRole QQuickXmlListModelRole
- \inqmlmodule QtQuick 2
+ \inqmlmodule QtQuick.XmlListModel 2
\brief For specifying a role to an XmlListModel
\ingroup qtquick-models
@@ -78,7 +92,7 @@ typedef QPair<int, int> QQuickXmlListRange;
*/
/*!
- \qmlproperty string QtQuick2::XmlRole::name
+ \qmlproperty string QtQuick.XmlListModel2::XmlRole::name
The name for the role. This name is used to access the model data for this role.
@@ -105,7 +119,7 @@ typedef QPair<int, int> QQuickXmlListRange;
*/
/*!
- \qmlproperty string QtQuick2::XmlRole::query
+ \qmlproperty string QtQuick.XmlListModel2::XmlRole::query
The relative XPath expression query for this role. The query must be relative; it cannot start
with a '/'.
@@ -122,7 +136,7 @@ typedef QPair<int, int> QQuickXmlListRange;
*/
/*!
- \qmlproperty bool QtQuick2::XmlRole::isKey
+ \qmlproperty bool QtQuick.XmlListModel2::XmlRole::isKey
Defines whether this is a key role.
Key roles are used to to determine whether a set of values should
be updated or added to the XML list model when XmlListModel::reload()
@@ -595,7 +609,7 @@ void QQuickXmlListModelPrivate::clear_role(QQmlListProperty<QQuickXmlListModelRo
/*!
\qmlclass XmlListModel QQuickXmlListModel
- \inqmlmodule QtQuick 2
+ \inqmlmodule QtQuick.XmlListModel 2
\brief For specifying a read-only model using XPath expressions
\ingroup qtquick-models
@@ -707,7 +721,7 @@ QQuickXmlListModel::~QQuickXmlListModel()
}
/*!
- \qmlproperty list<XmlRole> QtQuick2::XmlListModel::roles
+ \qmlproperty list<XmlRole> QtQuick.XmlListModel2::XmlListModel::roles
The roles to make available for this model.
*/
@@ -740,7 +754,7 @@ QVariant QQuickXmlListModel::data(int index, int role) const
}
/*!
- \qmlproperty int QtQuick2::XmlListModel::count
+ \qmlproperty int QtQuick.XmlListModel2::XmlListModel::count
The number of data entries in the model.
*/
int QQuickXmlListModel::count() const
@@ -765,7 +779,7 @@ QString QQuickXmlListModel::toString(int role) const
}
/*!
- \qmlproperty url QtQuick2::XmlListModel::source
+ \qmlproperty url QtQuick.XmlListModel2::XmlListModel::source
The location of the XML data source.
If both \c source and \l xml are set, \l xml is used.
@@ -788,7 +802,7 @@ void QQuickXmlListModel::setSource(const QUrl &src)
}
/*!
- \qmlproperty string QtQuick2::XmlListModel::xml
+ \qmlproperty string QtQuick.XmlListModel2::XmlListModel::xml
This property holds the XML data for this model, if set.
The text is assumed to be UTF-8 encoded.
@@ -812,7 +826,7 @@ void QQuickXmlListModel::setXml(const QString &xml)
}
/*!
- \qmlproperty string QtQuick2::XmlListModel::query
+ \qmlproperty string QtQuick.XmlListModel2::XmlListModel::query
An absolute XPath query representing the base query for creating model items
from this model's XmlRole objects. The query should start with '/' or '//'.
*/
@@ -838,7 +852,7 @@ void QQuickXmlListModel::setQuery(const QString &query)
}
/*!
- \qmlproperty string QtQuick2::XmlListModel::namespaceDeclarations
+ \qmlproperty string QtQuick.XmlListModel2::XmlListModel::namespaceDeclarations
The namespace declarations to be used in the XPath queries.
The namespaces should be declared as in XQuery. For example, if a requested document
@@ -872,7 +886,7 @@ void QQuickXmlListModel::setNamespaceDeclarations(const QString &declarations)
}
/*!
- \qmlmethod object QtQuick2::XmlListModel::get(int index)
+ \qmlmethod object QtQuick.XmlListModel2::XmlListModel::get(int index)
Returns the item at \a index in the model.
@@ -912,7 +926,7 @@ QQmlV8Handle QQuickXmlListModel::get(int index) const
}
/*!
- \qmlproperty enumeration QtQuick2::XmlListModel::status
+ \qmlproperty enumeration QtQuick.XmlListModel2::XmlListModel::status
Specifies the model loading status, which can be one of the following:
\list
@@ -933,7 +947,7 @@ QQuickXmlListModel::Status QQuickXmlListModel::status() const
}
/*!
- \qmlproperty real QtQuick2::XmlListModel::progress
+ \qmlproperty real QtQuick.XmlListModel2::XmlListModel::progress
This indicates the current progress of the downloading of the XML data
source. This value ranges from 0.0 (no data downloaded) to
@@ -954,7 +968,7 @@ qreal QQuickXmlListModel::progress() const
}
/*!
- \qmlmethod void QtQuick2::XmlListModel::errorString()
+ \qmlmethod void QtQuick.XmlListModel2::XmlListModel::errorString()
Returns a string description of the last error that occurred
if \l status is XmlListModel::Error.
@@ -985,7 +999,7 @@ void QQuickXmlListModel::componentComplete()
}
/*!
- \qmlmethod QtQuick2::XmlListModel::reload()
+ \qmlmethod QtQuick.XmlListModel2::XmlListModel::reload()
Reloads the model.
diff --git a/src/quick/doc/src/concepts/effects/particles.qdoc b/src/quick/doc/src/concepts/effects/particles.qdoc
index 2809ce4f85..c47501b82e 100644
--- a/src/quick/doc/src/concepts/effects/particles.qdoc
+++ b/src/quick/doc/src/concepts/effects/particles.qdoc
@@ -26,7 +26,7 @@
****************************************************************************/
/*!
- \qmlmodule QtQuick.Particles 2.0
+ \qmlmodule QtQuick.Particles 2
\title QML Module QtQuick.Particles 2.0
\brief Contains types for particle effects
diff --git a/src/quick/doc/src/whatsnew.qdoc b/src/quick/doc/src/whatsnew.qdoc
index c5a1c94924..8de2f7a324 100644
--- a/src/quick/doc/src/whatsnew.qdoc
+++ b/src/quick/doc/src/whatsnew.qdoc
@@ -351,23 +351,24 @@ the window loses focus.
\section2 QtQuick.Particles
This new module provides particle system support for creating a variety of 2D particle systems. See
-the \l {QtQuick.Particles} documentation for comprehensive details.
+the \l{QtQuick.Particles 2}{QtQuick.Particles} documentation for comprehensive details.
This obsoletes the experimental \c Qt.labs.particles module.
\section2 QtQuick.Window
This new module contains the \l Window type for creating a basic window and the \l Screen type for
-accessing a screen's resolution and other details.
+accessing a screen's resolution and other details. See the \l{QtQuick.Window 2}{QtQuick.Window}
+documentation for comprehensive details.
\section2 QtQuick.XmlListModel
This new module contains XmlListModel and associated types, which were previously in the QtQuick
-module. See the \l {QtQuick.XmlListModel} documentation for details.
+module. See the \l{QtQuick.XmlListModel 2}{QtQuick.XmlListModel} documentation for details.
\section2 QtQuick.LocalStorage
This new module provides access to the SQL Local Storage API that was previously accessible from the
-\l {QML Global Object}. See the \l {QtQuick.LocalStorage} documentation for details.
+\l {QML Global Object}. See the \l{QtQuick.LocalStorage 2}{QtQuick.LocalStorage} documentation for details.
*/
diff --git a/src/quick/items/qquickcanvas.cpp b/src/quick/items/qquickcanvas.cpp
index 12173a3e26..2de8fd5030 100644
--- a/src/quick/items/qquickcanvas.cpp
+++ b/src/quick/items/qquickcanvas.cpp
@@ -773,6 +773,20 @@ void QQuickCanvasPrivate::cleanup(QSGNode *n)
/*!
+ \qmlmodule QtQuick.Window 2
+ \title QML Module QtQuick.Window 2.0
+ \brief Contains types for window management
+
+ This QML module contains types for creating top-level windows and accessing screen information.
+
+ To use the types in this module, import the module with the following line:
+
+ \code
+ import QtQuick.Window 2.0
+ \endcode
+*/
+
+/*!
\qmlclass Window QQuickCanvas
\inqmlmodule QtQuick.Window 2
\ingroup qtquick-visual
@@ -1043,7 +1057,7 @@ QQuickItem *QQuickCanvas::mouseGrabberItem() const
/*!
- \qmlproperty color QtQuick2.Window::Window::color
+ \qmlproperty color QtQuick.Window2::Window::color
The background color for the window.
diff --git a/src/quick/items/qquickscreen.cpp b/src/quick/items/qquickscreen.cpp
index 17f4ebc1f0..aef40df520 100644
--- a/src/quick/items/qquickscreen.cpp
+++ b/src/quick/items/qquickscreen.cpp
@@ -70,31 +70,31 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \qmlattachedproperty int QtQuickWindow2::Screen::width
+ \qmlattachedproperty int QtQuick.Window2::Screen::width
\readonly
This contains the width of the screen in pixels.
*/
/*!
- \qmlattachedproperty int QtQuickWindow2::Screen::height
+ \qmlattachedproperty int QtQuick.Window2::Screen::height
\readonly
This contains the height of the screen in pixels.
*/
/*!
- \qmlattachedproperty Qt::ScreenOrientation QtQuickWindow2::Screen::primaryOrientation
+ \qmlattachedproperty Qt::ScreenOrientation QtQuick.Window2::Screen::primaryOrientation
\readonly
This contains the primary orientation of the screen.
*/
/*!
- \qmlattachedproperty Qt::ScreenOrientation QtQuickWindow2::Screen::orientation
+ \qmlattachedproperty Qt::ScreenOrientation QtQuick.Window2::Screen::orientation
\readonly
This contains the current orientation of the screen.
*/
/*!
- \qmlattachedmethod int QtQuickWindow2::Screen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b)
+ \qmlattachedmethod int QtQuick.Window2::Screen::angleBetween(Qt::ScreenOrientation a, Qt::ScreenOrientation b)
Returns the rotation angle, in degrees, between the two specified angles.
*/