I am trying to implement a customized QTableView integrated to the clipboard:

Qt Code:
  1. #include <QTableView>
  2. #include <QAction>
  3.  
  4. class GeneralTableView : public QTableView
  5. {
  6. Q_OBJECT
  7. public:
  8. explicit GeneralTableView(QWidget *parent = 0);
  9.  
  10. public slots:
  11. void copy();
  12.  
  13. protected:
  14. QAction* copyAction_;
  15. };
  16.  
  17. GeneralTableView::GeneralTableView(QWidget *parent) :
  18. QTableView(parent)
  19. {
  20. copyAction_ = new QAction(this);
  21. copyAction_->setShortcut(QKeySequence::Copy);
  22. connect(copyAction_, SIGNAL(triggered()),
  23. this, SLOT(copy()));
  24. }
To copy to clipboard, switch view to plain text mode 

But copy() does not get executed when I hit ctrl+c. Only some default version of copy gets called. This copies only one cell in the clipboard and doesn't call my copy(). How can I fix this?