Hello!

How do you access the main window (that's declared only in main function) from other functions of the same class?
This below is my main() and I can resize the window as shown.
Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication application(argc, argv);
  4. MyWidget window;
  5. window.resize(1200,800);
  6. window.show();
  7. return application.exec();
  8. }
To copy to clipboard, switch view to plain text mode 

But why can't I do it from another function like
Qt Code:
  1. void MyWidget::reSize()
  2. {
  3. window.resize(1200,800);
  4. }
To copy to clipboard, switch view to plain text mode 

The comiler complains like this: "insufficient contextual information to determine type". I think I need to declare "window" somewhere else to make this work.
I do not think that I can declare "window" in my *.h file, can I? Isn't this instance a bit different from all others?