sqlbrowser example: use explicit / override
Examples should show idiomatic use of Qt and C++, so mark the custom widget constructors in this example as explicit and their destructors are override. Amends 2690822428deec4f0c08f4d118d69a7c6036369e, which, however, inherited the missing explicit from older code. Pick-to: 6.8 Change-Id: I5b5b49f69330c6f139345bed7264c85a36c36e9b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit e0e9a5627376e04aba1b2ca2591554851d7de240) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
88600c3096
commit
cc1af8409a
@ -22,8 +22,8 @@ class Browser : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
Browser(QWidget *parent = nullptr);
|
||||
~Browser();
|
||||
explicit Browser(QWidget *parent = nullptr);
|
||||
~Browser() override;
|
||||
|
||||
QSqlError addConnection(const QString &driver, const QString &dbName, const QString &host,
|
||||
const QString &user, const QString &passwd, int port);
|
||||
|
@ -14,8 +14,8 @@ class ConnectionWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ConnectionWidget(QWidget *parent = nullptr);
|
||||
~ConnectionWidget();
|
||||
explicit ConnectionWidget(QWidget *parent = nullptr);
|
||||
~ConnectionWidget() override;
|
||||
|
||||
QSqlDatabase currentDatabase() const;
|
||||
|
||||
|
@ -19,8 +19,8 @@ class QSqlConnectionDialog : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
QSqlConnectionDialog(QWidget *parent = nullptr);
|
||||
~QSqlConnectionDialog();
|
||||
explicit QSqlConnectionDialog(QWidget *parent = nullptr);
|
||||
~QSqlConnectionDialog() override;
|
||||
|
||||
QString driverName() const;
|
||||
QString databaseName() const;
|
||||
|
Loading…
x
Reference in New Issue
Block a user