Daniel
Daniel

Reputation: 571

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

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

Upvotes: 23

Views: 12273

Answers (1)

liaK
liaK

Reputation: 11648

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.

Upvotes: 44

Related Questions