Quote Originally Posted by taylor34
I'd like to do that class cast, but I can't because my child widget class has no knowledge of the parent class (i.e. I'm not including the parent.h file or anything).
When you are starting to put those little arrows one after the other the compiler generates indermediate objects / pointers to objects, so not including the interface of the generated objects the compiler won't know what to do and also you can only have access to the public interface:
Qt Code:
  1. parent()->DoSomething();
To copy to clipboard, switch view to plain text mode 
is actually
Qt Code:
  1. QObject * temp = parent();
  2. temp->DoSomething(); // boom
To copy to clipboard, switch view to plain text mode 
while you need
Qt Code:
  1. #include "myform.h"
  2. //...
  3. MyForm *temp = (MyForm *)parent();
  4. temp->DoSomething()
To copy to clipboard, switch view to plain text mode