From 3dcc075f4a5efce348a6fa00cf5a0adef97b1089 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 18 Apr 2017 16:22:46 -0700 Subject: Move Q_REQUIRED_RESULT to its correct position That's before the return type or static, inline, constexpr or such keywords (if any). Perl Script: s/^(\s+)(.*) Q_REQUIRED_RESULT(;)?(\s*\/\/.*)?$/\1Q_REQUIRED_RESULT \2\3\4/ Change-Id: I7814054a102a407d876ffffd14b6a16182f159e2 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/corelib/global/qfloat16.h | 16 +-- src/corelib/global/qglobal.h | 18 +-- src/corelib/io/qurl.h | 4 +- src/corelib/thread/qthreadpool.h | 2 +- src/corelib/tools/qarraydata.h | 14 +-- src/corelib/tools/qarraydatapointer.h | 2 +- src/corelib/tools/qbytearray.h | 56 ++++----- src/corelib/tools/qdatetime.h | 20 ++-- src/corelib/tools/qline.h | 18 +-- src/corelib/tools/qpoint.h | 6 +- src/corelib/tools/qrect.h | 46 ++++---- src/corelib/tools/qsize.h | 26 ++--- src/corelib/tools/qstring.h | 202 ++++++++++++++++----------------- src/corelib/tools/qtimezoneprivate_p.h | 4 +- src/corelib/tools/qversionnumber.h | 28 ++--- 15 files changed, 227 insertions(+), 235 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h index 3b54719f4f..b0272c51c3 100644 --- a/src/corelib/global/qfloat16.h +++ b/src/corelib/global/qfloat16.h @@ -81,18 +81,18 @@ private: Q_DECLARE_TYPEINFO(qfloat16, Q_PRIMITIVE_TYPE); -Q_CORE_EXPORT Q_REQUIRED_RESULT bool qIsInf(qfloat16 f) Q_DECL_NOTHROW; // complements qnumeric.h -Q_CORE_EXPORT Q_REQUIRED_RESULT bool qIsNaN(qfloat16 f) Q_DECL_NOTHROW; // complements qnumeric.h -Q_CORE_EXPORT Q_REQUIRED_RESULT bool qIsFinite(qfloat16 f) Q_DECL_NOTHROW; // complements qnumeric.h +Q_REQUIRED_RESULT Q_CORE_EXPORT bool qIsInf(qfloat16 f) Q_DECL_NOTHROW; // complements qnumeric.h +Q_REQUIRED_RESULT Q_CORE_EXPORT bool qIsNaN(qfloat16 f) Q_DECL_NOTHROW; // complements qnumeric.h +Q_REQUIRED_RESULT Q_CORE_EXPORT bool qIsFinite(qfloat16 f) Q_DECL_NOTHROW; // complements qnumeric.h // The remainder of these utility functions complement qglobal.h -inline Q_REQUIRED_RESULT int qRound(qfloat16 d) Q_DECL_NOTHROW +Q_REQUIRED_RESULT inline int qRound(qfloat16 d) Q_DECL_NOTHROW { return qRound(static_cast(d)); } -inline Q_REQUIRED_RESULT qint64 qRound64(qfloat16 d) Q_DECL_NOTHROW +Q_REQUIRED_RESULT inline qint64 qRound64(qfloat16 d) Q_DECL_NOTHROW { return qRound64(static_cast(d)); } -inline Q_REQUIRED_RESULT bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) Q_DECL_NOTHROW +Q_REQUIRED_RESULT inline bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) Q_DECL_NOTHROW { float f1 = static_cast(p1); float f2 = static_cast(p2); @@ -105,7 +105,7 @@ inline Q_REQUIRED_RESULT bool qFuzzyCompare(qfloat16 p1, qfloat16 p2) Q_DECL_NOT return (qAbs(f1 - f2) * 102.5f <= qMin(qAbs(f1), qAbs(f2))); } -inline Q_REQUIRED_RESULT bool qIsNull(qfloat16 f) Q_DECL_NOTHROW +Q_REQUIRED_RESULT inline bool qIsNull(qfloat16 f) Q_DECL_NOTHROW { return (f.b16 & static_cast(0x7fff)) == 0; } @@ -247,7 +247,7 @@ QT_WARNING_POP /*! \internal */ -inline Q_REQUIRED_RESULT bool qFuzzyIsNull(qfloat16 f) Q_DECL_NOTHROW +Q_REQUIRED_RESULT inline bool qFuzzyIsNull(qfloat16 f) Q_DECL_NOTHROW { return qAbs(static_cast(f)) <= 0.001f; } diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 9ac29acd16..d4d20fd54a 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -770,26 +770,22 @@ typedef void (*QFunctionPointer)(); # define Q_UNIMPLEMENTED() qWarning("Unimplemented code.") #endif -Q_DECL_CONSTEXPR static inline bool qFuzzyCompare(double p1, double p2) Q_REQUIRED_RESULT Q_DECL_UNUSED; -Q_DECL_CONSTEXPR static inline bool qFuzzyCompare(double p1, double p2) +Q_REQUIRED_RESULT Q_DECL_CONSTEXPR static inline Q_DECL_UNUSED bool qFuzzyCompare(double p1, double p2) { return (qAbs(p1 - p2) * 1000000000000. <= qMin(qAbs(p1), qAbs(p2))); } -Q_DECL_CONSTEXPR static inline bool qFuzzyCompare(float p1, float p2) Q_REQUIRED_RESULT Q_DECL_UNUSED; -Q_DECL_CONSTEXPR static inline bool qFuzzyCompare(float p1, float p2) +Q_REQUIRED_RESULT Q_DECL_CONSTEXPR static inline Q_DECL_UNUSED bool qFuzzyCompare(float p1, float p2) { return (qAbs(p1 - p2) * 100000.f <= qMin(qAbs(p1), qAbs(p2))); } -Q_DECL_CONSTEXPR static inline bool qFuzzyIsNull(double d) Q_REQUIRED_RESULT Q_DECL_UNUSED; -Q_DECL_CONSTEXPR static inline bool qFuzzyIsNull(double d) +Q_REQUIRED_RESULT Q_DECL_CONSTEXPR static inline Q_DECL_UNUSED bool qFuzzyIsNull(double d) { return qAbs(d) <= 0.000000000001; } -Q_DECL_CONSTEXPR static inline bool qFuzzyIsNull(float f) Q_REQUIRED_RESULT Q_DECL_UNUSED; -Q_DECL_CONSTEXPR static inline bool qFuzzyIsNull(float f) +Q_REQUIRED_RESULT Q_DECL_CONSTEXPR static inline Q_DECL_UNUSED bool qFuzzyIsNull(float f) { return qAbs(f) <= 0.00001f; } @@ -799,8 +795,7 @@ Q_DECL_CONSTEXPR static inline bool qFuzzyIsNull(float f) check whether the actual value is 0 or close to 0, but whether it is binary 0, disregarding sign. */ -static inline bool qIsNull(double d) Q_REQUIRED_RESULT Q_DECL_UNUSED; -static inline bool qIsNull(double d) +Q_REQUIRED_RESULT static inline Q_DECL_UNUSED bool qIsNull(double d) { union U { double d; @@ -816,8 +811,7 @@ static inline bool qIsNull(double d) check whether the actual value is 0 or close to 0, but whether it is binary 0, disregarding sign. */ -static inline bool qIsNull(float f) Q_REQUIRED_RESULT Q_DECL_UNUSED; -static inline bool qIsNull(float f) +Q_REQUIRED_RESULT static inline Q_DECL_UNUSED bool qIsNull(float f) { union U { float f; diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h index c16825a033..0bb8707ff9 100644 --- a/src/corelib/io/qurl.h +++ b/src/corelib/io/qurl.h @@ -196,7 +196,7 @@ public: QString url(FormattingOptions options = FormattingOptions(PrettyDecoded)) const; QString toString(FormattingOptions options = FormattingOptions(PrettyDecoded)) const; QString toDisplayString(FormattingOptions options = FormattingOptions(PrettyDecoded)) const; - QUrl adjusted(FormattingOptions options) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QUrl adjusted(FormattingOptions options) const; QByteArray toEncoded(FormattingOptions options = FullyEncoded) const; static QUrl fromEncoded(const QByteArray &url, ParsingMode mode = TolerantMode); @@ -255,7 +255,7 @@ public: QString fragment(ComponentFormattingOptions options = PrettyDecoded) const; void setFragment(const QString &fragment, ParsingMode mode = TolerantMode); - QUrl resolved(const QUrl &relative) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QUrl resolved(const QUrl &relative) const; bool isRelative() const; bool isParentOf(const QUrl &url) const; diff --git a/src/corelib/thread/qthreadpool.h b/src/corelib/thread/qthreadpool.h index 74a8c28fc8..09b7f96f48 100644 --- a/src/corelib/thread/qthreadpool.h +++ b/src/corelib/thread/qthreadpool.h @@ -88,7 +88,7 @@ public: QT_DEPRECATED_X("use tryTake(), but note the different deletion rules") void cancel(QRunnable *runnable); #endif - bool tryTake(QRunnable *runnable) Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT bool tryTake(QRunnable *runnable); }; QT_END_NAMESPACE diff --git a/src/corelib/tools/qarraydata.h b/src/corelib/tools/qarraydata.h index bc20932cca..88f0cfb0ea 100644 --- a/src/corelib/tools/qarraydata.h +++ b/src/corelib/tools/qarraydata.h @@ -112,12 +112,10 @@ struct Q_CORE_EXPORT QArrayData return result; } - static QArrayData *allocate(size_t objectSize, size_t alignment, - size_t capacity, AllocationOptions options = Default) - Q_DECL_NOTHROW Q_REQUIRED_RESULT; - static QArrayData *reallocateUnaligned(QArrayData *data, size_t objectSize, - size_t newCapacity, AllocationOptions newOptions = Default) - Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT static QArrayData *allocate(size_t objectSize, size_t alignment, + size_t capacity, AllocationOptions options = Default) Q_DECL_NOTHROW; + Q_REQUIRED_RESULT static QArrayData *reallocateUnaligned(QArrayData *data, size_t objectSize, + size_t newCapacity, AllocationOptions newOptions = Default) Q_DECL_NOTHROW; static void deallocate(QArrayData *data, size_t objectSize, size_t alignment) Q_DECL_NOTHROW; @@ -217,8 +215,8 @@ struct QTypedArrayData class AlignmentDummy { QArrayData header; T data; }; - static QTypedArrayData *allocate(size_t capacity, - AllocationOptions options = Default) Q_REQUIRED_RESULT + Q_REQUIRED_RESULT static QTypedArrayData *allocate(size_t capacity, + AllocationOptions options = Default) { Q_STATIC_ASSERT(sizeof(QTypedArrayData) == sizeof(QArrayData)); return static_cast(QArrayData::allocate(sizeof(T), diff --git a/src/corelib/tools/qarraydatapointer.h b/src/corelib/tools/qarraydatapointer.h index b97dde5a61..51cfa6e849 100644 --- a/src/corelib/tools/qarraydatapointer.h +++ b/src/corelib/tools/qarraydatapointer.h @@ -174,7 +174,7 @@ public: } private: - Data *clone(QArrayData::AllocationOptions options) const Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Data *clone(QArrayData::AllocationOptions options) const { Data *x = Data::allocate(d->detachCapacity(d->size), options); Q_CHECK_PTR(x); diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h index a0e5c5478b..03bb9b5747 100644 --- a/src/corelib/tools/qbytearray.h +++ b/src/corelib/tools/qbytearray.h @@ -227,9 +227,9 @@ public: int count(const char *a) const; int count(const QByteArray &a) const; - QByteArray left(int len) const Q_REQUIRED_RESULT; - QByteArray right(int len) const Q_REQUIRED_RESULT; - QByteArray mid(int index, int len = -1) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QByteArray left(int len) const; + Q_REQUIRED_RESULT QByteArray right(int len) const; + Q_REQUIRED_RESULT QByteArray mid(int index, int len = -1) const; bool startsWith(const QByteArray &a) const; bool startsWith(char c) const; @@ -250,34 +250,34 @@ public: # define Q_REQUIRED_RESULT # define Q_REQUIRED_RESULT_pushed # endif - Q_ALWAYS_INLINE QByteArray toLower() const & Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QByteArray toLower() const & { return toLower_helper(*this); } - Q_ALWAYS_INLINE QByteArray toLower() && Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QByteArray toLower() && { return toLower_helper(*this); } - Q_ALWAYS_INLINE QByteArray toUpper() const & Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QByteArray toUpper() const & { return toUpper_helper(*this); } - Q_ALWAYS_INLINE QByteArray toUpper() && Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QByteArray toUpper() && { return toUpper_helper(*this); } - Q_ALWAYS_INLINE QByteArray trimmed() const & Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QByteArray trimmed() const & { return trimmed_helper(*this); } - Q_ALWAYS_INLINE QByteArray trimmed() && Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QByteArray trimmed() && { return trimmed_helper(*this); } - Q_ALWAYS_INLINE QByteArray simplified() const & Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QByteArray simplified() const & { return simplified_helper(*this); } - Q_ALWAYS_INLINE QByteArray simplified() && Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QByteArray simplified() && { return simplified_helper(*this); } # ifdef Q_REQUIRED_RESULT_pushed # pragma pop_macro("Q_REQUIRED_RESULT") # endif #else - QByteArray toLower() const Q_REQUIRED_RESULT; - QByteArray toUpper() const Q_REQUIRED_RESULT; - QByteArray trimmed() const Q_REQUIRED_RESULT; - QByteArray simplified() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QByteArray toLower() const; + Q_REQUIRED_RESULT QByteArray toUpper() const; + Q_REQUIRED_RESULT QByteArray trimmed() const; + Q_REQUIRED_RESULT QByteArray simplified() const; #endif - QByteArray leftJustified(int width, char fill = ' ', bool truncate = false) const Q_REQUIRED_RESULT; - QByteArray rightJustified(int width, char fill = ' ', bool truncate = false) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QByteArray leftJustified(int width, char fill = ' ', bool truncate = false) const; + Q_REQUIRED_RESULT QByteArray rightJustified(int width, char fill = ' ', bool truncate = false) const; QByteArray &prepend(char c); QByteArray &prepend(int count, char c); @@ -312,7 +312,7 @@ public: QList split(char sep) const; - QByteArray repeated(int times) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QByteArray repeated(int times) const; #ifndef QT_NO_CAST_TO_ASCII QT_ASCII_CAST_WARN QByteArray &append(const QString &s); @@ -362,16 +362,16 @@ public: QByteArray &setNum(double, char f = 'g', int prec = 6); QByteArray &setRawData(const char *a, uint n); // ### Qt 6: use an int - static QByteArray number(int, int base = 10) Q_REQUIRED_RESULT; - static QByteArray number(uint, int base = 10) Q_REQUIRED_RESULT; - static QByteArray number(qlonglong, int base = 10) Q_REQUIRED_RESULT; - static QByteArray number(qulonglong, int base = 10) Q_REQUIRED_RESULT; - static QByteArray number(double, char f = 'g', int prec = 6) Q_REQUIRED_RESULT; - static QByteArray fromRawData(const char *, int size) Q_REQUIRED_RESULT; - static QByteArray fromBase64(const QByteArray &base64, Base64Options options) Q_REQUIRED_RESULT; - static QByteArray fromBase64(const QByteArray &base64) Q_REQUIRED_RESULT; // ### Qt6 merge with previous - static QByteArray fromHex(const QByteArray &hexEncoded) Q_REQUIRED_RESULT; - static QByteArray fromPercentEncoding(const QByteArray &pctEncoded, char percent = '%') Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT static QByteArray number(int, int base = 10); + Q_REQUIRED_RESULT static QByteArray number(uint, int base = 10); + Q_REQUIRED_RESULT static QByteArray number(qlonglong, int base = 10); + Q_REQUIRED_RESULT static QByteArray number(qulonglong, int base = 10); + Q_REQUIRED_RESULT static QByteArray number(double, char f = 'g', int prec = 6); + Q_REQUIRED_RESULT static QByteArray fromRawData(const char *, int size); + Q_REQUIRED_RESULT static QByteArray fromBase64(const QByteArray &base64, Base64Options options); + Q_REQUIRED_RESULT static QByteArray fromBase64(const QByteArray &base64); // ### Qt6 merge with previous + Q_REQUIRED_RESULT static QByteArray fromHex(const QByteArray &hexEncoded); + Q_REQUIRED_RESULT static QByteArray fromPercentEncoding(const QByteArray &pctEncoded, char percent = '%'); #if defined(Q_OS_DARWIN) || defined(Q_QDOC) static QByteArray fromCFData(CFDataRef data); diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h index c7f14ed40a..2518dc7301 100644 --- a/src/corelib/tools/qdatetime.h +++ b/src/corelib/tools/qdatetime.h @@ -103,9 +103,9 @@ QT_DEPRECATED inline bool setYMD(int y, int m, int d) #endif // < Qt 6 void getDate(int *year, int *month, int *day) const; - QDate addDays(qint64 days) const Q_REQUIRED_RESULT; - QDate addMonths(int months) const Q_REQUIRED_RESULT; - QDate addYears(int years) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QDate addDays(qint64 days) const; + Q_REQUIRED_RESULT QDate addMonths(int months) const; + Q_REQUIRED_RESULT QDate addYears(int years) const; qint64 daysTo(const QDate &) const; Q_DECL_CONSTEXPR bool operator==(const QDate &other) const { return jd == other.jd; } @@ -166,9 +166,9 @@ public: #endif bool setHMS(int h, int m, int s, int ms = 0); - QTime addSecs(int secs) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QTime addSecs(int secs) const; int secsTo(const QTime &) const; - QTime addMSecs(int ms) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QTime addMSecs(int ms) const; int msecsTo(const QTime &) const; Q_DECL_CONSTEXPR bool operator==(const QTime &other) const { return mds == other.mds; } @@ -297,11 +297,11 @@ public: QString toString(Qt::DateFormat f = Qt::TextDate) const; QString toString(const QString &format) const; #endif - QDateTime addDays(qint64 days) const Q_REQUIRED_RESULT; - QDateTime addMonths(int months) const Q_REQUIRED_RESULT; - QDateTime addYears(int years) const Q_REQUIRED_RESULT; - QDateTime addSecs(qint64 secs) const Q_REQUIRED_RESULT; - QDateTime addMSecs(qint64 msecs) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QDateTime addDays(qint64 days) const; + Q_REQUIRED_RESULT QDateTime addMonths(int months) const; + Q_REQUIRED_RESULT QDateTime addYears(int years) const; + Q_REQUIRED_RESULT QDateTime addSecs(qint64 secs) const; + Q_REQUIRED_RESULT QDateTime addMSecs(qint64 msecs) const; QDateTime toTimeSpec(Qt::TimeSpec spec) const; inline QDateTime toLocalTime() const { return toTimeSpec(Qt::LocalTime); } diff --git a/src/corelib/tools/qline.h b/src/corelib/tools/qline.h index 5b5ca3b4c8..6361c1af9f 100644 --- a/src/corelib/tools/qline.h +++ b/src/corelib/tools/qline.h @@ -73,10 +73,10 @@ public: inline void translate(const QPoint &p); inline void translate(int dx, int dy); - Q_DECL_CONSTEXPR inline QLine translated(const QPoint &p) const Q_REQUIRED_RESULT; - Q_DECL_CONSTEXPR inline QLine translated(int dx, int dy) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QLine translated(const QPoint &p) const; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QLine translated(int dx, int dy) const; - Q_DECL_CONSTEXPR inline QPoint center() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QPoint center() const; inline void setP1(const QPoint &p1); inline void setP2(const QPoint &p2); @@ -221,7 +221,7 @@ public: Q_DECL_CONSTEXPR inline QLineF(qreal x1, qreal y1, qreal x2, qreal y2); Q_DECL_CONSTEXPR inline QLineF(const QLine &line) : pt1(line.p1()), pt2(line.p2()) { } - static QLineF fromPolar(qreal length, qreal angle) Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT static QLineF fromPolar(qreal length, qreal angle); Q_DECL_CONSTEXPR bool isNull() const; @@ -245,8 +245,8 @@ public: qreal angleTo(const QLineF &l) const; - QLineF unitVector() const Q_REQUIRED_RESULT; - Q_DECL_CONSTEXPR inline QLineF normalVector() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QLineF unitVector() const; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QLineF normalVector() const; // ### Qt 6: rename intersects() or intersection() and rename IntersectType IntersectionType IntersectType intersect(const QLineF &l, QPointF *intersectionPoint) const; @@ -257,10 +257,10 @@ public: inline void translate(const QPointF &p); inline void translate(qreal dx, qreal dy); - Q_DECL_CONSTEXPR inline QLineF translated(const QPointF &p) const Q_REQUIRED_RESULT; - Q_DECL_CONSTEXPR inline QLineF translated(qreal dx, qreal dy) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QLineF translated(const QPointF &p) const; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QLineF translated(qreal dx, qreal dy) const; - Q_DECL_CONSTEXPR inline QPointF center() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QPointF center() const; inline void setP1(const QPointF &p1); inline void setP2(const QPointF &p2); diff --git a/src/corelib/tools/qpoint.h b/src/corelib/tools/qpoint.h index 7b1004897a..0f3e0c3517 100644 --- a/src/corelib/tools/qpoint.h +++ b/src/corelib/tools/qpoint.h @@ -94,7 +94,7 @@ public: friend Q_DECL_CONSTEXPR inline const QPoint operator/(const QPoint &, qreal); #if defined(Q_OS_DARWIN) || defined(Q_QDOC) - CGPoint toCGPoint() const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT CGPoint toCGPoint() const Q_DECL_NOTHROW; #endif private: @@ -256,8 +256,8 @@ public: Q_DECL_CONSTEXPR QPoint toPoint() const; #if defined(Q_OS_DARWIN) || defined(Q_QDOC) - static QPointF fromCGPoint(CGPoint point) Q_DECL_NOTHROW Q_REQUIRED_RESULT; - CGPoint toCGPoint() const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT static QPointF fromCGPoint(CGPoint point) Q_DECL_NOTHROW; + Q_REQUIRED_RESULT CGPoint toCGPoint() const Q_DECL_NOTHROW; #endif private: diff --git a/src/corelib/tools/qrect.h b/src/corelib/tools/qrect.h index 4030cccbd5..19ff87b420 100644 --- a/src/corelib/tools/qrect.h +++ b/src/corelib/tools/qrect.h @@ -70,7 +70,7 @@ public: Q_DECL_CONSTEXPR inline int top() const Q_DECL_NOTHROW; Q_DECL_CONSTEXPR inline int right() const Q_DECL_NOTHROW; Q_DECL_CONSTEXPR inline int bottom() const Q_DECL_NOTHROW; - QRect normalized() const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QRect normalized() const Q_DECL_NOTHROW; Q_DECL_CONSTEXPR inline int x() const Q_DECL_NOTHROW; Q_DECL_CONSTEXPR inline int y() const Q_DECL_NOTHROW; @@ -104,9 +104,9 @@ public: Q_DECL_RELAXED_CONSTEXPR inline void translate(int dx, int dy) Q_DECL_NOTHROW; Q_DECL_RELAXED_CONSTEXPR inline void translate(const QPoint &p) Q_DECL_NOTHROW; - Q_DECL_CONSTEXPR inline QRect translated(int dx, int dy) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; - Q_DECL_CONSTEXPR inline QRect translated(const QPoint &p) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; - Q_DECL_CONSTEXPR inline QRect transposed() const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect translated(int dx, int dy) const Q_DECL_NOTHROW; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect translated(const QPoint &p) const Q_DECL_NOTHROW; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect transposed() const Q_DECL_NOTHROW; Q_DECL_RELAXED_CONSTEXPR inline void moveTo(int x, int t) Q_DECL_NOTHROW; Q_DECL_RELAXED_CONSTEXPR inline void moveTo(const QPoint &p) Q_DECL_NOTHROW; @@ -118,7 +118,7 @@ public: Q_DECL_RELAXED_CONSTEXPR inline void getCoords(int *x1, int *y1, int *x2, int *y2) const; Q_DECL_RELAXED_CONSTEXPR inline void adjust(int x1, int y1, int x2, int y2) Q_DECL_NOTHROW; - Q_DECL_CONSTEXPR inline QRect adjusted(int x1, int y1, int x2, int y2) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect adjusted(int x1, int y1, int x2, int y2) const Q_DECL_NOTHROW; Q_DECL_CONSTEXPR inline QSize size() const Q_DECL_NOTHROW; Q_DECL_CONSTEXPR inline int width() const Q_DECL_NOTHROW; @@ -136,8 +136,8 @@ public: bool contains(const QPoint &p, bool proper=false) const Q_DECL_NOTHROW; inline bool contains(int x, int y) const Q_DECL_NOTHROW; inline bool contains(int x, int y, bool proper) const Q_DECL_NOTHROW; - inline QRect united(const QRect &other) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; - inline QRect intersected(const QRect &other) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT inline QRect united(const QRect &other) const Q_DECL_NOTHROW; + Q_REQUIRED_RESULT inline QRect intersected(const QRect &other) const Q_DECL_NOTHROW; bool intersects(const QRect &r) const Q_DECL_NOTHROW; Q_DECL_CONSTEXPR inline QRect marginsAdded(const QMargins &margins) const Q_DECL_NOTHROW; @@ -146,15 +146,15 @@ public: Q_DECL_RELAXED_CONSTEXPR inline QRect &operator-=(const QMargins &margins) Q_DECL_NOTHROW; #if QT_DEPRECATED_SINCE(5, 0) - QT_DEPRECATED QRect unite(const QRect &r) const Q_DECL_NOTHROW Q_REQUIRED_RESULT { return united(r); } - QT_DEPRECATED QRect intersect(const QRect &r) const Q_DECL_NOTHROW Q_REQUIRED_RESULT { return intersected(r); } + Q_REQUIRED_RESULT QT_DEPRECATED QRect unite(const QRect &r) const Q_DECL_NOTHROW { return united(r); } + Q_REQUIRED_RESULT QT_DEPRECATED QRect intersect(const QRect &r) const Q_DECL_NOTHROW { return intersected(r); } #endif friend Q_DECL_CONSTEXPR inline bool operator==(const QRect &, const QRect &) Q_DECL_NOTHROW; friend Q_DECL_CONSTEXPR inline bool operator!=(const QRect &, const QRect &) Q_DECL_NOTHROW; #if defined(Q_OS_DARWIN) || defined(Q_QDOC) - CGRect toCGRect() const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT CGRect toCGRect() const Q_DECL_NOTHROW; #endif private: @@ -520,7 +520,7 @@ public: Q_DECL_CONSTEXPR inline bool isNull() const Q_DECL_NOTHROW; Q_DECL_CONSTEXPR inline bool isEmpty() const Q_DECL_NOTHROW; Q_DECL_CONSTEXPR inline bool isValid() const Q_DECL_NOTHROW; - QRectF normalized() const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QRectF normalized() const Q_DECL_NOTHROW; Q_DECL_CONSTEXPR inline qreal left() const Q_DECL_NOTHROW { return xp; } Q_DECL_CONSTEXPR inline qreal top() const Q_DECL_NOTHROW { return yp; } @@ -560,10 +560,10 @@ public: Q_DECL_RELAXED_CONSTEXPR inline void translate(qreal dx, qreal dy) Q_DECL_NOTHROW; Q_DECL_RELAXED_CONSTEXPR inline void translate(const QPointF &p) Q_DECL_NOTHROW; - Q_DECL_CONSTEXPR inline QRectF translated(qreal dx, qreal dy) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; - Q_DECL_CONSTEXPR inline QRectF translated(const QPointF &p) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF translated(qreal dx, qreal dy) const Q_DECL_NOTHROW; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF translated(const QPointF &p) const Q_DECL_NOTHROW; - Q_DECL_CONSTEXPR inline QRectF transposed() const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF transposed() const Q_DECL_NOTHROW; Q_DECL_RELAXED_CONSTEXPR inline void moveTo(qreal x, qreal y) Q_DECL_NOTHROW; Q_DECL_RELAXED_CONSTEXPR inline void moveTo(const QPointF &p) Q_DECL_NOTHROW; @@ -575,7 +575,7 @@ public: Q_DECL_RELAXED_CONSTEXPR inline void getCoords(qreal *x1, qreal *y1, qreal *x2, qreal *y2) const; Q_DECL_RELAXED_CONSTEXPR inline void adjust(qreal x1, qreal y1, qreal x2, qreal y2) Q_DECL_NOTHROW; - Q_DECL_CONSTEXPR inline QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const Q_DECL_NOTHROW; Q_DECL_CONSTEXPR inline QSizeF size() const Q_DECL_NOTHROW; Q_DECL_CONSTEXPR inline qreal width() const Q_DECL_NOTHROW; @@ -592,8 +592,8 @@ public: bool contains(const QRectF &r) const Q_DECL_NOTHROW; bool contains(const QPointF &p) const Q_DECL_NOTHROW; inline bool contains(qreal x, qreal y) const Q_DECL_NOTHROW; - inline QRectF united(const QRectF &other) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; - inline QRectF intersected(const QRectF &other) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT inline QRectF united(const QRectF &other) const Q_DECL_NOTHROW; + Q_REQUIRED_RESULT inline QRectF intersected(const QRectF &other) const Q_DECL_NOTHROW; bool intersects(const QRectF &r) const Q_DECL_NOTHROW; Q_DECL_CONSTEXPR inline QRectF marginsAdded(const QMarginsF &margins) const Q_DECL_NOTHROW; @@ -602,19 +602,19 @@ public: Q_DECL_RELAXED_CONSTEXPR inline QRectF &operator-=(const QMarginsF &margins) Q_DECL_NOTHROW; #if QT_DEPRECATED_SINCE(5, 0) - QT_DEPRECATED QRectF unite(const QRectF &r) const Q_DECL_NOTHROW Q_REQUIRED_RESULT { return united(r); } - QT_DEPRECATED QRectF intersect(const QRectF &r) const Q_DECL_NOTHROW Q_REQUIRED_RESULT { return intersected(r); } + Q_REQUIRED_RESULT QT_DEPRECATED QRectF unite(const QRectF &r) const Q_DECL_NOTHROW { return united(r); } + Q_REQUIRED_RESULT QT_DEPRECATED QRectF intersect(const QRectF &r) const Q_DECL_NOTHROW { return intersected(r); } #endif friend Q_DECL_CONSTEXPR inline bool operator==(const QRectF &, const QRectF &) Q_DECL_NOTHROW; friend Q_DECL_CONSTEXPR inline bool operator!=(const QRectF &, const QRectF &) Q_DECL_NOTHROW; - Q_DECL_CONSTEXPR inline QRect toRect() const Q_DECL_NOTHROW Q_REQUIRED_RESULT; - QRect toAlignedRect() const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QRect toRect() const Q_DECL_NOTHROW; + Q_REQUIRED_RESULT QRect toAlignedRect() const Q_DECL_NOTHROW; #if defined(Q_OS_DARWIN) || defined(Q_QDOC) - static QRectF fromCGRect(CGRect rect) Q_DECL_NOTHROW Q_REQUIRED_RESULT; - CGRect toCGRect() const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT static QRectF fromCGRect(CGRect rect) Q_DECL_NOTHROW; + Q_REQUIRED_RESULT CGRect toCGRect() const Q_DECL_NOTHROW; #endif private: diff --git a/src/corelib/tools/qsize.h b/src/corelib/tools/qsize.h index cd5f8adbf5..bb29dca7c4 100644 --- a/src/corelib/tools/qsize.h +++ b/src/corelib/tools/qsize.h @@ -64,15 +64,15 @@ public: Q_DECL_RELAXED_CONSTEXPR inline void setWidth(int w) Q_DECL_NOTHROW; Q_DECL_RELAXED_CONSTEXPR inline void setHeight(int h) Q_DECL_NOTHROW; void transpose() Q_DECL_NOTHROW; - Q_DECL_CONSTEXPR inline QSize transposed() const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSize transposed() const Q_DECL_NOTHROW; inline void scale(int w, int h, Qt::AspectRatioMode mode) Q_DECL_NOTHROW; inline void scale(const QSize &s, Qt::AspectRatioMode mode) Q_DECL_NOTHROW; - QSize scaled(int w, int h, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; - QSize scaled(const QSize &s, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QSize scaled(int w, int h, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW; + Q_REQUIRED_RESULT QSize scaled(const QSize &s, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW; - Q_DECL_CONSTEXPR inline QSize expandedTo(const QSize &) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; - Q_DECL_CONSTEXPR inline QSize boundedTo(const QSize &) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSize expandedTo(const QSize &) const Q_DECL_NOTHROW; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSize boundedTo(const QSize &) const Q_DECL_NOTHROW; Q_DECL_RELAXED_CONSTEXPR inline int &rwidth() Q_DECL_NOTHROW; Q_DECL_RELAXED_CONSTEXPR inline int &rheight() Q_DECL_NOTHROW; @@ -91,7 +91,7 @@ public: friend inline const QSize operator/(const QSize &, qreal); #if defined(Q_OS_DARWIN) || defined(Q_QDOC) - CGSize toCGSize() const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT CGSize toCGSize() const Q_DECL_NOTHROW; #endif private: @@ -228,15 +228,15 @@ public: Q_DECL_RELAXED_CONSTEXPR inline void setWidth(qreal w) Q_DECL_NOTHROW; Q_DECL_RELAXED_CONSTEXPR inline void setHeight(qreal h) Q_DECL_NOTHROW; void transpose() Q_DECL_NOTHROW; - Q_DECL_CONSTEXPR inline QSizeF transposed() const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSizeF transposed() const Q_DECL_NOTHROW; inline void scale(qreal w, qreal h, Qt::AspectRatioMode mode) Q_DECL_NOTHROW; inline void scale(const QSizeF &s, Qt::AspectRatioMode mode) Q_DECL_NOTHROW; - QSizeF scaled(qreal w, qreal h, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; - QSizeF scaled(const QSizeF &s, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QSizeF scaled(qreal w, qreal h, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW; + Q_REQUIRED_RESULT QSizeF scaled(const QSizeF &s, Qt::AspectRatioMode mode) const Q_DECL_NOTHROW; - Q_DECL_CONSTEXPR inline QSizeF expandedTo(const QSizeF &) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; - Q_DECL_CONSTEXPR inline QSizeF boundedTo(const QSizeF &) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSizeF expandedTo(const QSizeF &) const Q_DECL_NOTHROW; + Q_REQUIRED_RESULT Q_DECL_CONSTEXPR inline QSizeF boundedTo(const QSizeF &) const Q_DECL_NOTHROW; Q_DECL_RELAXED_CONSTEXPR inline qreal &rwidth() Q_DECL_NOTHROW; Q_DECL_RELAXED_CONSTEXPR inline qreal &rheight() Q_DECL_NOTHROW; @@ -257,8 +257,8 @@ public: Q_DECL_CONSTEXPR inline QSize toSize() const Q_DECL_NOTHROW; #if defined(Q_OS_DARWIN) || defined(Q_QDOC) - static QSizeF fromCGSize(CGSize size) Q_DECL_NOTHROW Q_REQUIRED_RESULT; - CGSize toCGSize() const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT static QSizeF fromCGSize(CGSize size) Q_DECL_NOTHROW; + Q_REQUIRED_RESULT CGSize toCGSize() const Q_DECL_NOTHROW; #endif private: diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 09a3bcb521..f81a58813d 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -261,47 +261,47 @@ public: const QChar operator[](uint i) const; QCharRef operator[](uint i); - QString arg(qlonglong a, int fieldwidth=0, int base=10, - QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT; - QString arg(qulonglong a, int fieldwidth=0, int base=10, - QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT; - QString arg(long a, int fieldwidth=0, int base=10, - QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT; - QString arg(ulong a, int fieldwidth=0, int base=10, - QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT; - QString arg(int a, int fieldWidth = 0, int base = 10, - QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT; - QString arg(uint a, int fieldWidth = 0, int base = 10, - QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT; - QString arg(short a, int fieldWidth = 0, int base = 10, - QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT; - QString arg(ushort a, int fieldWidth = 0, int base = 10, - QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT; - QString arg(double a, int fieldWidth = 0, char fmt = 'g', int prec = -1, - QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT; - QString arg(char a, int fieldWidth = 0, - QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT; - QString arg(QChar a, int fieldWidth = 0, - QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT; - QString arg(const QString &a, int fieldWidth = 0, - QChar fillChar = QLatin1Char(' ')) const Q_REQUIRED_RESULT; - QString arg(const QString &a1, const QString &a2) const Q_REQUIRED_RESULT; - QString arg(const QString &a1, const QString &a2, const QString &a3) const Q_REQUIRED_RESULT; - QString arg(const QString &a1, const QString &a2, const QString &a3, - const QString &a4) const Q_REQUIRED_RESULT; - QString arg(const QString &a1, const QString &a2, const QString &a3, - const QString &a4, const QString &a5) const Q_REQUIRED_RESULT; - QString arg(const QString &a1, const QString &a2, const QString &a3, - const QString &a4, const QString &a5, const QString &a6) const Q_REQUIRED_RESULT; - QString arg(const QString &a1, const QString &a2, const QString &a3, + Q_REQUIRED_RESULT QString arg(qlonglong a, int fieldwidth=0, int base=10, + QChar fillChar = QLatin1Char(' ')) const; + Q_REQUIRED_RESULT QString arg(qulonglong a, int fieldwidth=0, int base=10, + QChar fillChar = QLatin1Char(' ')) const; + Q_REQUIRED_RESULT QString arg(long a, int fieldwidth=0, int base=10, + QChar fillChar = QLatin1Char(' ')) const; + Q_REQUIRED_RESULT QString arg(ulong a, int fieldwidth=0, int base=10, + QChar fillChar = QLatin1Char(' ')) const; + Q_REQUIRED_RESULT QString arg(int a, int fieldWidth = 0, int base = 10, + QChar fillChar = QLatin1Char(' ')) const; + Q_REQUIRED_RESULT QString arg(uint a, int fieldWidth = 0, int base = 10, + QChar fillChar = QLatin1Char(' ')) const; + Q_REQUIRED_RESULT QString arg(short a, int fieldWidth = 0, int base = 10, + QChar fillChar = QLatin1Char(' ')) const; + Q_REQUIRED_RESULT QString arg(ushort a, int fieldWidth = 0, int base = 10, + QChar fillChar = QLatin1Char(' ')) const; + Q_REQUIRED_RESULT QString arg(double a, int fieldWidth = 0, char fmt = 'g', int prec = -1, + QChar fillChar = QLatin1Char(' ')) const; + Q_REQUIRED_RESULT QString arg(char a, int fieldWidth = 0, + QChar fillChar = QLatin1Char(' ')) const; + Q_REQUIRED_RESULT QString arg(QChar a, int fieldWidth = 0, + QChar fillChar = QLatin1Char(' ')) const; + Q_REQUIRED_RESULT QString arg(const QString &a, int fieldWidth = 0, + QChar fillChar = QLatin1Char(' ')) const; + Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2) const; + Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2, const QString &a3) const; + Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2, const QString &a3, + const QString &a4) const; + Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2, const QString &a3, + const QString &a4, const QString &a5) const; + Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2, const QString &a3, + const QString &a4, const QString &a5, const QString &a6) const; + Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2, const QString &a3, const QString &a4, const QString &a5, const QString &a6, - const QString &a7) const Q_REQUIRED_RESULT; - QString arg(const QString &a1, const QString &a2, const QString &a3, + const QString &a7) const; + Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2, const QString &a3, const QString &a4, const QString &a5, const QString &a6, - const QString &a7, const QString &a8) const Q_REQUIRED_RESULT; - QString arg(const QString &a1, const QString &a2, const QString &a3, + const QString &a7, const QString &a8) const; + Q_REQUIRED_RESULT QString arg(const QString &a1, const QString &a2, const QString &a3, const QString &a4, const QString &a5, const QString &a6, - const QString &a7, const QString &a8, const QString &a9) const Q_REQUIRED_RESULT; + const QString &a7, const QString &a8, const QString &a9) const; QString &vsprintf(const char *format, va_list ap) Q_ATTRIBUTE_FORMAT_PRINTF(2, 0); QString &sprintf(const char *format, ...) Q_ATTRIBUTE_FORMAT_PRINTF(2, 3); @@ -363,12 +363,12 @@ public: #ifndef QT_NO_REGULAREXPRESSION QString section(const QRegularExpression &re, int start, int end = -1, SectionFlags flags = SectionDefault) const; #endif - QString left(int n) const Q_REQUIRED_RESULT; - QString right(int n) const Q_REQUIRED_RESULT; - QString mid(int position, int n = -1) const Q_REQUIRED_RESULT; - QStringRef leftRef(int n) const Q_REQUIRED_RESULT; - QStringRef rightRef(int n) const Q_REQUIRED_RESULT; - QStringRef midRef(int position, int n = -1) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QString left(int n) const; + Q_REQUIRED_RESULT QString right(int n) const; + Q_REQUIRED_RESULT QString mid(int position, int n = -1) const; + Q_REQUIRED_RESULT QStringRef leftRef(int n) const; + Q_REQUIRED_RESULT QStringRef rightRef(int n) const; + Q_REQUIRED_RESULT QStringRef midRef(int position, int n = -1) const; bool startsWith(const QString &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; bool startsWith(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; @@ -379,8 +379,8 @@ public: bool endsWith(QLatin1String s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; bool endsWith(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; - QString leftJustified(int width, QChar fill = QLatin1Char(' '), bool trunc = false) const Q_REQUIRED_RESULT; - QString rightJustified(int width, QChar fill = QLatin1Char(' '), bool trunc = false) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QString leftJustified(int width, QChar fill = QLatin1Char(' '), bool trunc = false) const; + Q_REQUIRED_RESULT QString rightJustified(int width, QChar fill = QLatin1Char(' '), bool trunc = false) const; #if defined(Q_COMPILER_REF_QUALIFIERS) && !defined(QT_COMPILING_QSTRING_COMPAT_CPP) && !defined(Q_CLANG_QDOC) # if defined(Q_CC_GNU) && !defined(Q_CC_CLANG) && !defined(Q_CC_INTEL) @@ -390,37 +390,37 @@ public: # define Q_REQUIRED_RESULT # define Q_REQUIRED_RESULT_pushed # endif - Q_ALWAYS_INLINE QString toLower() const & Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString toLower() const & { return toLower_helper(*this); } - Q_ALWAYS_INLINE QString toLower() && Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString toLower() && { return toLower_helper(*this); } - Q_ALWAYS_INLINE QString toUpper() const & Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString toUpper() const & { return toUpper_helper(*this); } - Q_ALWAYS_INLINE QString toUpper() && Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString toUpper() && { return toUpper_helper(*this); } - Q_ALWAYS_INLINE QString toCaseFolded() const & Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString toCaseFolded() const & { return toCaseFolded_helper(*this); } - Q_ALWAYS_INLINE QString toCaseFolded() && Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString toCaseFolded() && { return toCaseFolded_helper(*this); } - Q_ALWAYS_INLINE QString trimmed() const & Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString trimmed() const & { return trimmed_helper(*this); } - Q_ALWAYS_INLINE QString trimmed() && Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString trimmed() && { return trimmed_helper(*this); } - Q_ALWAYS_INLINE QString simplified() const & Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString simplified() const & { return simplified_helper(*this); } - Q_ALWAYS_INLINE QString simplified() && Q_REQUIRED_RESULT + Q_REQUIRED_RESULT Q_ALWAYS_INLINE QString simplified() && { return simplified_helper(*this); } # ifdef Q_REQUIRED_RESULT_pushed # pragma pop_macro("Q_REQUIRED_RESULT") # endif #else - QString toLower() const Q_REQUIRED_RESULT; - QString toUpper() const Q_REQUIRED_RESULT; - QString toCaseFolded() const Q_REQUIRED_RESULT; - QString trimmed() const Q_REQUIRED_RESULT; - QString simplified() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QString toLower() const; + Q_REQUIRED_RESULT QString toUpper() const; + Q_REQUIRED_RESULT QString toCaseFolded() const; + Q_REQUIRED_RESULT QString trimmed() const; + Q_REQUIRED_RESULT QString simplified() const; #endif - QString toHtmlEscaped() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QString toHtmlEscaped() const; QString &insert(int i, QChar c); QString &insert(int i, const QChar *uc, int len); @@ -479,21 +479,21 @@ public: enum SplitBehavior { KeepEmptyParts, SkipEmptyParts }; - QStringList split(const QString &sep, SplitBehavior behavior = KeepEmptyParts, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_REQUIRED_RESULT; - QVector splitRef(const QString &sep, SplitBehavior behavior = KeepEmptyParts, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_REQUIRED_RESULT; - QStringList split(QChar sep, SplitBehavior behavior = KeepEmptyParts, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_REQUIRED_RESULT; - QVector splitRef(QChar sep, SplitBehavior behavior = KeepEmptyParts, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QStringList split(const QString &sep, SplitBehavior behavior = KeepEmptyParts, + Qt::CaseSensitivity cs = Qt::CaseSensitive) const; + Q_REQUIRED_RESULT QVector splitRef(const QString &sep, SplitBehavior behavior = KeepEmptyParts, + Qt::CaseSensitivity cs = Qt::CaseSensitive) const; + Q_REQUIRED_RESULT QStringList split(QChar sep, SplitBehavior behavior = KeepEmptyParts, + Qt::CaseSensitivity cs = Qt::CaseSensitive) const; + Q_REQUIRED_RESULT QVector splitRef(QChar sep, SplitBehavior behavior = KeepEmptyParts, + Qt::CaseSensitivity cs = Qt::CaseSensitive) const; #ifndef QT_NO_REGEXP - QStringList split(const QRegExp &sep, SplitBehavior behavior = KeepEmptyParts) const Q_REQUIRED_RESULT; - QVector splitRef(const QRegExp &sep, SplitBehavior behavior = KeepEmptyParts) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QStringList split(const QRegExp &sep, SplitBehavior behavior = KeepEmptyParts) const; + Q_REQUIRED_RESULT QVector splitRef(const QRegExp &sep, SplitBehavior behavior = KeepEmptyParts) const; #endif #ifndef QT_NO_REGULAREXPRESSION - QStringList split(const QRegularExpression &sep, SplitBehavior behavior = KeepEmptyParts) const Q_REQUIRED_RESULT; - QVector splitRef(const QRegularExpression &sep, SplitBehavior behavior = KeepEmptyParts) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QStringList split(const QRegularExpression &sep, SplitBehavior behavior = KeepEmptyParts) const; + Q_REQUIRED_RESULT QVector splitRef(const QRegularExpression &sep, SplitBehavior behavior = KeepEmptyParts) const; #endif enum NormalizationForm { NormalizationForm_D, @@ -501,31 +501,31 @@ public: NormalizationForm_KD, NormalizationForm_KC }; - QString normalized(NormalizationForm mode, QChar::UnicodeVersion version = QChar::Unicode_Unassigned) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QString normalized(NormalizationForm mode, QChar::UnicodeVersion version = QChar::Unicode_Unassigned) const; - QString repeated(int times) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QString repeated(int times) const; const ushort *utf16() const; #if defined(Q_COMPILER_REF_QUALIFIERS) && !defined(QT_COMPILING_QSTRING_COMPAT_CPP) && !defined(Q_CLANG_QDOC) - QByteArray toLatin1() const & Q_REQUIRED_RESULT + Q_REQUIRED_RESULT QByteArray toLatin1() const & { return toLatin1_helper(*this); } - QByteArray toLatin1() && Q_REQUIRED_RESULT + Q_REQUIRED_RESULT QByteArray toLatin1() && { return toLatin1_helper_inplace(*this); } - QByteArray toUtf8() const & Q_REQUIRED_RESULT + Q_REQUIRED_RESULT QByteArray toUtf8() const & { return toUtf8_helper(*this); } - QByteArray toUtf8() && Q_REQUIRED_RESULT + Q_REQUIRED_RESULT QByteArray toUtf8() && { return toUtf8_helper(*this); } - QByteArray toLocal8Bit() const & Q_REQUIRED_RESULT + Q_REQUIRED_RESULT QByteArray toLocal8Bit() const & { return toLocal8Bit_helper(isNull() ? nullptr : constData(), size()); } - QByteArray toLocal8Bit() && Q_REQUIRED_RESULT + Q_REQUIRED_RESULT QByteArray toLocal8Bit() && { return toLocal8Bit_helper(isNull() ? nullptr : constData(), size()); } #else - QByteArray toLatin1() const Q_REQUIRED_RESULT; - QByteArray toUtf8() const Q_REQUIRED_RESULT; - QByteArray toLocal8Bit() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QByteArray toLatin1() const; + Q_REQUIRED_RESULT QByteArray toUtf8() const; + Q_REQUIRED_RESULT QByteArray toLocal8Bit() const; #endif - QVector toUcs4() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QVector toUcs4() const; // note - this are all inline so we can benefit from strlen() compile time optimizations static inline QString fromLatin1(const char *str, int size = -1) @@ -563,12 +563,12 @@ public: { return fromLatin1(str, size); } QT_DEPRECATED static inline QString fromAscii(const QByteArray &str) { return fromLatin1(str); } - QByteArray toAscii() const Q_REQUIRED_RESULT + Q_REQUIRED_RESULT QByteArray toAscii() const { return toLatin1(); } #endif inline int toWCharArray(wchar_t *array) const; - static inline QString fromWCharArray(const wchar_t *string, int size = -1) Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT static inline QString fromWCharArray(const wchar_t *string, int size = -1); QString &setRawData(const QChar *unicode, int size); QString &setUnicode(const QChar *unicode, int size); @@ -1425,14 +1425,14 @@ public: int count(QChar c, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; int count(const QStringRef &s, Qt::CaseSensitivity cs = Qt::CaseSensitive) const; - QVector split(const QString &sep, QString::SplitBehavior behavior = QString::KeepEmptyParts, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_REQUIRED_RESULT; - QVector split(QChar sep, QString::SplitBehavior behavior = QString::KeepEmptyParts, - Qt::CaseSensitivity cs = Qt::CaseSensitive) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QVector split(const QString &sep, QString::SplitBehavior behavior = QString::KeepEmptyParts, + Qt::CaseSensitivity cs = Qt::CaseSensitive) const; + Q_REQUIRED_RESULT QVector split(QChar sep, QString::SplitBehavior behavior = QString::KeepEmptyParts, + Qt::CaseSensitivity cs = Qt::CaseSensitive) const; - QStringRef left(int n) const Q_REQUIRED_RESULT; - QStringRef right(int n) const Q_REQUIRED_RESULT; - QStringRef mid(int pos, int n = -1) const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QStringRef left(int n) const; + Q_REQUIRED_RESULT QStringRef right(int n) const; + Q_REQUIRED_RESULT QStringRef mid(int pos, int n = -1) const; void truncate(int pos) Q_DECL_NOTHROW { m_size = qBound(0, pos, m_size); } void chop(int n) Q_DECL_NOTHROW @@ -1478,13 +1478,13 @@ public: inline const_reverse_iterator crend() const { return rend(); } #if QT_DEPRECATED_SINCE(5, 0) - QT_DEPRECATED QByteArray toAscii() const Q_REQUIRED_RESULT + Q_REQUIRED_RESULT QT_DEPRECATED QByteArray toAscii() const { return toLatin1(); } #endif - QByteArray toLatin1() const Q_REQUIRED_RESULT; - QByteArray toUtf8() const Q_REQUIRED_RESULT; - QByteArray toLocal8Bit() const Q_REQUIRED_RESULT; - QVector toUcs4() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QByteArray toLatin1() const; + Q_REQUIRED_RESULT QByteArray toUtf8() const; + Q_REQUIRED_RESULT QByteArray toLocal8Bit() const; + Q_REQUIRED_RESULT QVector toUcs4() const; inline void clear() { m_string = Q_NULLPTR; m_position = m_size = 0; } QString toString() const; @@ -1526,7 +1526,7 @@ public: static int localeAwareCompare(const QStringRef &s1, const QString &s2); static int localeAwareCompare(const QStringRef &s1, const QStringRef &s2); - QStringRef trimmed() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT QStringRef trimmed() const; short toShort(bool *ok = Q_NULLPTR, int base = 10) const; ushort toUShort(bool *ok = Q_NULLPTR, int base = 10) const; int toInt(bool *ok = Q_NULLPTR, int base = 10) const; diff --git a/src/corelib/tools/qtimezoneprivate_p.h b/src/corelib/tools/qtimezoneprivate_p.h index 0038908160..74b79dce16 100644 --- a/src/corelib/tools/qtimezoneprivate_p.h +++ b/src/corelib/tools/qtimezoneprivate_p.h @@ -154,12 +154,12 @@ public: QLocale::Country country); // returns "UTC" QString and QByteArray - static inline QString utcQString() Q_REQUIRED_RESULT + Q_REQUIRED_RESULT static inline QString utcQString() { return QStringLiteral("UTC"); } - static inline QByteArray utcQByteArray() Q_REQUIRED_RESULT + Q_REQUIRED_RESULT static inline QByteArray utcQByteArray() { return QByteArrayLiteral("UTC"); } diff --git a/src/corelib/tools/qversionnumber.h b/src/corelib/tools/qversionnumber.h index 2aaa6201f7..d3cf743a67 100644 --- a/src/corelib/tools/qversionnumber.h +++ b/src/corelib/tools/qversionnumber.h @@ -248,39 +248,39 @@ public: inline explicit QVersionNumber(int maj, int min, int mic) { m_segments.setSegments(3, maj, min, mic); } - inline bool isNull() const Q_DECL_NOTHROW Q_REQUIRED_RESULT + Q_REQUIRED_RESULT inline bool isNull() const Q_DECL_NOTHROW { return segmentCount() == 0; } - inline bool isNormalized() const Q_DECL_NOTHROW Q_REQUIRED_RESULT + Q_REQUIRED_RESULT inline bool isNormalized() const Q_DECL_NOTHROW { return isNull() || segmentAt(segmentCount() - 1) != 0; } - inline int majorVersion() const Q_DECL_NOTHROW Q_REQUIRED_RESULT + Q_REQUIRED_RESULT inline int majorVersion() const Q_DECL_NOTHROW { return segmentAt(0); } - inline int minorVersion() const Q_DECL_NOTHROW Q_REQUIRED_RESULT + Q_REQUIRED_RESULT inline int minorVersion() const Q_DECL_NOTHROW { return segmentAt(1); } - inline int microVersion() const Q_DECL_NOTHROW Q_REQUIRED_RESULT + Q_REQUIRED_RESULT inline int microVersion() const Q_DECL_NOTHROW { return segmentAt(2); } - Q_CORE_EXPORT QVersionNumber normalized() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_CORE_EXPORT QVersionNumber normalized() const; - Q_CORE_EXPORT QVector segments() const Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_CORE_EXPORT QVector segments() const; - inline int segmentAt(int index) const Q_DECL_NOTHROW Q_REQUIRED_RESULT + Q_REQUIRED_RESULT inline int segmentAt(int index) const Q_DECL_NOTHROW { return (m_segments.size() > index) ? m_segments.at(index) : 0; } - inline int segmentCount() const Q_DECL_NOTHROW Q_REQUIRED_RESULT + Q_REQUIRED_RESULT inline int segmentCount() const Q_DECL_NOTHROW { return m_segments.size(); } - Q_CORE_EXPORT bool isPrefixOf(const QVersionNumber &other) const Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_CORE_EXPORT bool isPrefixOf(const QVersionNumber &other) const Q_DECL_NOTHROW; - Q_CORE_EXPORT static int compare(const QVersionNumber &v1, const QVersionNumber &v2) Q_DECL_NOTHROW Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_CORE_EXPORT static int compare(const QVersionNumber &v1, const QVersionNumber &v2) Q_DECL_NOTHROW; - Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber commonPrefix(const QVersionNumber &v1, const QVersionNumber &v2) Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber commonPrefix(const QVersionNumber &v1, const QVersionNumber &v2); - Q_CORE_EXPORT QString toString() const Q_REQUIRED_RESULT; - Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(const QString &string, int *suffixIndex = Q_NULLPTR) Q_REQUIRED_RESULT; + Q_REQUIRED_RESULT Q_CORE_EXPORT QString toString() const; + Q_REQUIRED_RESULT Q_CORE_EXPORT static Q_DECL_PURE_FUNCTION QVersionNumber fromString(const QString &string, int *suffixIndex = Q_NULLPTR); private: #ifndef QT_NO_DATASTREAM -- cgit v1.2.3