From 0359a82e6ef538316e550e7fa7c6dee8db72a225 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 28 Jan 2020 12:41:16 +0100 Subject: Doc: make Qt Sql snippets compilable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-81496 Change-Id: Id6206e9179c2e8157c99e777a3de35bd83d49e34 Reviewed-by: Topi Reiniƶ Reviewed-by: Paul Wicking --- src/sql/kernel/qsqldatabase.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/sql/kernel/qsqldatabase.cpp') 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 -- cgit v1.2.3