QT中Lambda表达式

1.

connect(发出者,发送的具体信号(函数地址),[](){
  表达式
})
  connect(ui->actionMotai,&QAction::triggered,[=](){
        //模态对话框
        QDialog dlg(this);
        dlg.resize(300,150);
        dlg.exec();
        qDebug()<<"模态对话框弹出";
    });
posted @ 2021-09-25 12:51  A_Powered  阅读(102)  评论(0编辑  收藏  举报