Suppress deprecation warnings.
Change-Id: If254bab3683f21f8eb85f1f2a2c881d285c093ae
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
static QWidget *decorationFromWidget(QWidget *w)
{
QLabel *label = new QLabel(0, Qt::ToolTip);
- QPixmap pm = QPixmap::grabWidget(w);
+ QPixmap pm = w->grab(QRect(0, 0, -1, -1));
label->setPixmap(pm);
label->resize(pm.size());
foreach (QWidget *w, action->associatedWidgets())
if (QToolButton *tb = qobject_cast<QToolButton *>(w))
- return QPixmap::grabWidget(tb);
+ return tb->grab(QRect(0, 0, -1, -1));
// Create a QToolButton
QToolButton *tb = new QToolButton;
tb->setText(action->text());
tb->setToolButtonStyle(Qt::ToolButtonTextOnly);
tb->adjustSize();
- const QPixmap rc = QPixmap::grabWidget(tb);
+ const QPixmap rc = tb->grab(QRect(0, 0, -1, -1));
tb->deleteLater();
return rc;
}
if (!widget)
return QImage();
- const QPixmap pixmap = QPixmap::grabWidget(widget);
+ const QPixmap pixmap = widget->grab(QRect(0, 0, -1, -1));
widget->deleteLater();
return pixmap.toImage();
}
QWidget *widget = createPreview(fw, pc, deviceProfileIndex, errorMessage);
if (!widget)
return QPixmap();
- const QPixmap rc = QPixmap::grabWidget(widget);
+ const QPixmap rc = widget->grab(QRect(0, 0, -1, -1));
widget->deleteLater();
return rc;
}
case 1: {
QWidget *deco = m_items.first()->decoration();
decorationTopLeft = deco->pos();
- const QPixmap widgetPixmap = QPixmap::grabWidget(deco);
+ const QPixmap widgetPixmap = deco->grab(QRect(0, 0, -1, -1));
#ifdef TRANSPARENT_DRAG_PIXMAP
QImage image(widgetPixmap.size(), QImage::Format_ARGB32);
image.fill(QColor(Qt::transparent).rgba());
decorationTopLeft = unitedGeometry.topLeft();
for (it = m_items.constBegin() ; it != cend; ++it ) {
QWidget *w = (*it)->decoration();
- const QPixmap wp = QPixmap::grabWidget(w);
+ const QPixmap wp = w->grab(QRect(0, 0, -1, -1));
const QPoint pos = w->pos() - decorationTopLeft;
painter.drawPixmap(pos, wp);
maskPainter.fillRect(QRect(pos, wp.size()), Qt::color1);
if (!widget)
return QPixmap();
- const QPixmap rc = QPixmap::grabWidget (widget);
+ const QPixmap rc = widget->grab(QRect(0, 0, -1, -1));
widget->deleteLater();
return rc;
}
if (m_dragIcon.isNull()) {
QLabel *label = new QLabel(m_dragLabel);
label->adjustSize();
- drg->setPixmap(QPixmap::grabWidget(label));
+ drg->setPixmap(label->grab(QRect(0, 0, -1, -1)));
label->deleteLater();
} else {
drg->setPixmap(m_dragIcon.pixmap(22, 22));