コードはこちら
void A::fun()
{
QAction* act = new QAction(this);
QAction* act2 = new QAction(this);
connect(act, QAction::triggered, [this, &act2]() {...; act2.setDisable(true);}
// crash when &act2 is used to capture the variable
// but it is okay using act2 to capture the variable
}
理由は何ですか?ありがとう。