aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/localstorage
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/imports/localstorage
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/imports/localstorage')
-rw-r--r--src/imports/localstorage/plugin.cpp67
1 files changed, 51 insertions, 16 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