the slot don't work for QListWidget itemClicked (pyqt)
问题 I create a QListWidget, and I want to connect the itemClicked with my slot. And the following code is OK: when I click the item, the listwidgetclicked has been called from PyQt5.QtWidgets import * from PyQt5.QtCore import * import sys class MainWindow(QMainWindow): def __init__(self, parent=None): super(MainWindow, self).__init__(parent) self.imagelabel = QLabel() layout = QVBoxLayout() self.imagelabel.setLayout(layout) self.setCentralWidget(self.imagelabel) label1 = QLabel('hello, world')