[PyQt] waht`s wrong with qstring

Phil Thompson phil at riverbankcomputing.com
Wed Sep 1 20:02:10 BST 2010


On Wed, 1 Sep 2010 16:39:42 +0800, "king011a" <king011a at 126.com> wrote:
> 2010-09-01 
> 
> 
> 
> king011a 
> Hi
> My development eviroment:
> os: windows xp
> python: python-3.1.2.msi
> pyqt: PyQt-Py3.1-gpl-4.7.4-1.exe
> code:
> import sys    from PyQt4 import QtCore, QtGui    app =
> QtGui.QApplication(sys.argv)    s = QtCore.QString()   
> sys.exit(app.exec_())
> It always show me
> in 'module'
> s = QtCore.QString()
> AttributeError: 'module' object has no attribute 'QString'
> I chaged code:
> import sys    from PyQt4.QtGui import *    from PyQt4.QtCore import *   
> app = QApplication(sys.argv)    s = QString()    sys.exit(app.exec_())
> Then it always show me like this:
> in 'module'
> s = QString()
> NameError: name 'QString' is not defined
> what should i do?

http://www.riverbankcomputing.com/static/Docs/PyQt4/pyqt4ref.html#qstring

Phil


More information about the PyQt mailing list