我收到错误:“RecursionError:调用 Python 对象时超出了最大递归深度”
片段:
def makeLabel():
item = listWidget.currentItem() #RecursionError: maximum recursion depth exceeded while calling a Python object
rect = listWidget.visualItemRect(item)
itemPos = QPoint(rect.x(), rect.y())
imageSize = item.icon().actualSize(QSize(100, 200))
listWidget.takeItem(listWidget.currentRow())
label = MovableLabel(self, 'Pogba.jpg')
pixmap = item.icon().pixmap(imageSize)
label.setPixmap(pixmap)
label.setFixedSize(imageSize)
label.move(itemPos)
label.grabMouse()
label.oldPos = itemPos
label.clicked = False
label.show()
self.players = []
pixmap = QPixmap()
listWidget = QListWidget(self)
listWidget.setViewMode(QListWidget.IconMode)
listWidget.setFixedSize(500, 700)
listWidget.setIconSize(QSize(100, 200))
listWidget.setDragDropMode(listWidget.InternalMove)
listWidget.setFocusPolicy(Qt.NoFocus) #Why no work?
listWidget.itemSelectionChanged.connect(makeLabel)
self.listWidget = listWidget
为什么我会收到此错误?