Screenshot secondary monitor
Solved
General and Desktop
-
QScreen *screen = QGuiApplication::screens().last(); QPixmap screenPixmap = screen->grabWindow(0, 0, 0, screen->size().width(), screen->size().height()); ui->label->setPixmap(screenPixmap.scaled(size(), Qt::KeepAspectRatio, Qt::SmoothTransformation));
QGuiApplication::screens().size() prints 2;
Not important, is it QGuiApplication::screens().last() or QGuiApplication::screens().first, it shows same picture (primary screen).
If primary screen at left, I can take texture of secondary with positive X offset, if primary at right, with negative X offset.Question: Is it a bug, and how I can to understand position of primary screen, is it left from secondary or not.
Same problem on Qt4: http://lists.qt-project.org/pipermail/qt-interest-old/2010-October/028182.html
OS X 10.10, Qt 5.5.1, example project: https://dl.dropboxusercontent.com/u/4852026/Multiscreen.zip