I'm trying to make a function that'll show a widget depending on the QWidget passed to it.
I have:
position_widget = new positionWidget();
timing_widget = new timingWidget();
...
void MainWindow::showScreen(QWidget *w)
{
ui->screenWidget->layout()->addWidget(w);
w->show();
}
void MainWindow::doConnects()
{
QObject::connect(buttons_widget, SIGNAL(showPositionScreen_signal()), this, SLOT(showScreen(position_screen)));
QObject::connect(buttons_widget, SIGNAL(showTimingScreen_signal()), this, SLOT(showScreen(timing_screen)));
}
Nothing happens when I click the button and it comes up with 'No such slot MainWindow::ShowScreen(timing_screen)'