Mantid
Loading...
Searching...
No Matches
MantidWidget.cpp
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
9
10using namespace MantidQt::API;
11
16MantidWidget::MantidWidget(QWidget *parent) : QWidget(parent), m_pyRunner() {
17 // re-emit the run Python code from m_pyRunner, to work this signal must reach
18 // the slot in QtiPlot
19 connect(&m_pyRunner, SIGNAL(runAsPythonScript(const QString &, bool)), this,
20 SIGNAL(runAsPythonScript(const QString &, bool)));
21}
22
29QString MantidWidget::runPythonCode(const QString &code, bool no_output) {
30 return m_pyRunner.runPythonCode(code, no_output);
31}
PythonRunner m_pyRunner
This object implements the runPythonCode() function, by emitting the code as a runAsPythonScript sign...
Definition: MantidWidget.h:54
void runAsPythonScript(const QString &code, bool)
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 ...
MantidWidget(QWidget *parent=nullptr)
Default constructor.
QString runPythonCode(const QString &code, bool no_output=false)
Run python code.