diff options
-rw-r--r-- | src/gui/text/qtextformat.cpp | 7 |
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); } /*! |