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>
bb10
Giuseppe D'Angelo 2013-09-15 15:41:59 +02:00 committed by The Qt Project
parent 579de35909
commit 3ec52de5e9
1 changed files with 2 additions and 2 deletions

View File

@ -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) ...
}