From ab2faea59aef652606fdf34ccc8af83f1b6d557a Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 31 Aug 2009 14:13:27 +0200 Subject: Document some of the new QVariant feature Including the befaviour change Reviewed-by: Thierry --- dist/changes-4.6.0 | 24 +++++++++++++++++------- src/corelib/kernel/qvariant.cpp | 1 + 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/dist/changes-4.6.0 b/dist/changes-4.6.0 index 194d670..ca984ac 100644 --- a/dist/changes-4.6.0 +++ b/dist/changes-4.6.0 @@ -27,6 +27,11 @@ information about a particular change. * [245219] Added QXmlQuery::setFocus(const QString &focus); + - QVariant + * Many optimisations + * Added QVariant::toFloat() and QVariant::toReal() + * Added QVariant(float) constructor + **************************************************************************** * Platform Specific Changes * **************************************************************************** @@ -83,29 +88,34 @@ information about a particular change. - QDesktopWidget on X11 no longer emits the resized(int) signal when screens are added or removed. This was not done on other platforms. Use the screenCountChanged signal instead - + - QUrl's parser is more strict when for hostnames in URLs. QUrl now enforces STD 3 rules: - + * each individual hostname section (between dots) must be at most 63 ASCII characters in length; - + * only letters, digits, and the hyphen character are allowed in the ASCII range; letters outside the ASCII range follow the normal IDN rules - + That means QUrl no longer accepts some URLs that were invalid before, but weren't interpreted as such. - + - The Unix configure-time check for STL is stricter now in Qt 4.6.0. This means some legacy STL implementations may fail to pass the test and, therefore, Qt will automatically disable STL support. - + This is a binary-compatible change: existing code will continue to work without being recompiled. However, it affects the source code, since some STL-compatibility API will not be enabled. - + Platforms affected by this change: * solaris-cc-* with the default (Cstd) C++ STL library recommendation: use -library=stlport4 See Sun Studio's documentation for the effects of this option + + - QVariant has now a new implicit constructor that takes a float. This + means that code that assigned a float to a variant would create a + variant with userType QMetaType::Float, instead of QVariant::Double. + diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 099fdf4..58f6537 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -1589,6 +1589,7 @@ QVariant::QVariant(const char *val) \fn QVariant::QVariant(float val) Constructs a new variant with a floating point value, \a val. + \since 4.6 */ /*! -- cgit v0.12