> On 7 Oct 2020, at 10:38, Volker Hilsheimer <[email protected]> wrote: > >> 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
Update: given that in Qt 6 QScreen provides equivalent functionality to QDesktopWidget (which is already gone in Qt 6) and QApplication::desktop(), we have now removed QApplication::desktop() from Qt 6. Volker _______________________________________________ Development mailing list [email protected] https://lists.qt-project.org/listinfo/development
