delShortcut = QtGui.QShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Delete), self.listWidget) delShortcut.activated.connect(self.deleteAssetName) def deleteAssetName(self): self.listWidget.takeItem(self.listWidget.currentRow())