summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-09-07 08:54:35 (GMT)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>2009-09-07 08:56:53 (GMT)
commit84bd6d5e10506d179e12f842659d98f7f9ef7e62 (patch)
treefd3931d8c563ee8cc1f03f4750e6a432b9ab6690 /src/gui
parent206769af3fe145dbc46628dba67ed3115fcbabf2 (diff)
downloadQt-84bd6d5e10506d179e12f842659d98f7f9ef7e62.zip
Qt-84bd6d5e10506d179e12f842659d98f7f9ef7e62.tar.gz
Qt-84bd6d5e10506d179e12f842659d98f7f9ef7e62.tar.bz2
Support setting font size in shorthand font properties
The fontSizeAdjustment defaulted to 0 which means "medium" in internal semantics. This will override any font size you set in the short-hand. In other locations, fontSizeAdjustment defaults to -255 which has no meaning attached. To allow setting the font size in short-hand (as in "font: 20px Arial"), we can't default to a specific adjustment. Two tests are added: The first verifies the case that already worked, where you specify the font size using the "font-size" property. The other verifies the short-hand case and would previously fail. Task-number: 207189 Reviewed-by: Simon Hausmann
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/text/qcssparser.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qcssparser.cpp b/src/gui/text/qcssparser.cpp
index f252444..a38f276 100644
--- a/src/gui/text/qcssparser.cpp
+++ b/src/gui/text/qcssparser.cpp
@@ -1171,7 +1171,7 @@ static void parseShorthandFontProperty(const QVector<Value> &values, QFont *font
{
font->setStyle(QFont::StyleNormal);
font->setWeight(QFont::Normal);
- *fontSizeAdjustment = 0;
+ *fontSizeAdjustment = -255;
int i = 0;
while (i < values.count()) {