Either cast the parent pointer to the right type or store the pointer to the parent somewhere in the child when receiving it in the constructor. Or use signals and slots.
Either cast the parent pointer to the right type or store the pointer to the parent somewhere in the child when receiving it in the constructor. Or use signals and slots.
The return value of `parent()` is `QObject*` by default, not `mainwindow*`. As such, you do not have access to `mainwindow` functions, even though you're pretty sure that's what type of object you actually have. That's why the cast is neccessary; it tells the compiler that even though you have a `QObject*`, it should be treated as a `mainwindow*` and let you call those functions as normal.
el33t (16th March 2011)
Did the casting an everything worked like a charm. Thanks a lot for the assitance guys!
Bookmarks