summaryrefslogtreecommitdiffstats
path: root/src/sql/models
diff options
context:
space:
mode:
Diffstat (limited to 'src/sql/models')
-rw-r--r--src/sql/models/qsqlquerymodel.cpp12
-rw-r--r--src/sql/models/qsqlrelationaldelegate.cpp2
-rw-r--r--src/sql/models/qsqlrelationaltablemodel.cpp12
-rw-r--r--src/sql/models/qsqltablemodel.cpp4
4 files changed, 15 insertions, 15 deletions
diff --git a/src/sql/models/qsqlquerymodel.cpp b/src/sql/models/qsqlquerymodel.cpp
index 85869e41ac..723767344c 100644
--- a/src/sql/models/qsqlquerymodel.cpp
+++ b/src/sql/models/qsqlquerymodel.cpp
@@ -111,7 +111,7 @@ void QSqlQueryModelPrivate::initColOffsets(int size)
the lower-level QSqlQuery and can be used to provide data to
view classes such as QTableView. For example:
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 16
+ \snippet sqldatabase/sqldatabase.cpp 16
We set the model's query, then we set up the labels displayed in
the view header.
@@ -119,13 +119,13 @@ void QSqlQueryModelPrivate::initColOffsets(int size)
QSqlQueryModel can also be used to access a database
programmatically, without binding it to a view:
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 21
+ \snippet sqldatabase/sqldatabase.cpp 21
The code snippet above extracts the \c salary field from record 4 in
the result set of the query \c{SELECT * from employee}. Assuming
that \c salary is column 2, we can rewrite the last line as follows:
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 22
+ \snippet sqldatabase/sqldatabase.cpp 22
The model is read-only by default. To make it read-write, you
must subclass it and reimplement setData() and flags(). Another
@@ -179,7 +179,7 @@ QSqlQueryModel::~QSqlQueryModel()
To force fetching of the entire result set, you can use the following:
- \snippet doc/src/snippets/code/src_sql_models_qsqlquerymodel.cpp 0
+ \snippet code/src_sql_models_qsqlquerymodel.cpp 0
\a parent should always be an invalid QModelIndex.
@@ -394,7 +394,7 @@ void QSqlQueryModel::setQuery(const QSqlQuery &query)
was an error setting the query.
Example:
- \snippet doc/src/snippets/code/src_sql_models_qsqlquerymodel.cpp 1
+ \snippet code/src_sql_models_qsqlquerymodel.cpp 1
\sa query(), queryChange(), lastError()
*/
@@ -529,7 +529,7 @@ QSqlRecord QSqlQueryModel::record() const
By default, inserted columns are empty. To fill them with data,
reimplement data() and handle any inserted column separately:
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 23
+ \snippet sqldatabase/sqldatabase.cpp 23
\sa removeColumns()
*/
diff --git a/src/sql/models/qsqlrelationaldelegate.cpp b/src/sql/models/qsqlrelationaldelegate.cpp
index 79e026fe57..e58c68f139 100644
--- a/src/sql/models/qsqlrelationaldelegate.cpp
+++ b/src/sql/models/qsqlrelationaldelegate.cpp
@@ -53,7 +53,7 @@ QT_BEGIN_NAMESPACE
use the class, simply call QAbstractItemView::setItemDelegate()
on the view with an instance of QSqlRelationalDelegate:
- \snippet examples/sql/relationaltablemodel/relationaltablemodel.cpp 4
+ \snippet sql/relationaltablemodel/relationaltablemodel.cpp 4
The \l{sql/relationaltablemodel}{Relational Table Model} example
(shown below) illustrates how to use QSqlRelationalDelegate in
diff --git a/src/sql/models/qsqlrelationaltablemodel.cpp b/src/sql/models/qsqlrelationaltablemodel.cpp
index a3d45576ae..6d0304e165 100644
--- a/src/sql/models/qsqlrelationaltablemodel.cpp
+++ b/src/sql/models/qsqlrelationaltablemodel.cpp
@@ -340,10 +340,10 @@ void QSqlRelationalTableModelPrivate::clearCache()
The following code snippet shows how the QSqlRelationalTableModel
was set up:
- \snippet examples/sql/relationaltablemodel/relationaltablemodel.cpp 0
+ \snippet sql/relationaltablemodel/relationaltablemodel.cpp 0
\codeline
- \snippet examples/sql/relationaltablemodel/relationaltablemodel.cpp 1
- \snippet examples/sql/relationaltablemodel/relationaltablemodel.cpp 2
+ \snippet sql/relationaltablemodel/relationaltablemodel.cpp 1
+ \snippet sql/relationaltablemodel/relationaltablemodel.cpp 2
The setRelation() function calls establish a relationship between
two tables. The first call specifies that column 2 in table \c
@@ -359,7 +359,7 @@ void QSqlRelationalTableModelPrivate::clearCache()
call QAbstractItemView::setItemDelegate() on the view with an
instance of QSqlRelationalDelegate:
- \snippet examples/sql/relationaltablemodel/relationaltablemodel.cpp 4
+ \snippet sql/relationaltablemodel/relationaltablemodel.cpp 4
The \l{sql/relationaltablemodel} example illustrates how to use
QSqlRelationalTableModel in conjunction with
@@ -486,9 +486,9 @@ bool QSqlRelationalTableModel::setData(const QModelIndex &index, const QVariant
Example:
- \snippet examples/sql/relationaltablemodel/relationaltablemodel.cpp 0
+ \snippet sql/relationaltablemodel/relationaltablemodel.cpp 0
\codeline
- \snippet examples/sql/relationaltablemodel/relationaltablemodel.cpp 1
+ \snippet sql/relationaltablemodel/relationaltablemodel.cpp 1
The setRelation() call specifies that column 2 in table \c
employee is a foreign key that maps with field \c id of table \c
diff --git a/src/sql/models/qsqltablemodel.cpp b/src/sql/models/qsqltablemodel.cpp
index 40315da204..30c3f032e0 100644
--- a/src/sql/models/qsqltablemodel.cpp
+++ b/src/sql/models/qsqltablemodel.cpp
@@ -213,7 +213,7 @@ QSqlRecord QSqlTableModelPrivate::primaryValues(int row) const
lower-level QSqlQuery and can be used to provide data to view
classes such as QTableView. For example:
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 24
+ \snippet sqldatabase/sqldatabase.cpp 24
We set the SQL table's name and the edit strategy, then we set up
the labels displayed in the view header. The edit strategy
@@ -224,7 +224,7 @@ QSqlRecord QSqlTableModelPrivate::primaryValues(int row) const
QSqlTableModel can also be used to access a database
programmatically, without binding it to a view:
- \snippet doc/src/snippets/sqldatabase/sqldatabase.cpp 21
+ \snippet sqldatabase/sqldatabase.cpp 21
The code snippet above extracts the \c salary field from record 4 in
the result set of the query \c{SELECT * from employee}.