diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2024-01-13 00:00:41 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2024-01-14 09:32:04 +0100 |
commit | 8bfebaa22f66d2cc32d6147611bcbaea3a85188c (patch) | |
tree | a16e191d3449dff288badb64b45cb517658bc2a4 /examples/sql/cachedtable | |
parent | 27dd17890060313d684b72c871be9da7eb2b74fe (diff) |
SQL examples: code cleanup
Misc code cleanup for the sql examples:
- don't include global Qt headers but only needed ones
- use proper tr() where possible
- pass parameters by const ref
- style fixes
Change-Id: I4fd4293948918b9d7b373b6d1e8eeecf6f25a622
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Diffstat (limited to 'examples/sql/cachedtable')
-rw-r--r-- | examples/sql/cachedtable/tableeditor.cpp | 11 | ||||
-rw-r--r-- | examples/sql/cachedtable/tableeditor.h | 8 |
2 files changed, 11 insertions, 8 deletions
diff --git a/examples/sql/cachedtable/tableeditor.cpp b/examples/sql/cachedtable/tableeditor.cpp index 97b3fa0d96..b92e256438 100644 --- a/examples/sql/cachedtable/tableeditor.cpp +++ b/examples/sql/cachedtable/tableeditor.cpp @@ -1,11 +1,16 @@ // Copyright (C) 2016 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause -#include <QtWidgets> -#include <QtSql> - #include "tableeditor.h" +#include <QDialogButtonBox> +#include <QHBoxLayout> +#include <QMessageBox> +#include <QPushButton> +#include <QSqlError> +#include <QSqlTableModel> +#include <QTableView> + //! [0] TableEditor::TableEditor(const QString &tableName, QWidget *parent) : QWidget(parent) diff --git a/examples/sql/cachedtable/tableeditor.h b/examples/sql/cachedtable/tableeditor.h index dfa50a8934..8c3c56b397 100644 --- a/examples/sql/cachedtable/tableeditor.h +++ b/examples/sql/cachedtable/tableeditor.h @@ -6,11 +6,9 @@ #include <QDialog> -QT_BEGIN_NAMESPACE -class QDialogButtonBox; -class QPushButton; -class QSqlTableModel; -QT_END_NAMESPACE +QT_FORWARD_DECLARE_CLASS(QDialogButtonBox) +QT_FORWARD_DECLARE_CLASS(QPushButton) +QT_FORWARD_DECLARE_CLASS(QSqlTableModel) //! [0] class TableEditor : public QWidget |