I want to use MousePressEvent but I dont know how I need to create the files...(main.cpp, ProjectQt.cpp,ProjectQt.h)

Anyone help me to run MousePressEvent on a QTableWidget application. for example I found the event method but I dont know how I can run the method.

Qt Code:
  1. void mousePressEvent ( QMouseEvent * event ){
  2. if(event->button() == Qt::LeftButton){
  3.  
  4. }
  5. }
To copy to clipboard, switch view to plain text mode 

Anyone help me?