Hi,
I want to call a wrapped C++ function from a python script which is not returning immediately (in detail: it is a function which starts a QApplication window and the last line in that function is QApplication->exec()). So after that function call I want to move on to my next line in the python script but on executing this script and the previous line it hangs forever.
In contrast when I manually type my script line for line in the python command line I can go on to my next line after pressing enter a second time on the non-returning function call line.
So how to solve the issue when executing the script?
Thanks!!
Edit:
My python interpreter is embedded in an application. I want to write an extension for this application as a separate Qt4 window. All the python stuff is only for make my graphical plugin accessible per script (per boost.python wrapping).
My python script:
import imp
import os
Plugin = imp.load_dynamic('Plugin', os.getcwd() + 'Plugin.dll')
qt = Plugin.StartQt4() # it hangs here when executing as script
pl = PluginCPP.PluginCPP() # Creates a QMainWindow
pl.ShowWindow() # shows the window
The C++ code for the Qt start function looks like this:
class StartQt4
{
public:
StartQt4()
{
int i = 0;
QApplication* qapp = new QApplication(i, NULL);
qapp->exec();
}
};