Hi i added context menu to a table widget...
But it is not displaying for table header...what changes i need to do?


my context menu function is:
Qt Code:
  1. void MainWindow::ProvideContextMenu(const QPoint &point)
  2. {
  3. QTableWidgetItem *item=filesTable->itemAt(point);
  4.  
  5.  
  6.  
  7. QPoint globalpos=filesTable->mapToGlobal(point);
  8. QString cell=item->text();
  9. cout<<"EVENT GENERATED..."<<cell.toStdString()<<endl;
  10.  
  11. QAction *pAddAction= new QAction("add",filesTable);
  12. QAction *pSplitAction= new QAction("SPLIT",filesTable);
  13. QMenu *pContextMenu = new QMenu( this);
  14. pContextMenu->addAction(pAddAction);
  15. pContextMenu->addAction(pSplitAction);
  16. pContextMenu->exec(globalpos);
  17.  
  18. }
To copy to clipboard, switch view to plain text mode