use the following if you want to have the app open as maximized window:
Mainwindow w;
w.setWindowState(Qt::WindowMaximized);
w.show();
use the following if you want to have the app open as fullscreen window:
Mainwindow w;
w.setWindowState(Qt::WindowFullScreen);
w.show();