I haven't used invokeMethod() myself, but to do this, I usually just use signals and slots. For instance, you ...
stackoverflow.com