How to handle the connection event of widget output in Orange3?

I am developing an add-on widget for Orange3. Is there any way to handle the event of connection/disconnection of widget output?

I would like to postpone heavy calculations for one of the outputs until this output is connected with the input of another widget.

Upvotes: 13

Views: 254

Answers (1)

alexey
alexey

Reputation: 706

As far as I know, there is no signal (Orange3 employs PyQt's signals & slots) in source widget about it being connected with another one.

But you can always postpone heavy computation by hiding it in lazy properties or starting this computation within the receiving widget.

class TargetWidget(OWWidget): 
   @Inputs.obj
   def set_obj(self, obj): 
       # start computation here
       obj.compute()


Upvotes: 1

Related Questions