Don't use copydoc for methods exposed to SIP

Fixes #54429
This commit is contained in:
Nyall Dawson 2024-08-29 09:45:48 +10:00
parent ef00e77537
commit 17bc7d5f6d
16 changed files with 267 additions and 62 deletions

View File

@ -11,7 +11,7 @@ QgsApplication.Sampler = QgsApplication.Cursor.Sampler
QgsApplication.XDR = QgsApplication.endian_t.XDR
QgsApplication.NDR = QgsApplication.endian_t.NDR
try:
QgsApplication.__attribute_docs__ = {'customVariablesChanged': 'Emitted whenever a custom global variable changes.\n', 'nullRepresentationChanged': '\\copydoc :py:func:`~QgsApplication.nullRepresentation`\n', 'requestForTranslatableObjects': 'Emitted when project strings which require translation are being collected for inclusion in a .ts file.\nIn order to register translatable strings, connect to this signal and register the strings within the specified ``translationContext``.\n\n.. versionadded:: 3.4\n', 'localeChanged': 'Emitted when project locale has been changed.\n\n.. versionadded:: 3.22.2\n'}
QgsApplication.__attribute_docs__ = {'customVariablesChanged': 'Emitted whenever a custom global variable changes.\n', 'nullRepresentationChanged': 'Emitted when the string representating the `NULL` value is changed.\n\n.. seealso:: :py:func:`setNullRepresentation`\n\n.. seealso:: :py:func:`nullRepresentation`\n', 'requestForTranslatableObjects': 'Emitted when project strings which require translation are being collected for inclusion in a .ts file.\nIn order to register translatable strings, connect to this signal and register the strings within the specified ``translationContext``.\n\n.. versionadded:: 3.4\n', 'localeChanged': 'Emitted when project locale has been changed.\n\n.. versionadded:: 3.22.2\n'}
except NameError:
pass
QgsApplication.instance = staticmethod(QgsApplication.instance)

View File

@ -4,7 +4,7 @@ try:
except NameError:
pass
try:
QgsMapThemeCollection.__attribute_docs__ = {'mapThemesChanged': 'Emitted when map themes within the collection are changed.\n', 'mapThemeChanged': 'Emitted when a map theme changes definition.\n', 'mapThemeRenamed': 'Emitted when a map theme within the collection is renamed.\n\n.. versionadded:: 3.14\n', 'projectChanged': 'Emitted when the project changes\n\n\\copydoc :py:func:`~QgsMapThemeCollection.project`\n'}
QgsMapThemeCollection.__attribute_docs__ = {'mapThemesChanged': 'Emitted when map themes within the collection are changed.\n', 'mapThemeChanged': 'Emitted when a map theme changes definition.\n', 'mapThemeRenamed': 'Emitted when a map theme within the collection is renamed.\n\n.. versionadded:: 3.14\n', 'projectChanged': 'Emitted when the project changes\n\n.. seealso:: :py:func:`project`\n\n.. seealso:: :py:func:`setProject`\n'}
except NameError:
pass
QgsMapThemeCollection.createThemeFromCurrentState = staticmethod(QgsMapThemeCollection.createThemeFromCurrentState)

View File

