I think .text() in Python 3.1 with PyQt4 is returning a python 'str'
object, instead of a QString. Try and do type(self.ui.txtText.text())
and see what it returns.
Richard Parker wrote:
I have the following statement in an application that runs fine with
Python 2.6 (and PyQt):
text = self.ui.txtText.text().left(5).toUpper()
In Python 3.1.1 (with PyQt), I get the following error for the first
statement:
" text = self.ui.txtText.text().left(5).toUpper()
AttributeError: 'str' object has no attribute 'left' "
The "ui.txtText.text" object is a QLineEdit object, whose
documentation indicates that its "text()" function returns a QString
object, whose documentatation states that the "left(self, n)" and
"toUpper() functions are supported. What has changed between Python
2.6 and Python 3.1 that would account for this error?
Thanks.
------------------------------------------------------------------------
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
_______________________________________________
PyQt mailing list PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt