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
parent
579de35909
commit
3ec52de5e9
|
|
@ -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) ...
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue