PDA

View Full Version : QSqlDatabase::lastError() in MessageBox



xyz247
10th October 2012, 05:39
I'm trying to figure out why my connection is failing, yet I can't show the last error in a mesagebox. This is a GUI application and using qDebug() << db.lastError() does not display anything. When I do put db.lastError() in the messagebox text, I get this error: error: no matching function for call to 'QMessageBox::setText(QSqlError)'

How can I show the last error? I haven't found any viable method of converting QSqlError to QString.

Lesiok
10th October 2012, 05:50
QSqlError::text

xyz247
10th October 2012, 05:58
Well that's embarrassing! Thanks Lesiok. "Driver not found".