Add dox note on symbol ownership in QgsSymbolSelectorWidget class

This commit is contained in:
nirvn 2019-08-26 13:22:33 +07:00 committed by Mathieu Pellerin
parent d26b7abc57
commit 07c871de5f
2 changed files with 15 additions and 6 deletions

View File

@ -37,6 +37,10 @@ Symbol selector widget that can be used to select and build a symbol
:param style: The style used by the widget.
:param vl: The vector layer for the symbol.
:param parent:
.. note::
The ownership of the symbol is not transferred and must exist for the lifetime of the widget.
%End
QMenu *advancedMenu();
@ -72,6 +76,7 @@ Returns the symbol that is currently active in the widget. Can be ``None``.
%End
public slots:
void moveLayerDown();

View File

@ -95,12 +95,13 @@ class GUI_EXPORT QgsSymbolSelectorWidget: public QgsPanelWidget, private Ui::Qgs
// TODO QGIS 4.0 - transfer ownership of symbol to widget!
/**
* Symbol selector widget that can be used to select and build a symbol
* \param symbol The symbol to load into the widget as a start point.
* \param style The style used by the widget.
* \param vl The vector layer for the symbol.
* \param parent
*/
* Symbol selector widget that can be used to select and build a symbol
* \param symbol The symbol to load into the widget as a start point.
* \param style The style used by the widget.
* \param vl The vector layer for the symbol.
* \param parent
* \note The ownership of the symbol is not transferred and must exist for the lifetime of the widget.
*/
QgsSymbolSelectorWidget( QgsSymbol *symbol, QgsStyle *style, QgsVectorLayer *vl, QWidget *parent SIP_TRANSFERTHIS = nullptr );
//! Returns menu for "advanced" button - create it if doesn't exist and show the advanced button
@ -127,10 +128,13 @@ class GUI_EXPORT QgsSymbolSelectorWidget: public QgsPanelWidget, private Ui::Qgs
*/
QgsSymbol *symbol() { return mSymbol; }
// TODO QGIS 4.0 - transfer ownership of symbol to widget!
/**
* Loads the given symbol into the widget.
* \param symbol The symbol to load.
* \param parent The parent symbol layer item. If the parent parameter is null, the whole symbol and model will be reset.
* \note The ownership of the symbol is not transferred and must exist for the lifetime of the widget.
*/
void loadSymbol( QgsSymbol *symbol, SymbolLayerItem *parent = nullptr ) SIP_SKIP;