<div dir="ltr"><p>The code works fine in api v1, if i uncomment the top sip calls, then
it means i'll be using v2, then of course i'll see errors like</p>
<p><code>TypeError: invalid result type from Validator.validate()</code></p>
<p>i know i need to change the return value of .validate() , but if i change it to what pyqt doc says in v2 ,
<a href="http://pyqt.sourceforge.net/Docs/PyQt4/qvalidator.html#validate-2" rel="nofollow">http://pyqt.sourceforge.net/Docs/PyQt4/qvalidator.html#validate-2</a>
,it gives me segmentation fault ( on pyqt 4.6.1, centos 6.3 x64). why?</p>
<p>v2 code works fine on pyqt 4.8 and 4.10 though ( tested on a fedora
19 linux and a windows 7 machine.) is this a bug or what am i missing ?</p>
<p>thanks !</p>
<pre style class=""><code><span class=""><a href="http://pastebin.com/dDeZ52gZ">http://pastebin.com/dDeZ52gZ</a><br> <br><br><br> #!/usr/bin/env python2<br> <br> # api v2<br> import sip<br> sip.setapi('QString', 2)<br>
sip.setapi('QVariant', 2)<br> <br> from PyQt4.QtGui import *<br> from PyQt4.QtCore import *<br> import re,os,sys<br> <br> class MyQComboBox(QComboBox):<br> def __init__(self, parent=None, listing=None):<br>
super(MyQComboBox, self).__init__(parent)<br> <br> if listing != None:<br> self.listSetup(listing)<br> <br> def listSetup(self, listing):<br> self.setEditable(True)<br>
</span></code></pre></div>