Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #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;
- }
Add Comment
Please, Sign In to add comment