@falzip
Thanks..that worked.

@wysota
I wasn't using dlg.exec(). Most probably that was the reason. Thanks for helping.