Why not declare my_function as a slot? You can still call it in a normal way.