I have created two sub menus in my save button using the code below.
QAction *saveAction
= menu
->addAction
("Save New");
QAction *editAction
= menu
->addAction
("Save Edits");
ui.saveButton->setMenu(menu);
connect(saveAction, SIGNAL(triggered()), this, SLOT(saveNew()));
connect(editAction, SIGNAL(triggered()), this, SLOT(saveEdits()));
QMenu *menu = new QMenu(this);
QAction *saveAction = menu->addAction("Save New");
QAction *editAction = menu->addAction("Save Edits");
ui.saveButton->setMenu(menu);
connect(saveAction, SIGNAL(triggered()), this, SLOT(saveNew()));
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?.
Bookmarks