@ -63,50 +63,85 @@ of the corresponding properties.
QgsExpressionContextScope expressionContextScope() const;
%Docstring
Returns the expression context scope for the action scope.
An expression scope may offer additional variables for an action scope.
This can be an `field_name` for the attribute which was clicked or
`click_x` and `click_y` for actions which are available as map canvas clicks.
.. seealso:: :py:func:`setExpressionContextScope`
%End
void setExpressionContextScope( const QgsExpressionContextScope &expressionContextScope );
%Docstring
\copydoc :py:func:`~QgsActionScope.expressionContextScope`
Sets the expression context scope for the action scope.
An expression scope may offer additional variables for an action scope.
This can be an `field_name` for the attribute which was clicked or
`click_x` and `click_y` for actions which are available as map canvas clicks.
.. seealso:: :py:func:`expressionContextScope`
%End
QString id() const;
%Docstring
A unique identifier for this action scope.
Returns the unique identifier for this action scope.
.. seealso:: :py:func:`setId`
%End
void setId( const QString &id );
%Docstring
\copydoc :py:func:`~QgsActionScope.id`
Sets the unique ``id`` for this action scope.
.. seealso:: :py:func:`id`
%End
QString title() const;
%Docstring
Returns the action scope's title.
The title is a human readable and translated string that will be
presented to the user in the properties dialog.
.. seealso:: :py:func:`setTitle`
%End
void setTitle( const QString &title );
%Docstring
\copydoc :py:func:`~QgsActionScope.title`
Sets the action scope's ``title``.
The title should be a human readable and translated string that will be
presented to the user in the properties dialog.
.. seealso:: :py:func:`title`
%End
QString description() const;
%Docstring
Returns the action scope's description.
The description should be a longer description of where actions in this scope
are available. It is not necessary to list the available expression variables
in here, they are extracted automatically from the :py:func:`~QgsActionScope.expressionContextScope`.
.. seealso:: :py:func:`setDescription`
%End
void setDescription( const QString &description );
%Docstring
\copydoc :py:func:`~QgsActionScope.description`
Sets the action scope's ``description``.
The description should be a longer description of where actions in this scope
are available. It is not necessary to list the available expression variables
in here, they are extracted automatically from the :py:func:`~QgsActionScope.expressionContextScope`.
.. seealso:: :py:func:`description`
%End
bool isValid() const;
%Docstring
Returns if this scope is valid.
Returns ``True`` if this scope is valid.
%End
Py_hash_t __hash__();
%MethodCode

View File

@ -986,17 +986,32 @@ differently across work stations.
static QString nullRepresentation();
%Docstring
This string is used to represent the value `NULL` throughout QGIS.
Returns the string used to represent the value `NULL` throughout QGIS.
In general, when passing values around, prefer to use a null QVariant
`QVariant( field.type() )` or `QVariant( QVariant.Int )`. This value
should only be used in the final presentation step when showing values
in a widget or sending it to a web browser.
.. note::
In general, when passing values around, prefer to use an invalid QVariant.
The :py:func:`~QgsApplication.nullRepresentation` value should only be used in the final presentation step when showing values
in a widget or sending it to a web browser.
.. seealso:: :py:func:`setNullRepresentation`
.. seealso:: :py:func:`nullRepresentationChanged`
%End
static void setNullRepresentation( const QString &nullRepresentation );
%Docstring
\copydoc :py:func:`~QgsApplication.nullRepresentation`
Sets the string used to represent the value `NULL` throughout QGIS.
.. note::
In general, when passing values around, prefer to use an invalid QVariant.
The :py:func:`~QgsApplication.nullRepresentation` value should only be used in the final presentation step when showing values
in a widget or sending it to a web browser.
.. seealso:: :py:func:`nullRepresentation`
.. seealso:: :py:func:`nullRepresentationChanged`
%End
static QVariantMap customVariables();
@ -1080,10 +1095,13 @@ Emits the signal to collect all the strings of .qgs to be included in ts file
Emitted whenever a custom global variable changes.
%End
void nullRepresentationChanged();
%Docstring
\copydoc :py:func:`~QgsApplication.nullRepresentation`
Emitted when the string representating the `NULL` value is changed.
.. seealso:: :py:func:`setNullRepresentation`
.. seealso:: :py:func:`nullRepresentation`
%End
void requestForTranslatableObjects( QgsTranslationContext *translationContext );

View File

