api(Deprecated): Remove strong requirement on \deprecated

Because some method (only QgsGeometry::set actually) can be deprecated
only in python, not in C++. But \deprecated triggers the need for Q_DECL_DEPRECATED
This commit is contained in:
Julien Cabieces 2024-12-16 16:48:28 +01:00
parent 51dc2ec2ac
commit 0fdb3508a5
4 changed files with 8 additions and 8 deletions

View File

@ -148,7 +148,7 @@ and a deep copy. Where possible, use :py:func:`~QgsGeometry.constGet` instead.
.. seealso:: :py:func:`set`
%End
void set( QgsAbstractGeometry *geometry /Transfer/ ) /Deprecated="Since 3.0. "/;
void set( QgsAbstractGeometry *geometry /Transfer/ ) /Deprecated/;
%Docstring
Sets the underlying geometry store. Ownership of geometry is transferred.
@ -165,8 +165,6 @@ Sets the underlying geometry store. Ownership of geometry is transferred.
.. seealso:: :py:func:`get`
.. seealso:: :py:func:`constGet`
.. deprecated:: 3.0
%End
bool isNull() const /HoldGIL/;

View File

@ -148,7 +148,7 @@ and a deep copy. Where possible, use :py:func:`~QgsGeometry.constGet` instead.
.. seealso:: :py:func:`set`
%End
void set( QgsAbstractGeometry *geometry /Transfer/ ) /Deprecated="Since 3.0. "/;
void set( QgsAbstractGeometry *geometry /Transfer/ ) /Deprecated/;
%Docstring
Sets the underlying geometry store. Ownership of geometry is transferred.
@ -165,8 +165,6 @@ Sets the underlying geometry store. Ownership of geometry is transferred.
.. seealso:: :py:func:`get`
.. seealso:: :py:func:`constGet`
.. deprecated:: 3.0
%End
bool isNull() const /HoldGIL/;

View File

@ -1200,7 +1200,12 @@ def fix_annotations(line):
# these have no effect (and aren't required) on sip >= 6
replacements[r"SIP_THROW\(\s*([\w\s,]+?)\s*\)"] = ""
replacements[r"\bSIP_DEPRECATED\b"] = f'/Deprecated="{CONTEXT.deprecated_message}"/'
if CONTEXT.deprecated_message:
replacements[r"\bSIP_DEPRECATED\b"] = (
f'/Deprecated="{CONTEXT.deprecated_message}"/'
)
else:
replacements[r"\bSIP_DEPRECATED\b"] = f"/Deprecated/"
for _pattern, replacement in replacements.items():
line = re.sub(_pattern, replacement, line)

View File

@ -227,7 +227,6 @@ class CORE_EXPORT QgsGeometry
*
* \see get()
* \see constGet()
* \deprecated QGIS 3.0
*/
void set( QgsAbstractGeometry *geometry SIP_TRANSFER ) SIP_DEPRECATED;