feddischson / swig_qt Goto Github PK
View Code? Open in Web Editor NEWExample SWIG definitions for compiling QT wrappers. Just used as an example for some discussions.
Example SWIG definitions for compiling QT wrappers. Just used as an example for some discussions.
Hi @feddischson ,
Many thanks to your qt python swig binding, and it helped me a lot
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
where test_qt_binding.py
is renamed from your example python file.
Here is (part of) the mac error log:
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
It seems something wrong is passed to QCoreApplication::arguments
, but I do not understand why. Any suggestions?
Moreover, I tried to exec. a QCoreApplication
, and it run without segment fault.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.