mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-31 10:55:44 +00:00
Add a static context for connecting Qt signals for python extensions
This commit is contained in:
@@ -673,31 +673,31 @@ int main(int argc, char *argv[])
|
||||
|
||||
py.ctx().setGlobal("pyrenderdoc", (ICaptureContext *)&ctx);
|
||||
|
||||
QObject::connect(
|
||||
&py.ctx(), &PythonContext::exception,
|
||||
[&pythonExited](const QString &type, const QString &value, int, QList<QString> frames) {
|
||||
if(type == lit("SystemExit"))
|
||||
{
|
||||
pythonExited = true;
|
||||
return;
|
||||
}
|
||||
QObject::connect(&py.ctx(), &PythonContext::exception,
|
||||
[&pythonExited](const QString &, const QString &type, const QString &value,
|
||||
int, QList<QString> frames) {
|
||||
if(type == lit("SystemExit"))
|
||||
{
|
||||
pythonExited = true;
|
||||
return;
|
||||
}
|
||||
|
||||
QString exString;
|
||||
QString exString;
|
||||
|
||||
if(!frames.isEmpty())
|
||||
{
|
||||
exString += tr("Traceback (most recent call last):\n");
|
||||
for(const QString &f : frames)
|
||||
exString += QFormatStr(" %1\n").arg(f);
|
||||
}
|
||||
if(!frames.isEmpty())
|
||||
{
|
||||
exString += tr("Traceback (most recent call last):\n");
|
||||
for(const QString &f : frames)
|
||||
exString += QFormatStr(" %1\n").arg(f);
|
||||
}
|
||||
|
||||
exString += QFormatStr("%1: %2\n").arg(type).arg(value);
|
||||
exString += QFormatStr("%1: %2\n").arg(type).arg(value);
|
||||
|
||||
qCritical("%s", exString.toUtf8().data());
|
||||
});
|
||||
qCritical("%s", exString.toUtf8().data());
|
||||
});
|
||||
|
||||
QObject::connect(&py.ctx(), &PythonContext::textOutput,
|
||||
[](bool isStdError, const QString &output) {
|
||||
[](const QString &, bool isStdError, const QString &output) {
|
||||
if(isStdError)
|
||||
qCritical("%s", output.toUtf8().data());
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user