解决办法:
方法一:利用函数指针
语法:
//类名:ImgProcessor
//槽函数
void ShowNewFile();
void ShowNewFile(QString fileName);
//无参函数指针
void (ImgProcessor:: *showNewFilePtr)() = &ImgProcessor::ShowNewFile;
//有参函数指针
void (ImgProcessor:: *showNewFileStringPtr)(QString) = &ImgProcessor::ShowNewFile;
//菜单项
NewFileAction = new QAction("新建",this);
//信号槽连接
connect( NewFileAction, &QAction::triggered, this, showNewFilePtr);
方法二:利用C++的类型转换
语法:static_cast<type>(expression)
static_cast<void(QComboBox::*)(int)>(&QComboBox::activated)