-1

I have a QTableWidget, which allows changing the data in a table while the program is running. I would like to know in which row and column the data was changed. There is a default signal cellChanged(int row, int column) but I dont know how to receive the row and column values in a custom slot.

Is there a way to do that?

1 Answers1

-1

For anyone wondering, you need to connect the signal to SLOT using lambda. For example:

self.ui.TW.cellChanged.connect(lambda row, column: on_cellChanged(row, column))

This passes on the value emmited by signal to the slot.

  • Using a lambda like this doesn't make a lot of sense. It's useless, as it's *exactly* the same as doing `self.ui.TW.cellChanged.connect(on_cellChanged)`. – musicamante Jan 27 '21 at 10:40