summaryrefslogtreecommitdiffstats
path: root/examples/sql/tablemodel/tablemodel.cpp
diff options
context:
space:
mode:
authorMichael Winkelmann <Michael.winkelmann@qt.io>2017-07-20 16:39:01 +0200
committerTopi Reiniö <topi.reinio@qt.io>2017-09-14 10:48:48 +0000
commit3d67793a9ec01f15e3dcf6b59e6e0df5f59bdfad (patch)
treee8bd72349e2580e2dfb4908a96653f3fa3644922 /examples/sql/tablemodel/tablemodel.cpp
parent590e71a69cc74b4e7da1ccb19a1304047dbaecb8 (diff)
Revamp SQL examples to C++11
Changed signals and slots to new syntax, used nullptr and replaced foreach with new C++11 range based for loops. Also fixed a few minor flaws. Task-number: QTBUG-60633 Change-Id: Ice4030133971912f96752d9d84c638c70fd73e35 Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io> Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'examples/sql/tablemodel/tablemodel.cpp')
-rw-r--r--examples/sql/tablemodel/tablemodel.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/examples/sql/tablemodel/tablemodel.cpp b/examples/sql/tablemodel/tablemodel.cpp
index c22e25cbef..a6e0341c23 100644
--- a/examples/sql/tablemodel/tablemodel.cpp
+++ b/examples/sql/tablemodel/tablemodel.cpp
@@ -47,11 +47,13 @@
** $QT_END_LICENSE$
**
****************************************************************************/
+#include "../connection.h"
-#include <QtWidgets>
-#include <QtSql>
+#include <QApplication>
+#include <QSqlTableModel>
+#include <QTableView>
-#include "../connection.h"
+#include <stdlib.h>
void initializeModel(QSqlTableModel *model)
{
@@ -76,7 +78,7 @@ int main(int argc, char *argv[])
{
QApplication app(argc, argv);
if (!createConnection())
- return 1;
+ return EXIT_FAILURE;
QSqlTableModel model;