doc: Fix a few doc errors for QtSQL
authorTor Arne Vestbø <tor.arne.vestbo@digia.com>
Fri, 12 Oct 2012 12:06:53 +0000 (14:06 +0200)
committerFrederik Gladhorn <frederik.gladhorn@digia.com>
Fri, 12 Oct 2012 13:06:30 +0000 (15:06 +0200)
The examples include path already contains 'sql', so we can't prefix the
includes with 'sql' as well. Changing the include path to also include
the parent examples directory is not an option, as qdoc will then try to
generate output for example single example.

Change-Id: Ifae07af86e60e6105a0625f29fbd6bc8f73b2550
Reviewed-by: Martin Smith <martin.smith@digia.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
src/sql/doc/qtsql.qdocconf
src/sql/doc/src/sql-programming.qdoc
src/sql/models/qsqlquerymodel.cpp
src/sql/models/qsqlrelationaldelegate.cpp
src/sql/models/qsqlrelationaltablemodel.cpp
src/sql/models/qsqltablemodel.cpp

index 185f506..34a2378 100644 (file)
@@ -31,7 +31,7 @@ qhp.QtSql.subprojects.examples.selectors = fake:example
 
 tagfile                 = ../../../doc/qtsql/qtsql.tags
 
-depends                 += qtcore
+depends                 += qtcore qtwidgets
 
 headerdirs  += ..
 
index 3fe2373..aa2eb24 100644 (file)
     The following code snippet shows how the QSqlRelationalTableModel
     was set up:
 
-    \snippet sql/relationaltablemodel/relationaltablemodel.cpp 0
+    \snippet relationaltablemodel/relationaltablemodel.cpp 0
     \codeline
-    \snippet sql/relationaltablemodel/relationaltablemodel.cpp 1
-    \snippet sql/relationaltablemodel/relationaltablemodel.cpp 2
+    \snippet relationaltablemodel/relationaltablemodel.cpp 1
+    \snippet relationaltablemodel/relationaltablemodel.cpp 2
 
     See the QSqlRelationalTableModel documentation for details.
 */
     You can use the same model as a data source for multiple views.
     If the user edits the model through one of the views, the other
     views will reflect the changes immediately. The
-    \l{sql/tablemodel}{Table Model} example shows how it works.
+    \l{tablemodel}{Table Model} example shows how it works.
 
     View classes display a header at the top to label the columns. To
     change the header texts, call
     model. The header's labels default to the table's field names.
     For example:
 
-    \snippet sql/relationaltablemodel/relationaltablemodel.cpp 3
+    \snippet relationaltablemodel/relationaltablemodel.cpp 3
 
     QTableView also has a vertical header on the left with numbers
     identifying the rows. If you insert rows programmatically using
     read-write. The following two functions make fields 1 and 2 of a
     query model editable:
 
-    \snippet sql/querymodel/editablesqlmodel.cpp 0
+    \snippet querymodel/editablesqlmodel.cpp 0
     \codeline
-    \snippet sql/querymodel/editablesqlmodel.cpp 1
+    \snippet querymodel/editablesqlmodel.cpp 1
 
     The setFirstName() helper function is defined as follows:
 
-    \snippet sql/querymodel/editablesqlmodel.cpp 2
+    \snippet querymodel/editablesqlmodel.cpp 2
 
     The setLastName() function is similar. See the
-    \l{sql/querymodel}{Query Model} example for the complete source code.
+    \l{querymodel}{Query Model} example for the complete source code.
 
     Subclassing a model makes it possible to customize it in many
     ways: You can provide tooltips for the items, change the
 
     \image relationaltable.png Editing a foreign key in a relational table
 
-    The \l{sql/relationaltablemodel}{Relational Table Model} example
+    The \l{relationaltablemodel}{Relational Table Model} example
     illustrates how to use QSqlRelationalTableModel in conjunction with
     QSqlRelationalDelegate to provide tables with foreign key
     support.
 
     \image qdatawidgetmapper-simple.png
 
-    The \l{sql/books}{Books} example shows how information can
+    The \l{books}{Books} example shows how information can
     be presented for easy access by using QDataWidgetMapper and a set of
     simple input widgets.
 */
index 926b78f..c49a1f2 100644 (file)
@@ -129,7 +129,7 @@ void QSqlQueryModelPrivate::initColOffsets(int size)
     option is to use QSqlTableModel, which provides a read-write
     model based on a single database table.
 
-    The \l{sql/querymodel} example illustrates how to use
+    The \l{querymodel} example illustrates how to use
     QSqlQueryModel to display the result of a query. It also shows
     how to subclass QSqlQueryModel to customize the contents of the
     data before showing it to the user, and how to create a
index 31b3df3..af50c03 100644 (file)
@@ -53,9 +53,9 @@ QT_BEGIN_NAMESPACE
     use the class, simply call QAbstractItemView::setItemDelegate()
     on the view with an instance of QSqlRelationalDelegate:
 
-    \snippet sql/relationaltablemodel/relationaltablemodel.cpp 4
+    \snippet relationaltablemodel/relationaltablemodel.cpp 4
 
-    The \l{sql/relationaltablemodel}{Relational Table Model} example
+    The \l{relationaltablemodel}{Relational Table Model} example
     (shown below) illustrates how to use QSqlRelationalDelegate in
     conjunction with QSqlRelationalTableModel to provide tables with
     foreign key support.
index e249277..c3637f0 100644 (file)
@@ -340,10 +340,10 @@ void QSqlRelationalTableModelPrivate::clearCache()
     The following code snippet shows how the QSqlRelationalTableModel
     was set up:
 
-    \snippet sql/relationaltablemodel/relationaltablemodel.cpp 0
+    \snippet relationaltablemodel/relationaltablemodel.cpp 0
     \codeline
-    \snippet sql/relationaltablemodel/relationaltablemodel.cpp 1
-    \snippet sql/relationaltablemodel/relationaltablemodel.cpp 2
+    \snippet relationaltablemodel/relationaltablemodel.cpp 1
+    \snippet 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,9 +359,9 @@ void QSqlRelationalTableModelPrivate::clearCache()
     call QAbstractItemView::setItemDelegate() on the view with an
     instance of QSqlRelationalDelegate:
 
-    \snippet sql/relationaltablemodel/relationaltablemodel.cpp 4
+    \snippet relationaltablemodel/relationaltablemodel.cpp 4
 
-    The \l{sql/relationaltablemodel} example illustrates how to use
+    The \l{relationaltablemodel} example illustrates how to use
     QSqlRelationalTableModel in conjunction with
     QSqlRelationalDelegate to provide tables with foreign key
     support.
@@ -486,9 +486,9 @@ bool QSqlRelationalTableModel::setData(const QModelIndex &index, const QVariant
 
     Example:
 
-    \snippet sql/relationaltablemodel/relationaltablemodel.cpp 0
+    \snippet relationaltablemodel/relationaltablemodel.cpp 0
     \codeline
-    \snippet sql/relationaltablemodel/relationaltablemodel.cpp 1
+    \snippet 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
index 5feb308..d685c7e 100644 (file)
@@ -251,7 +251,7 @@ QSqlRecord QSqlTableModelPrivate::primaryValues(int row) const
     sort order using setSort(). At the end, you must call select() to
     populate the model with data.
 
-    The \l{sql/tablemodel} example illustrates how to use
+    The \l{tablemodel} example illustrates how to use
     QSqlTableModel as the data source for a QTableView.
 
     QSqlTableModel provides no direct support for foreign keys. Use