简体   繁体   中英

QInputDialog does not return just text

This is my code:

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

It returns (PyQt4.QtCore.QString(u'aa'), True) . How do i get just the text "aa" ? Is the only solution to manipulate the string?

>>> from PyQt4.QtCore import QString
>>> s = QString('Test')
>>> s
    PyQt4.QtCore.QString(u'Test')
>>> str(s)
    'Test'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM