Guest User

Untitled

a guest
Feb 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. #include <QGuiApplication>
  2. #include <QScreen>
  3. #include <Qpixmap>
  4. #include <QDebug>
  5.  
  6. int main(int argc, char *argv[])
  7. {
  8. QGuiApplication a(argc, argv);
  9.  
  10. QList<QScreen *> screens = QGuiApplication::screens();
  11. QList<QPixmap> pixmapsList;
  12. for (int i=0; i<screens.size(); i++)
  13. {
  14. pixmapsList.push_back(screens[i]->grabWindow(0));
  15. }
  16.  
  17. for (int i=0; i<pixmapsList.size(); i++)
  18. {
  19. qDebug()<< "Screen" << i << ":";
  20. qDebug()<< "height:" << pixmapsList[i].height();
  21. qDebug()<< "width:" <<pixmapsList[i].width();
  22. qDebug()<< "rect:" <<pixmapsList[i].rect();
  23. qDebug()<< "size:" <<pixmapsList[i].size();
  24. qDebug()<< "cacheKey:" <<pixmapsList[i].cacheKey();
  25. qDebug()<< "depth:" <<pixmapsList[i].depth();
  26. qDebug()<< "isQBitmap:" <<pixmapsList[i].isQBitmap();
  27. qDebug()<< "isNull:" <<pixmapsList[i].isNull();
  28. qDebug()<< "defaultDepth:" <<pixmapsList[i].defaultDepth();
  29. qDebug()<< "";
  30. }
  31. return 0;
  32. }
Add Comment
Please, Sign In to add comment