Don't use deprecated QPixmap::grabWindow(),grabWidget().

Change-Id: I5d0ffb17d60ad53822d537b9c736307486823d45
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
This commit is contained in:
Debao Zhang 2012-05-22 20:01:12 -07:00 committed by Qt by Nokia
parent 03536d3e3d
commit 62fafaf16a

View File

@ -46,6 +46,7 @@
#include "qevent.h" #include "qevent.h"
#include "qimage.h" #include "qimage.h"
#include "qpainter.h" #include "qpainter.h"
#include "qscreen.h"
#include "qpixmap.h" #include "qpixmap.h"
#include "qpointer.h" #include "qpointer.h"
#include "qtimer.h" #include "qtimer.h"
@ -161,8 +162,8 @@ void QAlphaWidget::run(int time)
move(widget->geometry().x(),widget->geometry().y()); move(widget->geometry().x(),widget->geometry().y());
resize(widget->size().width(), widget->size().height()); resize(widget->size().width(), widget->size().height());
frontImage = QPixmap::grabWidget(widget).toImage(); frontImage = widget->grab(QRect()).toImage();
backImage = QPixmap::grabWindow(QApplication::desktop()->winId(), backImage = QGuiApplication::primaryScreen()->grabWindow(QApplication::desktop()->winId(),
widget->geometry().x(), widget->geometry().y(), widget->geometry().x(), widget->geometry().y(),
widget->geometry().width(), widget->geometry().height()).toImage(); widget->geometry().width(), widget->geometry().height()).toImage();
@ -407,7 +408,7 @@ QRollEffect::QRollEffect(QWidget* w, Qt::WindowFlags f, DirFlags orient)
if (orientation & (DownScroll|UpScroll)) if (orientation & (DownScroll|UpScroll))
currentHeight = 0; currentHeight = 0;
pm = QPixmap::grabWidget(widget); pm = widget->grab(QRect());
} }
/* /*