Thanks for the example code, but I've just discovered the problem. In my simplified example, the focus was indeed the problem, but in my actual code (which I tested more extensively) I forgot to call widget.addAction()! The way I'm dealing with them is through several modules and a lot of abstraction, and somehow that just slipped through the gap.

Thanks for the help though!