Mantid
|
This is the base class all customised widgets that do not wish to be tied to a specific Mantid algorithm but rather customised for user's requirements. More...
#include <MantidWidget.h>
Signals | |
void | runAsPythonScript (const QString &code, bool) |
Public Member Functions | |
virtual QVariant | getUserInput () const |
Returns a QVariant containing what the widget classes as user input so that input can be returned through a common interface. More... | |
virtual void | setUserInput (const QVariant &value) |
Sets a value on a mantid widget through a common interface. More... | |
Protected Member Functions | |
MantidWidget (QWidget *parent=nullptr) | |
Default constructor. More... | |
QString | runPythonCode (const QString &code, bool no_output=false) |
Run python code that is passed to it and, optionally, return anything it wrote to standard output as a string. More... | |
Private Attributes | |
PythonRunner | m_pyRunner |
This object implements the runPythonCode() function, by emitting the code as a runAsPythonScript signal. More... | |
This is the base class all customised widgets that do not wish to be tied to a specific Mantid algorithm but rather customised for user's requirements.
The virtual function getUserInput() must be implemented to return what the widget considers as user input.
Definition at line 27 of file MantidWidget.h.
|
protected |
Default constructor.
parent | :: The parent widget |
Definition at line 16 of file MantidWidget.cpp.
References m_pyRunner, and runAsPythonScript().
|
inlinevirtual |
Returns a QVariant containing what the widget classes as user input so that input can be returned through a common interface.
Reimplemented in MantidQt::API::FileFinderWidget, and MantidQt::MantidWidgets::MuonFitDataSelector.
Definition at line 34 of file MantidWidget.h.
|
signal |
Referenced by MantidWidget().
|
protected |
Run python code that is passed to it and, optionally, return anything it wrote to standard output as a string.
Run a piece of python code and return any output that it writes to stdout.
code | :: the Python commands to execute |
no_output | :: if set to true this method returns an empty string, if false it returns the output from any Python print statements |
Definition at line 29 of file MantidWidget.cpp.
References m_pyRunner, and MantidQt::API::PythonRunner::runPythonCode().
|
inlinevirtual |
Sets a value on a mantid widget through a common interface.
value | :: The value as a QVariant |
Reimplemented in MantidQt::API::FileFinderWidget, and MantidQt::MantidWidgets::MuonFitDataSelector.
Definition at line 39 of file MantidWidget.h.
References value.
Referenced by MantidQt::API::AlgorithmDialog::setPreviousValue().
|
private |
This object implements the runPythonCode() function, by emitting the code as a runAsPythonScript signal.
Definition at line 54 of file MantidWidget.h.
Referenced by MantidWidget(), and runPythonCode().