signal和slot的权限

1、signal不需要public, protected, private修饰。signal不需要有定义的函数体,仅仅需要声明即可。

2、slot虽然可以用public,protected,private修饰,这些权限仅仅是作为普通的函数调用时的权限,作为slot时不受这些权限的限制。(Since slots are normal member functions, they follow the normal C++ rules when called directly. However, as slots, they can be invoked by any component, regardless of its access level, via a signal-slot connection. This means that a signal emitted from an instance of an arbitrary class can cause a private slot to be invoked in an instance of an unrelated class.)

你可能感兴趣的:(signal和slot的权限)