Qt4的表现是正常的,Qt5应该要编译报错的,但是很不幸,官方做了各种尝试,想让Qt5报错(也就是要禁止楼主在Qt5这么使用信号),但是都失败了。
In Qt 5 we had to change signals from protected to public. This is unfortunate since this mean anyone can emit the signals. We found no way around it
------------------
Qt4以及之前版本,signal都是protected的,这是一个正常的设计。Qt5信号和槽引入的新的语法,由于connect的时候,需要获取信号的地址,signal被迫改成了public,不然将无法编译。