diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-03-25 09:55:23 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-03-25 10:17:35 (GMT) |
commit | 6a9b91754a2c30da798dcb1e8d3a5a987886aa2a (patch) | |
tree | 5424cdcd0b3ec813978ee47a39ad4567cbf867f4 | |
parent | 80d4b51b173d9ea9a4a56230d026a2e91bb04f50 (diff) | |
download | Qt-6a9b91754a2c30da798dcb1e8d3a5a987886aa2a.zip Qt-6a9b91754a2c30da798dcb1e8d3a5a987886aa2a.tar.gz Qt-6a9b91754a2c30da798dcb1e8d3a5a987886aa2a.tar.bz2 |
Fix crash while styling the title bar of a QMdiArea with stylesheet
This stylesheet used to crash: *::title { border 1px solid black }
Reviewed-by: bnilsen
-rw-r--r-- | src/gui/styles/qstylesheetstyle.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gui/styles/qstylesheetstyle.cpp b/src/gui/styles/qstylesheetstyle.cpp index 2558409..f22cd56 100644 --- a/src/gui/styles/qstylesheetstyle.cpp +++ b/src/gui/styles/qstylesheetstyle.cpp @@ -4840,7 +4840,8 @@ int QStyleSheetStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const if (subRule.hasContentsSize()) return subRule.size().height(); else if (subRule.hasBox() || subRule.hasBorder()) { - return subRule.size(QSize(0, opt->fontMetrics.lineSpacing())).height(); + QFontMetrics fm = opt ? opt->fontMetrics : w->fontMetrics(); + return subRule.size(QSize(0, fm.lineSpacing())).height(); } break; } |