Is there any other way of getting PythonQt error handling other than PythonQtScriptingConsole? I'm asking because migrating code from Pyside sometimes requires testing where the QApplication is within the python script and PythonQtScriptingConsole only work when a paint device is present.
Note: On Windows, AllocConsole(); works well with pure C++ Pyhton but fail to do anything with C++ PyhtonQt.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Just enable the Python stdout/err redirection on PythonQt::init() and connect to the signals of PythonQt::self() pythonStdOut/Err. From there you can print to whereever you want.
Another possibility is to not redirect the output and to build a windows "console" application, then the output will be visible in the dos shell.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Greetings,
Is there any other way of getting PythonQt error handling other than PythonQtScriptingConsole? I'm asking because migrating code from Pyside sometimes requires testing where the QApplication is within the python script and PythonQtScriptingConsole only work when a paint device is present.
Note: On Windows, AllocConsole(); works well with pure C++ Pyhton but fail to do anything with C++ PyhtonQt.
Just enable the Python stdout/err redirection on PythonQt::init() and connect to the signals of PythonQt::self() pythonStdOut/Err. From there you can print to whereever you want.
Another possibility is to not redirect the output and to build a windows "console" application, then the output will be visible in the dos shell.
Thank you Florian for your feedback. Would this be a good approach:
QObject::connect(PythonQt::self(), SIGNAL(pythonStdOut(const QString&)), this, SLOT(Print(const QString&)));
Or you have something else in mind?
Note: The second options works but won't be portable.