There is no object named "MainWindow" in scope where that statement is. There is, however, a type called "MainWindow" so the compiler is expecting an explicit call to method in the MainWindow class, like "MainWindow::staticFunc();", or a declaration, like "MainWindow foobar;", and does not find one before the dot and generates and error. You want neither of these anyway.

Assuming you are trying to print the window corresponding to the object this code is executing in then you should be calling render() on "this" object, i.e:
Qt Code:
  1. render(&printer);
To copy to clipboard, switch view to plain text mode