(Frustrated rant about having to sign up just to discover I can't even comment without getting site-specific UselessInternetPoints removed).
I've filed a bug in JIRA, since I can actually do that without first having to go spam random forums / vote-up random pages.
https://bugreports.qt-project.org/browse/QTBUG-40586#comment-251940
Please link to that from http://qt-project.org/doc/qt-4.8/qsqlerror.html with a note along the lines of:
"Application developers should generally avoid directly parsing error messages, as they may vary based on locale, database system version, etc. Usually the framework would offer access to the underlying database's standard SQLSTATE error code but QSQLError does not present this information at time of writing. A future revision of the QSQLError class may hopefully address this issue. In the mean time application developers should not attempt to differentiate between error types, such as "serialization failure" or "column does not exist", beyond the information provided by the type() method.".