However, I met a problem with qapplication.
I include your binding in another module, and run your example. here is what I got:
Hey, this also works: It is a <__main__.MyCustomQtClass; proxy of <Swig Object of type 'QObject *' at 0x109e90390> >
<prtex.QString; proxy of <Swig Object of type 'QString *' at 0x109e90690> >
<prtex.QObject; proxy of <Swig Object of type 'QObject *' at 0x109e90360> >
IsWidgetType: False
IsWindowType: False
IsWidgetType: True
IsWindowType: False
[1] 46206 segmentation fault python test_qt_binding.py
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000002b00000000
VM Regions Near 0x2b00000000:
VM_ALLOCATE 00000001159c6000-00000001159c7000 [ 4K] rw-/rwx SM=ALI
-->
STACK GUARD 0000700000000000-0000700000001000 [ 4K] ---/rwx SM=NUL stack guard for thread 1
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libsystem_c.dylib 0x00007fff91c56132 strlen + 18
1 org.qt-project.QtCore 0x000000010c917ac7 QCoreApplication::arguments() + 199
2 libqcocoa.dylib 0x0000000112b392db -[QCocoaApplicationDelegate application:openFiles:] + 251
3 com.apple.AppKit 0x00007fff8d05b0d9 -[NSApplication _doOpenFile:ok:tryTemp:] + 248
4 com.apple.AppKit 0x00007fff8cc0052d -[NSApplication finishLaunching] + 1557
5 com.apple.AppKit 0x00007fff8cbffbbd -[NSApplication run] + 231
6 libqcocoa.dylib 0x0000000112b3652f QCocoaEventDispatcher::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) + 2191
7 org.qt-project.QtCore 0x000000010c9119d1 QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) + 417
8 org.qt-project.QtCore 0x000000010c915e85 QCoreApplication::exec() + 341
9 _prtex.so 0x000000010aa74b61 _wrap_QApplication__exec(_object*, _object*) + 33
10 org.python.python 0x0000000109a1953a PyEval_EvalFrameEx + 27019
11 org.python.python 0x0000000109a129bf PyEval_EvalCodeEx + 1618
12 org.python.python 0x0000000109a12367 PyEval_EvalCode + 48
13 org.python.python 0x0000000109a35d0e run_mod + 53
14 org.python.python 0x0000000109a35db1 PyRun_FileExFlags + 133
15 org.python.python 0x0000000109a35902 PyRun_SimpleFileExFlags + 702
16 org.python.python 0x0000000109a4726d Py_Main + 3101
17 libdyld.dylib 0x00007fff8e6b35ad start + 1
Moreover, I tried to exec. a QCoreApplication
, and it run without segment fault.