PDA

View Full Version : How to call a function from another window?



TomASS
7th October 2009, 20:44
Hi,

I've a main window, and I'opening a new window from it:

void MainWindow::slotNowyTransport(){
OFormNowyTransport = new FormNowyTransport(this);
OFormNowyTransport->show();
}

and I've another function:

void MainWindow::refresh(){
refresh_list();
}


When i've opened a OFormNowyTransport a fill the form, and call FormNowyTransport::add().

There is (in FormNowyTransport::add() function) on the end this->close(); before I'ld like to call a MainWindow::refresh() to refresh the list.


How can I do that?

codebehind
7th October 2009, 21:37
if i understand right you have a list in your main form and you fill this list in FormNowyTransport.

I would do it with a list which is initialized in main form and passed it by reference to FormNowyTransport


OFormNowyTransport = new FormNowyTransport(this,&"someList")

or create a signal slot relaltion in mainform

connect(OFormNowyTransport,close,this,"listtransform")