From b9d98c10bdc3c8e6330e84cca48ea302e8cd61c3 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Tue, 25 Nov 2014 09:47:43 +0100 Subject: Deprecate implementations of functions deprecated in headers If you build with configure -DQT_NO_DEPRECATED this will avoid some build errors. Change-Id: If2b2e57b6919091f3f077ebc2aeca0c3fd2421aa Reviewed-by: Olivier Goffart Reviewed-by: Konstantin Ritt --- src/corelib/kernel/qcoreapplication.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/corelib') diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 77900ba906..ca3d92bad1 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -2580,6 +2580,7 @@ void QCoreApplication::removeNativeEventFilter(QAbstractNativeEventFilter *filte \sa QAbstractEventDispatcher::hasPendingEvents() */ +#if QT_DEPRECATED_SINCE(5, 3) bool QCoreApplication::hasPendingEvents() { QAbstractEventDispatcher *eventDispatcher = QAbstractEventDispatcher::instance(); @@ -2587,6 +2588,7 @@ bool QCoreApplication::hasPendingEvents() return eventDispatcher->hasPendingEvents(); return false; } +#endif /*! Returns a pointer to the event dispatcher object for the main thread. If no -- cgit v1.2.3 From 8f201ca4e70a51d1d41f23375414baa4e37e4816 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 24 Nov 2014 16:39:10 +0100 Subject: QJsonArray::(const_)iterator: mark the pointer typedefs as internal MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Just like the other typedefs; removes the doc warnings. Change-Id: I61142b8db57f4e0cc44cb8c459b1e82e69da3413 Reviewed-by: Frederik Gladhorn Reviewed-by: Olivier Goffart Reviewed-by: Jędrzej Nowacki --- src/corelib/json/qjsonarray.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/corelib') diff --git a/src/corelib/json/qjsonarray.cpp b/src/corelib/json/qjsonarray.cpp index 73c53ea649..acbd7dda8f 100644 --- a/src/corelib/json/qjsonarray.cpp +++ b/src/corelib/json/qjsonarray.cpp @@ -709,6 +709,11 @@ bool QJsonArray::operator!=(const QJsonArray &other) const \internal */ +/*! \typedef QJsonArray::iterator::pointer + + \internal +*/ + /*! \fn QJsonArray::iterator::iterator() Constructs an uninitialized iterator. @@ -953,6 +958,11 @@ bool QJsonArray::operator!=(const QJsonArray &other) const \internal */ +/*! \typedef QJsonArray::const_iterator::pointer + + \internal +*/ + /*! \fn QJsonArray::const_iterator::const_iterator(const const_iterator &other) Constructs a copy of \a other. -- cgit v1.2.3 From fc3402ca823b74d1a642753c4cc8bef931411ab7 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 25 Nov 2014 14:33:49 +0100 Subject: Clarify QString::clear() QString::clear() sets the string to the null QString, not just an empty one. Change-Id: Ie6f070f9f2e464105a7b87376e6dad90b5e4d2f2 Reviewed-by: Oswald Buddenhagen --- src/corelib/tools/qstring.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 29b546770c..9921d5cfbb 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -1692,9 +1692,9 @@ void QString::expand(int i) /*! \fn void QString::clear() - Clears the contents of the string and makes it empty. + Clears the contents of the string and makes it null. - \sa resize(), isEmpty() + \sa resize(), isNull() */ /*! \fn QString &QString::operator=(const QString &other) -- cgit v1.2.3 From c6aa76122e209350b8a7b3cb8b5bc8127a3722e7 Mon Sep 17 00:00:00 2001 From: Benjamin Lutz Date: Mon, 16 Sep 2013 14:37:34 +0200 Subject: Fix size miscalculation in QByteArray::toBase64 The size calculation in QByteArray::toBase64 overcalculates the size required for the output by up to 3 Bytes. This is fixed, which also implies that truncate() at the end is needed only if OmitTrailingEquals is used. Task-number: QTBUG-32436 Change-Id: I92a893047e7aca027c4aa0a6655bcca514585ff5 Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira --- src/corelib/tools/qbytearray.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/corelib') diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index a622221bd3..6ac442d27b 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -3571,7 +3571,7 @@ QByteArray QByteArray::toBase64(Base64Options options) const const char padchar = '='; int padlen = 0; - QByteArray tmp((d->size * 4) / 3 + 3, Qt::Uninitialized); + QByteArray tmp((d->size + 2) / 3 * 4, Qt::Uninitialized); int i = 0; char *out = tmp.data(); @@ -3609,8 +3609,9 @@ QByteArray QByteArray::toBase64(Base64Options options) const *out++ = alphabet[m]; } } - - tmp.truncate(out - tmp.data()); + Q_ASSERT((options & OmitTrailingEquals) || (out == tmp.size() + tmp.data())); + if (options & OmitTrailingEquals) + tmp.truncate(out - tmp.data()); return tmp; } -- cgit v1.2.3