[PyKDE] Re: embedding python widgets in C++ app

Patrick Stinson patrickkidd.lists at gmail.com
Fri Jan 26 07:40:21 GMT 2007


My mail config was a little messed up, so I'm trying to manually
continue this thread.

David: I've copied your code almost exactly, and I'm getting seg
faults in Py_CallObject after copying your call_function() from the
web. The pyDict and callable pointers are both valid... any ideas?

Phil: Why does PyQt4.QtCore still not exist after the following code:

extern "C"
{
  void initsip();
  void initQtCore();
  void initQtGui();
}

int main()
{

      struct _inittab builtin_modules[] = {
	{ "sip", initsip },
	{ "PyQt4.QtCore", initQtCore },
	{ "PyQt4.QtGui", initQtGui },
	{ NULL, NULL }
      };

      PyImport_ExtendInittab(builtin_modules);

      printf("Initializing Python...");
      Py_Initialize();
      printf(" done.\n");

      PyRun_SimpleString("import PyQt4.QtCore");

}

>>> "no module PyQt4.QtCore"

-- 
Patrick Kidd Stinson
http://www.patrickkidd.com/
http://pkaudio.sourceforge.net/
http://pksampler.sourceforge.net/




More information about the PyQt mailing list