Created
February 8, 2018 23:26
-
-
Save the-nose-knows/45f872e5a4809657523270e2429a615e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QGuiApplication> | |
#include <QScreen> | |
#include <Qpixmap> | |
#include <QDebug> | |
int main(int argc, char *argv[]) | |
{ | |
QGuiApplication a(argc, argv); | |
QList<QScreen *> screens = QGuiApplication::screens(); | |
QList<QPixmap> pixmapsList; | |
for (int i=0; i<screens.size(); i++) | |
{ | |
pixmapsList.push_back(screens[i]->grabWindow(0)); | |
} | |
for (int i=0; i<pixmapsList.size(); i++) | |
{ | |
qDebug()<< "Screen" << i << ":"; | |
qDebug()<< "height:" << pixmapsList[i].height(); | |
qDebug()<< "width:" <<pixmapsList[i].width(); | |
qDebug()<< "rect:" <<pixmapsList[i].rect(); | |
qDebug()<< "size:" <<pixmapsList[i].size(); | |
qDebug()<< "cacheKey:" <<pixmapsList[i].cacheKey(); | |
qDebug()<< "depth:" <<pixmapsList[i].depth(); | |
qDebug()<< "isQBitmap:" <<pixmapsList[i].isQBitmap(); | |
qDebug()<< "isNull:" <<pixmapsList[i].isNull(); | |
qDebug()<< "defaultDepth:" <<pixmapsList[i].defaultDepth(); | |
qDebug()<< ""; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment