Fix PyQGIS documentation for QgsFeature.setAttribute

Fixes #51276
This commit is contained in:
Nyall Dawson 2023-01-03 14:50:03 +10:00
parent d8eac90dff
commit 7297f7aa9e
2 changed files with 4 additions and 8 deletions

View File

@ -529,8 +529,6 @@ Returns the field map associated with the feature.
%Docstring %Docstring
Insert a value into attribute, by field ``name``. Insert a value into attribute, by field ``name``.
Returns ``False`` if field ``name`` could not be matched.
Field map must be associated using :py:func:`~QgsFeature.setFields` before this method can be used. Field map must be associated using :py:func:`~QgsFeature.setFields` before this method can be used.
Calling this method will automatically set the feature as valid (see :py:func:`~QgsFeature.isValid`). Calling this method will automatically set the feature as valid (see :py:func:`~QgsFeature.isValid`).
@ -552,7 +550,7 @@ Alternatively, in Python it is possible to directly set a field's value via the
:param name: The name of the field to set :param name: The name of the field to set
:param value: The value to set :param value: The value to set
:raises KeyError: if the attribute name could not be converted to an index :raises KeyError: if the attribute name could not could not be matched.
.. seealso:: :py:func:`setFields` .. seealso:: :py:func:`setFields`
%End %End
@ -605,7 +603,7 @@ Alternatively, in Python it is possible to directly `del` an attribute via its n
:param name: The name of the field to clear :param name: The name of the field to clear
:raises KeyError: if attribute name could not be converted to index :raises KeyError: if attribute name could not be matched.
.. seealso:: :py:func:`setFields` .. seealso:: :py:func:`setFields`
%End %End

View File

@ -598,8 +598,6 @@ class CORE_EXPORT QgsFeature
/** /**
* Insert a value into attribute, by field \a name. * Insert a value into attribute, by field \a name.
* *
* Returns FALSE if field \a name could not be matched.
*
* Field map must be associated using setFields() before this method can be used. * Field map must be associated using setFields() before this method can be used.
* *
* Calling this method will automatically set the feature as valid (see isValid()). * Calling this method will automatically set the feature as valid (see isValid()).
@ -620,7 +618,7 @@ class CORE_EXPORT QgsFeature
* *
* \param name The name of the field to set * \param name The name of the field to set
* \param value The value to set * \param value The value to set
* \throws KeyError if the attribute name could not be converted to an index * \throws KeyError if the attribute name could not could not be matched.
* \see setFields() * \see setFields()
*/ */
void setAttribute( const QString &name, const QVariant &value / GetWrapper / ); void setAttribute( const QString &name, const QVariant &value / GetWrapper / );
@ -685,7 +683,7 @@ class CORE_EXPORT QgsFeature
* \endcode * \endcode
* *
* \param name The name of the field to clear * \param name The name of the field to clear
* \throws KeyError if attribute name could not be converted to index * \throws KeyError if attribute name could not be matched.
* \see setFields() * \see setFields()
*/ */
bool deleteAttribute( const QString &name ); bool deleteAttribute( const QString &name );