Re: [PyQt] [SIP] Segfault with nested template types

2013-07-06 Thread Casper Ti. Vector
Follow up: after replacing code of pia_test() with
 Test.pia.clear();
with everything else unchanged, this issue can still be reproduced.

On Sat, Jul 06, 2013 at 02:04:57AM +0800, Casper Ti. Vector wrote:
 test.h:
  #include qmap.h
  #include qpair.h
  typedef QPairint, int cell;
  struct test { QMapcell, cell pia; };
  extern test Test;
  void pia_test();
 
 test.cpp:
  #include test.h
  using namespace std;
  test Test;
  void pia_test() {
Test.pia[QPairint, int(0, 0)] = QPairint, int(0, 0);
  }
 
 test.sip:
  %Module test
  %ModuleHeaderCode
  #include test.h
  #define sipType_cell sipFindType(cell)
  %End
  %Include qmap.sip // Exactly same file from PyQt4
  %Include qpair.sip// See above
  typedef QPairint, int cell;
  struct test { QMapcell, cell pia; };
  test Test;
  void pia_test();
 
 test.py:
  import test
  print(test.Test.pia)  # An empty dictionary
  test.pia_test()
  print(test.Test.pia)  # Causes a segmentation fault
 
 How can I resolve this kind of issues?
 Is this some kind of bug?
 Thanks very much :)

-- 
My current OpenPGP key:
4096R/0xE18262B5D9BF213A (expires: 2017.1.1)
D69C 1828 2BF2 755D C383 D7B2 E182 62B5 D9BF 213A

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


[PyQt] Issue with PyQt4/5 and Qt 5.1

2013-07-06 Thread Detlev Offenbach
Hello,

today I compiled the Qt 5.1 and built the latest stable releases of PyQt4 
and PyQt5 against it. Now I am not able to start any QProcess. I executed 
the QProcess test program as contained in 
'qtbase/tests/auto/corelib/io/qprocess'. This shows a complete success. 
However, if I execute the demo 'PyQt-gpl-5.0/examples/qtdemo', it doesn't 
work (starting assistant or any of the examples fail). What did I do wrong?

The behavior is identical with PyQt4 and PyQt5.

Regards,
Detlev-- 
*Detlev Offenbach*
det...@die-offenbachs.de
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

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

2013-07-06 Thread brett
Hi Phil,

I am trying to see if SIP will help me with a task I'm trying to solve.  I
started out by trying the More Complex C++ Example in the docs.  However,
I'm using Qt5, and the example is for Qt4.

I see the pyqtconfig is part of Qt4, but not Qt5.  No problem, except
pyqtconfig is pretty integrated into the example, and as a beginner, I'm
not sure how to take pyqtconfig out.

Is there a Qt5 example for SIP?

Thanks!
Brett

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


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

2013-07-06 Thread Phil Thompson
On Sat, 6 Jul 2013 07:30:43 -0700, br...@stottlemyer.com wrote:
 Hi Phil,
 
 I am trying to see if SIP will help me with a task I'm trying to solve. 
I
 started out by trying the More Complex C++ Example in the docs. 
However,
 I'm using Qt5, and the example is for Qt4.
 
 I see the pyqtconfig is part of Qt4, but not Qt5.  No problem, except
 pyqtconfig is pretty integrated into the example, and as a beginner, I'm
 not sure how to take pyqtconfig out.
 
 Is there a Qt5 example for SIP?

Look at the configure.py for PyQt5. A minimal build system would just be a
shell script that invoked sip then the C++ compiler then the linker. The
only thing you need to consider is to use the right -t flags to sip and
these can be found by introspecting current versions of PyQt.

Phil
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] Problems with wrapping complex types using typedefs

2013-07-06 Thread Casper Ti. Vector
For now, aside from directly writing code to wrap
 std::map std::pairint, int, std::vectorunsigned long 
this is the only way that works; either
 #define sipType_cell sipFindType(cell)
 #define sipType_idxx sipFindType(idxx)
 typedef std::pairint, int cell;
 typedef std::vectorunsigned long idxx;
 std::mapcell, idxx Test;
or
 #define sipType_cell sipFindType(cell)
 typedef std::pairint, int cell;
 std::mapstd::pairint, int, idxx Test;
causes segfaults.

However, I still hope for a way to eradicate these disgusting segfaults
without reintroducing those magic numbers in headers.
Phil, could you help me?  Thanks...

On Fri, Jul 05, 2013 at 05:41:21PM +0800, Casper Ti. Vector wrote:
 For example, assuming all example use this header:
  %Module test
  %ModuleHeaderCode
  #include test.h
  %End
  %Include types.sip // Where map, pair and vector are wrapped.
 
 This code:
  std::mapstd::pairint, int, std::vectorunsigned long  Test;
 fails because sip complains:
  sip: Test has an unsupported type - provide %GetCode and %SetCode
 
 while this code:
  typedef std::pairint, int cell;
  typedef std::vectorunsigned long idxx;
  std::mapcell, idxx Test;
 fails because the compiler complains like:
  error: 'sipType_cell' was not declared in this scope
  error: 'sipType_idxx' was not declared in this scope
 
 I searched Google for `python sip typedef' and found this message:
 http://www.riverbankcomputing.com/pipermail/pyqt/2011-January/029111.html
 It seems that adding something like:
  #define sipType_cell sipType_std_pair_1800_1800
  #define sipType_idxx sipType_std_vector_2100
 to the `%ModuleHeaderCode' section make everything runs well.
 
 However, this trick seems quite unreliable because these magic numbers
 (1800, 2100, etc.) might vary from version to version.  So is there any
 elegant way to wrap these types?
 
 In addition, I personally think it is favourable to generate `sipType's
 for typedefs, because this can greatly simplify efforts on wrapping
 complex template types, such as those in my examples.

-- 
My current OpenPGP key:
4096R/0xE18262B5D9BF213A (expires: 2017.1.1)
D69C 1828 2BF2 755D C383 D7B2 E182 62B5 D9BF 213A

___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


Re: [PyQt] PyQt5 module not found

2013-07-06 Thread Dmitry Shachnev
On Fri, Jul 5, 2013 at 10:31 PM, Shriramana Sharma samj...@gmail.com wrote:
 I had to install python3 sphinx using pip to get latest 1.2 which
 works with Py3.3.1 on Raring (Raring-installed Sphinx is not usable
 with Py3: https://bugs.launchpad.net/ubuntu/+source/sphinx/+bug/1184658).
 I hence removed the build-dep on the python3-sphinx package.

 I also manually installed python3-jinja2 and python3-pygments with py3
 sphinx requires.

Ubuntu's Sphinx has python3.3 support patches backported from
upstream, and is capable of building PyQt docs. The traceback in that
bug looks specific to pngmath extension, I will now look if I can fix
that crash.

--
Dmitry Shachnev
___
PyQt mailing listPyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt