def dragMoveEvent(self, event: QDragMoveEvent): if event.mimeData().hasText(): self.curRow = 0 index = self.indexAt(event.pos()) if index.isValid(): if event.pos().y( ) - index.row() * self.itemRowHeight >= self.itemRowHeight / 2: self.curRow = index.row() + 1 else: self.curRow = index.row() else: self.curRow = self.model.rowCount() self.targetRow = self.curRow self.lineLabel.setGeometry( 1, self.headerHeight + self.targetRow * self.itemRowHeight, self.width() - 2, 2) event.acceptProposedAction() return event.ignore() QTableView.dragMoveEvent(self, event)
def dragMoveEvent(self, event: QtGui.QDragMoveEvent) -> None: if event.mimeData().hasUrls(): event.acceptProposedAction()
def dragMoveEvent(self, e: qtg.QDragMoveEvent) -> None: if e.mimeData().hasUrls(): e.acceptProposedAction() else: e.ignore()