summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2011-09-13 14:02:02 +0200
committerQt by Nokia <qt-info@nokia.com>2011-09-15 09:11:35 +0200
commitd6f971c8547d7f0619b63f7e07f1c292e811b45f (patch)
tree2efcf5bfaf2b4cc141bedaa74151cb1e2fac38b2 /src
parent204108d37bbe6b17b43f6cc997c369e338c274df (diff)
Fixed tst_qpixmap::grabWidget().
prepareToRender() might call adjustSize() resulting in the widget's size changing, so we should make sure to call adjustSize() _before_ we decide on the required pixmap dimensions. Task-number: QTBUG-21402 Change-Id: Ie72b46bc8e8e22f848769f78187f47ae9f4e37d3 Reviewed-on: http://codereview.qt-project.org/4772 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/kernel/qwidget.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 76544d2524..9211a24efd 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -5188,6 +5188,8 @@ QPixmap QWidget::grab(const QRect &rectangle)
if (testAttribute(Qt::WA_PendingResizeEvent) || !testAttribute(Qt::WA_WState_Created))
sendResizeEvents(this);
+ adjustSize();
+
QRect r(rectangle);
if (r.width() < 0)
r.setWidth(width() - rectangle.x());