diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> | 2015-01-06 15:41:05 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com> | 2015-01-08 10:07:00 +0100 |
commit | d056618d685bd93d57538b703f25d8cb35d91aed (patch) | |
tree | 10642b089cadee3ed993924989de00477a5b4f2e /tests/auto/gui/painting | |
parent | 7ad75cd8ef7e95bba3cfc694b7baffbc445bd2b0 (diff) |
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 <gunnar@sletta.org>
Diffstat (limited to 'tests/auto/gui/painting')
-rw-r--r-- | tests/auto/gui/painting/qpainter/tst_qpainter.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
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); |