QGIS API Documentation
2.0.1-Dufour
|
Utility class for running python commands from various parts of QGIS. More...
#include <qgspythonrunner.h>
Static Public Member Functions | |
static bool | isValid () |
returns true if the runner has an instance (and thus is able to run commands) | |
static bool | run (QString command, QString messageOnError=QString()) |
execute a python statement | |
static bool | eval (QString command, QString &result) |
Eval a python statement. | |
static void | setInstance (QgsPythonRunner *runner) |
assign an instance of python runner so that run() can be used. |
Protected Member Functions | |
QgsPythonRunner () | |
protected constructor: can be instantiated only from children | |
virtual | ~QgsPythonRunner () |
virtual bool | runCommand (QString command, QString messageOnError=QString())=0 |
virtual bool | evalCommand (QString command, QString &result)=0 |
Static Protected Attributes | |
static QgsPythonRunner * | mInstance = NULL |
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.
|
static |
Eval a python statement.
Definition at line 42 of file qgspythonrunner.cpp.
References evalCommand(), mInstance, and QgsDebugMsg.
|
protectedpure virtual |
Referenced by eval().
|
static |
returns true if the runner has an instance (and thus is able to run commands)
Definition at line 23 of file qgspythonrunner.cpp.
References mInstance.
|
static |
execute a python statement
Definition at line 28 of file qgspythonrunner.cpp.
References mInstance, QgsDebugMsg, and runCommand().
Referenced by QgsAttributeDialog::dialogDestroyed(), QgsAttributeDialog::QgsAttributeDialog(), and QgsAttributeAction::runAction().
|
protectedpure virtual |
Referenced by run().
|
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.
References mInstance.
|
staticprotected |
Definition at line 57 of file qgspythonrunner.h.
Referenced by eval(), isValid(), run(), and setInstance().