From 0ee9b6831a4385d8a7b208220ed82ec6bf538b4e Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 6 Mar 2012 22:45:17 +0100 Subject: [PATCH] QtSql: make some constructors explicit This is a semi-automatic search, so I'm reasonably sure that all the exported ones have been caught. Change-Id: I3a79f66f9705bc991175f396138efe3088727a85 Reviewed-by: Mark Brand Reviewed-by: Honglei Zhang --- src/sql/kernel/qsqlfield.h | 4 ++-- src/sql/kernel/qsqlindex.h | 2 +- src/sql/kernel/qsqlquery.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/sql/kernel/qsqlfield.h b/src/sql/kernel/qsqlfield.h index 58dce8b..f5cda7e 100644 --- a/src/sql/kernel/qsqlfield.h +++ b/src/sql/kernel/qsqlfield.h @@ -57,8 +57,8 @@ class Q_SQL_EXPORT QSqlField public: enum RequiredStatus { Unknown = -1, Optional = 0, Required = 1 }; - QSqlField(const QString& fieldName = QString(), - QVariant::Type type = QVariant::Invalid); + explicit QSqlField(const QString& fieldName = QString(), + QVariant::Type type = QVariant::Invalid); QSqlField(const QSqlField& other); QSqlField& operator=(const QSqlField& other); diff --git a/src/sql/kernel/qsqlindex.h b/src/sql/kernel/qsqlindex.h index e3e55b6..0af63ab 100644 --- a/src/sql/kernel/qsqlindex.h +++ b/src/sql/kernel/qsqlindex.h @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE class Q_SQL_EXPORT QSqlIndex : public QSqlRecord { public: - QSqlIndex(const QString &cursorName = QString(), const QString &name = QString()); + explicit QSqlIndex(const QString &cursorName = QString(), const QString &name = QString()); QSqlIndex(const QSqlIndex &other); ~QSqlIndex(); QSqlIndex &operator=(const QSqlIndex &other); diff --git a/src/sql/kernel/qsqlquery.h b/src/sql/kernel/qsqlquery.h index 930bb25..19df1d5 100644 --- a/src/sql/kernel/qsqlquery.h +++ b/src/sql/kernel/qsqlquery.h @@ -62,8 +62,8 @@ class QSqlQueryPrivate; class Q_SQL_EXPORT QSqlQuery { public: - QSqlQuery(QSqlResult *r); - QSqlQuery(const QString& query = QString(), QSqlDatabase db = QSqlDatabase()); + explicit QSqlQuery(QSqlResult *r); + explicit QSqlQuery(const QString& query = QString(), QSqlDatabase db = QSqlDatabase()); explicit QSqlQuery(QSqlDatabase db); QSqlQuery(const QSqlQuery& other); QSqlQuery& operator=(const QSqlQuery& other); -- 2.7.4