title: pyqt开发记录
urlname: 30_python用pyqt开发
author: vsyour
language: zh-CN
date: 2017-05-22 03:03:03
tags: [pyqt,python]
categories: python
pyqt开发记录
QQ群:397745473
提示:QInputDialog is not defined
---------------------------
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
---------------------------
解决方法:
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