-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 Answer 1

-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.

1
  • 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). Jan 27, 2021 at 10:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.