diff options
Diffstat (limited to 'examples/sql/querymodel')
-rw-r--r-- | examples/sql/querymodel/customsqlmodel.h | 2 | ||||
-rw-r--r-- | examples/sql/querymodel/editablesqlmodel.h | 2 | ||||
-rw-r--r-- | examples/sql/querymodel/main.cpp | 9 |
3 files changed, 8 insertions, 5 deletions
diff --git a/examples/sql/querymodel/customsqlmodel.h b/examples/sql/querymodel/customsqlmodel.h index 5d2f625665..462d2ab822 100644 --- a/examples/sql/querymodel/customsqlmodel.h +++ b/examples/sql/querymodel/customsqlmodel.h @@ -59,7 +59,7 @@ class CustomSqlModel : public QSqlQueryModel Q_OBJECT public: - CustomSqlModel(QObject *parent = 0); + CustomSqlModel(QObject *parent = nullptr); QVariant data(const QModelIndex &item, int role) const override; }; diff --git a/examples/sql/querymodel/editablesqlmodel.h b/examples/sql/querymodel/editablesqlmodel.h index 1341dd372a..e8caad2765 100644 --- a/examples/sql/querymodel/editablesqlmodel.h +++ b/examples/sql/querymodel/editablesqlmodel.h @@ -58,7 +58,7 @@ class EditableSqlModel : public QSqlQueryModel Q_OBJECT public: - EditableSqlModel(QObject *parent = 0); + EditableSqlModel(QObject *parent = nullptr); Qt::ItemFlags flags(const QModelIndex &index) const override; bool setData(const QModelIndex &index, const QVariant &value, int role) override; diff --git a/examples/sql/querymodel/main.cpp b/examples/sql/querymodel/main.cpp index 83804682f9..da19939dd8 100644 --- a/examples/sql/querymodel/main.cpp +++ b/examples/sql/querymodel/main.cpp @@ -48,12 +48,15 @@ ** ****************************************************************************/ -#include <QtWidgets> - #include "../connection.h" #include "customsqlmodel.h" #include "editablesqlmodel.h" +#include <QApplication> +#include <QTableView> + +#include <stdlib.h> + void initializeModel(QSqlQueryModel *model) { model->setQuery("select * from person"); @@ -80,7 +83,7 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); if (!createConnection()) - return 1; + return EXIT_FAILURE; QSqlQueryModel plainModel; EditableSqlModel editableModel; |