1 | // Copyright (C) 2016 The Qt Company Ltd. |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause |
3 | #include <QSqlDatabase> |
4 | #include <QSqlQuery> |
5 | #include <QSqlQueryModel> |
6 | #include <QSqlError> |
7 | #include <QDebug> |
8 | |
9 | void checkSqlQueryModel() |
10 | { |
11 | //! [0] |
12 | QSqlQueryModel model; |
13 | model.setQuery(query: "select * from myTable"); |
14 | if (model.lastError().isValid()) |
15 | qDebug() << model.lastError(); |
16 | //! [0] |
17 | } |
18 |