@ -274,12 +274,20 @@ legend items of passed layer tree model.
QgsProject *project();
%Docstring
The :py:class:`QgsProject` on which this map theme collection works.
Returns the :py:class:`QgsProject` on which this map theme collection works.
.. seealso:: :py:func:`setProject`
.. seealso:: :py:func:`projectChanged`
%End
void setProject( QgsProject *project );
%Docstring
\copydoc :py:func:`~QgsMapThemeCollection.project`
Sets the ``project`` on which this map theme collection works.
.. seealso:: :py:func:`project`
.. seealso:: :py:func:`projectChanged`
%End
QList< QgsMapLayer * > masterLayerOrder() const;
@ -322,7 +330,9 @@ Emitted when a map theme within the collection is renamed.
%Docstring
Emitted when the project changes
\copydoc :py:func:`~QgsMapThemeCollection.project`
.. seealso:: :py:func:`project`
.. seealso:: :py:func:`setProject`
%End
};

View File

@ -2282,13 +2282,22 @@ Returns the configuration flags of the field at given index
void setEditorWidgetSetup( int index, const QgsEditorWidgetSetup &setup );
%Docstring
\copydoc editorWidgetSetup
Sets the editor widget ``setup`` for the field at the specified ``index``.
The editor widget setup defines which :py:class:`QgsFieldFormatter` and editor widget will be used
for the field.
.. seealso:: :py:func:`editorWidgetSetup`
%End
QgsEditorWidgetSetup editorWidgetSetup( int index ) const;
%Docstring
Returns the editor widget setup for the field at the specified ``index``.
The editor widget setup defines which :py:class:`QgsFieldFormatter` and editor widget will be used
for the field at `index`.
for the field.
.. seealso:: :py:func:`setEditorWidgetSetup`
%End
virtual QSet<QVariant> uniqueValues( int fieldIndex, int limit = -1 ) const ${SIP_FINAL};

View File

@ -1,6 +1,6 @@
# The following has been generated automatically from src/core/qgsapplication.h
try:
QgsApplication.__attribute_docs__ = {'customVariablesChanged': 'Emitted whenever a custom global variable changes.\n', 'nullRepresentationChanged': '\\copydoc :py:func:`~QgsApplication.nullRepresentation`\n', 'requestForTranslatableObjects': 'Emitted when project strings which require translation are being collected for inclusion in a .ts file.\nIn order to register translatable strings, connect to this signal and register the strings within the specified ``translationContext``.\n\n.. versionadded:: 3.4\n', 'localeChanged': 'Emitted when project locale has been changed.\n\n.. versionadded:: 3.22.2\n'}
QgsApplication.__attribute_docs__ = {'customVariablesChanged': 'Emitted whenever a custom global variable changes.\n', 'nullRepresentationChanged': 'Emitted when the string representating the `NULL` value is changed.\n\n.. seealso:: :py:func:`setNullRepresentation`\n\n.. seealso:: :py:func:`nullRepresentation`\n', 'requestForTranslatableObjects': 'Emitted when project strings which require translation are being collected for inclusion in a .ts file.\nIn order to register translatable strings, connect to this signal and register the strings within the specified ``translationContext``.\n\n.. versionadded:: 3.4\n', 'localeChanged': 'Emitted when project locale has been changed.\n\n.. versionadded:: 3.22.2\n'}
except NameError:
pass
QgsApplication.instance = staticmethod(QgsApplication.instance)

View File

@ -4,7 +4,7 @@ try:
except NameError:
pass
try:
QgsMapThemeCollection.__attribute_docs__ = {'mapThemesChanged': 'Emitted when map themes within the collection are changed.\n', 'mapThemeChanged': 'Emitted when a map theme changes definition.\n', 'mapThemeRenamed': 'Emitted when a map theme within the collection is renamed.\n\n.. versionadded:: 3.14\n', 'projectChanged': 'Emitted when the project changes\n\n\\copydoc :py:func:`~QgsMapThemeCollection.project`\n'}
QgsMapThemeCollection.__attribute_docs__ = {'mapThemesChanged': 'Emitted when map themes within the collection are changed.\n', 'mapThemeChanged': 'Emitted when a map theme changes definition.\n', 'mapThemeRenamed': 'Emitted when a map theme within the collection is renamed.\n\n.. versionadded:: 3.14\n', 'projectChanged': 'Emitted when the project changes\n\n.. seealso:: :py:func:`project`\n\n.. seealso:: :py:func:`setProject`\n'}
except NameError:
pass
QgsMapThemeCollection.createThemeFromCurrentState = staticmethod(QgsMapThemeCollection.createThemeFromCurrentState)

