Skip to content

Commit 2ec776c

Browse files
author
Jim Hamill
committed
Misc updates
1 parent 24cf905 commit 2ec776c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

BrowseWidget.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#include <QSqlField>
99
#include <QSqlError>
1010

11-
#include "InsertRowDialog.h"
11+
#include <QMessageBox>
1212

1313
BrowseWidget::BrowseWidget(QWidget *parent) :
1414
QWidget(parent),
@@ -110,6 +110,11 @@ void BrowseWidget::commitChanges()
110110
// Submit all previous changes
111111
if (m_model->isDirty()) {
112112
m_model->submitAll();
113+
114+
// Check if there was an error and display it if there was
115+
if (m_model->lastError().type() != QSqlError::NoError) {
116+
QMessageBox::critical(this, "Operation failed", m_model->lastError().text());
117+
}
113118
}
114119

115120
// Revert back to OnFieldChange

0 commit comments

Comments
 (0)