Re: [PyQt] how aim same function to other tables

2011-08-24 Thread Josh Stratton
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)

[PyQt] how aim same function to other tables

2011-08-24 Thread Tony Peña
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