2013-03-25 84 views
1

這是我的代碼:QInputDialog不返回不僅僅是文字

itemnum = QInputDialog.getText(self, "Recall - Item", "Item No.", QLineEdit.Normal, "") 
print itemnum 

它返回(PyQt4.QtCore.QString(u'aa'), True)。我如何得到文本"aa"?是唯一的解決方案來操縱字符串?

+0

'print str(itemnum [0])' – 2013-03-25 20:17:18

+0

Thank you @ A.Rodas .. that do it .. – JoeMicro 2013-03-25 20:44:31

回答

0
>>> from PyQt4.QtCore import QString 
>>> s = QString('Test') 
>>> s 
    PyQt4.QtCore.QString(u'Test') 
>>> str(s) 
    'Test' 
相關問題