summaryrefslogtreecommitdiffstats
path: root/src/sql/doc/snippets/code
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2013-09-15 15:41:59 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-17 01:01:46 +0200
commit3ec52de5e96c332a207b48c8a7655d3fdfc5edb8 (patch)
tree62523f50cb535cc65a712a2c447237f3afef0ed7 /src/sql/doc/snippets/code
parent579de35909b7033632ca14ed4983914bfa7fb5ab (diff)
Fix QSqlDriver::handle casting examples
QVariant::typeName() returns a const char *, so one can't use == to compare it against another string. Change-Id: Id7a4c06a9e4874459609b3749f87d39ed73e8405 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
Diffstat (limited to 'src/sql/doc/snippets/code')
-rw-r--r--src/sql/doc/snippets/code/src_sql_kernel_qsqldriver.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sql/doc/snippets/code/src_sql_kernel_qsqldriver.cpp b/src/sql/doc/snippets/code/src_sql_kernel_qsqldriver.cpp
index 55b17c05eb..d0b825ac21 100644
--- a/src/sql/doc/snippets/code/src_sql_kernel_qsqldriver.cpp
+++ b/src/sql/doc/snippets/code/src_sql_kernel_qsqldriver.cpp
@@ -52,12 +52,12 @@ if (v.isValid() && qstrcmp(v.typeName(), "sqlite3*")==0) {
//! [1]
-if (v.typeName() == "PGconn*") {
+if (qstrcmp(v.typeName(), "PGconn*")) {
PGconn *handle = *static_cast<PGconn **>(v.data());
if (handle != 0) ...
}
-if (v.typeName() == "MYSQL*") {
+if (qstrcmp(v.typeName(), "MYSQL*")) {
MYSQL *handle = *static_cast<MYSQL **>(v.data());
if (handle != 0) ...
}