We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24cf905 commit 2ec776cCopy full SHA for 2ec776c
BrowseWidget.cpp
@@ -8,7 +8,7 @@
8
#include <QSqlField>
9
#include <QSqlError>
10
11
-#include "InsertRowDialog.h"
+#include <QMessageBox>
12
13
BrowseWidget::BrowseWidget(QWidget *parent) :
14
QWidget(parent),
@@ -110,6 +110,11 @@ void BrowseWidget::commitChanges()
110
// Submit all previous changes
111
if (m_model->isDirty()) {
112
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
+ }
118
}
119
120
// Revert back to OnFieldChange
0 commit comments