diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 3d0ffd9269..355ef5bee0 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -4765,10 +4765,8 @@ static void sendResizeEvents(QWidget *target) given \a rectangle. If the \a widget has any children, then they are also painted in the appropriate positions. - If no rectangle is specified (the default) the entire widget is - painted. - - Replacement for Qt 4's QPixmap::grabWidget(). + If a rectangle with an invalid size is specified (the default), + the entire widget is painted. \sa render(), QPixmap */ diff --git a/src/widgets/kernel/qwidget.h b/src/widgets/kernel/qwidget.h index b7a5e26690..0110a3850b 100644 --- a/src/widgets/kernel/qwidget.h +++ b/src/widgets/kernel/qwidget.h @@ -351,7 +351,7 @@ public: const QRegion &sourceRegion = QRegion(), RenderFlags renderFlags = RenderFlags(DrawWindowBackground | DrawChildren)); - Q_INVOKABLE QPixmap grab(const QRect &rectangle); + Q_INVOKABLE QPixmap grab(const QRect &rectangle = QRect(QPoint(0, 0), QSize(-1, -1))); #ifndef QT_NO_GRAPHICSEFFECT QGraphicsEffect *graphicsEffect() const;