Commit c1fc530e authored by Hugo Hörnquist's avatar Hugo Hörnquist

Add error message on invalid SQL query

parent 7730b552
......@@ -1017,6 +1017,14 @@ void MainWindow::on_sqlOutReload_clicked()
{
QSqlQueryModel* model = (QSqlQueryModel*) ui->sqlOutput->model();
model->setQuery(ui->sqlEdit->toPlainText());
if (model->lastError().isValid()) {
QMessageBox::warning(
this, "SQL Querry error",
"Error while executing query\n\n " + model->lastError().text());
return;
}
ui->tabWidget_2->setCurrentIndex(0);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment