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 doe

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

2013-07-07 Thread Mathias . Born
ng symbols: >Creating library release\hello.lib and object release\hello.exp > siphellocmodule.obj : error LNK2001: unresolved external symbol "struct > _pyqt4ClassTypeDef 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 ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt

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

2013-07-07 Thread Mathias . Born
gt; "-lpython33_d" to each Makefile.Debug and "-lpython33" to > Makefile.Release >> solves this. >> >> I tried adding LFLAGS_DEBUG+="-lpython33_d" as parameter to the > configure >> script, but it had >> no effect on the makefiles. >> >> (3) >> The final 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. > 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 ___ 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
uot;set%s%s" % (ascii_upper(prop_name[0]), prop_name[1:]))(prop_value) AttributeError: 'QHBoxLayout' object has no attribute 'setMargin' The log_window.ui instantiates a QHBoxLayout, with all margins set to the same value. This makes the uic module try to set a "marg

Re: [PyQt] General questions on parsing large QStrings

2013-05-12 Thread Mathias . Born
e_AS_UNICODE(obj), qstr.utf16(), qstr.length() * sizeof (Py_UNICODE)); #endif return obj; } As you can see, 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] PyQt5 Snapshot, build problems and their solutions, Windows, mingw

2013-05-12 Thread Mathias . Born
efile.Release solves this. I tried adding LFLAGS_DEBUG+="-lpython33_d" as parameter to the configure script, but it had no effect on the makefiles. (3) The final debugging versions of the DLLs get the wrong names. They all miss the trailing "_d". This way they can't be impo

Re: [PyQt] faulty PyQt 4.10 Makefile on Windows

2013-04-21 Thread Mathias . Born
;>> Phil >> >> The official "qt-everywhere-opensource-src-5.1.0-alpha.7z" from >> http://qt-project.org/wiki/Qt-5.1-Alpha >> >> Compiled without errors. > ...so a Qt bug. > Phil I find that very strange. Are you saying that

Re: [PyQt] faulty PyQt 4.10 Makefile on Windows

2013-04-21 Thread Mathias . Born
> >> Manually removing all "# legacy" fixed it. But I couldn't figure out > which >> of the >> build tools put it in there. > That will come from Qt. Which version of Qt? > Phil The official "qt-everywhere-opensource-src-5.1.0-alpha.7z" from h

[PyQt] faulty PyQt 4.10 Makefile on Windows

2013-04-20 Thread Mathias . Born
moving all "# 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] selecting a bezier curve

2013-04-14 Thread Mathias . Born
drawn by the 3D-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,

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

2013-01-24 Thread Mathias . Born
if sys.platform.startswith("linux") and qt_version >= 0x05: lib = "Qt5" + lib[2:] However, my Qt5 build created libraries named "Qt5Gui.lib" and so on, not "QtGui4.lib". If I replace lib = lib + "4" b

[PyQt] bug in pyqt's configure.py

2013-01-21 Thread Mathias . Born
t; in line 1401: p = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=stderr, env=env, universal_newlines=True) However, this most likely will break other parts. Best Regards, Mathias Born

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

2013-01-05 Thread Mathias . Born
the cyclic garbage collector." (from the docs) If "statusbar" were given an extra reference to "window", the crash could be avoided, but then "del window" would not delete the window anymore. 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

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

2013-01-05 Thread Mathias . Born
e a crash. Is there any place in PyQt 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
o debugg your entire 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 graph

Re: [PyQt] A gobal variable problem in sip

2012-10-24 Thread Mathias . Born
variable "static int i", which ought to be different. The names of these objects, which are both "i", come into existence at different times. While this is perfectly legal C++, it obviously obfuscates your program. Just naming them differently should a

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

2012-09-21 Thread Mathias . Born
to get hold of the wrapper instance. This instance is then used in the C++ code. It transparently forwards method calls to the Python part. (That's why it was so important to have the wrapper "re-throw" Python exceptions as C++ exceptions.) Thanks to "sipTransfer(obj, Py_None)"

Re: [PyQt] sip: extend exception support

2012-09-19 Thread Mathias . Born
working properly anymore. sip.h declares typedef void (*sipVirtErrorHandlerFunc)(struct _sipSimpleWrapper *); but the generated code 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 ___ 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
ve, and > hg identify > says "6d704a7ab6c5 tip". > 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

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

2012-09-18 Thread Mathias . Born
ith my sip file. Don't have 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: extend exception support

2012-09-17 Thread Mathias . Born
omments: In the docs about the "%DefaultVirtualErrorHandler" directive, there is a typo %DefaultVirtualErrorHandle my_handler which should read %DefaultVirtualErrorHandler my_handler In addition, the function type is not void my_handler(sip_gilstate_t, PyObject

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::optional /AllowNone/ >> >> works, sip tells me >> >> Deprecation warning : type_map

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

2012-09-13 Thread Mathias . Born
orks, sip tells me >> >> Deprecation warning : type_mappings.sip.h:269: Annotation is invalid >> >> for >> >> template >> %MappedType boost::optional /AllowNone/ >> >> If this is intended, why this limitiation

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

2012-09-10 Thread Mathias . Born
? 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
C++ function creates a new object that will be owned by the Python side. I'd like to have another annotation which tells sip that the Python 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

Re: [PyQt] sip: extend exception support

2012-08-27 Thread Mathias . Born
rror(pythonExceptionToText()); >> %End >> >> which would follow the %Module directive to define the body of an >> error handler function which is called instead of "throw > SIPPyException()". >> >> Best Regards, >> Mathias > In current hg... > %Virtua

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

2012-08-27 Thread Mathias . Born
oType", > who >> would guess that Py_None has such a different meaning? >> >> How about adding a corresponding hint to the documentation >> of "sipConvertToType"? > I'm not sure that adding documentation to something about what

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. > T

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

2012-08-26 Thread Mathias . Born
How about adding a corresponding hint to the documentation of "sipConvertToType"? 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
PyException" (derived from >> std::exception), which becomes part of the API and is always used >> in such cases. >> In order not to break existing code, it would only be used in >> classes or methods which are annotated appropriately. >> (So an

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

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

[PyQt] sip: extend exception support

2012-08-15 Thread Mathias . Born
re annotated appropriately. (So 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 _

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

2012-08-15 Thread Mathias . Born
t;> What about: >> >> if (sipCppHasRef(sipSelf)) >> { >> 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. > 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 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
== What about: if (sipCppHasRef(sipSelf)) { 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

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

2012-08-13 Thread Mathias . Born
age the Python part myself. In the sip sources, I can see a flag "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

pyqt@riverbankcomputing.com

2011-06-01 Thread Mathias . Born
Hi, During my first steps with SIP I discovered that it accepts function parameters like void example_function(const T&); but not void example_function(T const&); It would be nice if SIP supported this, too. Best Regards, Mathias Born