with AND without a semicolon :

Qt Code:
  1. QSqlError QSE = query.lastError();
  2. QString tmp = QSE.text();
  3. QMessageBox::warning(NULL, "", tmp);
To copy to clipboard, switch view to plain text mode 

tmp value:
"near "test": syntax error Unable to execute statement"
text() function