Hey there,
I am having some trouble with slots & signals in my program.
my mainView class contains a slot called ‘launchApp’, launchApp accepts a QString as a parameter as you can see below:
void mainView::launchApp(QString appName)
{
if(appName == "music")
{
}
}
meanwhile I have a button in another class called ‘sideBar’. when this button is clicked it calls mainView::launchApp:
connect(launchMusicAppButton, SIGNAL(clicked()), mainView_object_pointer, SLOT(launchApp("music")));
when I run my application I get this error:
QObject::connect: No such slot mainView::launchApp(“music”)
I believe that the problem lies in how I am declaring the parameter of launchApp. How can I have “music” as a parameter of launchApp? It is designed to accept QStrings as you can see above.
Thanks for your help!
↧