summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBjoern Erik Nilsen <bjorn.nilsen@nokia.com>2009-05-06 14:32:01 (GMT)
committerBjoern Erik Nilsen <bjorn.nilsen@nokia.com>2009-05-06 15:17:59 (GMT)
commit67c2b69d45eb43078b7e4193ced6cd513602483c (patch)
treed36450519b6e7f00157f4cb77b9b687666797e9c /tests
parent85f6350812d5a22c496c66f4f91ea8e36e454561 (diff)
downloadQt-67c2b69d45eb43078b7e4193ced6cd513602483c.zip
Qt-67c2b69d45eb43078b7e4193ced6cd513602483c.tar.gz
Qt-67c2b69d45eb43078b7e4193ced6cd513602483c.tar.bz2
Crash in QWidget::render when passing an untransformed QPixmap painter.
The crash only occurred on Windows and X11 when running with -graphicssystem raster. The reason is that the actual paint device in QRasterPaintEngine::begin() is changed to pixmap->data->buffer(), which means QPaintEngine::paintDevice() returns something else than what it was told to paint on (see cb0c899b56b84154f69ddc545991bc6ded96ab01) The root of the problem, however, was that we used a weird condition (painter->worldMatrixEnabled(), added in 345072b9 for Qt 4.4) to find the target device. We did that because the shared painter was completely different in 4.4. We refactored it in 4.5.0, and we can only trust QPaintEngine::paintDevice to be the target device. Auto-test included. Task-number: 252837 Reviewed-by: Trond
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qwidget/tst_qwidget.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/auto/qwidget/tst_qwidget.cpp b/tests/auto/qwidget/tst_qwidget.cpp
index dee48a3..5896df9 100644
--- a/tests/auto/qwidget/tst_qwidget.cpp
+++ b/tests/auto/qwidget/tst_qwidget.cpp
@@ -287,6 +287,7 @@ private slots:
void render_systemClip2();
void render_systemClip3_data();
void render_systemClip3();
+ void render_task252837();
void setContentsMargins();
@@ -7097,6 +7098,16 @@ void tst_QWidget::render_systemClip3()
}
}
+void tst_QWidget::render_task252837()
+{
+ QWidget widget;
+ widget.resize(200, 200);
+
+ QPixmap pixmap(widget.size());
+ QPainter painter(&pixmap);
+ // Please do not crash.
+ widget.render(&painter);
+}
void tst_QWidget::setContentsMargins()
{
QLabel label("why does it always rain on me?");