summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpixmap.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@nokia.com>2012-02-09 13:46:28 +0100
committerQt by Nokia <qt-info@nokia.com>2012-02-09 21:35:52 +0100
commit41914453d38d01b9b69e16ccee69444d1a304bf7 (patch)
tree9b29cc8fa4d1bca01f9ad24ebc380b1e3307690d /src/gui/image/qpixmap.cpp
parentbe98fa32c7d56ea91359b647a329356fa44eca04 (diff)
Introduce QScreen::grabWindow(), deprecate QPixmap::grabWindow().
WId can be local to a screen. Change-Id: I09ca71313836a34dbf33289b254c80207a956bb1 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui/image/qpixmap.cpp')
-rw-r--r--src/gui/image/qpixmap.cpp13
1 files changed, 13 insertions, 0 deletions
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
*/