Can you pull the table name out of the event object? Another option
is to make a unique function for each table, which calls the addFriend
function itself with the table name. That way you won't have to
duplicate addFriend code.
example:
addFriend(event, table):
def table1AddFriend(event)
hi I want to use same function to other tables like this
tablename = Searchtable but could be table1 table2 table3 ... table n
addAction.triggered.connect(self.addFriend) <- This works ok def addFriend(
self, event): tablename = 'SearchtableWidget' table_obj = getattr(self.ui,
tablename) cu