[PyQt] Bug with latest PyQt4 (4.7.6)

Algis Kabaila akabaila at pcug.org.au
Sun Sep 12 00:09:18 BST 2010


On Saturday 11 September 2010 22:04:59 Alexander Nestorov wrote:
> I wrote a small test/example to show the bug. Here it is:
> 
> ##############################################
> from PyQt4 import *
> from PyQt4.QtCore import *
> from PyQt4.QtGui import *
> 
> print PyQt4.QtCore.PYQT_VERSION_STR
> 
> app = QApplication([""])
> app.setGraphicsSystem("raster")
> ##############################################
> 
> This will print '4.7.6' and then will crash with error:
> AttributeError: 'QApplication' object has no attribute 'setGraphicsSystem'
> 
> This same script runs perfectly with 4.7.4
> Is that a bug in PyQt4? If "yes", how can I fix that? Or when it will be
> fixed?
> 
> Regads
Your example program fails with 
****
Traceback (most recent call last):
  File "./anotherTest.py", line 7, in <module>
    print PyQt4.QtCore.PYQT_VERSION_STR
NameError: name 'PyQt4' is not defined
****
import PyQt4 
fixes the typo for a system with PyQt4 and Qt4 (binaries) from ubuntu 10.04. 
Just gnitpicking...
-- 
OldAl
akabaila at pcug.org.au


More information about the PyQt mailing list