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>
bb10
Samuel Rødal 2011-09-13 14:02:02 +02:00 committed by Qt by Nokia
parent 204108d37b
commit d6f971c854
2 changed files with 2 additions and 2 deletions

View File

@ -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());

View File

@ -31,5 +31,3 @@ wince*: {
}
RESOURCES += qpixmap.qrc
CONFIG += insignificant_test # QTBUG-21402