diff options
-rw-r--r-- | doc/src/snippets/code/src_sql_kernel_qsqldriver.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/src/snippets/code/src_sql_kernel_qsqldriver.cpp b/doc/src/snippets/code/src_sql_kernel_qsqldriver.cpp index d49b6e0..1a3772f 100644 --- a/doc/src/snippets/code/src_sql_kernel_qsqldriver.cpp +++ b/doc/src/snippets/code/src_sql_kernel_qsqldriver.cpp @@ -41,7 +41,7 @@ //! [0] QSqlDatabase db = ...; QVariant v = db.driver()->handle(); -if (v.isValid() && qstrcmp(v.typeName(), "sqlite3*")==0) { +if (v.isValid() && qstrcmp(v.typeName(), "sqlite3*") == 0) { // v.data() returns a pointer to the handle sqlite3 *handle = *static_cast<sqlite3 **>(v.data()); if (handle != 0) { // check that it is not NULL @@ -52,12 +52,12 @@ if (v.isValid() && qstrcmp(v.typeName(), "sqlite3*")==0) { //! [1] -if (v.typeName() == "PGconn*") { +if (qstrcmp(v.typeName(), "PGconn*") == 0) { PGconn *handle = *static_cast<PGconn **>(v.data()); if (handle != 0) ... } -if (v.typeName() == "MYSQL*") { +if (qstrcmp(v.typeName(), "MYSQL*") == 0) { MYSQL *handle = *static_cast<MYSQL **>(v.data()); if (handle != 0) ... } |