In Qt (4.6), is it ok to call slots directly?

后端 未结 1 2121
情书的邮戳
情书的邮戳 2021-02-18 19:07

I found myself in the need of having to call a slot directly. I think it\'s perfectly fine doing it as long as it makes sense in your design. What do you think?

Thanks

相关标签:
1条回答
  • 2021-02-18 20:03

    Yes.. Slots are just normal functions and you can call them directly..

    From docs,

    A slot is called when a signal connected to it is emitted. Slots are normal C++ functions and can be called normally; their only special feature is that signals can be connected to them.

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