I'm writing an application in which I need to open a dialog and execute automatically (without clicking on a push button for example) some animation function.

For opening the dialog, the main windows has a push button that is connected to a slot, which contains

Qt Code:
  1. //Open the dialog
  2. dialog dlg=new Dlg ;
  3. dlg.exec();
  4. //Get data from the dialog after it is closed
  5. ...
To copy to clipboard, switch view to plain text mode 

My dialog class is something like the following, where functionToBeCalled() is the function to be called:
Qt Code:
  1. class Dlg : public QDialog
  2. {
  3. /* ...other attributes and methods here... */
  4.  
  5. public:
  6. void functionToBeCalled();
  7. }
To copy to clipboard, switch view to plain text mode 

Could anybody tell me how to do that please?

Thank you in advance for your help.