From 3ed2ec14870c4035cfd1bd986f6d8f4f55890270 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Mon, 24 Mar 2014 16:20:11 +0100 Subject: Fix some documentation errors. Correct links and fix typos, remove obsolete documentation, fix some snippets, mark some classes as internal. Change-Id: I9a3266605f060783413d32740057a57a820c8929 Reviewed-by: Laszlo Agocs --- src/corelib/tools/qmargins.cpp | 20 ++++++++++++++++++++ src/corelib/tools/qstring.cpp | 4 ++-- 2 files changed, 22 insertions(+), 2 deletions(-) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qmargins.cpp b/src/corelib/tools/qmargins.cpp index 03993f05a9..6f2c6c2c7c 100644 --- a/src/corelib/tools/qmargins.cpp +++ b/src/corelib/tools/qmargins.cpp @@ -333,6 +333,26 @@ QT_BEGIN_NAMESPACE \since 5.1 */ +/*! + \fn QMargins &QMargins::operator+=(int addend) + \overload + + Adds the \a addend to each component of this object + and returns a reference to it. + + \sa operator-=() +*/ + +/*! + \fn QMargins &QMargins::operator-=(int subtrahend) + \overload + + Subtracts the \a subtrahend from each component of this object + and returns a reference to it. + + \sa operator+=() +*/ + /*! \fn QMargins &QMargins::operator*=(int factor) diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 7547ba8c19..a8770e886b 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -6168,7 +6168,7 @@ qulonglong QString::toIntegral_helper(const QChar *data, uint len, bool *ok, int \snippet qstring/main.cpp 73 - \sa number(), toULong(), toInt(), QLocale::toLong() + \sa number(), toULong(), toInt(), QLocale::toInt() */ long QString::toLong(bool *ok, int base) const @@ -6197,7 +6197,7 @@ long QString::toLong(bool *ok, int base) const \snippet qstring/main.cpp 78 - \sa number(), QLocale::toULong() + \sa number(), QLocale::toUInt() */ ulong QString::toULong(bool *ok, int base) const -- cgit v1.2.3 From ce8271ce051677a90e975db3a3b82b1e9c7261eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Tue, 18 Mar 2014 10:05:57 +0100 Subject: Remove useless Q_NO_DECLARED_NOT_DEFINED flag The flag is used only in qstring.h and gives no real value. Task-number: QTBUG-37437 Change-Id: I7513b56af208a5edee8452b8bbcb9b128e25133d Reviewed-by: Friedemann Kleint Reviewed-by: Lars Knoll --- src/corelib/tools/qstring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index cf0726d831..2d9a42957e 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -711,7 +711,7 @@ public: Q_DECL_CONSTEXPR inline QString(QStringDataPtr dd) : d(dd.ptr) {} private: -#if defined(QT_NO_CAST_FROM_ASCII) && !defined(Q_NO_DECLARED_NOT_DEFINED) +#if defined(QT_NO_CAST_FROM_ASCII) QString &operator+=(const char *s); QString &operator+=(const QByteArray &s); QString(const char *ch); -- cgit v1.2.3 From 5279134935e858e6fa8565c936b17e88d7bded50 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 21 Jan 2014 10:35:01 +0100 Subject: Reuse one QCollator instance for QString::localeAwareCompare Constructing a QCollator is somewhat expensive, and made localeAwareCompare really slow. As QCollator (at least with the ICU implementation) is not thread safe, use one collator per thread. This speeds up collation of a long list of strings by a factor of 250 for the test case in the bug below. Task-number: QTBUG-36149 Change-Id: I645cdc3546347d1dcc7a03b7563b628c7f756944 Reviewed-by: Thiago Macieira Reviewed-by: Konstantin Ritt --- src/corelib/tools/qstring.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index a8770e886b..f14cdcedda 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -78,6 +78,7 @@ #include "qchar.cpp" #include "qstringmatcher.cpp" #include "qstringiterator_p.h" +#include "qthreadstorage.h" #ifdef Q_OS_WIN # include @@ -5319,6 +5320,10 @@ int QString::localeAwareCompare(const QString &other) const return localeAwareCompare_helper(constData(), length(), other.constData(), other.length()); } +#if defined(QT_USE_ICU) +Q_GLOBAL_STATIC(QThreadStorage, defaultCollator) +#endif + /*! \internal \since 4.5 @@ -5362,8 +5367,9 @@ int QString::localeAwareCompare_helper(const QChar *data1, int length1, CFRelease(otherString); return result; #elif defined(QT_USE_ICU) - QCollator collator; - return collator.compare(data1, length1, data2, length2); + if (!defaultCollator()->hasLocalData()) + defaultCollator()->setLocalData(QCollator()); + return defaultCollator()->localData().compare(data1, length1, data2, length2); #elif defined(Q_OS_UNIX) // declared in int delta = strcoll(toLocal8Bit_helper(data1, length1).constData(), toLocal8Bit_helper(data2, length2).constData()); -- cgit v1.2.3 From 3df521dd98d32017b124ec1985389632056d3b5e Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Tue, 25 Mar 2014 09:26:56 +0100 Subject: Mark QPoint, QPointF, QRect, QRectF as reentrant. Task-number: QTBUG-37667 Change-Id: I978a53e075efcfba8898c8e96bce8f19350dd6c4 Reviewed-by: Jerome Pasion Reviewed-by: Thiago Macieira --- src/corelib/tools/qpoint.cpp | 2 ++ src/corelib/tools/qrect.cpp | 2 ++ 2 files changed, 4 insertions(+) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qpoint.cpp b/src/corelib/tools/qpoint.cpp index 565b1223fe..1063cda52b 100644 --- a/src/corelib/tools/qpoint.cpp +++ b/src/corelib/tools/qpoint.cpp @@ -49,6 +49,7 @@ QT_BEGIN_NAMESPACE \class QPoint \inmodule QtCore \ingroup painting + \reentrant \brief The QPoint class defines a point in the plane using integer precision. @@ -467,6 +468,7 @@ QDebug operator<<(QDebug d, const QPointF &p) \class QPointF \inmodule QtCore \ingroup painting + \reentrant \brief The QPointF class defines a point in the plane using floating point precision. diff --git a/src/corelib/tools/qrect.cpp b/src/corelib/tools/qrect.cpp index 33753efbda..382793f175 100644 --- a/src/corelib/tools/qrect.cpp +++ b/src/corelib/tools/qrect.cpp @@ -52,6 +52,7 @@ QT_BEGIN_NAMESPACE \class QRect \inmodule QtCore \ingroup painting + \reentrant \brief The QRect class defines a rectangle in the plane using integer precision. @@ -1296,6 +1297,7 @@ QDebug operator<<(QDebug dbg, const QRect &r) { \class QRectF \inmodule QtCore \ingroup painting + \reentrant \brief The QRectF class defines a rectangle in the plane using floating point precision. -- cgit v1.2.3 From af2f227080f8d1d129b3e764b3c6c6dc7c36abbc Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Wed, 26 Mar 2014 12:43:25 +0100 Subject: Fix typos Change-Id: I5388666f68f44b052b8950741a5d43f951ba4931 Reviewed-by: Gabriel de Dietrich --- src/corelib/tools/qstring.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index f14cdcedda..01faad6f2d 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -7568,6 +7568,8 @@ QString QString::multiArg(int numArgs, const QString **args) const \since 5.2 Constructs a new QString containing a copy of the \a string CFString. + + \note this function is only available on Mac OS X and iOS. */ /*! \fn CFStringRef QString::toCFString() const @@ -7575,18 +7577,24 @@ QString QString::multiArg(int numArgs, const QString **args) const Creates a CFString from a QString. The caller owns the CFString and is responsible for releasing it. + + \note this function is only available on Mac OS X and iOS. */ /*! \fn QString QString::fromNSString(const NSString *string) \since 5.2 Constructs a new QString containing a copy of the \a string NSString. + + \note this function is only available on Mac OS X and iOS. */ /*! \fn NSString QString::toNSString() const \since 5.2 - Creates a NSString from a QString.g. The NSString is autoreleased. + Creates a NSString from a QString. The NSString is autoreleased. + + \note this function is only available on Mac OS X and iOS. */ /*! \fn bool QString::isSimpleText() const -- cgit v1.2.3 From 624ac989ce7e6834d15a6a60da801dddc33d0321 Mon Sep 17 00:00:00 2001 From: aavit Date: Mon, 17 Mar 2014 14:49:03 +0100 Subject: Fix compile for embedded Android It also has a broken declaration of posix_memalign Change-Id: Ie8f245564f80b04901425729b46953828204efaf Reviewed-by: Andy Nichols --- src/corelib/tools/qsimd_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/tools') diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h index d293532f1d..f4ca971567 100644 --- a/src/corelib/tools/qsimd_p.h +++ b/src/corelib/tools/qsimd_p.h @@ -79,7 +79,7 @@ // SSE intrinsics #if defined(__SSE2__) || (defined(QT_COMPILER_SUPPORTS_SSE2) && defined(Q_CC_MSVC)) -#if defined(QT_LINUXBASE) +#if defined(QT_LINUXBASE) || defined(Q_OS_ANDROID_NO_SDK) /// this is an evil hack - the posix_memalign declaration in LSB /// is wrong - see http://bugs.linuxbase.org/show_bug.cgi?id=2431 # define posix_memalign _lsb_hack_posix_memalign -- cgit v1.2.3