QT connect 的信号,不能写类名

这样不行

connect(copyAction, SIGNAL(QAction::triggered(bool)), this, SLOT(CopyMessage()));

这样可以

connect(copyAction, SIGNAL(triggered(bool)), this, SLOT(CopyMessage()));

想写类名可以用这种方式,注意 slot 前面的 & 不要遗漏。

connect(copyAction, &QAction::triggered, this, &this_gui_class::CopyMessage);

 

posted on 2020-10-23 10:04  liujx2019  阅读(268)  评论(0编辑  收藏  举报

导航