QGIS API Documentation
2.18.21-Las Palmas (9fba24a)
|
Utility class for running python commands from various parts of QGIS. More...
#include <qgspythonrunner.h>
Static Public Member Functions | |
static bool | eval (const QString &command, QString &result) |
Eval a python statement. More... | |
static bool | isValid () |
Returns true if the runner has an instance (and thus is able to run commands) More... | |
static bool | run (const QString &command, const QString &messageOnError=QString()) |
Execute a python statement. More... | |
static void | setInstance (QgsPythonRunner *runner) |
Assign an instance of python runner so that run() can be used. More... | |
Protected Member Functions | |
QgsPythonRunner () | |
Protected constructor: can be instantiated only from children. More... | |
virtual | ~QgsPythonRunner () |
virtual bool | evalCommand (QString command, QString &result)=0 |
virtual bool | runCommand (QString command, QString messageOnError=QString())=0 |
Static Protected Attributes | |
static QgsPythonRunner * | mInstance = nullptr |
Utility class for running python commands from various parts of QGIS.
There is no direct python support in the core library, so it is expected that application with python support creates a subclass that implements pure virtual function(s) during the initialization. The static methods will then work as expected.
Added in QGIS v?
Definition at line 29 of file qgspythonrunner.h.
|
protected |
Protected constructor: can be instantiated only from children.
Definition at line 64 of file qgspythonrunner.cpp.
|
protectedvirtual |
Definition at line 68 of file qgspythonrunner.cpp.
Eval a python statement.
Definition at line 42 of file qgspythonrunner.cpp.
|
protectedpure virtual |
|
static |
Returns true if the runner has an instance (and thus is able to run commands)
Definition at line 23 of file qgspythonrunner.cpp.
|
static |
Execute a python statement.
Definition at line 28 of file qgspythonrunner.cpp.
|
protectedpure virtual |
|
static |
Assign an instance of python runner so that run() can be used.
This method should be called during app initialization. Takes ownership of the object, deletes previous instance.
Definition at line 55 of file qgspythonrunner.cpp.
|
staticprotected |
Definition at line 57 of file qgspythonrunner.h.