File tree Expand file tree Collapse file tree 3 files changed +59
-1
lines changed Expand file tree Collapse file tree 3 files changed +59
-1
lines changed Original file line number Diff line number Diff line change 26
26
27
27
// /@cond PRIVATE
28
28
29
+ QgsNativeAlgorithms::QgsNativeAlgorithms ( QObject *parent )
30
+ : QgsProcessingProvider( parent )
31
+ {}
32
+
33
+ QIcon QgsNativeAlgorithms::icon () const
34
+ {
35
+ return QgsApplication::getThemeIcon ( QStringLiteral ( " /providerQgis.svg" ) );
36
+ }
37
+
38
+ QString QgsNativeAlgorithms::svgIconPath () const
39
+ {
40
+ return QgsApplication::iconPath ( QStringLiteral ( " providerQgis.svg" ) );
41
+ }
42
+
43
+ QString QgsNativeAlgorithms::id () const
44
+ {
45
+ return QStringLiteral ( " native" );
46
+ }
47
+
48
+ QString QgsNativeAlgorithms::name () const
49
+ {
50
+ return tr ( " QGIS" );
51
+ }
52
+
53
+ bool QgsNativeAlgorithms::supportsNonFileBasedOutput () const
54
+ {
55
+ return true ;
56
+ }
57
+
58
+ void QgsNativeAlgorithms::loadAlgorithms ()
59
+ {
60
+ addAlgorithm ( new QgsCentroidAlgorithm () );
61
+ addAlgorithm ( new QgsBufferAlgorithm () );
62
+ }
63
+
64
+
65
+
29
66
QgsCentroidAlgorithm::QgsCentroidAlgorithm ()
30
67
{
31
68
addParameter ( new QgsProcessingParameterVector ( QStringLiteral ( " INPUT" ), QObject::tr ( " Input layer" ) ) );
Original file line number Diff line number Diff line change 21
21
#include " qgis_core.h"
22
22
#include " qgis.h"
23
23
#include " qgsprocessingalgorithm.h"
24
+ #include " qgsprocessingprovider.h"
24
25
25
26
// /@cond PRIVATE
26
27
28
+ class QgsNativeAlgorithms : public QgsProcessingProvider
29
+ {
30
+ public:
31
+
32
+ QgsNativeAlgorithms ( QObject *parent = nullptr );
33
+
34
+ QIcon icon () const override ;
35
+ QString svgIconPath () const override ;
36
+ QString id () const override ;
37
+ QString name () const override ;
38
+ bool supportsNonFileBasedOutput () const override ;
39
+
40
+ protected:
41
+
42
+ void loadAlgorithms () override ;
43
+
44
+ };
45
+
27
46
/* *
28
47
* Native centroid algorithm.
29
48
*/
@@ -54,7 +73,7 @@ class QgsBufferAlgorithm : public QgsProcessingAlgorithm
54
73
55
74
QgsBufferAlgorithm ();
56
75
57
- QString name () const override { return QStringLiteral ( " fixeddistancebuffer " ); }
76
+ QString name () const override { return QStringLiteral ( " buffer " ); }
58
77
QString displayName () const override { return QObject::tr ( " Buffer" ); }
59
78
virtual QStringList tags () const override { return QObject::tr ( " buffer,grow" ).split ( ' ,' ); }
60
79
QString group () const override { return QObject::tr ( " Vector geometry tools" ); }
Original file line number Diff line number Diff line change 40
40
41
41
#include " gps/qgsgpsconnectionregistry.h"
42
42
#include " processing/qgsprocessingregistry.h"
43
+ #include " processing/qgsnativealgorithms.h"
43
44
44
45
#include < QDir>
45
46
#include < QFile>
@@ -1578,6 +1579,7 @@ QgsApplication::ApplicationMembers::ApplicationMembers()
1578
1579
mGpsConnectionRegistry = new QgsGPSConnectionRegistry ();
1579
1580
mPluginLayerRegistry = new QgsPluginLayerRegistry ();
1580
1581
mProcessingRegistry = new QgsProcessingRegistry ();
1582
+ mProcessingRegistry ->addProvider ( new QgsNativeAlgorithms ( mProcessingRegistry ) );
1581
1583
mAnnotationRegistry = new QgsAnnotationRegistry ();
1582
1584
}
1583
1585
You can’t perform that action at this time.
0 commit comments