summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextformat.cpp
diff options
context:
space:
mode:
authorDavid Boddie <dboddie@trolltech.com>2009-08-11 18:31:32 (GMT)
committerDavid Boddie <dboddie@trolltech.com>2009-08-11 18:31:32 (GMT)
commite13a8bf193bb7583040b52dfc4a72796d77a3785 (patch)
treec61c15f3c88d4d989f748019b0b793d88a8d489f /src/gui/text/qtextformat.cpp
parent9605898c99490c9ad2b8cc1eb367d5531a18d1e3 (diff)
parent5c4c47facfcb75b0277872a0fac813ab41700e5e (diff)
downloadQt-e13a8bf193bb7583040b52dfc4a72796d77a3785.zip
Qt-e13a8bf193bb7583040b52dfc4a72796d77a3785.tar.gz
Qt-e13a8bf193bb7583040b52dfc4a72796d77a3785.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt
Diffstat (limited to 'src/gui/text/qtextformat.cpp')
-rw-r--r--src/gui/text/qtextformat.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp
index a3dd83e..fd0c17f 100644
--- a/src/gui/text/qtextformat.cpp
+++ b/src/gui/text/qtextformat.cpp
@@ -875,7 +875,8 @@ int QTextFormat::intProperty(int propertyId) const
/*!
Returns the value of the property specified by \a propertyId. If the
- property isn't of QVariant::Double type, 0 is returned instead.
+ property isn't of QVariant::Double or QMetaType::Float type, 0 is
+ returned instead.
\sa setProperty() boolProperty() intProperty() stringProperty() colorProperty() lengthProperty() lengthVectorProperty() Property
*/
@@ -884,9 +885,9 @@ qreal QTextFormat::doubleProperty(int propertyId) const
if (!d)
return 0.;
const QVariant prop = d->property(propertyId);
- if (prop.type() != QVariant::Double)
+ if (prop.type() != QVariant::Double && prop.type() != QMetaType::Float)
return 0.;
- return prop.toDouble(); // ####
+ return qVariantValue<qreal>(prop);
}
/*!