Author Topic: Qt screenshot with multiple monitors  (Read 1132 times)

0 Members and 1 Guest are viewing this topic.

Offline firewalkerTopic starter

  • Super Contributor
  • ***
  • Posts: 2450
  • Country: gr
Qt screenshot with multiple monitors
« on: July 17, 2020, 09:27:40 am »
I have a problem with a program using Qt to screenshot. I order to try and solve it my self, I had a look to the screenshot example:

https://doc.qt.io/qt-5/qtwidgets-desktop-screenshot-example.html

Downloading and compiling the program, it works but only for the individual screens. In another post

https://forum.qt.io/topic/65813/screenshot-secondary-monitor

I saw that the line (screenshot.cpp line 170)

Code: [Select]
screen->grabWindow(0);
Should be change to

Code: [Select]
originalPixmap = screen->grabWindow(0, screen->geometry().x(), screen->geometry().y(), screen->size().width(), screen->size().height());
With this change when the program is moved to the secondary monitor; captures it just fine.



When moved to the primary monitor it just capture only a part of the screen and not the entire two monitors. The produced image has the dimensions of the primary monitor.



Exactly the same issue I have with the software I need to use.

This is my monitor configuration:



And this is my entire desktop capture with KDE Spectacle.



What could be the issue?
Become a realist, stay a dreamer.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf