From d056618d685bd93d57538b703f25d8cb35d91aed Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Tue, 6 Jan 2015 15:41:05 +0100 Subject: [PATCH] Make sure widget is polished before checking its font QWidget is polished when show() is called, so unless you do this first, QWidget::font() will return a default constructed QFont, and not necessarily the default specified in the platform theme. Comparing this to QPainter::font() later, which has been resolved against the platform theme font, and not the default constructed font, you can get a mismatch and a false test failure. This happened on Android. Change-Id: I41ef5b10879bbd4bb8ef8d52ecaccf5e8e894075 Reviewed-by: Gunnar Sletta --- tests/auto/gui/painting/qpainter/tst_qpainter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp index 41ceebb646..8a0705630d 100644 --- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp @@ -730,6 +730,7 @@ void tst_QPainter::initFrom() pal.setColor(QPalette::Foreground, QColor(255, 0, 0)); pal.setBrush(QPalette::Background, QColor(0, 255, 0)); widget->setPalette(pal); + widget->show(); QFont font = widget->font(); font.setPointSize(26);