[Qt-interest] Grab image of second monitor

simion ploscariu simion314 at gmail.com
Thu Oct 14 10:24:54 CEST 2010


Hi, I need to grab the second monitor  (or any other monitor 3,4) in
windows using Qt4.6 . I tried many variants and i always get the first
monitor or nothing
It seams that it could be possible to get a image with all the screens
combined but i am unable to get that, i get only the first screen

Sample code
QWidget* screen=QApplication::desktop()->screen(screenNumber);
QPixmap entireDesktop= QPixmap::grabWindow(screen->winId());;
same if i try to grab QApplication::desktop() or screenNumber is 0 or
1 , i always get the same result.
Using grabWidget will not work on this widgets, it gets me a gray image
Thx



More information about the Qt-interest-old mailing list