Quote Originally Posted by anda_skoa View Post
A top level widget (without a parent) or one of the widget window types (QMainWindow, QDialog) has an associated QWindow.
Thank you for that explanation it is good to know.
After a hint from elros I solved my problem by doing this:

Qt Code:
  1. include <QtWidgets/QApplication>
  2. include "mainwindow.h"
  3. include <QWindow>
  4.  
  5. int main(int argc, char *argv[])
  6. {
  7. QApplication a(argc, argv);
  8. MainWindow w;
  9. w.show();
  10. QWindow *window = w.windowHandle();
  11. window->reportContentOrientationChange(Qt::LandscapeOrientation);
  12. return a.exec();
  13. }
To copy to clipboard, switch view to plain text mode 
Is this the right way to access the associated QWindow from my MainWindow? However this is working.