QSqlError
QSqlError is a lightweight value object in the QtSql module that encapsulates information about a database error that occurred during a database operation. It is most commonly obtained from QSqlQuery::lastError() after executing a query, but drivers or higher-level components may also construct or propagate QSqlError objects. The class is intended to convey both machine-readable and human-readable error data to help diagnose issues in database access and SQL execution.
A QSqlError carries several pieces of information: the error type (QSqlErrorType), a native error number from
Typical use is to check whether an operation succeeded by examining the error type or isValid(), and
QSqlError is part of the QtSql module and interoperates with QSqlQuery and QSqlDatabase. It is designed to