connect signal from class instead of instance
-
Hello, I am currently building an app and there's several custom widgets. Each of these widgets emit a signal when a spinbox they contain is changed.
Is it possible to connect a signal from the class itself or do I need to loop over all the instances of that class and connect them from the object?
-
Hello, I am currently building an app and there's several custom widgets. Each of these widgets emit a signal when a spinbox they contain is changed.
Is it possible to connect a signal from the class itself or do I need to loop over all the instances of that class and connect them from the object?
-
@Deneguil
The latter. You cannot "connect by class" in any actual way. You can implement it any way you like, e.g. in the class instance constructor, but you do have to connect each instance. Signal (and slot) connections are by object.