0

为什么我会得到这个

Object::connect: No such slot Ide::on_action_Exit_triggered(index)
Object::connect:  (sender name:   'actionClose_Project')
Object::connect:  (receiver name: 'Ide')

当我尝试这个时:

connect(this->ui->actionClose_Project, SIGNAL(triggered()), this, SLOT(on_action_Exit_triggered(index)));

void Ide::on_action_Exit_triggered(int index)
{
  qDebug()<<"test\n";
}

谢谢你。

4

1 回答 1

4

Please insert prototype of function like this :

connect(this->ui->actionClose_Project, SIGNAL(triggered()), this, SLOT(on_action_Exit_triggered(int)));

This format you use isn't common to use slot. the signal and slot should be same in parameters.

于 2012-05-07T18:58:40.710 回答