View File

@ -63,50 +63,85 @@ of the corresponding properties.
QgsExpressionContextScope expressionContextScope() const;
%Docstring
Returns the expression context scope for the action scope.
An expression scope may offer additional variables for an action scope.
This can be an `field_name` for the attribute which was clicked or
`click_x` and `click_y` for actions which are available as map canvas clicks.
.. seealso:: :py:func:`setExpressionContextScope`
%End
void setExpressionContextScope( const QgsExpressionContextScope &expressionContextScope );
%Docstring
\copydoc :py:func:`~QgsActionScope.expressionContextScope`
Sets the expression context scope for the action scope.
An expression scope may offer additional variables for an action scope.
This can be an `field_name` for the attribute which was clicked or
`click_x` and `click_y` for actions which are available as map canvas clicks.
.. seealso:: :py:func:`expressionContextScope`
%End
QString id() const;
%Docstring
A unique identifier for this action scope.
Returns the unique identifier for this action scope.
.. seealso:: :py:func:`setId`
%End
void setId( const QString &id );
%Docstring
\copydoc :py:func:`~QgsActionScope.id`
Sets the unique ``id`` for this action scope.
.. seealso:: :py:func:`id`
%End
QString title() const;
%Docstring
Returns the action scope's title.
The title is a human readable and translated string that will be
presented to the user in the properties dialog.
.. seealso:: :py:func:`setTitle`
%End
void setTitle( const QString &title );
%Docstring
\copydoc :py:func:`~QgsActionScope.title`
Sets the action scope's ``title``.
The title should be a human readable and translated string that will be
presented to the user in the properties dialog.
.. seealso:: :py:func:`title`
%End
QString description() const;
%Docstring
Returns the action scope's description.
The description should be a longer description of where actions in this scope
are available. It is not necessary to list the available expression variables
in here, they are extracted automatically from the :py:func:`~QgsActionScope.expressionContextScope`.
.. seealso:: :py:func:`setDescription`
%End
void setDescription( const QString &description );
%Docstring
\copydoc :py:func:`~QgsActionScope.description`
Sets the action scope's ``description``.
The description should be a longer description of where actions in this scope
are available. It is not necessary to list the available expression variables
in here, they are extracted automatically from the :py:func:`~QgsActionScope.expressionContextScope`.
.. seealso:: :py:func:`description`
%End
bool isValid() const;
%Docstring
Returns if this scope is valid.
Returns ``True`` if this scope is valid.
%End
long __hash__();
%MethodCode

View File

@ -986,17 +986,32 @@ differently across work stations.
static QString nullRepresentation();
%Docstring
This string is used to represent the value `NULL` throughout QGIS.
Returns the string used to represent the value `NULL` throughout QGIS.
In general, when passing values around, prefer to use a null QVariant
`QVariant( field.type() )` or `QVariant( QVariant.Int )`. This value
should only be used in the final presentation step when showing values
in a widget or sending it to a web browser.
.. note::
In general, when passing values around, prefer to use an invalid QVariant.
The :py:func:`~QgsApplication.nullRepresentation` value should only be used in the final presentation step when showing values
in a widget or sending it to a web browser.
.. seealso:: :py:func:`setNullRepresentation`
.. seealso:: :py:func:`nullRepresentationChanged`
%End
static void setNullRepresentation( const QString &nullRepresentation );
%Docstring
\copydoc :py:func:`~QgsApplication.nullRepresentation`
Sets the string used to represent the value `NULL` throughout QGIS.
.. note::
In general, when passing values around, prefer to use an invalid QVariant.
The :py:func:`~QgsApplication.nullRepresentation` value should only be used in the final presentation step when showing values
in a widget or sending it to a web browser.
.. seealso:: :py:func:`nullRepresentation`
.. seealso:: :py:func:`nullRepresentationChanged`
%End
static QVariantMap customVariables();
@ -1080,10 +1095,13 @@ Emits the signal to collect all the strings of .qgs to be included in ts file
Emitted whenever a custom global variable changes.
%End
void nullRepresentationChanged();
%Docstring
\copydoc :py:func:`~QgsApplication.nullRepresentation`
Emitted when the string representating the `NULL` value is changed.
.. seealso:: :py:func:`setNullRepresentation`
.. seealso:: :py:func:`nullRepresentation`
%End
void requestForTranslatableObjects( QgsTranslationContext *translationContext );

