I'm trying to upgrade my old Application.. (add it one more function). So, I added one more item in 'File' menu.
<addaction name="actionDownload_Firmware_Image"/>
<action name="actionDownload_Firmware_Image">
<property name="text">
<string>&Download Firmware Image</string>
</property>
<property name="menuRole">
<enum>QAction::ApplicationSpecificRole</enum>
</property>
</action>
Defined my Slot here:
void MainWindow::on_actionDownload_Firmware_Image_triggered()
MainWindow.h>
private slots:
void on_actionDownload_Firmware_Image_triggered();
So, I clean my project, run qmake
, build project... Play it, and I get exactly the same GUI as before, no new Menu item.
When App is run, I get the following message>
QMetaObject::connectSlotsByName: No matching signal for on_actionDownload_Firmware_Image_triggered()
I noticed on other questions on stackoverflow that connectSlotsByName
is not recommended for use, but all of my functions and slots are called exactly the same, so it should work like this.
I'm not sure why this is happening, any help is welcome.
Thanks!
Q_OBJECT
macro in yourMainWindow
declaration. And next time provide an SSCCE with your problem (not only several lines from class defination). – Dmitry Sazonov