summaryrefslogtreecommitdiffstats
path: root/src/sql/kernel/qsqldatabase.cpp
diff options
context:
space:
mode:
authorNico Vertriest <[email protected]>2020-01-28 12:41:16 +0100
committerPaul Wicking <[email protected]>2020-03-20 06:53:59 +0100
commit0359a82e6ef538316e550e7fa7c6dee8db72a225 (patch)
treeed1b3067b429b0edb986a9b6afc64f0c31664d6e /src/sql/kernel/qsqldatabase.cpp
parentb77e239c5e7d3befbd48200aa51c5ff9b51d07f0 (diff)
Doc: make Qt Sql snippets compilable
Task-number: QTBUG-81496 Change-Id: Id6206e9179c2e8157c99e777a3de35bd83d49e34 Reviewed-by: Topi Reiniƶ <[email protected]> Reviewed-by: Paul Wicking <[email protected]>
Diffstat (limited to 'src/sql/kernel/qsqldatabase.cpp')
-rw-r--r--src/sql/kernel/qsqldatabase.cpp8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp
index 32338c1fe2c..facf7fd28c7 100644
--- a/src/sql/kernel/qsqldatabase.cpp
+++ b/src/sql/kernel/qsqldatabase.cpp
@@ -561,7 +561,7 @@ QStringList QSqlDatabase::drivers()
and don't want to compile it as a plugin.
Example:
- \snippet code/src_sql_kernel_qsqldatabase.cpp 2
+ \snippet code/src_sql_kernel_qsqldatabase_snippet.cpp 2
QSqlDatabase takes ownership of the \a creator pointer, so you
mustn't delete it yourself.
@@ -1271,9 +1271,7 @@ bool QSqlDatabase::isDriverAvailable(const QString& name)
application. For example, you can create a PostgreSQL connection
with your own QPSQL driver like this:
- \snippet code/src_sql_kernel_qsqldatabase.cpp 5
- \codeline
- \snippet code/src_sql_kernel_qsqldatabase.cpp 6
+ \snippet code/src_sql_kernel_qsqldatabase_snippet.cpp 6
The above code sets up a PostgreSQL connection and instantiates a
QPSQLDriver object. Next, addDatabase() is called to add the
@@ -1292,7 +1290,7 @@ bool QSqlDatabase::isDriverAvailable(const QString& name)
client library. Make sure the client library is in your linker's
search path, and add lines like these to your \c{.pro} file:
- \snippet code/src_sql_kernel_qsqldatabase.cpp 7
+ \snippet code/src_sql_kernel_qsqldatabase_snippet.cpp 7
The method described works for all the supplied drivers. The only
difference will be in the driver constructor arguments. Here is a