def mousePressEvent(self, event): # override middle button paste if event.button() == Qt.MidButton: cb = app.clipboard() item = self.indexAt(event.pos()) if item: item.model().setData(item, QVariant(cb.text(QClipboard.Selection))) else: QTableView.mousePressEvent(self, event)
def mousePressEvent(self, event): # override middle button paste if event.button() == Qt.MidButton: cb = app.clipboard() item = self.indexAt(event.pos()) if item: item.model().setData( item,QVariant(cb.text(QClipboard.Selection))) else: QTableView.mousePressEvent(self, event)
def mousePressEvent(self, event): """Reimplement Qt method""" if event.button() != Qt.LeftButton: QTableView.mousePressEvent(self, event) return index_clicked = self.indexAt(event.pos()) if index_clicked.isValid(): if index_clicked == self.currentIndex() \ and index_clicked in self.selectedIndexes(): self.clearSelection() else: QTableView.mousePressEvent(self, event) else: self.clearSelection() event.accept()
def mousePressEvent(self, event): self.__mousePressed = event.pos() self.__lastMousePos = event.pos() QTableView.mousePressEvent(self, event)