Created sub-menus slots won't work
I have created two sub menus in my save button using the code below.
Code:
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()));
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?.
Re: Created sub-menus slots won't work
Did you not forget to use the 'slots' or Q_SLOTS in your header?
Are you slots private perhaps?
Is the slot signature correct?
Re: Created sub-menus slots won't work
Also, check your app console output, Qt will print warning messages if connect statement is not correct (invalid signal / slot names etc).