PDA

View Full Version : QSqlTableModel reference in a second dialog....



scott_hollen
19th October 2011, 03:04
First off, please go easy on me as I'm lack-of-sleep-addled from a 4 month old and visit from the in-laws...

Second -- I'm trying to reference a model that I've created in my MainWindow in a secondary data entry dialog that I've created...I have a pushbutton that creates a pop-up dialog wthat includes comboboxes populated from models instantiated in my MainWindow dialog...I can't seem to make the pop-up dialog "see" the model created in MainWindow dialog no matter what I've tried so I'm wondering if someone knows of an example I can follow...

Thanks for any help!


scott

ChrisW67
19th October 2011, 07:40
Member variable visibility is governed by the rules of C++. Private and protected members are not generally visible outside the class. Pass a reference or pointer to the model when you construct your pop-up dialog.

scott_hollen
19th October 2011, 14:06
I tried that but but I was probably hacking too much and not thinking it thru, so I'll try that route again...Thanks!


scott

scott_hollen
19th October 2011, 20:30
Yep, stupid typo with my pointers...Went back to the start and added the variables I needed one at a time CAREFULLY and it worked fine...Thanks for the help and sorry for the bother...


scott