Hello

i have 2 windows,one mainwindow and one dialog.a signal emmited from the mainwindow and the dialog appears.Do something in the dialog and before i close it i have to call a function from the mainwindow to refresh a mainwindow's label.
How can i do that?

example code:
Qt Code:
  1. ======Class MainWindow========
  2. MainWindow::MainWindow( QWidget * parent, Qt::WFlags f ): QMainWindow( parent, f )
  3. {
  4. setupUi( this );
  5. connect( showBtn, SIGNAL( clicked() ), this, SLOT( showUsers() ) );
  6. }
  7.  
  8.  
  9.  
  10. void MainWindow::showUsers( )
  11. {
  12. //actons etc.etc.
  13. Users *usr;
  14. usr->show();
  15.  
  16. }
  17.  
  18.  
  19. ======Class Users========
  20. Users::Users( QWidget * parent ) : QDialog( parent )
  21. {
  22. setupUi(this);
  23. setModal(true);
  24. connect( testButton, SIGNAL( clicked( ) ), this, SLOT(changeSomething( ) ) );
  25. }
  26.  
  27.  
  28. void Users::changeSomething( )
  29. {
  30. //actons etc.etc.
  31. and somewhere here i have to use a function from mainwindow
  32. to update something e.g mainwindow->refresh();
  33. }
To copy to clipboard, switch view to plain text mode 

Can anyone help??

Thanks