summaryrefslogtreecommitdiffstats
path: root/src/gui/image
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
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')
-rw-r--r--src/gui/image/image.pri1
-rw-r--r--src/gui/image/qpixmap.cpp13
-rw-r--r--src/gui/image/qpixmap_qpa.cpp53
3 files changed, 13 insertions, 54 deletions
diff --git a/src/gui/image/image.pri b/src/gui/image/image.pri
index dd7b665ecc..f83e7e60c9 100644
--- a/src/gui/image/image.pri
+++ b/src/gui/image/image.pri
@@ -45,7 +45,6 @@ SOURCES += \
image/qimagepixmapcleanuphooks.cpp \
image/qvolatileimage.cpp
-SOURCES += image/qpixmap_qpa.cpp
win32: SOURCES += image/qpixmap_win.cpp
SOURCES += image/qvolatileimagedata.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
*/
diff --git a/src/gui/image/qpixmap_qpa.cpp b/src/gui/image/qpixmap_qpa.cpp
deleted file mode 100644
index 162c5f5286..0000000000
--- a/src/gui/image/qpixmap_qpa.cpp
+++ /dev/null
@@ -1,53 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** Contact: http://www.qt-project.org/
-**
-** This file is part of the QtGui module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser General Public
-** License version 2.1 as published by the Free Software Foundation and
-** appearing in the file LICENSE.LGPL included in the packaging of this
-** file. Please review the following information to ensure the GNU Lesser
-** General Public License version 2.1 requirements will be met:
-** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU General
-** Public License version 3.0 as published by the Free Software Foundation
-** and appearing in the file LICENSE.GPL included in the packaging of this
-** file. Please review the following information to ensure the GNU General
-** Public License version 3.0 requirements will be met:
-** http://www.gnu.org/copyleft/gpl.html.
-**
-** Other Usage
-** Alternatively, this file may be used in accordance with the terms and
-** conditions contained in a signed written agreement between you and Nokia.
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qpixmap.h>
-#include <qscreen.h>
-#include <private/qguiapplication_p.h>
-
-QT_BEGIN_NAMESPACE
-
-QPixmap QPixmap::grabWindow(WId window, int x, int y, int w, int h)
-{
- return QGuiApplication::primaryScreen()->handle()->grabWindow(window, x, y, w, h);
-}
-
-QT_END_NAMESPACE