c++ - Several monitors fullscreen application in QT 4.8 -
i use qt4.8 create application , have 2 monitors identical screen resolutions connected pc. how possible make application main window fullscreen on both monitors?
hope code in way:
#include "mainwindow.h" #include "ui_mainwindow.h" #include <qdesktopwidget> //include desktop info mainwindow::mainwindow(qwidget *parent) : qmainwindow(parent), ui(new ui::mainwindow) { ui->setupui(this); int x=0; //our x start position int y=0; //our y start position qdesktopwidget *desktop = new qdesktopwidget();//our desktop instance /*here im taking in count have same resolution on monitor, can width knowing quantity of monitor , multiplying first monitor width*/ int width = desktop->screencount()*desktop->screengeometry(0).width(); int height = desktop->screengeometry(0).height();//just getting first //monitor height same in monitors this->setgeometry(x,y,width,height);//now set final geometry //my mainwindow. } mainwindow::~mainwindow() { delete ui; }
maybe theres faster , less code way can see how works... let me know if need else.
Comments
Post a Comment