我正在尝试使用pip安装PyQt包,但是我收到此错误:
~$ pip install PyQt
Downloading/unpacking PyQt
Downloading PyQt-x11-gpl-4.8.3.tar.gz
(9.8Mb): 9.8Mb downloaded Running
setup.py egg_info for package PyQt
Traceback (most recent call last):
File "<string>", line 14, in <module>
IOError: [Errno 2] No such file or directory:
'/home/john/build/PyQt/setup.py'
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 14, in
<module>
IOError: [Errno 2] No such file or
directory:
'/home/john/build/PyQt/setup.py
---------------------------------------- Command python setup.py egg_info
failed with error code 1 Storing
complete log in
/home/john/.pip/pip.log
Run Code Online (Sandbox Code Playgroud) 我在我的应用程序中有QListWidget,我需要从QListWidget获取项目的字符串值,用户双击该项目(激活项目).
QtCore.QObject.connect(self.ui.listWidget, QtCore.SIGNAL("itemActivated (QListWidgetItem *)"), self.cas_dialog_spust)
def cas_dialog_spust(self):
predmet = QtGui.QListWidget.currentItem(QtGui.QListWidget())
print(predmet)
strpredmet = QtGui.QListWidgetItem.text(QtGui.QListWidgetItem(predmet))
print(strpredmet)
Run Code Online (Sandbox Code Playgroud)
当我实际运行它时,我双击QListWidget中的Item,predmet是None,我真的不知道为什么.