Skip to content

Commit

Permalink
Remove an incorrect /Transfer/ annotation, add a missing /Transfer/ a…
Browse files Browse the repository at this point in the history
…nnotation
  • Loading branch information
nyalldawson committed Nov 27, 2018
1 parent 2a03d2b commit 6cc41a9
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
Expand Up @@ -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.
Expand Down
Expand Up @@ -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/ );
Expand Down
4 changes: 2 additions & 2 deletions src/core/layertree/qgslayertreemodellegendnode.h
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/core/symbology/qgslegendsymbolitem.cpp
Expand Up @@ -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;
}

Expand Down
10 changes: 8 additions & 2 deletions src/core/symbology/qgslegendsymbolitem.h
Expand Up @@ -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
Expand Down

0 comments on commit 6cc41a9

Please sign in to comment.