How does one convert from QString and QBytArray values to plain ascii strings for printing?

I would like to print plain ascii text to a file, based on values I glean from QLineEdit and QDateEdit fields. eg:

self.theLineEdit          = QtGui.QLineEdit()
self.theDateEdit          = QtGui.QDateEdit()
lineStr = self.theLineEdit .text()
dateStr = theDateEdit.text()
outfile.write(lineStr)
outfile.write(dateStr)


This yields:

PyQt4.QtCore.QString(u'foo')
PyQt4.QtCore.QByteArray('5/14/09')

When what I want is:

foo
5/14/09

I've tried using toAscii(), toLatin1(), etc., with no change.

Thanks in advance,
Scott


_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to