> On 7 Oct 2020, at 08:24, Martin Koller <[email protected]> wrote:
> 
> Hi,
> 
> in Qt6 the QDesktopWidget is gone, which I used in
> 
>    QWidget *desktop = QApplication::desktop();
>    QPixmap pm = QGuiApplication::screenAt(event->globalPos())->
>                     grabWindow(desktop->winId(), event->globalPos().x(), 
> event->globalPos().y(), 1, 1);
> 
> How do I get the desktop window id in Qt6 ?


You don’t need one, pass 0 for the WId into QScreen::grabWindow; it’s the 
default in Qt 6. Coordinates are then relative to your virtual desktop (or to 
the screen that you call grabWindow on if you don’t have a virtual desktop 
setup).

Volker

_______________________________________________
Development mailing list
[email protected]
https://lists.qt-project.org/listinfo/development

Reply via email to