From 2692cb0e613e53df78e67a8826295b02d9079f88 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Tue, 22 Sep 2020 16:39:11 +0200 Subject: [PATCH] Doc: Fix QSqlField documentation for deprecated constructor Also, merge constructor overloads, and remove superfluous explicit from a non-converting constructor. Change-Id: I60d0e646d1aaeb8ea66b7598076c3e3ba356c12e Reviewed-by: Paul Wicking --- src/sql/kernel/qsqlfield.cpp | 26 ++------------------------ src/sql/kernel/qsqlfield.h | 9 ++------- 2 files changed, 4 insertions(+), 31 deletions(-) diff --git a/src/sql/kernel/qsqlfield.cpp b/src/sql/kernel/qsqlfield.cpp index 5a3d0a1a23..a4d4309da2 100644 --- a/src/sql/kernel/qsqlfield.cpp +++ b/src/sql/kernel/qsqlfield.cpp @@ -154,17 +154,9 @@ public: \sa requiredStatus() */ -/*! - \fn QSqlField::QSqlField(const QString &fieldName, QVariant::Type type) - - Constructs an empty field called \a fieldName of variant type \a type. - - \sa setRequiredStatus(), setLength(), setPrecision(), setDefaultValue(), - setGenerated(), setReadOnly() -*/ - /*! \fn QSqlField::QSqlField(const QString &fieldName, QVariant::Type type, const QString &table) + \obsolete Use the constructor using a QMetaType instead \overload Constructs an empty field called \a fieldName of variant type \a @@ -175,21 +167,7 @@ public: */ /*! - \fn QSqlField::QSqlField(const QString &fieldName, QVariant::Type type) - - Constructs an empty field called \a fieldName of type \a type. - - \sa setRequiredStatus(), setLength(), setPrecision(), setDefaultValue(), - setGenerated(), setReadOnly() -*/ -QSqlField::QSqlField(const QString &fieldName, QMetaType type) -{ - d = new QSqlFieldPrivate(fieldName, type, QString()); - val = QVariant(QMetaType(type), nullptr); -} - -/*! - \fn QSqlField::QSqlField(const QString &fieldName, QVariant::Type type, const QString &table) + \since 6.0 \overload Constructs an empty field called \a fieldName of type \a diff --git a/src/sql/kernel/qsqlfield.h b/src/sql/kernel/qsqlfield.h index c4acc6a22c..3a133c4e6b 100644 --- a/src/sql/kernel/qsqlfield.h +++ b/src/sql/kernel/qsqlfield.h @@ -56,17 +56,12 @@ public: #if QT_DEPRECATED_SINCE(6,0) QT_DEPRECATED_VERSION_X_6_0("Use the constructor using a QMetaType instead") - explicit QSqlField(const QString& fieldName, QVariant::Type type) - : QSqlField(fieldName, QMetaType(type)) - {} - QT_DEPRECATED_VERSION_X_6_0("Use the constructor using a QMetaType instead") - QSqlField(const QString &fieldName, QVariant::Type type, const QString &tableName) + QSqlField(const QString& fieldName, QVariant::Type type, const QString &tableName = QString()) : QSqlField(fieldName, QMetaType(type), tableName) {} #endif - explicit QSqlField(const QString& fieldName = QString(), QMetaType type = QMetaType()); - QSqlField(const QString &fieldName, QMetaType type, const QString &tableName); + explicit QSqlField(const QString& fieldName = QString(), QMetaType type = QMetaType(), const QString &tableName = QString()); QSqlField(const QSqlField& other); QSqlField& operator=(const QSqlField& other);