QDesktopWidget desktop; int desktopHeight=desktop.geometry().height(); int desktopWidth=desktop.geometry().width(); this->resize(desktopWidth,desktopHeight);
You pretty much had it, just give the screen ID of your main monitor to the geometry() call.
geometry()
QDesktopWidget widget; QRect mainScreenSize = widget.availableGeometry(widget.primaryScreen()); // or screenGeometry(), depending on your needs