Mantid
Loading...
Searching...
No Matches
Signals | Public Member Functions | Protected Member Functions | Private Attributes | List of all members
MantidQt::API::MantidWidget Class Reference

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>

Inheritance diagram for MantidQt::API::MantidWidget:
MantidQt::API::FileFinderWidget MantidQt::MantidWidgets::DataSelector MantidQt::MantidWidgets::IFitScriptGeneratorView MantidQt::MantidWidgets::LogValueSelector MantidQt::MantidWidgets::MuonFitDataSelector MantidQt::MantidWidgets::FitScriptGeneratorView MockFitScriptGeneratorView

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...
 

Detailed Description

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.

Author
Martyn Gigg, Tessella Support Services plc
Date
18/03/2009

Definition at line 27 of file MantidWidget.h.

Constructor & Destructor Documentation

◆ MantidWidget()

MantidWidget::MantidWidget ( QWidget *  parent = nullptr)
protected

Default constructor.

Parameters
parent:: The parent widget

Definition at line 16 of file MantidWidget.cpp.

References m_pyRunner, and runAsPythonScript().

Member Function Documentation

◆ getUserInput()

virtual QVariant MantidQt::API::MantidWidget::getUserInput ( ) const
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.

◆ runAsPythonScript

void MantidQt::API::MantidWidget::runAsPythonScript ( const QString &  code,
bool   
)
signal

Referenced by MantidWidget().

◆ runPythonCode()

QString MantidWidget::runPythonCode ( const QString &  code,
bool  no_output = false 
)
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.

Parameters
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
Returns
output from Python print statements unless no_output is false

Definition at line 29 of file MantidWidget.cpp.

References m_pyRunner, and MantidQt::API::PythonRunner::runPythonCode().

◆ setUserInput()

virtual void MantidQt::API::MantidWidget::setUserInput ( const QVariant &  value)
inlinevirtual

Sets a value on a mantid widget through a common interface.

Parameters
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().

Member Data Documentation

◆ m_pyRunner

PythonRunner MantidQt::API::MantidWidget::m_pyRunner
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().


The documentation for this class was generated from the following files: