Hello!

I'm making a program which has many tables, lets say for this post, two tables. So, with the table_1 i want to capture mouse events and do something when left button is pressed and other thing when right button is pressed. To do that i created a class called Table derived from QTableWidget and reimplemented mousepressevent(). I created using Desing a table and promoted it to Table. For this table, everything is working fine.

But now, i want to do the same thing with table_2, but i don't know how to select the context, when i click on the table_1 do this, when i click in the table_2, do that. I wonder if i have to create another class, like Table2, rewrite mousepressevent() and promote table_2 to Table2.

What do you think? What is the best way for doing that?