qt里.h文件中槽函数定义为
void changedFont(const QFont &f);
在cpp文件中
connect(fontcombo[0], SIGNAL(currentFontChanged(QFont)), this, SLOT(changedFont(const QFont &)));
connect 这么写可以编译通过,但是
connect(fontcombo[0], SIGNAL(currentFontChanged(QFont)), this, SLOT(changedFont(const QFont &f)));
connect 这么写却不可以通过,这是为什么?
两者区别就是 const QFont & 和 const QFont &f
求牛人指教~~
不应该吧,connect的SIGNAL SLOT内部不做语法检测,编译应该不报错吧