0

Right now I'm connecting a function to a signal:

table.cellClicked.connect(self.cellClick)

and I can access the row and column arguments from the cellClicked signal by simply using them as arguments

def cellClick(self, row, column):
    print("row, column: " + str(row) + ", " + str(column))

However, I want to send in an argument with it:

table.cellClicked.connect(lambda: self.cellClick(idx))

but if I do this, I can't access the row and column variables.

How do I send in additional arguments while also allowing for access to those variables?

Mdev
  • 2,440
  • 2
  • 17
  • 25
  • Use `table.cellClicked.connect(lambda row, column, new_arg=idx: self.cellClick(row, column, new_arg))` – eyllanesc Jun 22 '18 at 03:29
  • @eyllanesc Thank you! Your other answer didn't show up on google for some reason, looked for a while – Mdev Jun 22 '18 at 03:30

0 Answers0