From 62fafaf16a972337fb3d6540889efc7cbf56ba7c Mon Sep 17 00:00:00 2001 From: Debao Zhang Date: Tue, 22 May 2012 20:01:12 -0700 Subject: [PATCH] Don't use deprecated QPixmap::grabWindow(),grabWidget(). Change-Id: I5d0ffb17d60ad53822d537b9c736307486823d45 Reviewed-by: Friedemann Kleint --- src/widgets/widgets/qeffects.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/widgets/widgets/qeffects.cpp b/src/widgets/widgets/qeffects.cpp index 84823675dd..4724ed8903 100644 --- a/src/widgets/widgets/qeffects.cpp +++ b/src/widgets/widgets/qeffects.cpp @@ -46,6 +46,7 @@ #include "qevent.h" #include "qimage.h" #include "qpainter.h" +#include "qscreen.h" #include "qpixmap.h" #include "qpointer.h" #include "qtimer.h" @@ -161,8 +162,8 @@ void QAlphaWidget::run(int time) move(widget->geometry().x(),widget->geometry().y()); resize(widget->size().width(), widget->size().height()); - frontImage = QPixmap::grabWidget(widget).toImage(); - backImage = QPixmap::grabWindow(QApplication::desktop()->winId(), + frontImage = widget->grab(QRect()).toImage(); + backImage = QGuiApplication::primaryScreen()->grabWindow(QApplication::desktop()->winId(), widget->geometry().x(), widget->geometry().y(), widget->geometry().width(), widget->geometry().height()).toImage(); @@ -407,7 +408,7 @@ QRollEffect::QRollEffect(QWidget* w, Qt::WindowFlags f, DirFlags orient) if (orientation & (DownScroll|UpScroll)) currentHeight = 0; - pm = QPixmap::grabWidget(widget); + pm = widget->grab(QRect()); } /*