Created
February 8, 2018 23:44
-
-
Save the-nose-knows/1cea22f45f8eb418264c579f64515d10 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, screens[i]->geometry().x(), screens[i]->geometry().y(), screens[i]->geometry().width(), screens[i]->geometry().height())); | |
} | |
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