View File

@ -274,12 +274,20 @@ legend items of passed layer tree model.
QgsProject *project();
%Docstring
The :py:class:`QgsProject` on which this map theme collection works.
Returns the :py:class:`QgsProject` on which this map theme collection works.
.. seealso:: :py:func:`setProject`
.. seealso:: :py:func:`projectChanged`
%End
void setProject( QgsProject *project );
%Docstring
\copydoc :py:func:`~QgsMapThemeCollection.project`
Sets the ``project`` on which this map theme collection works.
.. seealso:: :py:func:`project`
.. seealso:: :py:func:`projectChanged`
%End
QList< QgsMapLayer * > masterLayerOrder() const;
@ -322,7 +330,9 @@ Emitted when a map theme within the collection is renamed.
%Docstring
Emitted when the project changes
\copydoc :py:func:`~QgsMapThemeCollection.project`
.. seealso:: :py:func:`project`
.. seealso:: :py:func:`setProject`
%End
};

View File

@ -2282,13 +2282,22 @@ Returns the configuration flags of the field at given index
void setEditorWidgetSetup( int index, const QgsEditorWidgetSetup &setup );
%Docstring
\copydoc editorWidgetSetup
Sets the editor widget ``setup`` for the field at the specified ``index``.
The editor widget setup defines which :py:class:`QgsFieldFormatter` and editor widget will be used
for the field.
.. seealso:: :py:func:`editorWidgetSetup`
%End
QgsEditorWidgetSetup editorWidgetSetup( int index ) const;
%Docstring
Returns the editor widget setup for the field at the specified ``index``.
The editor widget setup defines which :py:class:`QgsFieldFormatter` and editor widget will be used
for the field at `index`.
for the field.
.. seealso:: :py:func:`setEditorWidgetSetup`
%End
virtual QSet<QVariant> uniqueValues( int fieldIndex, int limit = -1 ) const ${SIP_FINAL};

View File

@ -70,49 +70,85 @@ class CORE_EXPORT QgsActionScope
bool operator==( const QgsActionScope &other ) const;
/**
* Returns the expression context scope for the action scope.
*
* An expression scope may offer additional variables for an action scope.
* This can be an `field_name` for the attribute which was clicked or
* `click_x` and `click_y` for actions which are available as map canvas clicks.
*
* \see setExpressionContextScope()
*/
QgsExpressionContextScope expressionContextScope() const;
/**
* \copydoc expressionContextScope()
* Sets the expression context scope for the action scope.
*
* An expression scope may offer additional variables for an action scope.
* This can be an `field_name` for the attribute which was clicked or
* `click_x` and `click_y` for actions which are available as map canvas clicks.
*
* \see expressionContextScope()
*/
void setExpressionContextScope( const QgsExpressionContextScope &expressionContextScope );
/**
* A unique identifier for this action scope.
* Returns the unique identifier for this action scope.
*
* \see setId()
*/
QString id() const;
//! \copydoc id()
/**
* Sets the unique \a id for this action scope.
*
* \see id()
*/
void setId( const QString &id );
/**
* Returns the action scope's title.
*
* The title is a human readable and translated string that will be
* presented to the user in the properties dialog.
*
* \see setTitle()
*/
QString title() const;
//! \copydoc title()
/**
* Sets the action scope's \a title.
*
* The title should be a human readable and translated string that will be
* presented to the user in the properties dialog.
*
* \see title()
*/
void setTitle( const QString &title );
/**
* Returns the action scope's description.
*
* The description should be a longer description of where actions in this scope
* are available. It is not necessary to list the available expression variables
* in here, they are extracted automatically from the expressionContextScope().
*
* \see setDescription()
*/
QString description() const;
//! \copydoc description()
/**
* Sets the action scope's \a description.
*
* The description should be a longer description of where actions in this scope
* are available. It is not necessary to list the available expression variables
* in here, they are extracted automatically from the expressionContextScope().
*
* \see description()
*/
void setDescription( const QString &description );
/**
* Returns if this scope is valid.
*
* Returns TRUE if this scope is valid.
*/
bool isValid() const;
#ifdef SIP_RUN

View File

@ -964,17 +964,26 @@ class CORE_EXPORT QgsApplication : public QApplication
static QgsLocalizedDataPathRegistry *localizedDataPathRegistry() SIP_KEEPREFERENCE;
/**
* This string is used to represent the value `NULL` throughout QGIS.
* Returns the string used to represent the value `NULL` throughout QGIS.
*
* In general, when passing values around, prefer to use a null QVariant
* `QVariant( field.type() )` or `QVariant( QVariant::Int )`. This value
* should only be used in the final presentation step when showing values
* \note In general, when passing values around, prefer to use an invalid QVariant.
* The nullRepresentation() value should only be used in the final presentation step when showing values
* in a widget or sending it to a web browser.
*
* \see setNullRepresentation()
* \see nullRepresentationChanged()
*/
static QString nullRepresentation();
/**
* \copydoc nullRepresentation()
* Sets the string used to represent the value `NULL` throughout QGIS.
*
* \note In general, when passing values around, prefer to use an invalid QVariant.
* The nullRepresentation() value should only be used in the final presentation step when showing values
* in a widget or sending it to a web browser.
*
* \see nullRepresentation()
* \see nullRepresentationChanged()
*/
static void setNullRepresentation( const QString &nullRepresentation );
@ -1072,9 +1081,11 @@ class CORE_EXPORT QgsApplication : public QApplication
*/
void customVariablesChanged();
/**
* \copydoc nullRepresentation()
* Emitted when the string representating the `NULL` value is changed.
*
* \see setNullRepresentation()
* \see nullRepresentation()
*/
void nullRepresentationChanged();

View File

@ -324,13 +324,18 @@ class CORE_EXPORT QgsMapThemeCollection : public QObject
void applyTheme( const QString &name, QgsLayerTreeGroup *root, QgsLayerTreeModel *model );
/**
* The QgsProject on which this map theme collection works.
* Returns the QgsProject on which this map theme collection works.
*
* \see setProject()
* \see projectChanged()
*/
QgsProject *project();
/**
* \copydoc project()
* Sets the \a project on which this map theme collection works.
*
* \see project()
* \see projectChanged()
*/
void setProject( QgsProject *project );
@ -370,7 +375,8 @@ class CORE_EXPORT QgsMapThemeCollection : public QObject
/**
* Emitted when the project changes
*
* \copydoc project()
* \see project()
* \see setProject()
*/
void projectChanged();

View File

@ -2191,14 +2191,22 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
Qgis::FieldConfigurationFlags fieldConfigurationFlags( int index ) const;
/**
* \copydoc editorWidgetSetup
* Sets the editor widget \a setup for the field at the specified \a index.
*
* The editor widget setup defines which QgsFieldFormatter and editor widget will be used
* for the field.
*
* \see editorWidgetSetup()
*/
void setEditorWidgetSetup( int index, const QgsEditorWidgetSetup &setup );
/**
* The editor widget setup defines which QgsFieldFormatter and editor widget will be used
* for the field at `index`.
* Returns the editor widget setup for the field at the specified \a index.
*
* The editor widget setup defines which QgsFieldFormatter and editor widget will be used
* for the field.
*
* \see setEditorWidgetSetup()
*/
QgsEditorWidgetSetup editorWidgetSetup( int index ) const;