diff options
author | Paul Wicking <paul.wicking@qt.io> | 2020-03-23 12:56:02 +0100 |
---|---|---|
committer | Paul Wicking <paul.wicking@qt.io> | 2020-03-26 12:25:06 +0100 |
commit | 3f3e200aef80ac33e6bf116c656ebc28d5918836 (patch) | |
tree | 613c6c8c44fcd6445723cd9c9cddb2bf1c37ec68 /src/sql/doc/snippets/sqldatabase/sqldatabase.cpp | |
parent | f22c929c8a1e9575ba9f99acdbb061e12d4da4a2 (diff) |
Doc: Fix coverity warnings in SQL snippets
Fixes: QTBUG-83008
Change-Id: I126bc04719cd221a3d80ae825fca44e63aeec934
Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
Diffstat (limited to 'src/sql/doc/snippets/sqldatabase/sqldatabase.cpp')
-rw-r--r-- | src/sql/doc/snippets/sqldatabase/sqldatabase.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/sql/doc/snippets/sqldatabase/sqldatabase.cpp b/src/sql/doc/snippets/sqldatabase/sqldatabase.cpp index 2039007c4a..0c09d76145 100644 --- a/src/sql/doc/snippets/sqldatabase/sqldatabase.cpp +++ b/src/sql/doc/snippets/sqldatabase/sqldatabase.cpp @@ -207,7 +207,7 @@ void QSqlQuery_snippets() QMap<QString, QVariant> sqlIterator(query.boundValues()); for (auto i = sqlIterator.begin(); i != sqlIterator.end(); ++i) { cout << i.key().toUtf8().data() << ": " - << i.value().toString().toUtf8().data() << Qt::endl; + << i.value().toString().toUtf8().data() << "\n"; } //! [14] } @@ -217,7 +217,7 @@ void QSqlQuery_snippets() //! [15] QList<QVariant> list = query.boundValues().values(); for (int i = 0; i < list.size(); ++i) - cout << i << ": " << list.at(i).toString().toUtf8().data() << Qt::endl; + cout << i << ": " << list.at(i).toString().toUtf8().data() << "\n"; //! [15] } } @@ -274,6 +274,7 @@ void QSqlTableModel_snippets() model.select(); int salary = model.record(4).value("salary").toInt(); //! [25] + Q_UNUSED(salary); } } @@ -514,7 +515,7 @@ public: const QString & /* password */, const QString & /* host */, int /* port */, const QString & /* options */) override { return false; } - void close() {} + void close() override {} QSqlResult *createResult() const override { return new XyzResult(this); } }; //! [48] |