diff options
author | Jason Barron <jbarron@trolltech.com> | 2009-08-13 07:24:47 (GMT) |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2009-08-13 08:27:51 (GMT) |
commit | 13cbcc0ddca0fdd5be9ede09052d31785c1e4d55 (patch) | |
tree | b647be5699145ccae1545096aba5c495d96f8eb5 /src/gui/text/qtextformat.cpp | |
parent | 081078137a6fbc85d6be1437f6afc1d60e4f75f9 (diff) | |
parent | de088b5a7f7b57e568399334667b14bfc9e7b893 (diff) | |
download | Qt-13cbcc0ddca0fdd5be9ede09052d31785c1e4d55.zip Qt-13cbcc0ddca0fdd5be9ede09052d31785c1e4d55.tar.gz Qt-13cbcc0ddca0fdd5be9ede09052d31785c1e4d55.tar.bz2 |
Merge commit 'qt/master'
Conflicts:
examples/opengl/samplebuffers/glwidget.cpp
src/corelib/io/qfsfileengine_unix.cpp
src/corelib/kernel/qobject.cpp
src/corelib/tools/qsharedpointer.cpp
src/gui/gui.pro
tests/auto/qhttp/tst_qhttp.cpp
tests/auto/qkeyevent/tst_qkeyevent.cpp
Diffstat (limited to 'src/gui/text/qtextformat.cpp')
-rw-r--r-- | src/gui/text/qtextformat.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index 7f82365..82c81ef 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(). |