def playlistMousePressEvent(self, event): if event.button() == Qt.RightButton: self.pListView.selectionModel().reset() self.playlistShowContextMenu(event) else: if not self.pListView.indexAt(event.pos()).isValid(): self.deselectPlaylistItems() QListView.mousePressEvent(self.pListView, event)
def mousePressEvent(self, event): # 鼠标按住拖动 self.originPosY = event.globalY() self.originPosX = event.globalX() QListView.mousePressEvent(self, event)