I have created two sub menus in my save button using the code below.

Qt Code:
  1. QMenu *menu = new QMenu(this);
  2.  
  3. QAction *saveAction = menu->addAction("Save New");
  4. QAction *editAction = menu->addAction("Save Edits");
  5.  
  6. ui.saveButton->setMenu(menu);
  7.  
  8. connect(saveAction, SIGNAL(triggered()), this, SLOT(saveNew()));
  9. connect(editAction, SIGNAL(triggered()), this, SLOT(saveEdits()));
To copy to clipboard, switch view to plain text mode 

The project compiles without any errors but when i click any of the sub-menus i have created,the saveAction or the editAction slots won't execute.

What i am i doing wrong?.