Skip to content

Commit

Permalink
[symbology] Add method for retrieving symbol layers as list
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Nov 24, 2014
1 parent a0c1380 commit fa1e803
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
23 changes: 22 additions & 1 deletion python/core/symbology-ng/qgssymbolv2.sip
Expand Up @@ -54,9 +54,30 @@ class QgsSymbolV2
SymbolType type() const;

// symbol layers handling


/**Returns list of symbol layers contained in the symbol.
* @returns symbol layers list
* @note added in QGIS 2.7
* @see symbolLayer
* @see symbolLayerCount
*/
QgsSymbolLayerV2List symbolLayers();

/**Returns a specific symbol layers contained in the symbol.
* @param layer layer number
* @returns corresponding symbol layer
* @note added in QGIS 2.7
* @see symbolLayers
* @see symbolLayerCount
*/
QgsSymbolLayerV2* symbolLayer( int layer );

/**Returns total number of symbol layers contained in the symbol.
* @returns count of symbol layers
* @note added in QGIS 2.7
* @see symbolLayers
* @see symbolLayer
*/
int symbolLayerCount();

//! insert symbol layer to specified index
Expand Down
21 changes: 21 additions & 0 deletions src/core/symbology-ng/qgssymbolv2.h
Expand Up @@ -80,8 +80,29 @@ class CORE_EXPORT QgsSymbolV2

// symbol layers handling

/**Returns list of symbol layers contained in the symbol.
* @returns symbol layers list
* @note added in QGIS 2.7
* @see symbolLayer
* @see symbolLayerCount
*/
QgsSymbolLayerV2List symbolLayers() { return mLayers; }

/**Returns a specific symbol layers contained in the symbol.
* @param layer layer number
* @returns corresponding symbol layer
* @note added in QGIS 2.7
* @see symbolLayers
* @see symbolLayerCount
*/
QgsSymbolLayerV2* symbolLayer( int layer );

/**Returns total number of symbol layers contained in the symbol.
* @returns count of symbol layers
* @note added in QGIS 2.7
* @see symbolLayers
* @see symbolLayer
*/
int symbolLayerCount() { return mLayers.count(); }

//! insert symbol layer to specified index
Expand Down

0 comments on commit fa1e803

Please sign in to comment.