I have inserted data into a cell displayed by QTableView
if the cell is beeing clicked
it emits a signal to a function that inserts data into that cell
self.tableview.clicked.connect(self.insertdata_onclick)
def insertdata_onclick(self, data):
x = self.tableview.selectionModel().currentIndex().row()
y = self.tableview.selectionModel().currentIndex().column()
self.datamodel.input_data[x][y] = data
self.datamodel.layoutChanged.emit()
# cell selected
# get position of that cell
# change data of that cell
How can I replicate this behavior if the cell is currently selected ?