connect(m_mapper, SIGNAL(mapped(QString)), this, SLOT(slotButtonClick(QString)));
发送给自定义的槽函数一个QString,是不是只有上面那一种方法能实现?
自己试了好几种方法,但是报错error: no matching member function for call to ‘connect‘
不会报错呀..你怎么用的
m_mapper = new Mapper;
connect(m_mapper, &Mapper::mapped, this, &MainWindow::do_mapped);
class Mapper : public QObject {
Q_OBJECT
public:
explicit Mapper(QObject *parent = nullptr);
signals:
void mapped(QString);
};
学习。。。。。。。。。。
如果确实有错误:QOverload<QString>::of(&Mapper::mapped)