Hey,
I have a small problem:
I want to connect my QPushButtons to a Slot, which needs a int as argument, so I tried:
QObject::connect(Level1, SIGNAL(clicked()), parent, SLOT(StartLevel(1)));
QObject::connect(Level2, SIGNAL(clicked()), parent, SLOT(StartLevel(2)));
QObject::connect(Level3, SIGNAL(clicked()), parent, SLOT(StartLevel(3)));
But as an application output, I get:
Qt Code:
Object::connect: No such slot StartWindow::StartLevel(1) Object::connect: No such slot StartWindow::StartLevel(2) Object::connect: No such slot StartWindow::StartLevel(3)To copy to clipboard, switch view to plain text mode
My Slot in a QMainWindow:
void StartWindow::StartLevel(int _level)
{
Level *level = new Level(_level);
qDebug() << this->focusWidget();
this->setCentralWidget(level);
level->grabKeyboard();
}
Is there a easy way to connect the clicked()-Signal to a Slot, which needs an int-argument?
Thanks for your answer...
nearlyNERD
Bookmarks