0%

pyqt开发记录

pyqt开发记录
QQ群:397745473

提示:QInputDialog is not defined

1
2
3
4
5
6
7
8
9
---------------------------
eric6 - eric6
---------------------------
<p>The debugged program raised the exception <b>unhandled NameError</b><br>"<b>
global name &#x27;QInputDialog&#x27; 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)

这样就能正常弹出框来了

QQ群:397745473

欢迎关注我的其它发布渠道