[PyQt] QDateEdit is ignoring the sip API level 2

Phil Thompson phil at riverbankcomputing.com
Tue Jun 7 11:19:01 BST 2011


On Tue, 7 Jun 2011 10:55:46 +0100, Daniele Esposti <expo at expobrain.net>
wrote:
> This simple example raise an AssertionError because the type of the
> value returned by the QDateEdit.date() property is a QDate instance
> even the sip API level for QDate is set to 2.
> 
> Here the example which triggers the problem:
> 
> 
> #!/usr/bin/env python
> # -*- coding: utf-8 -*-
> 
> import datetime
> import sip
> 
> sip.setapi( "QDate", 2 )
> 
> from PyQt4 import QtGui
> 
> 
> app = QtGui.QApplication( [] )
> 
> assert( isinstance( QtGui.QDateEdit().date(), datetime.date ) )

The only difference in behaviour is the value returned by hash(), see...

http://www.riverbankcomputing.com/static/Docs/PyQt4/html/python_v3.html#qdate

Phil


More information about the PyQt mailing list