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:
======Class MainWindow========
{
setupUi( this );
connect( showBtn, SIGNAL( clicked() ), this, SLOT( showUsers() ) );
}
void MainWindow::showUsers( )
{
//actons etc.etc.
Users *usr;
usr->show();
}
======Class Users========
{
setupUi(this);
setModal(true);
connect( testButton, SIGNAL( clicked( ) ), this, SLOT(changeSomething( ) ) );
}
void Users::changeSomething( )
{
//actons etc.etc.
and somewhere here i have to use a function from mainwindow
to update something e.g mainwindow->refresh();
}
======Class MainWindow========
MainWindow::MainWindow( QWidget * parent, Qt::WFlags f ): QMainWindow( parent, f )
{
setupUi( this );
connect( showBtn, SIGNAL( clicked() ), this, SLOT( showUsers() ) );
}
void MainWindow::showUsers( )
{
//actons etc.etc.
Users *usr;
usr->show();
}
======Class Users========
Users::Users( QWidget * parent ) : QDialog( parent )
{
setupUi(this);
setModal(true);
connect( testButton, SIGNAL( clicked( ) ), this, SLOT(changeSomething( ) ) );
}
void Users::changeSomething( )
{
//actons etc.etc.
and somewhere here i have to use a function from mainwindow
to update something e.g mainwindow->refresh();
}
To copy to clipboard, switch view to plain text mode
Can anyone help??
Thanks
Bookmarks