By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,650 Members | 812 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,650 IT Pros & Developers. It's quick & easy.

accessing parent form from a child form.how?

P: n/a
hello everyone,

i have a mainForm, that is run basically from main.cpp.
then i also have a childForm, that gets instanciated from within a
function in mainForm. basically:

#include "childrenforms.h"

//etcetc

class childrenForms;

//etcetc

childrenForms *childForm;

//etcetc

mainForm::showChildForm()
{
childForm = new childrenForm(..);
childForm.show(); //to prepare the form for showing on screen
childForm.exec(); //to run it
}

so far so good... however the mainForm also has a writeToFile()
function..

mainForm::writeToFile() {....}

i need to make this visible to the childForm...
so that i can basically somehow run the mainForm->writeToFile()
function by calling it from within the childForm.
how can i do that?
thank you for your help
nass

Sep 21 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a

nass wrote:
hello everyone,

i have a mainForm, that is run basically from main.cpp.
then i also have a childForm, that gets instanciated from within a
function in mainForm. basically:

#include "childrenforms.h"

//etcetc

class childrenForms;

//etcetc

childrenForms *childForm;

//etcetc

mainForm::showChildForm()
{
childForm = new childrenForm(..);
childForm.show(); //to prepare the form for showing on screen
childForm.exec(); //to run it
}

so far so good... however the mainForm also has a writeToFile()
function..

mainForm::writeToFile() {....}

i need to make this visible to the childForm...
so that i can basically somehow run the mainForm->writeToFile()
function by calling it from within the childForm.
how can i do that?
thank you for your help
nass
Pass a pointer to the child form:

mainForm::showChildForm()
{
childForm = new childrenForm(this);

Sep 21 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.