Remove an incorrect /Transfer/ annotation, add a missing /Transfer/ annotation

This commit is contained in:
Nyall Dawson 2018-11-27 11:15:30 +10:00
parent 2a03d2b210
commit 6cc41a9474
5 changed files with 19 additions and 9 deletions

View File

@ -221,9 +221,9 @@ Returns the symbol used by the legend node.
.. versionadded:: 2.14
%End
void setSymbol( QgsSymbol *symbol );
void setSymbol( QgsSymbol *symbol /Transfer/ );
%Docstring
Sets the symbol to be used by the legend node. The symbol change is also propagated
Sets the ``symbol`` to be used by the legend node. The symbol change is also propagated
to the associated vector layer's renderer.
:param symbol: new symbol for node. Ownership is transferred.

View File

@ -94,9 +94,13 @@ Key of the parent legend node. For legends with tree hierarchy
Parameter parentRuleKey added in QGIS 2.8
%End
void setSymbol( QgsSymbol *s /Transfer/ );
void setSymbol( QgsSymbol *s );
%Docstring
Sets symbol of the item. Takes ownership of symbol.
Sets the symbol of the item.
Does not take ownership of symbol -- an internal clone is made of the symbol.
.. seealso:: :py:func:`symbol`
%End
void setDataDefinedSizeLegendSettings( QgsDataDefinedSizeLegend *settings /Transfer/ );

View File

@ -214,13 +214,13 @@ class CORE_EXPORT QgsSymbolLegendNode : public QgsLayerTreeModelLegendNode
const QgsSymbol *symbol() const;
/**
* Sets the symbol to be used by the legend node. The symbol change is also propagated
* Sets the \a symbol to be used by the legend node. The symbol change is also propagated
* to the associated vector layer's renderer.
* \param symbol new symbol for node. Ownership is transferred.
* \see symbol()
* \since QGIS 2.14
*/
void setSymbol( QgsSymbol *symbol );
void setSymbol( QgsSymbol *symbol SIP_TRANSFER );
/**
* Returns label of text to be shown on top of the symbol.

View File

@ -72,7 +72,7 @@ bool QgsLegendSymbolItem::isScaleOK( double scale ) const
void QgsLegendSymbolItem::setSymbol( QgsSymbol *s )
{
mSymbol.reset( s );
mSymbol.reset( s ? s->clone() : nullptr );
mOriginalSymbolPointer = s;
}

View File

@ -88,8 +88,14 @@ class CORE_EXPORT QgsLegendSymbolItem
*/
QString parentRuleKey() const { return mParentKey; }
//! Sets symbol of the item. Takes ownership of symbol.
void setSymbol( QgsSymbol *s SIP_TRANSFER );
/**
* Sets the symbol of the item.
*
* Does not take ownership of symbol -- an internal clone is made of the symbol.
*
* \see symbol()
*/
void setSymbol( QgsSymbol *s );
/**
* Sets extra information about data-defined size. If set, this item should be converted to QgsDataDefinedSizeLegendNode