Q_INVOKABLE vs. slots
-
wrote on 17 Aug 2010, 08:12 last edited by
I'm just curious, is it more lightweight to mark a method with Q_INVOKABLE than as a slot?
Is it more of a design question to mark a method with Q_INVOKABLE, for instance a method that calculates and returns a value but is not inteeded to be used with signals.
-
Invokable methods are like slots are made available through the metatype system, so I don't think it's more "lightweight". The difference is rather a semantic one (do you want to use it for signal/slot connections? Or is it just about making a method available in QtScript?). Also, constructors can be marked as Q_INVOKABLE, while they cannot be slots.
-
wrote on 18 Aug 2010, 19:26 last edited by
Thanks kkoehne, you confirmed what I expected.
-
wrote on 26 Aug 2010, 13:18 last edited by
Can I somehow mark static methods with Q_INVOKABLE and use them in QtScript without needance to write huge binding for this method?
-
wrote on 26 Aug 2010, 15:19 last edited by
You might want create separate thread for this...