Add support for reading state
This commit is contained in:
parent
1eac3f6a83
commit
4c2a4790c0
12 changed files with 163 additions and 103 deletions
|
|
@ -16,7 +16,7 @@ PythonRunner::~PythonRunner() {
|
|||
}
|
||||
}
|
||||
|
||||
void PythonRunner::runScript(const QString& scriptContent) {
|
||||
bool PythonRunner::runScript(const QString& scriptContent) {
|
||||
if (m_process->state() == QProcess::Running) {
|
||||
m_process->terminate();
|
||||
m_process->waitForFinished(1000);
|
||||
|
|
@ -24,6 +24,8 @@ void PythonRunner::runScript(const QString& scriptContent) {
|
|||
|
||||
m_outputWidget->clear();
|
||||
m_process->start("python3", QStringList() << "-u" << "-c" << scriptContent);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void PythonRunner::stopScript() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue