QWidget:grab() has a default parameter (invalid rect).
QRect() is the null rect and widget->grab(QRect())
returns an empty pixmap.
QWidget:grab() has to be free of side effects and should not
affect any dirty flags.
Change-Id: I8ff558343c366769cd6c587e77f862668e8054f2
Task-number: QTBUG-25436
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
const QWidget::RenderFlags renderFlags = QWidget::DrawWindowBackground | QWidget::DrawChildren | QWidget::IgnoreMask;
+ const bool oldDirtyOpaqueChildren = d->dirtyOpaqueChildren;
QRect r(rectangle);
if (r.width() < 0 || r.height() < 0) {
// For grabbing widgets that haven't been shown yet,
if (!d->isOpaque)
res.fill(Qt::transparent);
render(&res, QPoint(), QRegion(r), renderFlags);
+
+ d->dirtyOpaqueChildren = oldDirtyOpaqueChildren;
return res;
}
const bool updatesEnabled = container->updatesEnabled();
#endif
-#if defined(Q_WS_WIN) && !defined(QT_NO_EFFECTS)
+#if !defined(QT_NO_EFFECTS)
bool scrollDown = (listRect.topLeft() == below);
if (QApplication::isEffectEnabled(Qt::UI_AnimateCombo)
&& !style->styleHint(QStyle::SH_ComboBox_Popup, &opt, this) && !window()->testAttribute(Qt::WA_DontShowOnScreen))
move(widget->geometry().x(),widget->geometry().y());
resize(widget->size().width(), widget->size().height());
- frontImage = widget->grab(QRect()).toImage();
+ frontImage = widget->grab().toImage();
backImage = QGuiApplication::primaryScreen()->grabWindow(QApplication::desktop()->winId(),
widget->geometry().x(), widget->geometry().y(),
widget->geometry().width(), widget->geometry().height()).toImage();