From 41914453d38d01b9b69e16ccee69444d1a304bf7 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 9 Feb 2012 13:46:28 +0100 Subject: Introduce QScreen::grabWindow(), deprecate QPixmap::grabWindow(). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit WId can be local to a screen. Change-Id: I09ca71313836a34dbf33289b254c80207a956bb1 Reviewed-by: Samuel Rødal --- src/gui/image/qpixmap.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/gui/image/qpixmap.cpp') diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index f1a06fa33c..16945edc90 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -1613,9 +1613,22 @@ QPixmap QPixmap::fromImageReader(QImageReader *imageReader, Qt::ImageConversionF \warning In general, grabbing an area outside the screen is not safe. This depends on the underlying window system. + \warning The function is deprecated in Qt 5.0 since there might be + platform plugins in which window system identifiers (\c WId) + are local to a screen. Use QScreen::grabWindow() instead. + \sa grabWidget(), {Screenshot Example} + \sa QScreen + \deprecated */ +QPixmap QPixmap::grabWindow(WId window, int x, int y, int w, int h) +{ + qWarning("%s is deprecated, use QScreen::grabWindow() instead." + " Defaulting to primary screen.", Q_FUNC_INFO); + return QGuiApplication::primaryScreen()->grabWindow(window, x, y, w, h); +} + /*! \internal */ -- cgit v1.2.3