QSignalMapper *signalMapper = new QSignalMapper(this); QString tmpStr = "cur"; QAction *act = new QAction(tmpStr, this); ui->menLoad->addAction(act); signalMapper->setMapping(act, QString(tmpStr)); connect(act, SIGNAL(triggered()), signalMapper, SLOT(map())); connect(signalMapper, SIGNAL(mapped(QWidget*)), this, SLOT(loadCustomProject(QWidget*)));
QAction *act = dynamic_cast<QAction*>(widget); act->setText("new");
signalMapper->setMapping(act, QString(tmpStr));
connect(signalMapper, SIGNAL(mapped(QWidget*)), this, SLOT(loadCustomProject(QWidget*)));
signalMapper->setMapping(act, act);