13

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.

1 Answers1

1

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()


alexey
  • 646
  • 5
  • 9