[PyQt] sip: how to make a python instance owned by C++ without using a parent

2012-08-13 Thread Mathias . Born
SIP_CPP_HAS_REF that might just achieve that, but there appears to be no official way to use it. Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] sip: how to make a python instance owned by C++ without using a parent

2012-08-14 Thread Mathias . Born
)) { sipResetCppHasRef(sipSelf); Py_DECREF(sipSelf); } Is there an official way for my wrapper to have the SIP_CPP_HAS_REF flag set? It would then automatically dispose its Python counterpart. Best Regards, Mathias Born On 14.08.2012, 10:22:26 Phil Thompson wrote: On Mon

Re: [PyQt] sip: how to make a python instance owned by C++ without using a parent

2012-08-15 Thread Mathias . Born
wrapper to have the SIP_CPP_HAS_REF flag set? It would then automatically dispose its Python counterpart. I could change sipTransferTo() to do this if the owner was Py_None. At the moment this is undocumented behaviour. Would this be sufficient? I believe so. Best Regards, Mathias Born

[PyQt] sip: extend exception support

2012-08-15 Thread Mathias . Born
an additional annotation is necessary to activate this behavior.) I believe an extension like this would make sip a lot more useful for embedding Python into a C++ program. Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http

Re: [PyQt] sip: how to make a python instance owned by C++ without using a parent

2012-08-15 Thread Mathias . Born
? I believe so. Done in hg. Phil Thanks! Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] sip: extend exception support

2012-08-26 Thread Mathias . Born
for embedding Python into a C++ program. Best Regards, Mathias Born Try current hg or tonight's snapshot. See the all_throw_cpp_exception %Module argument and the /ThrowsCppException/ and /NoThrowsCppException/ function annotations. Not heavily tested. That's great! I tried sip-4.13.4-snapshot

Re: [PyQt] sip: extend exception support

2012-08-26 Thread Mathias . Born
On 26.08.2012, 16:07:52 Phil Thompson wrote: On Sun, 26 Aug 2012 14:30:32 +0200, mathias.b...@gmx.de wrote: On 26.08.2012, 16:46:24 Phil Thompson wrote: On Wed, 15 Aug 2012 15:54:11 +0200, mathias.b...@gmx.de wrote: ... Should all be fixed in current hg and tonight's snapshot. Thanks,

Re: [PyQt] sip: how to make a python instance owned by C++ without using a parent

2012-08-27 Thread Mathias . Born
that obj can also be managed by the C++ instance itself, but this can only be achieved by using sipTransferTo. to the documentation of sipConvertToType. Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http

Re: [PyQt] sip: extend exception support

2012-08-27 Thread Mathias . Born
Great! I tested this, works fine. Thank you for providing this feature. Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] sip: add new annotation for specifying ownership of results of virtual methods

2012-09-03 Thread Mathias . Born
implementation of a class method creates a new object that will be owned by the C++ side. Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] sip: template %MappedType doesn't allow /AllowNone/

2012-09-10 Thread Mathias . Born
this limitiation? Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] sip: template %MappedType doesn't allow /AllowNone/

2012-09-13 Thread Mathias . Born
: type_mappings.sip.h:269: Annotation is invalid for templateType %MappedType boost::optionalType /AllowNone/ If this is intended, why this limitiation? Lazy programming on my part - fixed in hg. Phil Great, thanks! Best Regards, Mathias Born ___ PyQt mailing

Re: [PyQt] sip: template %MappedType doesn't allow /AllowNone/

2012-09-17 Thread Mathias . Born
On 17.09.2012, 18:44:19 Phil Thompson wrote: On Mon, 10 Sep 2012 23:31:20 +0200, mathias.b...@gmx.de wrote: Phil, While using /AlloNone/ on a normal mapped type directive like %MappedType boost::optionalfs::path /AllowNone/ works, sip tells me Deprecation warning :

Re: [PyQt] sip: extend exception support

2012-09-17 Thread Mathias . Born
%DefaultVirtualErrorHandle my_handler which should read %DefaultVirtualErrorHandler my_handler In addition, the function type is not void my_handler(sip_gilstate_t, PyObject *); but instead void my_handler(sip_gilstate_t, sipSimpleWrapper*); Best Regards, Mathias Born

Re: [PyQt] sip: template %MappedType doesn't allow /AllowNone/

2012-09-18 Thread Mathias . Born
time right now to look at it, though. Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] sip: template %MappedType doesn't allow /AllowNone/

2012-09-19 Thread Mathias . Born
. But now sip.exe crashes with my sip file. Don't have time right now to look at it, though. Best Regards, Mathias Born I believe you need to add spec-errorhandlers = NULL; to the parse function in parser.y of sipgen (line 4326). This stops sip.exe from crashing for me. Best Regards, Mathias

Re: [PyQt] sip: extend exception support

2012-09-19 Thread Mathias . Born
containes error handlers that look like void sipVEH_ltse_app_defaultVirtualErrorHandler(sip_gilstate_t, PyObject *) And inside other functions they are referred to as, for example extern void sipVEH_ltse_app_defaultVirtualErrorHandler(sip_gilstate_t, PyObject *); Best Regards, Mathias Born

Re: [PyQt] sip: add new annotation for specifying ownership of results of virtual methods

2012-09-21 Thread Mathias . Born
relationships here like in Qt. Just Python objects that can be used in C++ as if they were C++ only. Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] A gobal variable problem in sip

2012-10-24 Thread Mathias . Born
think this is an issue with PyQt. But let me quote Bjarne Stroustrup: C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do it blows your whole leg off. Best Regards, Mathias Born ___ PyQt mailing listPyQt

Re: [PyQt] Help tracking down intermittent segfault using QGraphicsItem

2013-01-05 Thread Mathias . Born
project is slim. On a mailing list such as this one, the best way is to reduce the problem to a self contained, minimum size test case which reproduces the bug. Best Regards, Mathias Born On 05.01.2013, 05:11:10 Lee Harr wrote: I develop a free python turtle graphics application: http

Re: [PyQt] Help tracking down intermittent segfault using QGraphicsItem

2013-01-05 Thread Mathias . Born
where the Python code has to keep references to keep the program going? Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] Help tracking down intermittent segfault using QGraphicsItem

2013-01-05 Thread Mathias . Born
. This would be safer, but sip currently doesn't do that. Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] bug in pyqt's configure.py

2013-01-21 Thread Mathias . Born
, stdout=subprocess.PIPE, stderr=stderr, env=env, universal_newlines=True) However, this most likely will break other parts. Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com

[PyQt] Bug report, compiling latest snapshots against Qt5 on Windows

2013-01-24 Thread Mathias . Born
, but then I get linker errors due to missing symbols from the Qt5Widgets.lib, which the script seems to miss as dependency. Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo

Re: [PyQt] selecting a bezier curve

2013-04-14 Thread Mathias . Born
-chip exclusively. Very fast. Best Regards, Mathias Born On 14.04.2013, 02:15:16 Tom Brown wrote: I've created a simple application (see below) that draws a bezier curve. I want to give the user the ability to select the curve so they can move it around. However, I'm having trouble selecting

[PyQt] faulty PyQt 4.10 Makefile on Windows

2013-04-20 Thread Mathias . Born
# legacy fixed it. But I couldn't figure out which of the build tools put it in there. Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] faulty PyQt 4.10 Makefile on Windows

2013-04-21 Thread Mathias . Born
-everywhere-opensource-src-5.1.0-alpha.7z from http://qt-project.org/wiki/Qt-5.1-Alpha Compiled without errors. Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Re: [PyQt] faulty PyQt 4.10 Makefile on Windows

2013-04-21 Thread Mathias . Born
PyQt ... Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] PyQt5 Snapshot, build problems and their solutions, Windows, mingw

2013-05-12 Thread Mathias . Born
debugging versions of the DLLs get the wrong names. They all miss the trailing _d. This way they can't be imported, unless manually renamed arcordingly. Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http

Re: [PyQt] General questions on parsing large QStrings

2013-05-12 Thread Mathias . Born
, this will use a lot of memory in your case. Best Regards, Mathias Born ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[PyQt] Bug: PyQt5.uic.loadUi() attempts to set non-existing property

2013-06-02 Thread Mathias . Born
' The log_window.ui instantiates a QHBoxLayout, with all margins set to the same value. This makes the uic module try to set a margin property, which doesn't exist. Setting one of the margins (for example leftMargin) to a different value works. Best Regards, Mathias Born log_window.ui

Re: [PyQt] PyQt5 Snapshot, build problems and their solutions, Windows, mingw

2013-07-07 Thread Mathias . Born
. They all miss the trailing _d. This way they can't be imported, unless manually renamed arcordingly. Try tonight's snapshot. Thanks. Using VS2012, it now works out of the box with python 3.3.2 and Qt 5.1. Have not tested the mingw stuff yet. Best Regards, Mathias Born

Re: [PyQt] [SIP] is there a Qt5 example for SIP?

2013-07-07 Thread Mathias . Born
sipTypeDef_hello_MyNamespace (?sipTypeDef_hello_MyNamespace@@3U_pyqt4ClassTypeDef@@A) release\hello.dll : fatal error LNK1120: 1 unresolved externals What's the proper way to describe this to sip? Hi, Are you really compiling and linking all C++ files generated by SIP? Best Regards, Mathias Born

Re: [PyQt] Fwd: Re: c++ app integrate PyQt

2013-10-01 Thread Mathias . Born
Hi, In case you are on M$-WIndows, I'd like to mention a nasty bug in Visual C++ 2012 that took me days to dig out of google: http://bugs.python.org/issue17797 In short: when you embedd the python interpreter into an application compiled as WINDOWS (not as CONSOLE), the operating system