I thought that PyQt would convert QStrings to Python strings automatically,
but this seems not to be true:

---------------------------------------------------------------------------
import sys
from qt import *

app=QApplication(sys.argv)
vbox=QVBox()

edit=QLineEdit(vbox)
ok=QPushButton('Finish',vbox)
QObject.connect(ok,SIGNAL("clicked()"),app,SLOT("quit()"))
vbox.show()

app.exec_loop()
print int(edit.text())
--------------------------------------------------------------------------

In this code I read a string from a QLineEdit and try to convert it to an
integer but this is not possible as the return value edit.text() is a QString.
(I also get a segmentation fault, who knows, why?)

So how can I convert the QString to a Python string?

TIA,
Janos Blazi

-- 
GMX - Die Kommunikationsplattform im Internet.
http://www.gmx.net

_______________________________________________
PyKDE mailing list    [EMAIL PROTECTED]
http://mats.gmd.de/mailman/listinfo/pykde

Reply via email to