QSqlError is a value type with broken move semantics. A value that's been moved-from via assignment operator will be valid (it will have the d-pointer of the assignee), while a value that's been moved from via move-construction will be invalid (d-pointer will be nullptr).
Getters don't check the d-pointer for being a valid pointer. That is is ok as per QUIP-19.
The class should generally use implicit sharing to avoid these inconsistencies.