Skip to content

Commit bf484da

Browse files
committed
[processing] Allow providers to return path to SVG icon
1 parent b71019d commit bf484da

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

python/core/processing/qgsprocessingprovider.sip

+7
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,16 @@ class QgsProcessingProvider
2020

2121
/**
2222
* Returns an icon for the provider.
23+
* @see svgIcon()
2324
*/
2425
virtual QIcon icon() const;
2526

27+
/**
28+
* Returns a path to an SVG version of the provider's icon.
29+
* @see icon()
30+
*/
31+
virtual QString svgIconPath() const;
32+
2633
/**
2734
* Returns the unique provider id, used for identifying the provider. This string
2835
* should be a unique, short, character only string, eg "qgis" or "gdal". This

src/core/processing/qgsprocessingprovider.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,10 @@
2020

2121
QIcon QgsProcessingProvider::icon() const
2222
{
23-
return QgsApplication::getThemeIcon( "/alg.svg" );
23+
return QgsApplication::getThemeIcon( "/processingAlgorithm.svg" );
24+
}
25+
26+
QString QgsProcessingProvider::svgIconPath() const
27+
{
28+
return QgsApplication::iconPath( "processingAlgorithm.svg" );
2429
}

src/core/processing/qgsprocessingprovider.h

+7
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,16 @@ class CORE_EXPORT QgsProcessingProvider
4848

4949
/**
5050
* Returns an icon for the provider.
51+
* @see svgIcon()
5152
*/
5253
virtual QIcon icon() const;
5354

55+
/**
56+
* Returns a path to an SVG version of the provider's icon.
57+
* @see icon()
58+
*/
59+
virtual QString svgIconPath() const;
60+
5461
/**
5562
* Returns the unique provider id, used for identifying the provider. This string
5663
* should be a unique, short, character only string, eg "qgis" or "gdal". This

0 commit comments

Comments
 (0)