Qt: Return value of signal works, why is the official doc saying it is impossible / forbidden?

前端 未结 1 1632
走了就别回头了
走了就别回头了 2021-01-18 01:06

Qt documentation says, return values of signals are not possible:

Signals are automatically generated by the moc and must not be implemented in the

相关标签:
1条回答
  • 2021-01-18 01:31

    The problem is that the return types are are not checked for compatibility at connect-time, thus connecting a double-returning slot to a float-returning signal, say, will overflow the stack (no pun intended) space allocated to the float.

    0 讨论(0)
提交回复
热议问题