Delayed function call?
-
I have a function I want to run after a dialog is displayed. I tried calling it from the showEvent handler but that's still fired before the dialog is actually displayed. Is there a way to do an async call that is delayed by a second? Or some way to fire the function after the dialog is actually displayed?
-
Hi,
How/when are you showing that dialog ?
-
Then you can call your method after your exec call.
Isn't that what you are doing ?
-
@SGaist said in Delayed function call?:
Then you can call your method after your exec call.
Isn't that what you are doing ?
No it's calling a function inside the dialog. Basically simulating clicking one of the buttons automatically.
I'm porting this from MFC. In MFC I use PostMessage to send a fake click to the button and it works as expected. Just trying to recreate it in Qt.
-
@Dan203 in showEvent
QTimer::singleShot(1000, this, &yourfunc ); if yourfunc is in the dialog.