QSocketNotifier 信号具有与分配的插槽不同的签名
QSocketNotifier signal has a different signature than the assigned slot
即激活的 QSocketNotifier 信号如何具有与以下代码中分配的插槽不同的签名
connect(my_skt_read_notifier, SIGNAL(activated(int)), this, SLOT(skt_process_rcv()));
我的印象是信号和槽应该具有相同的签名,对吗?
notifier中的int参数表示什么?
来自Qt docs:
The signature of a signal must match the signature of the receiving
slot. (In fact a slot may have a shorter signature than the signal it
receives because it can ignore extra arguments.)...
因此,在您的情况下它也应该有效,因为插槽的参数少于连接的信号。
即激活的 QSocketNotifier 信号如何具有与以下代码中分配的插槽不同的签名
connect(my_skt_read_notifier, SIGNAL(activated(int)), this, SLOT(skt_process_rcv()));
我的印象是信号和槽应该具有相同的签名,对吗?
notifier中的int参数表示什么?
来自Qt docs:
The signature of a signal must match the signature of the receiving slot. (In fact a slot may have a shorter signature than the signal it receives because it can ignore extra arguments.)...
因此,在您的情况下它也应该有效,因为插槽的参数少于连接的信号。