summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-03-25 09:55:23 (GMT)
committerOlivier Goffart <ogoffart@trolltech.com>2009-03-25 10:17:35 (GMT)
commit6a9b91754a2c30da798dcb1e8d3a5a987886aa2a (patch)
tree5424cdcd0b3ec813978ee47a39ad4567cbf867f4 /src/gui/styles
parent80d4b51b173d9ea9a4a56230d026a2e91bb04f50 (diff)
downloadQt-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
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qstylesheetstyle.cpp3
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;
}