这是我的代码:
itemnum = QInputDialog.getText(self, "Recall - Item", "Item No.", QLineEdit.Normal, "")
print itemnum
返回(PyQt4.QtCore.QString(u'aa'), True)
。我如何获得文字"aa"
?是操纵字符串的唯一解决方案吗?
答案 0 :(得分:0)
>>> from PyQt4.QtCore import QString
>>> s = QString('Test')
>>> s
PyQt4.QtCore.QString(u'Test')
>>> str(s)
'Test'