[symbology] Add method for retrieving symbol layers as list

This commit is contained in:
Nyall Dawson 2014-11-24 20:44:33 +11:00
parent a0c1380e79
commit fa1e8032e7
2 changed files with 42 additions and 0 deletions

View File

@ -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

View File

@ -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