hi all,
i've to make a dll to provide grid functionality (mostly excel type) like cut, copy,paste, redo,undo,add row, delete row.

These functions are there in context menu as well as can use keyboard shortcuts like Ctrl+X for cut etc...

i've inherited the QTableWidget class.

i've implemented context menu also in a dll function and called the function in the main project.

Now i am implementing the context menu functions.

My problem is how to pass the object of table to the grid function on click of context menu.

My project looks like below.



Both upper and lower table are separate pointers (say temp1,temp2) of QGrid type.

I am implementing the delete function.

Following is the code snippet:

Qt Code:
  1. // Constructors. creates the grid with x rows, y columns
  2.  
  3. QGrid::QGrid(int x, int y,QWidget *parent) : QTableWidget(x,y,parent)
  4. {
  5.  
  6. }
  7.  
  8. //Creates context menu in main program
  9.  
  10. void QGrid::setUpContextmenu()
  11. {
  12. addAction(deleterowAct);
  13. setContextMenuPolicy(Qt::ActionsContextMenu);
  14. }
  15.  
  16. void QGrid::createActions()
  17. {
  18. deleterowAct = new QAction(IDS_DELETEROW, this);
  19. deleterowAct->setStatusTip(tr("Delete a row"));
  20. connect(deleterowAct, SIGNAL(triggered()), this, SLOT(deleteTableRow()));
  21. deleterowAct->setEnabled(true);
  22. }
  23.  
  24. // delete row function
  25.  
  26. void QGrid::deleteTableRow()
  27. {
  28. QMessageBox::information(this,"hi","hello");
  29. this->removeRow(this->currentRow());
  30. }
To copy to clipboard, switch view to plain text mode 



The QMessageBox won't popup on cliking the delete and also the function is not working ... how can i pass the grid object (temp1/temp2). i used this pointer instead ... but it doesn't seem to work.

also my other functions will require the pointers.

what can be done ?