MCPcopy Create free account
hub / github.com/baldurk/renderdoc / RunScript

Method RunScript

qrenderdoc/Windows/PythonShell.cpp:1062–1090  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1060}
1061
1062void PythonShell::RunScript()
1063{
1064 PythonContext *context = newContext();
1065
1066 ANALYTIC_SET(UIFeatures.PythonInterop, true);
1067
1068 ui->outputHelpTabs->setCurrentIndex(0);
1069
1070 ui->scriptOutput->clear();
1071
1072 QString script = QString::fromUtf8(scriptEditor->getText(scriptEditor->textLength() + 1));
1073
1074 enableButtons(false);
1075
1076 LambdaThread *thread = new LambdaThread([this, script, context]() {
1077 scriptContext = context;
1078 context->executeString(lit("script.py"), script);
1079 scriptContext = NULL;
1080
1081 GUIInvoke::call(this, [this, context]() {
1082 context->Finish();
1083 enableButtons(true);
1084 });
1085 });
1086
1087 thread->setName(lit("Python script"));
1088 thread->selfDelete(true);
1089 thread->start();
1090}
1091
1092void PythonShell::on_execute_clicked()
1093{

Callers 1

BeginMethod · 0.80

Calls 9

getTextMethod · 0.80
textLengthMethod · 0.80
executeStringMethod · 0.80
selfDeleteMethod · 0.80
fromUtf8Function · 0.50
clearMethod · 0.45
FinishMethod · 0.45
setNameMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected