summaryrefslogtreecommitdiffstats
path: root/src/declarative/extra
diff options
context:
space:
mode:
authorMichael Brasser <michael.brasser@nokia.com>2009-05-01 04:41:06 (GMT)
committerMichael Brasser <michael.brasser@nokia.com>2009-05-01 04:41:06 (GMT)
commitd40df4790d6c8f6b6572c46c91ec058c86b44942 (patch)
treec430b0639ae6642d341258160c9d90f057c6bd9c /src/declarative/extra
parente93e5076e11a7a9cfdd4b9cb1a2d4dbf1f579177 (diff)
downloadQt-d40df4790d6c8f6b6572c46c91ec058c86b44942.zip
Qt-d40df4790d6c8f6b6572c46c91ec058c86b44942.tar.gz
Qt-d40df4790d6c8f6b6572c46c91ec058c86b44942.tar.bz2
Doc work.
Diffstat (limited to 'src/declarative/extra')
-rw-r--r--src/declarative/extra/qmlsqlconnection.cpp45
-rw-r--r--src/declarative/extra/qmlsqlquery.cpp34
2 files changed, 36 insertions, 43 deletions
diff --git a/src/declarative/extra/qmlsqlconnection.cpp b/src/declarative/extra/qmlsqlconnection.cpp
index 7f1fec2..a39aa6f 100644
--- a/src/declarative/extra/qmlsqlconnection.cpp
+++ b/src/declarative/extra/qmlsqlconnection.cpp
@@ -67,6 +67,26 @@ public:
/*!
\qmlclass SqlConnection QmlSqlConnection
\brief The SqlConnection element describes a connection to an SQL database.
+
+ The SqlConnection element works in a similar way to
+ QSqlDatabase::addDatabase(). It allows setting the database properties
+ such that the connection does not need to be set up in C++ code.
+ It differs from QSqlDatabase::addDatabase() in that it will automatically
+ open the database.
+
+ The database can then either be used from an SqlQuery element using its id
+ as a bind, or using its name. If the database is set up externally to
+ Qml the query should connect using its name.
+
+ \qml
+ <SqlConnection id="myConnection">
+ <name>qmlConnection</name>
+ <driver>QSQLITE</driver>
+ <databaseName>"mydb.sqlite"</databaseName>
+ </SqlConnection>
+ <SqlQuery id="listmodel" connection="{myConnection}">SELECT * FROM mytable</SqlQuery>
+ <SqlQuery id="othermodel" connection="qmlConnection">SELECT * FROM myothertable</SqlQuery>
+ \endqml
*/
/*!
@@ -142,32 +162,9 @@ public:
*/
/*!
+ \internal
\class QmlSqlConnection
\brief The QmlSqlConnection class manages a connection to an SQL database.
-
- \qmltext
-
- The SqlConnection element works in a similar way to
- QSqlDatabase::addDatabase(). It allows setting the database properties
- such that the connection does not need to be set up in C++ code.
- It differs from QSqlDatabase::addDatabase() in that it will automatically
- open the database.
-
- The database can then either be used from an SqlQuery element using its id
- as a bind, or using its name. If the database is set up externally to
- Qml the query should connect using its name.
-
- \qml
- <SqlConnection id="myConnection">
- <name>qmlConnection</name>
- <driver>QSQLITE</driver>
- <databaseName>"mydb.sqlite"</databaseName>
- </SqlConnection>
- <SqlQuery id="listmodel" connection="{myConnection}">SELECT * FROM mytable</SqlQuery>
- <SqlQuery id="othermodel" connection="qmlConnection">SELECT * FROM myothertable</SqlQuery>
- \endqml
-
- \endqmltext
*/
/*!
diff --git a/src/declarative/extra/qmlsqlquery.cpp b/src/declarative/extra/qmlsqlquery.cpp
index 39f4c1e..70b3bdd 100644
--- a/src/declarative/extra/qmlsqlquery.cpp
+++ b/src/declarative/extra/qmlsqlquery.cpp
@@ -67,16 +67,8 @@ public:
/*!
\qmlclass SqlBind QmlSqlBind
- \brief the SqlBind element specifies a value binding for an SqlQuery element.
-*/
+ \brief The SqlBind element specifies a value binding for an SqlQuery element.
-/*!
- \class QmlSqlBind
- \brief The QmlSqlBind class specifies a value binding for a QmlSqlQuery.
-
- \qmltext
-
- \qml
By using bindings its possible to cause a SqlQuery to update itself
when values bound through the SqlBind change. Hence in the example
below the results for the SqlQuery will change as searchText changes.
@@ -84,6 +76,7 @@ public:
If the query is not a SELECT statement, the effects of the bound
values will only apply when the SqlQuery exec() slot is called.
+ \qml
<SqlQuery>
SELECT * FROM mytable WHERE name LIKE :value
<bindings>
@@ -97,7 +90,12 @@ public:
</bindings>
<SqlQuery>
\endqml
- \endqmltext
+*/
+
+/*!
+ \internal
+ \class QmlSqlBind
+ \brief The QmlSqlBind class specifies a value binding for a QmlSqlQuery.
*/
/*!
@@ -235,13 +233,7 @@ public:
/*!
\qmlclass SqlQuery QmlSqlQuery
\brief The SqlQuery element describes a query into an SQL database.
-*/
-
-/*
- \class QmlSqlQuery
- \brief the QmlSqlQuery class manages a query into an SQL database.
- \qmltext
The SqlQuery element has three parts. The first is the query itself,
which can either be specified using the query property or by the
default text for the element. The second specifies the connection
@@ -256,11 +248,11 @@ public:
the query.
If the query is a select statement it can be used as a model for a ListView.
- The roles will be the columns of the result set. Use the SQL AS keyword
+ The roles will be the columns of the result set. Use the SQL AS keyword
in the query if you want to override the column names from that of the
table selected. You should also use the AS keyword if there is no
appropriate table column name for the result column.
-
+
\qml
<SqlQuery connection="{qmlConnectionId}" query="DELETE FROM mytable"/>
<SqlQuery connection="connectionName">
@@ -268,7 +260,11 @@ public:
</SqlQuery>
<SqlQuery>SELECT id AS recordId, (firstName || ' ' || lastName) AS fullName FROM mytable</SqlQuery>
\endqml
- \endqmltext
+*/
+
+/*
+ \class QmlSqlQuery
+ \brief the QmlSqlQuery class manages a query into an SQL database.
*/
/*!