[Interest] Qt4 QODBCDriver class and header file no longer in Qt5?

Constantin Makshin cmakshin at gmail.com
Wed Jul 31 22:00:54 CEST 2013


While class names and #include-s are certainly safer because they are
checked at compile-time, but text names unleash the real power of QtSql
— unified API (which, IMHO, doesn't make much sense if you stick your
application to one particular RDBMS) and ability to make the database
interface selectable by the final user. :)

P.S.:
I know SQL is not 100% the same everywhere, but this problem is much
less serious than different native database APIs. :)

On 07/31/2013 07:23 PM, Niels Dekker wrote:
> On 2013-07-31 16:52, Mark Brand wrote:
>> The SQL driver headers were made explicitly private. For  the reasoning behind
>> this, see commit 1ee11474622e7da068fb1cd26f509ed10848a3b5 and the related
>> change in Gerrit.
> 
> Thanks, I found the commit at 
> http://qt.gitorious.org/~peter-h/qt/peter-hs-qtbase/commit/1ee11474622e7da068fb1cd26f509ed10848a3b5 
>   It says that "no one used those headers in Qt 4", but well... I did  :-)
> 
>> If you follow the pattern in the "Detailed Description" [1] of the
>> documentation of the QSqlDatabase class, you won't need to explicitly
>> instantiate the driver in your code, or include the header that declares its
>> constructor.
> 
> FWIW, in general, as a C++ programmer, I prefer to type class names and 
> #include statements, which are checked at compile time, rather than 
> literal strings, which are only checked at run-time. But if the 
> QODBCDriver class is unsupported, I'll stop using it, of course!
> 
>> [1] https://qt-project.org/doc/qt-5.1/qtsql/qsqldatabase.html#details
> 
> Thanks for the link!
> 
> Kind regards, Niels
> --
> Niels Dekker
> http://www.xs4all.nl/~nd/dekkerware
> Scientific programmer at LKEB, Leiden University Medical Center

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130801/2047741e/attachment.sig>


More information about the Interest mailing list