From fbf836657f06f2f302aaaf6bb6416f19d979f2aa Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Fri, 18 Jun 2021 05:56:21 +0200 Subject: Doc: Ensure deprecated APIs in Qt Sql are documented as such Added \deprecated + [version_since] where needed Fixes: QTBUG-94585 Pick-to: 6.2 6.1 Change-Id: Id6d1fee1bbb6f8194e90a494673edef34530482b Reviewed-by: Andy Shaw --- src/sql/kernel/qsqlfield.cpp | 36 ++++++++++++++++++------------------ src/sql/models/qsqlquerymodel.cpp | 3 +-- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/src/sql/kernel/qsqlfield.cpp b/src/sql/kernel/qsqlfield.cpp index 65594b35fe..e74ceacd8b 100644 --- a/src/sql/kernel/qsqlfield.cpp +++ b/src/sql/kernel/qsqlfield.cpp @@ -156,9 +156,9 @@ public: /*! \fn QSqlField::QSqlField(const QString &fieldName, QVariant::Type type, const QString &table) - \deprecated Use the constructor using a QMetaType instead. - + \deprecated [6.0] Use the constructor taking a QMetaType instead. \overload + Constructs an empty field called \a fieldName of variant type \a type in \a table. @@ -233,7 +233,7 @@ QSqlField::~QSqlField() /*! Sets the required status of this field to \a required. - \sa requiredStatus(), setType(), setLength(), setPrecision(), + \sa requiredStatus(), setMetaType(), setLength(), setPrecision(), setDefaultValue(), setGenerated(), setReadOnly() */ void QSqlField::setRequiredStatus(RequiredStatus required) @@ -255,7 +255,7 @@ void QSqlField::setRequiredStatus(RequiredStatus required) maximum number of characters the string can hold; the meaning varies for other types. - \sa length(), setType(), setRequiredStatus(), setPrecision(), + \sa length(), setMetaType(), setRequiredStatus(), setPrecision(), setDefaultValue(), setGenerated(), setReadOnly() */ void QSqlField::setLength(int fieldLength) @@ -267,7 +267,7 @@ void QSqlField::setLength(int fieldLength) /*! Sets the field's \a precision. This only affects numeric fields. - \sa precision(), setType(), setRequiredStatus(), setLength(), + \sa precision(), setMetaType(), setRequiredStatus(), setLength(), setDefaultValue(), setGenerated(), setReadOnly() */ void QSqlField::setPrecision(int precision) @@ -279,7 +279,7 @@ void QSqlField::setPrecision(int precision) /*! Sets the default value used for this field to \a value. - \sa defaultValue(), value(), setType(), setRequiredStatus(), + \sa defaultValue(), value(), setMetaType(), setRequiredStatus(), setLength(), setPrecision(), setGenerated(), setReadOnly() */ void QSqlField::setDefaultValue(const QVariant &value) @@ -303,7 +303,7 @@ void QSqlField::setSqlType(int type) QSqlQueryModel and QSqlTableModel will generate SQL for this field. - \sa isGenerated(), setType(), setRequiredStatus(), setLength(), + \sa isGenerated(), setMetaType(), setRequiredStatus(), setLength(), setPrecision(), setDefaultValue(), setReadOnly() */ void QSqlField::setGenerated(bool gen) @@ -396,7 +396,7 @@ QString QSqlField::name() const int or double are usually stored as strings to prevent precision loss. - \sa setType() + \sa setMetaType() */ QMetaType QSqlField::metaType() const { @@ -406,7 +406,7 @@ QMetaType QSqlField::metaType() const /*! Set's the field's variant type to \a type. - \sa type(), setRequiredStatus(), setLength(), setPrecision(), + \sa metaType(), setRequiredStatus(), setLength(), setPrecision(), setDefaultValue(), setGenerated(), setReadOnly() */ void QSqlField::setMetaType(QMetaType type) @@ -419,7 +419,7 @@ void QSqlField::setMetaType(QMetaType type) /*! \fn QVariant::Type QSqlField::type() const - \deprecated Use metaType() instead. + \deprecated [6.0] Use metaType() instead. Returns the field's type as stored in the database. Note that the actual value might have a different type, @@ -432,9 +432,9 @@ void QSqlField::setMetaType(QMetaType type) /*! \fn void QSqlField::setType(QVariant::Type type) - \deprecated Use setMetaType() instead. + \deprecated [6.0] Use setMetaType() instead. - Set's the field's variant type to \a type. + Sets the field's variant type to \a type. \sa setMetaType() */ @@ -443,7 +443,7 @@ void QSqlField::setMetaType(QMetaType type) Returns \c true if the field's value is read-only; otherwise returns false. - \sa setReadOnly(), type(), requiredStatus(), length(), precision(), + \sa setReadOnly(), metaType(), requiredStatus(), length(), precision(), defaultValue(), isGenerated() */ bool QSqlField::isReadOnly() const @@ -469,7 +469,7 @@ void QSqlField::detach() Returns \c true if this is a required field; otherwise returns \c false. An \c INSERT will fail if a required field does not have a value. - \sa setRequiredStatus(), type(), length(), precision(), defaultValue(), + \sa setRequiredStatus(), metaType(), length(), precision(), defaultValue(), isGenerated() */ QSqlField::RequiredStatus QSqlField::requiredStatus() const @@ -483,7 +483,7 @@ QSqlField::RequiredStatus QSqlField::requiredStatus() const If the returned value is negative, it means that the information is not available from the database. - \sa setLength(), type(), requiredStatus(), precision(), defaultValue(), + \sa setLength(), metaType(), requiredStatus(), precision(), defaultValue(), isGenerated() */ int QSqlField::length() const @@ -498,7 +498,7 @@ int QSqlField::length() const If the returned value is negative, it means that the information is not available from the database. - \sa setPrecision(), type(), requiredStatus(), length(), defaultValue(), + \sa setPrecision(), metaType(), requiredStatus(), length(), defaultValue(), isGenerated() */ int QSqlField::precision() const @@ -509,7 +509,7 @@ int QSqlField::precision() const /*! Returns the field's default value (which may be NULL). - \sa setDefaultValue(), type(), requiredStatus(), length(), precision(), + \sa setDefaultValue(), metaType(), requiredStatus(), length(), precision(), isGenerated() */ QVariant QSqlField::defaultValue() const @@ -534,7 +534,7 @@ int QSqlField::typeID() const Returns \c true if the field is generated; otherwise returns false. - \sa setGenerated(), type(), requiredStatus(), length(), precision(), + \sa setGenerated(), metaType(), requiredStatus(), length(), precision(), defaultValue() */ bool QSqlField::isGenerated() const diff --git a/src/sql/models/qsqlquerymodel.cpp b/src/sql/models/qsqlquerymodel.cpp index 2e87c0fb44..674b3f258b 100644 --- a/src/sql/models/qsqlquerymodel.cpp +++ b/src/sql/models/qsqlquerymodel.cpp @@ -420,11 +420,10 @@ void QSqlQueryModel::queryChange() /*! - \deprecated + \deprecated [6.2] Use the \c{setQuery(QSqlQuery &&query)} overload instead. \overload \since 4.5 - Use the \c{setQuery(QSqlQuery &&query)} overload instead. */ void QSqlQueryModel::setQuery(const QSqlQuery &query) { -- cgit v1.2.3