I need a slot to be called with an argument after Qt has done its internal bussiness and started the event loop again. The two options I see are:

Qt Code:
  1. connect(this, SIGNAL(mysig(int)), someobject, SLOT(myslot(int)));
  2. emit mysignal(arg);
To copy to clipboard, switch view to plain text mode 

but that won't work because it calls mysignal right now instead of waiting for other scheduled stuff.


Qt Code:
  1. QTimer::singleShot(0, someobject, SLOT(myslot()));
To copy to clipboard, switch view to plain text mode 

calls the slot at the proper time, but won't pass an argument. Anything put within the parentheses of myslot() is expected to be a type rather than a value.

I suppose I could use the singleShot method and pass the argument via a global variable but that feels like being back to C64 Basic where GOSUB didn't take arguments...

Is there a more elegant way?