Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-20089

QSqlDriver::handle() documentation erroneous

    XMLWordPrintable

Details

    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            cvandonderen Casper van Donderen
            fvielhauer Florian Vielhauer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes