Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.7.3
-
1575462bf90851fb134db4892e93c04b396543f1
Description
The last example snippet in the documentation of QSqlDriver::handle() is erroneous.
if (v.typeName() == "PGconn*") { PGconn *handle = *static_cast<PGconn **>(v.data()); if (handle != 0) ... } if (v.typeName() == "MYSQL*") { MYSQL *handle = *static_cast<MYSQL **>(v.data()); if (handle != 0) ... }
As QVariant::typeName() returns a const char* the string comparisons simply don't work.