summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextformat.cpp
diff options
context:
space:
mode:
authorKent Hansen <khansen@trolltech.com>2009-08-12 09:21:36 (GMT)
committerKent Hansen <khansen@trolltech.com>2009-08-12 09:21:36 (GMT)
commit61f454dd144590025d9001b669b102528782bfeb (patch)
tree99f34395836f298ac70738ce652dec4e6d30d445 /src/gui/text/qtextformat.cpp
parentd5315a79b86df6350ed9ed2c90074e8fdae8ab4d (diff)
parentb3b2bc3f190d80e30b968648dd91048df67b8a50 (diff)
downloadQt-61f454dd144590025d9001b669b102528782bfeb.zip
Qt-61f454dd144590025d9001b669b102528782bfeb.tar.gz
Qt-61f454dd144590025d9001b669b102528782bfeb.tar.bz2
Merge branch 'master' of git@scm.dev.nokia.troll.no:qt/qt into qtscript-jsc-backend
Conflicts: configure src/script/qscriptarray_p.h src/script/qscriptasm.cpp src/script/qscriptasm_p.h src/script/qscriptbuffer_p.h src/script/qscriptclass.cpp src/script/qscriptclassdata.cpp src/script/qscriptclassdata_p.h src/script/qscriptclassinfo_p.h src/script/qscriptclasspropertyiterator_p.h src/script/qscriptcompiler.cpp src/script/qscriptcompiler_p.h src/script/qscriptcontext_p.cpp src/script/qscriptcontext_p.h src/script/qscriptcontextfwd_p.h src/script/qscriptcontextinfo_p.h src/script/qscriptecmaarray.cpp src/script/qscriptecmaarray_p.h src/script/qscriptecmaboolean.cpp src/script/qscriptecmaboolean_p.h src/script/qscriptecmacore.cpp src/script/qscriptecmacore_p.h src/script/qscriptecmadate.cpp src/script/qscriptecmadate_p.h src/script/qscriptecmaerror.cpp src/script/qscriptecmaerror_p.h src/script/qscriptecmafunction.cpp src/script/qscriptecmafunction_p.h src/script/qscriptecmaglobal.cpp src/script/qscriptecmaglobal_p.h src/script/qscriptecmamath.cpp src/script/qscriptecmamath_p.h src/script/qscriptecmanumber.cpp src/script/qscriptecmanumber_p.h src/script/qscriptecmaobject.cpp src/script/qscriptecmaobject_p.h src/script/qscriptecmaregexp.cpp src/script/qscriptecmaregexp_p.h src/script/qscriptecmastring.cpp src/script/qscriptecmastring_p.h src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptengine_p.h src/script/qscriptengineagent_p.h src/script/qscriptenginefwd_p.h src/script/qscriptextenumeration.cpp src/script/qscriptextenumeration_p.h src/script/qscriptextqobject.cpp src/script/qscriptextqobject_p.h src/script/qscriptextvariant.cpp src/script/qscriptextvariant_p.h src/script/qscriptfunction.cpp src/script/qscriptfunction_p.h src/script/qscriptgc_p.h src/script/qscriptglobals_p.h src/script/qscriptmember_p.h src/script/qscriptnameid_p.h src/script/qscriptnodepool_p.h src/script/qscriptobject_p.h src/script/qscriptobjectfwd_p.h src/script/qscriptprettypretty.cpp src/script/qscriptprettypretty_p.h src/script/qscriptsyntaxcheckresult_p.h src/script/qscriptvalue.cpp src/script/qscriptvalue_p.h src/script/qscriptvaluefwd_p.h src/script/qscriptvalueimpl.cpp src/script/qscriptvalueimpl_p.h src/script/qscriptvalueimplfwd_p.h src/script/qscriptvalueiteratorimpl.cpp src/script/qscriptvalueiteratorimpl_p.h
Diffstat (limited to 'src/gui/text/qtextformat.cpp')
-rw-r--r--src/gui/text/qtextformat.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp
index a3dd83e..9a2f49b6 100644
--- a/src/gui/text/qtextformat.cpp
+++ b/src/gui/text/qtextformat.cpp
@@ -34,7 +34,7 @@
** met: http://www.gnu.org/copyleft/gpl.html.
**
** If you are unsure which license is appropriate for your use, please
-** contact the sales department at http://www.qtsoftware.com/contact.
+** contact the sales department at http://qt.nokia.com/contact.
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -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);
}
/*!
@@ -1603,7 +1604,7 @@ void QTextCharFormat::setUnderlineStyle(UnderlineStyle style)
\fn void QTextCharFormat::setAnchorHref(const QString &value)
Sets the hypertext link for the text format to the given \a value.
- This is typically a URL like "http://qtsoftware.com/index.html".
+ This is typically a URL like "http://example.com/index.html".
The anchor will be displayed with the \a value as its display text;
if you want to display different text call setAnchorNames().