PDA

View Full Version : access to mainForm from an ui.h



mickey
7th May 2006, 16:34
Hi, I created a dialog.ui.h from desinger (with some widgets); now I need, eg when I check a spinBox in this dialog, take some things in myMainForm; I'd like to obtain a pointer
like this: "myMainForm* w" in dialog.ui.h, but how? Thanks

madcat
7th May 2006, 17:04
Normally you don't need a pointer, just use myMainForm::yourWidget which is defined in window.ui.h... But maybe I did not understand your question correctly :)

sumsin
8th May 2006, 09:37
you can access it by "this" pointer.

"this" is available in ui.h file.

zlatko
8th May 2006, 10:13
you can access it by "this" pointer.

"this" is available in ui.h file.

this is pointer on current used class . You always can write just someMethod() instead this->someMethod()

2 mickey:
Use subclassing method for using designer generated code instead use *ui.h ...and all problem will be clearly