def contextEvent(self, event):
        currentWidget = self.searchResultTableIndexs.get(self.currentName)
        if not currentWidget:
            return

        item = currentWidget.itemAt(currentWidget.mapFromGlobal(QCursor.pos()))
        self.menu = QMenu(currentWidget)

        self.menu.addAction(self.actionDownloadSong)

        try:
            self.currentIndex = item.row() - 1
        # 在索引是最后一行时会获取不到。
        except:
            self.currentIndex = -1

        self.menu.exec_(QCursor.pos())
Ejemplo n.º 2
0
    def contextEvent(self, event):
        currentWidget = self.searchResultTableIndexs.get(self.currentName)
        if not currentWidget:
            return

        item = currentWidget.itemAt(currentWidget.mapFromGlobal(QCursor.pos()))
        self.menu = QMenu(currentWidget)

        self.menu.addAction(self.actionDownloadSong)
        
        try:
            self.currentIndex = item.row() - 1
        # 在索引是最后一行时会获取不到。
        except:
            self.currentIndex = -1

        self.menu.exec_(QCursor.pos())
Ejemplo n.º 3
0
    def singsFrameContextMenuEvent(self, event):
        item = self.detailSings.singsTable.itemAt(self.detailSings.singsTable.mapFromGlobal(QCursor.pos()))
        self.menu = QMenu(self.detailSings.singsTable)

        self.menu.addAction(self.actionNextPlay)
        self.menu.addAction(self.actionDownloadSong)
        
        try:
            self.currentIndex = item.row() - 1
        # 在索引是最后一行时会获取不到。
        except:
            self.currentIndex = -1

        self.menu.exec_(QCursor.pos())
Ejemplo n.º 4
0
    def singsFrameContextMenuEvent(self, event):
        item = self.detailSings.singsTable.itemAt(self.detailSings.singsTable.mapFromGlobal(QCursor.pos()))
        self.menu = QMenu(self.detailSings.singsTable)

        self.menu.addAction(self.actionNextPlay)
        self.menu.addAction(self.actionDownloadSong)
        
        try:
            self.currentIndex = item.row() - 1
        # 在索引是最后一行时会获取不到。
        except:
            self.currentIndex = -1

        self.menu.exec_(QCursor.pos())
Ejemplo n.º 5
0
 def mouseReleaseEvent(self, event):
     # 先进行判断,防止误点将鼠标移开后还是会判断为已经点击的尴尬。
     if QCursor.pos() != self.mousePos:
         return
     else:
         self.clicked.emit(self.ids, self.picName)
Ejemplo n.º 6
0
 def mousePressEvent(self, event):
     # 记录下当前鼠标的位置。
     self.mousePos = QCursor.pos()
Ejemplo n.º 7
0
 def mouseReleaseEvent(self, event):
     # 先进行判断,防止误点将鼠标移开后还是会判断为已经点击的尴尬。
     if QCursor.pos() != self.mousePos:
         return
     else:
         self.clicked.emit(self.ids, self.picName)
Ejemplo n.º 8
0
 def mousePressEvent(self, event):
     # 记录下当前鼠标的位置。
     self.mousePos = QCursor.pos()