--------------------------- eric6 - eric6 --------------------------- <p>The debugged program raised the exception <b>unhandled NameError</b><br>"<b> global name 'QInputDialog' is not defined</b>"<br>File: <b>E:\python\register\pyqt\001\client.py</b>, Line: <b>131</b></p><p>Break here?</p> --------------------------- &Yes &No ---------------------------
解决方法:
1 2 3 4 5
from PyQt4.QtCore import * from PyQt4.QtGui import *
user_key, ok = self.QInputDialog.getText(self, u'提示标题', u'请输入参数:', self.QLineEdit.Normal, u'框内内容') print unicode(user_key)