summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qbytearray.cpp85
-rw-r--r--src/corelib/tools/qbytearray.h18
-rw-r--r--src/corelib/tools/qbytearray_mac.mm101
-rw-r--r--src/corelib/tools/qbytearraylist.cpp258
-rw-r--r--src/corelib/tools/qbytearraylist.h124
-rw-r--r--src/corelib/tools/qdatetimeparser_p.h2
-rw-r--r--src/corelib/tools/qeasingcurve.cpp16
-rw-r--r--src/corelib/tools/qstring.cpp134
-rw-r--r--src/corelib/tools/qvarlengtharray.qdoc8
-rw-r--r--src/corelib/tools/qvector.cpp5
-rw-r--r--src/corelib/tools/tools.pri5
11 files changed, 304 insertions, 452 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index 52207dcd4e..9c2a242e8e 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -4186,6 +4186,91 @@ QByteArray QByteArray::fromPercentEncoding(const QByteArray &input, char percent
return tmp;
}
+/*! \fn QByteArray QByteArray::fromCFData(CFDataRef data)
+ \since 5.3
+
+ Constructs a new QByteArray containing a copy of the CFData \a data.
+
+ \sa fromRawCFData(), fromRawData(), toRawCFData(), toCFData()
+*/
+
+/*! \fn QByteArray QByteArray::fromRawCFData(CFDataRef data)
+ \since 5.3
+
+ Constructs a QByteArray that uses the bytes of the CFData \a data.
+
+ The \a data's bytes are not copied.
+
+ The caller guarantees that the CFData will not be deleted
+ or modified as long as this QByteArray object exists.
+
+ \sa fromCFData(), fromRawData(), toRawCFData(), toCFData()
+*/
+
+/*! \fn CFDataRef QByteArray::toCFData() const
+ \since 5.3
+
+ Creates a CFData from a QByteArray. The caller owns the CFData object
+ and is responsible for releasing it.
+
+ \sa toRawCFData(), fromCFData(), fromRawCFData(), fromRawData()
+*/
+
+/*! \fn CFDataRef QByteArray::toRawCFData() const
+ \since 5.3
+
+ Constructs a CFData that uses the bytes of the QByteArray.
+
+ The QByteArray's bytes are not copied.
+
+ The caller guarantees that the QByteArray will not be deleted
+ or modified as long as this CFData object exists.
+
+ \sa toCFData(), fromRawCFData(), fromCFData(), fromRawData()
+*/
+
+/*! \fn QByteArray QByteArray::fromNSData(const NSData *data)
+ \since 5.3
+
+ Constructs a new QByteArray containing a copy of the NSData \a data.
+
+ \sa fromRawNSData(), fromRawData(), toNSData(), toRawNSData()
+*/
+
+/*! \fn QByteArray QByteArray::fromRawNSData(const NSData *data)
+ \since 5.3
+
+ Constructs a QByteArray that uses the bytes of the NSData \a data.
+
+ The \a data's bytes are not copied.
+
+ The caller guarantees that the NSData will not be deleted
+ or modified as long as this QByteArray object exists.
+
+ \sa fromNSData(), fromRawData(), toRawNSData(), toNSData()
+*/
+
+/*! \fn NSData QByteArray::toNSData() const
+ \since 5.3
+
+ Creates a NSData from a QByteArray. The NSData object is autoreleased.
+
+ \sa fromNSData(), fromRawNSData(), fromRawData(), toRawNSData()
+*/
+
+/*! \fn NSData QByteArray::toRawNSData() const
+ \since 5.3
+
+ Constructs a NSData that uses the bytes of the QByteArray.
+
+ The QByteArray's bytes are not copied.
+
+ The caller guarantees that the QByteArray will not be deleted
+ or modified as long as this NSData object exists.
+
+ \sa fromRawNSData(), fromNSData(), fromRawData(), toNSData()
+*/
+
static inline bool q_strchr(const char str[], char chr)
{
if (!str) return false;
diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h
index ae8166db81..b0a6971964 100644
--- a/src/corelib/tools/qbytearray.h
+++ b/src/corelib/tools/qbytearray.h
@@ -65,6 +65,12 @@
#endif
+#ifdef Q_OS_MAC
+Q_FORWARD_DECLARE_CF_TYPE(CFData);
+# ifdef __OBJC__
+Q_FORWARD_DECLARE_OBJC_CLASS(NSData);
+# endif
+#endif
QT_BEGIN_NAMESPACE
@@ -354,6 +360,18 @@ public:
static QByteArray fromHex(const QByteArray &hexEncoded);
static QByteArray fromPercentEncoding(const QByteArray &pctEncoded, char percent = '%');
+#if defined(Q_OS_MAC) || defined(Q_QDOC)
+ static QByteArray fromCFData(CFDataRef data);
+ static QByteArray fromRawCFData(CFDataRef data);
+ CFDataRef toCFData() const Q_DECL_CF_RETURNS_RETAINED;
+ CFDataRef toRawCFData() const Q_DECL_CF_RETURNS_RETAINED;
+# if defined(__OBJC__) || defined(Q_QDOC)
+ static QByteArray fromNSData(const NSData *data);
+ static QByteArray fromRawNSData(const NSData *data);
+ NSData *toNSData() const Q_DECL_NS_RETURNS_AUTORELEASED;
+ NSData *toRawNSData() const Q_DECL_NS_RETURNS_AUTORELEASED;
+# endif
+#endif
typedef char *iterator;
typedef const char *const_iterator;
diff --git a/src/corelib/tools/qbytearray_mac.mm b/src/corelib/tools/qbytearray_mac.mm
new file mode 100644
index 0000000000..8bddf20dc6
--- /dev/null
+++ b/src/corelib/tools/qbytearray_mac.mm
@@ -0,0 +1,101 @@
+/****************************************************************************
+**
+** Copyright (C) 2014 Samuel Gaist <samuel.gaist@edeltech.ch>
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the QtCore module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Digia. For licensing terms and
+** conditions see http://qt.digia.com/licensing. For further information
+** use the contact form at http://qt.digia.com/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Digia gives you certain additional
+** rights. These rights are described in the Digia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3.0 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU General Public License version 3.0 requirements will be
+** met: http://www.gnu.org/copyleft/gpl.html.
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qbytearray.h"
+
+#import <Foundation/Foundation.h>
+
+QT_BEGIN_NAMESPACE
+
+QByteArray QByteArray::fromCFData(CFDataRef data)
+{
+ if (!data)
+ return QByteArray();
+
+ return QByteArray(reinterpret_cast<const char *>(CFDataGetBytePtr(data)), CFDataGetLength(data));
+}
+
+QByteArray QByteArray::fromRawCFData(CFDataRef data)
+{
+ if (!data)
+ return QByteArray();
+
+ return QByteArray::fromRawData(reinterpret_cast<const char *>(CFDataGetBytePtr(data)), CFDataGetLength(data));
+}
+
+CFDataRef QByteArray::toCFData() const
+{
+ return CFDataCreate(kCFAllocatorDefault, reinterpret_cast<const UInt8 *>(data()), length());
+}
+
+CFDataRef QByteArray::toRawCFData() const
+{
+ return CFDataCreateWithBytesNoCopy(kCFAllocatorDefault, reinterpret_cast<const UInt8 *>(data()),
+ length(), kCFAllocatorNull);
+}
+
+QByteArray QByteArray::fromNSData(const NSData *data)
+{
+ if (!data)
+ return QByteArray();
+ return QByteArray(reinterpret_cast<const char *>([data bytes]), [data length]);
+}
+
+QByteArray QByteArray::fromRawNSData(const NSData *data)
+{
+ if (!data)
+ return QByteArray();
+ return QByteArray::fromRawData(reinterpret_cast<const char *>([data bytes]), [data length]);
+}
+
+NSData *QByteArray::toNSData() const
+{
+ return [NSData dataWithBytes:constData() length:size()];
+}
+
+NSData *QByteArray::toRawNSData() const
+{
+ // const_cast is fine here because NSData is immutable thus will never modify bytes we're giving it
+ return [NSData dataWithBytesNoCopy:const_cast<char *>(constData()) length:size() freeWhenDone:NO];
+}
+
+QT_END_NAMESPACE
diff --git a/src/corelib/tools/qbytearraylist.cpp b/src/corelib/tools/qbytearraylist.cpp
deleted file mode 100644
index 817342d682..0000000000
--- a/src/corelib/tools/qbytearraylist.cpp
+++ /dev/null
@@ -1,258 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 by Southwest Research Institute (R)
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qbytearraylist.h>
-
-QT_BEGIN_NAMESPACE
-
-/*! \typedef QByteArrayListIterator
- \relates QByteArrayList
-
- The QByteArrayListIterator type definition provides a Java-style const
- iterator for QByteArrayList.
-
- QByteArrayList provides both \l{Java-style iterators} and
- \l{STL-style iterators}. The Java-style const iterator is simply
- a type definition for QListIterator<QByteArray>.
-
- \sa QMutableByteArrayListIterator, QByteArrayList::const_iterator
-*/
-
-/*! \typedef QMutableByteArrayListIterator
- \relates QByteArrayList
-
- The QByteArrayListIterator type definition provides a Java-style
- non-const iterator for QByteArrayList.
-
- QByteArrayList provides both \l{Java-style iterators} and
- \l{STL-style iterators}. The Java-style non-const iterator is
- simply a type definition for QMutableListIterator<QByteArray>.
-
- \sa QByteArrayListIterator, QByteArrayList::iterator
-*/
-
-/*!
- \class QByteArrayList
- \inmodule QtCore
- \since 5.3
- \brief The QByteArrayList class provides a list of byte arrays.
-
- \ingroup tools
- \ingroup shared
- \ingroup string-processing
-
- \reentrant
-
- QByteArrayList inherits from QList<QByteArray>. Like QList, QByteArrayList is
- \l{implicitly shared}. It provides fast index-based access as well as fast
- insertions and removals. Passing string lists as value parameters is both
- fast and safe.
-
- All of QList's functionality also applies to QByteArrayList. For example, you
- can use isEmpty() to test whether the list is empty, and you can call
- functions like append(), prepend(), insert(), replace(), removeAll(),
- removeAt(), removeFirst(), removeLast(), and removeOne() to modify a
- QByteArrayList. In addition, QByteArrayList provides several join()
- methods for concatenating the list into a single QByteArray.
-
- The purpose of QByteArrayList is quite different from that of QStringList.
- Whereas QStringList has many methods for manipulation of elements within
- the list, QByteArrayList does not.
- Normally, QStringList should be used whenever working with a list of printable
- strings. QByteArrayList should be used to handle and efficiently join large blobs
- of binary data, as when sequentially receiving serialized data through a
- QIODevice.
-
- \sa QByteArray, QStringList
-*/
-
-/*!
- \fn QByteArrayList::QByteArrayList()
-
- Constructs an empty byte array list.
-*/
-
-/*!
- \fn QByteArrayList::QByteArrayList(const QByteArray &ba)
-
- Constructs a byte array list that contains the given byte array,
- \a ba. Longer lists are easily created like this:
-
- \snippet qbytearraylist/main.cpp 0
-
- \sa append()
-*/
-
-/*!
- \fn QByteArrayList::QByteArrayList(const QByteArrayList &other)
-
- Constructs a copy of the \a other byte array list.
-
- This operation takes \l{constant time} because QByteArrayList is
- \l{implicitly shared}, making the process of returning a
- QByteArrayList from a function very fast. If a shared instance is
- modified, it will be copied (copy-on-write), and that takes
- \l{linear time}.
-
- \sa operator=()
-*/
-
-/*!
- \fn QByteArrayList::QByteArrayList(const QList<QByteArray> &other)
-
- Constructs a copy of \a other.
-
- This operation takes \l{constant time}, because QByteArrayList is
- \l{implicitly shared}. This makes returning a QByteArrayList from a
- function very fast. If a shared instance is modified, it will be
- copied (copy-on-write), and that takes \l{linear time}.
-
- \sa operator=()
-*/
-
-/*! \fn QByteArrayList::QByteArrayList(std::initializer_list<QByteArray> args)
-
- Construct a list from a std::initializer_list given by \a args.
-
- This constructor is only enabled if the compiler supports C++11 initializer
- lists.
-*/
-
-/*!
- \fn QByteArray QByteArrayList::join() const
-
- Joins all the byte arrays into a single byte array.
-*/
-
-/*!
- \fn QByteArray QByteArrayList::join(const QByteArray &separator) const
-
- Joins all the byte arrays into a single byte array with each
- element separated by the given \a separator.
-*/
-
-int QByteArrayList_joinedSize(const QByteArrayList *that, int seplen)
-{
- int totalLength = 0;
- const int size = that->size();
-
- for (int i = 0; i < size; ++i)
- totalLength += that->at(i).size();
-
- if (size > 0)
- totalLength += seplen * (size - 1);
-
- return totalLength;
-}
-
-/*!
- \fn QByteArray QByteArrayList::join(char separator) const
-
- Joins all the byte arrays into a single byte array with each
- element separated by the given \a separator.
-*/
-QByteArray QtPrivate::QByteArrayList_join(const QByteArrayList *that, const char *sep, int seplen)
-{
- int totalLength = QByteArrayList_joinedSize(that, seplen);
- QByteArray res;
- if (totalLength == 0)
- return res;
- res.reserve(totalLength);
- for (int i = 0; i < that->size(); ++i) {
- if (i)
- res.append(sep, seplen);
- res += that->at(i);
- }
- return res;
-}
-
-/*!
- \fn QByteArrayList operator+(const QByteArrayList &list1, const QByteArrayList &list2)
- \relates QByteArrayList
-
- Returns a byte array list that is the concatenation of \a list1 and \a list2.
-*/
-
-/*!
- \fn QByteArrayList& operator+=(QByteArrayList &list1, const QByteArrayList &list2)
- \relates QByteArrayList
-
- Appends \a list2 to \a list1 and returns a reference to \a list1.
-*/
-
-/*!
- \fn QByteArrayList &QByteArrayList::operator<<(const QByteArray &ba)
-
- Appends the given byte array, \a ba, to this byte array list and returns
- a reference to the byte array list.
-
- \sa append()
-*/
-
-/*!
- \fn QByteArrayList &QByteArrayList::operator<<(const QByteArrayList &other)
-
- \overload
-
- Appends the \a other byte array list to the byte array list and returns a reference to
- the latter byte array list.
-*/
-
-/*!
- \fn QDataStream &operator>>(QDataStream &in, QByteArrayList &list)
- \relates QByteArrayList
-
- Reads a byte array list from the given \a in stream into the specified
- \a list.
-
- \sa {Serializing Qt Data Types}
-*/
-
-/*!
- \fn QDataStream &operator<<(QDataStream &out, const QByteArrayList &list)
- \relates QByteArrayList
-
- Writes the given byte array \a list to the specified \a out stream.
-
- \sa {Serializing Qt Data Types}
-*/
-
-QT_END_NAMESPACE
diff --git a/src/corelib/tools/qbytearraylist.h b/src/corelib/tools/qbytearraylist.h
deleted file mode 100644
index 882bc68f09..0000000000
--- a/src/corelib/tools/qbytearraylist.h
+++ /dev/null
@@ -1,124 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2013 by Southwest Research Institute (R)
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the QtCore module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and Digia. For licensing terms and
-** conditions see http://qt.digia.com/licensing. For further information
-** use the contact form at http://qt.digia.com/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Digia gives you certain additional
-** rights. These rights are described in the Digia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-
-#ifndef QBYTEARRAYLIST_H
-#define QBYTEARRAYLIST_H
-
-#include <QtCore/qdatastream.h>
-#include <QtCore/qlist.h>
-#include <QtCore/qbytearray.h>
-
-QT_BEGIN_NAMESPACE
-
-
-typedef QListIterator<QByteArray> QByteArrayListIterator;
-typedef QMutableListIterator<QByteArray> QMutableByteArrayListIterator;
-
-class QByteArrayList : public QList<QByteArray>
-{
-public:
- inline QByteArrayList() { }
- inline explicit QByteArrayList(const QByteArray &i) { append(i); }
- inline QByteArrayList(const QByteArrayList &l) : QList<QByteArray>(l) { }
- inline QByteArrayList(const QList<QByteArray> &l) : QList<QByteArray>(l) { }
-#ifdef Q_COMPILER_INITIALIZER_LISTS
- inline QByteArrayList(std::initializer_list<QByteArray> args) : QList<QByteArray>(args) { }
-#endif
-
- inline QByteArray join() const;
- inline QByteArray join(const QByteArray &sep) const;
- inline QByteArray join(char sep) const;
-
- inline QByteArrayList &operator<<(const QByteArray &str)
- { append(str); return *this; }
- inline QByteArrayList &operator<<(const QByteArrayList &l)
- { *this += l; return *this; }
-};
-
-Q_DECLARE_TYPEINFO(QByteArrayList, Q_MOVABLE_TYPE);
-
-namespace QtPrivate {
- QByteArray Q_CORE_EXPORT QByteArrayList_join(const QByteArrayList *that, const char *s, int l);
-}
-
-inline QByteArray QByteArrayList::join() const
-{
- return QtPrivate::QByteArrayList_join(this, 0, 0);
-}
-
-inline QByteArray QByteArrayList::join(const QByteArray &sep) const
-{
- return QtPrivate::QByteArrayList_join(this, sep.constData(), sep.size());
-}
-
-inline QByteArray QByteArrayList::join(char sep) const
-{
- return QtPrivate::QByteArrayList_join(this, &sep, 1);
-}
-
-inline QByteArrayList operator+(const QByteArrayList &lhs, const QByteArrayList &rhs)
-{
- QByteArrayList res = lhs;
- res += rhs;
- return res;
-}
-
-inline QByteArrayList& operator+=(QByteArrayList &lhs, const QByteArrayList &rhs)
-{
- lhs.append( rhs );
- return lhs;
-}
-
-#ifndef QT_NO_DATASTREAM
-inline QDataStream &operator>>(QDataStream &in, QByteArrayList &list)
-{
- return operator>>(in, static_cast<QList<QByteArray> &>(list));
-}
-inline QDataStream &operator<<(QDataStream &out, const QByteArrayList &list)
-{
- return operator<<(out, static_cast<const QList<QByteArray> &>(list));
-}
-#endif // QT_NO_DATASTREAM
-
-QT_END_NAMESPACE
-
-#endif // QBYTEARRAYLIST_H
diff --git a/src/corelib/tools/qdatetimeparser_p.h b/src/corelib/tools/qdatetimeparser_p.h
index 2b4f59a23a..e2513b43a5 100644
--- a/src/corelib/tools/qdatetimeparser_p.h
+++ b/src/corelib/tools/qdatetimeparser_p.h
@@ -241,7 +241,7 @@ public:
3. User increments month: 31/03/2000
At step 1, cachedDay stores 31. At step 2, the 31 is invalid for February, so the cachedDay is not updated.
- At step 3, the the month is changed to March, for which 31 is a valid day. Since 29 < 31, the day is set to cachedDay.
+ At step 3, the month is changed to March, for which 31 is a valid day. Since 29 < 31, the day is set to cachedDay.
This is good for when users have selected their desired day and are scrolling up or down in the month or year section
and do not want smaller months (or non-leap years) to alter the day that they chose.
*/
diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp
index 2708901866..409ebd1de5 100644
--- a/src/corelib/tools/qeasingcurve.cpp
+++ b/src/corelib/tools/qeasingcurve.cpp
@@ -1232,6 +1232,8 @@ void QEasingCurve::setOvershoot(qreal overshoot)
It is only applicable if type() is QEasingCurve::BezierSpline.
Note that the spline implicitly starts at (0.0, 0.0) and has to end at (1.0, 1.0) to
be a valid easing curve.
+ \a c1 and \a c2 are the control points used for drawing the curve.
+ \a endPoint is the endpoint of the curve.
*/
void QEasingCurve::addCubicBezierSegment(const QPointF & c1, const QPointF & c2, const QPointF & endPoint)
{
@@ -1290,8 +1292,12 @@ QVector<QPointF> static inline tcbToBezier(const TCBPoints &tcbPoints)
It is only applicable if type() is QEasingCurve::TCBSpline.
The spline has to start explitly at (0.0, 0.0) and has to end at (1.0, 1.0) to
be a valid easing curve.
- The three parameters are called tension, continuity and bias. All three parameters are
- valid between -1 and 1 and define the tangent of the control point.
+ The tension \a t changes the length of the tangent vector.
+ The continuity \a c changes the sharpness in change between the tangents.
+ The bias \a b changes the direction of the tangent vector.
+ \a nextPoint is the sample position.
+ All three parameters are valid between -1 and 1 and define the
+ tangent of the control point.
If all three parameters are 0 the resulting spline is a Catmull-Rom spline.
The begin and endpoint always have a bias of -1 and 1, since the outer tangent is not defined.
*/
@@ -1390,7 +1396,7 @@ void QEasingCurve::setType(Type type)
/*!
Sets a custom easing curve that is defined by the user in the function \a func.
The signature of the function is qreal myEasingFunction(qreal progress),
- where \e progress and the return value is considered to be normalized between 0 and 1.
+ where \e progress and the return value are considered to be normalized between 0 and 1.
(In some cases the return value can be outside that range)
After calling this function type() will return QEasingCurve::Custom.
\a func cannot be zero.
@@ -1420,8 +1426,8 @@ QEasingCurve::EasingFunction QEasingCurve::customType() const
/*!
Return the effective progress for the easing curve at \a progress.
- While \a progress must be between 0 and 1, the returned effective progress
- can be outside those bounds. For instance, QEasingCurve::InBack will
+ Whereas \a progress must be between 0 and 1, the returned effective progress
+ can be outside those bounds. For example, QEasingCurve::InBack will
return negative values in the beginning of the function.
*/
qreal QEasingCurve::valueForProgress(qreal progress) const
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 116da9e383..7547ba8c19 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -1617,7 +1617,7 @@ void QString::resize(int size)
This function is useful for code that needs to build up a long
string and wants to avoid repeated reallocation. In this example,
- we want to add to the string until some condition is true, and
+ we want to add to the string until some condition is \c true, and
we're fairly sure that size is large enough to make a call to
reserve() worthwhile:
@@ -2534,6 +2534,9 @@ bool QString::operator==(QLatin1String other) const
QT_NO_CAST_FROM_ASCII when you compile your applications. This
can be useful if you want to ensure that all user-visible strings
go through QObject::tr(), for example.
+
+ Returns \c true if this string is lexically equal to the parameter
+ string \a other. Otherwise returns \c false.
*/
/*! \fn bool QString::operator==(const char *other) const
@@ -2563,9 +2566,11 @@ bool operator<(const QString &s1, const QString &s2)
{
return ucstrcmp(s1.constData(), s1.length(), s2.constData(), s2.length()) < 0;
}
-
/*!
- \overload operator<()
+ \overload operator<()
+ \relates QString
+ Returns \c true if this string is lexically less than the parameter
+ string called \a other; otherwise returns \c false.
*/
bool QString::operator<(QLatin1String other) const
{
@@ -2592,6 +2597,9 @@ bool QString::operator<(QLatin1String other) const
/*! \fn bool QString::operator<(const char *other) const
+ Returns \c true if this string is lexically less than string \a other.
+ Otherwise returns \c false.
+
\overload operator<()
The \a other const char pointer is converted to a QString using
@@ -2616,6 +2624,9 @@ bool QString::operator<(QLatin1String other) const
/*! \fn bool QString::operator<=(QLatin1String other) const
+ Returns \c true if this string is lexically less than or equal to
+ parameter string \a other. Otherwise returns \c false.
+
\overload operator<=()
*/
@@ -2658,7 +2669,10 @@ bool QString::operator<(QLatin1String other) const
*/
/*!
- \overload operator>()
+ \overload operator>()
+ \relates QString
+ Returns \c true if this string is lexically greater than the parameter
+ string \a other; otherwise returns \c false.
*/
bool QString::operator>(QLatin1String other) const
{
@@ -2710,6 +2724,9 @@ bool QString::operator>(QLatin1String other) const
/*! \fn bool QString::operator>=(QLatin1String other) const
+ Returns \c true if this string is lexically greater than or equal to parameter
+ string \a other. Otherwise returns \c false.
+
\overload operator>=()
*/
@@ -2754,6 +2771,9 @@ bool QString::operator>(QLatin1String other) const
/*! \fn bool QString::operator!=(QLatin1String other) const
+ Returns \c true if this string is not equal to parameter string \a other.
+ Otherwise returns \c false.
+
\overload operator!=()
*/
@@ -4082,7 +4102,7 @@ QString QString::mid(int position, int n) const
/*!
Returns \c true if the string starts with \a s; otherwise returns
- false.
+ \c false.
If \a cs is Qt::CaseSensitive (default), the search is
case sensitive; otherwise the search is case insensitive.
@@ -4109,7 +4129,7 @@ bool QString::startsWith(QLatin1String s, Qt::CaseSensitivity cs) const
\overload startsWith()
Returns \c true if the string starts with \a c; otherwise returns
- false.
+ \c false.
*/
bool QString::startsWith(QChar c, Qt::CaseSensitivity cs) const
{
@@ -4138,7 +4158,7 @@ bool QString::startsWith(const QStringRef &s, Qt::CaseSensitivity cs) const
/*!
Returns \c true if the string ends with \a s; otherwise returns
- false.
+ \c false.
If \a cs is Qt::CaseSensitive (default), the search is case
sensitive; otherwise the search is case insensitive.
@@ -4181,7 +4201,7 @@ bool QString::endsWith(QLatin1String s, Qt::CaseSensitivity cs) const
/*!
Returns \c true if the string ends with \a c; otherwise returns
- false.
+ \c false.
\overload endsWith()
*/
@@ -4581,7 +4601,7 @@ QString& QString::setUnicode(const QChar *unicode, int size)
replaced with a single space.
Whitespace means any character for which QChar::isSpace() returns
- true. This includes the ASCII characters '\\t', '\\n', '\\v',
+ \c true. This includes the ASCII characters '\\t', '\\n', '\\v',
'\\f', '\\r', and ' '.
Example:
@@ -4671,7 +4691,7 @@ QString QString::simplified() const
the end.
Whitespace means any character for which QChar::isSpace() returns
- true. This includes the ASCII characters '\\t', '\\n', '\\v',
+ \c true. This includes the ASCII characters '\\t', '\\n', '\\v',
'\\f', '\\r', and ' '.
Example:
@@ -4866,7 +4886,7 @@ QString& QString::fill(QChar ch, int size)
/*! \fn bool QString::isEmpty() const
Returns \c true if the string has no characters; otherwise returns
- false.
+ \c false.
Example:
@@ -4981,7 +5001,7 @@ QString& QString::fill(QChar ch, int size)
\relates QString
Returns \c true if \a s1 is not equal to \a s2; otherwise returns
- false.
+ \c false.
For \a s1 != 0, this is equivalent to \c {compare(} \a s1, \a s2
\c {) != 0}. Note that no string is equal to \a s1 being 0.
@@ -5389,12 +5409,12 @@ const ushort *QString::utf16() const
Returns a string of size \a width that contains this string
padded by the \a fill character.
- If \a truncate is false and the size() of the string is more than
+ If \a truncate is \c false and the size() of the string is more than
\a width, then the returned string is a copy of the string.
\snippet qstring/main.cpp 32
- If \a truncate is true and the size() of the string is more than
+ If \a truncate is \c true and the size() of the string is more than
\a width, then any characters in a copy of the string after
position \a width are removed, and the copy is returned.
@@ -5430,7 +5450,7 @@ QString QString::leftJustified(int width, QChar fill, bool truncate) const
\snippet qstring/main.cpp 49
- If \a truncate is false and the size() of the string is more than
+ If \a truncate is \c false and the size() of the string is more than
\a width, then the returned string is a copy of the string.
If \a truncate is true and the size() of the string is more than
@@ -6053,8 +6073,8 @@ QString &QString::vsprintf(const char* cformat, va_list ap)
base, which is 10 by default and must be between 2 and 36, or 0.
Returns 0 if the conversion fails.
- If a conversion error occurs, *\a{ok} is set to false; otherwise
- *\a{ok} is set to true.
+ If a conversion error occurs, *\a{ok} is set to \c false; otherwise
+ *\a{ok} is set to \c true.
If \a base is 0, the C language convention is used: If the string
begins with "0x", base 16 is used; if the string begins with "0",
@@ -6093,8 +6113,8 @@ qlonglong QString::toIntegral_helper(const QChar *data, int len, bool *ok, int b
base, which is 10 by default and must be between 2 and 36, or 0.
Returns 0 if the conversion fails.
- If a conversion error occurs, *\a{ok} is set to false; otherwise
- *\a{ok} is set to true.
+ If a conversion error occurs, *\a{ok} is set to \c false; otherwise
+ *\a{ok} is set to \c true.
If \a base is 0, the C language convention is used: If the string
begins with "0x", base 16 is used; if the string begins with "0",
@@ -6134,8 +6154,8 @@ qulonglong QString::toIntegral_helper(const QChar *data, uint len, bool *ok, int
base, which is 10 by default and must be between 2 and 36, or 0.
Returns 0 if the conversion fails.
- If a conversion error occurs, *\a{ok} is set to false; otherwise
- *\a{ok} is set to true.
+ If a conversion error occurs, *\a{ok} is set to \c false; otherwise
+ *\a{ok} is set to \c true.
If \a base is 0, the C language convention is used: If the string
begins with "0x", base 16 is used; if the string begins with "0",
@@ -6163,8 +6183,8 @@ long QString::toLong(bool *ok, int base) const
base, which is 10 by default and must be between 2 and 36, or 0.
Returns 0 if the conversion fails.
- If a conversion error occurs, *\a{ok} is set to false; otherwise
- *\a{ok} is set to true.
+ If a conversion error occurs, *\a{ok} is set to \c false; otherwise
+ *\a{ok} is set to \c true.
If \a base is 0, the C language convention is used: If the string
begins with "0x", base 16 is used; if the string begins with "0",
@@ -6191,8 +6211,8 @@ ulong QString::toULong(bool *ok, int base) const
base, which is 10 by default and must be between 2 and 36, or 0.
Returns 0 if the conversion fails.
- If a conversion error occurs, *\a{ok} is set to false; otherwise
- *\a{ok} is set to true.
+ If a conversion error occurs, *\a{ok} is set to \c false; otherwise
+ *\a{ok} is set to \c true.
If \a base is 0, the C language convention is used: If the string
begins with "0x", base 16 is used; if the string begins with "0",
@@ -6218,8 +6238,8 @@ int QString::toInt(bool *ok, int base) const
base, which is 10 by default and must be between 2 and 36, or 0.
Returns 0 if the conversion fails.
- If a conversion error occurs, *\a{ok} is set to false; otherwise
- *\a{ok} is set to true.
+ If a conversion error occurs, *\a{ok} is set to \c false; otherwise
+ *\a{ok} is set to \c true.
If \a base is 0, the C language convention is used: If the string
begins with "0x", base 16 is used; if the string begins with "0",
@@ -6245,8 +6265,8 @@ uint QString::toUInt(bool *ok, int base) const
base, which is 10 by default and must be between 2 and 36, or 0.
Returns 0 if the conversion fails.
- If a conversion error occurs, *\a{ok} is set to false; otherwise
- *\a{ok} is set to true.
+ If a conversion error occurs, *\a{ok} is set to \c false; otherwise
+ *\a{ok} is set to \c true.
If \a base is 0, the C language convention is used: If the string
begins with "0x", base 16 is used; if the string begins with "0",
@@ -6272,8 +6292,8 @@ short QString::toShort(bool *ok, int base) const
base, which is 10 by default and must be between 2 and 36, or 0.
Returns 0 if the conversion fails.
- If a conversion error occurs, *\a{ok} is set to false; otherwise
- *\a{ok} is set to true.
+ If a conversion error occurs, *\a{ok} is set to \c false; otherwise
+ *\a{ok} is set to \c true.
If \a base is 0, the C language convention is used: If the string
begins with "0x", base 16 is used; if the string begins with "0",
@@ -6300,8 +6320,8 @@ ushort QString::toUShort(bool *ok, int base) const
Returns 0.0 if the conversion fails.
- If a conversion error occurs, \c{*}\a{ok} is set to false;
- otherwise \c{*}\a{ok} is set to true.
+ If a conversion error occurs, \c{*}\a{ok} is set to \c false;
+ otherwise \c{*}\a{ok} is set to \c true.
\snippet qstring/main.cpp 66
@@ -6332,8 +6352,8 @@ double QString::toDouble(bool *ok) const
/*!
Returns the string converted to a \c float value.
- If a conversion error occurs, *\a{ok} is set to false; otherwise
- *\a{ok} is set to true. Returns 0.0 if the conversion fails.
+ If a conversion error occurs, *\a{ok} is set to \c false; otherwise
+ *\a{ok} is set to \c true. Returns 0.0 if the conversion fails.
The string conversion will always happen in the 'C' locale. For locale
dependent conversion use QLocale::toFloat()
@@ -8276,7 +8296,7 @@ ownership of it, no memory is freed when instances are destroyed.
\fn bool QStringRef::isEmpty() const
Returns \c true if the string reference has no characters; otherwise returns
- false.
+ \c false.
A string reference is empty if its size is zero.
@@ -9523,7 +9543,7 @@ QVector<uint> QStringRef::toUcs4() const
the end.
Whitespace means any character for which QChar::isSpace() returns
- true. This includes the ASCII characters '\\t', '\\n', '\\v',
+ \c true. This includes the ASCII characters '\\t', '\\n', '\\v',
'\\f', '\\r', and ' '.
Unlike QString::simplified(), trimmed() leaves internal whitespace alone.
@@ -9555,8 +9575,8 @@ QStringRef QStringRef::trimmed() const
base, which is 10 by default and must be between 2 and 36, or 0.
Returns 0 if the conversion fails.
- If a conversion error occurs, *\a{ok} is set to false; otherwise
- *\a{ok} is set to true.
+ If a conversion error occurs, *\a{ok} is set to \c false; otherwise
+ *\a{ok} is set to \c true.
If \a base is 0, the C language convention is used: If the string
begins with "0x", base 16 is used; if the string begins with "0",
@@ -9580,8 +9600,8 @@ qint64 QStringRef::toLongLong(bool *ok, int base) const
base, which is 10 by default and must be between 2 and 36, or 0.
Returns 0 if the conversion fails.
- If a conversion error occurs, *\a{ok} is set to false; otherwise
- *\a{ok} is set to true.
+ If a conversion error occurs, *\a{ok} is set to \c false; otherwise
+ *\a{ok} is set to \c true.
If \a base is 0, the C language convention is used: If the string
begins with "0x", base 16 is used; if the string begins with "0",
@@ -9607,8 +9627,8 @@ quint64 QStringRef::toULongLong(bool *ok, int base) const
base, which is 10 by default and must be between 2 and 36, or 0.
Returns 0 if the conversion fails.
- If a conversion error occurs, *\a{ok} is set to false; otherwise
- *\a{ok} is set to true.
+ If a conversion error occurs, *\a{ok} is set to \c false; otherwise
+ *\a{ok} is set to \c true.
If \a base is 0, the C language convention is used: If the string
begins with "0x", base 16 is used; if the string begins with "0",
@@ -9634,8 +9654,8 @@ long QStringRef::toLong(bool *ok, int base) const
base, which is 10 by default and must be between 2 and 36, or 0.
Returns 0 if the conversion fails.
- If a conversion error occurs, *\a{ok} is set to false; otherwise
- *\a{ok} is set to true.
+ If a conversion error occurs, *\a{ok} is set to \c false; otherwise
+ *\a{ok} is set to \c true.
If \a base is 0, the C language convention is used: If the string
begins with "0x", base 16 is used; if the string begins with "0",
@@ -9660,8 +9680,8 @@ ulong QStringRef::toULong(bool *ok, int base) const
base, which is 10 by default and must be between 2 and 36, or 0.
Returns 0 if the conversion fails.
- If a conversion error occurs, *\a{ok} is set to false; otherwise
- *\a{ok} is set to true.
+ If a conversion error occurs, *\a{ok} is set to \c false; otherwise
+ *\a{ok} is set to \c true.
If \a base is 0, the C language convention is used: If the string
begins with "0x", base 16 is used; if the string begins with "0",
@@ -9685,8 +9705,8 @@ int QStringRef::toInt(bool *ok, int base) const
base, which is 10 by default and must be between 2 and 36, or 0.
Returns 0 if the conversion fails.
- If a conversion error occurs, *\a{ok} is set to false; otherwise
- *\a{ok} is set to true.
+ If a conversion error occurs, *\a{ok} is set to \c false; otherwise
+ *\a{ok} is set to \c true.
If \a base is 0, the C language convention is used: If the string
begins with "0x", base 16 is used; if the string begins with "0",
@@ -9710,8 +9730,8 @@ uint QStringRef::toUInt(bool *ok, int base) const
base, which is 10 by default and must be between 2 and 36, or 0.
Returns 0 if the conversion fails.
- If a conversion error occurs, *\a{ok} is set to false; otherwise
- *\a{ok} is set to true.
+ If a conversion error occurs, *\a{ok} is set to \c false; otherwise
+ *\a{ok} is set to \c true.
If \a base is 0, the C language convention is used: If the string
begins with "0x", base 16 is used; if the string begins with "0",
@@ -9735,8 +9755,8 @@ short QStringRef::toShort(bool *ok, int base) const
base, which is 10 by default and must be between 2 and 36, or 0.
Returns 0 if the conversion fails.
- If a conversion error occurs, *\a{ok} is set to false; otherwise
- *\a{ok} is set to true.
+ If a conversion error occurs, *\a{ok} is set to \c false; otherwise
+ *\a{ok} is set to \c true.
If \a base is 0, the C language convention is used: If the string
begins with "0x", base 16 is used; if the string begins with "0",
@@ -9761,8 +9781,8 @@ ushort QStringRef::toUShort(bool *ok, int base) const
Returns 0.0 if the conversion fails.
- If a conversion error occurs, \c{*}\a{ok} is set to false;
- otherwise \c{*}\a{ok} is set to true.
+ If a conversion error occurs, \c{*}\a{ok} is set to \c false;
+ otherwise \c{*}\a{ok} is set to \c true.
The string conversion will always happen in the 'C' locale. For locale
dependent conversion use QLocale::toDouble()
@@ -9784,8 +9804,8 @@ double QStringRef::toDouble(bool *ok) const
/*!
Returns the string converted to a \c float value.
- If a conversion error occurs, *\a{ok} is set to false; otherwise
- *\a{ok} is set to true. Returns 0.0 if the conversion fails.
+ If a conversion error occurs, *\a{ok} is set to \c false; otherwise
+ *\a{ok} is set to \c true. Returns 0.0 if the conversion fails.
The string conversion will always happen in the 'C' locale. For locale
dependent conversion use QLocale::toFloat()
diff --git a/src/corelib/tools/qvarlengtharray.qdoc b/src/corelib/tools/qvarlengtharray.qdoc
index 05d9258c86..73036ceaed 100644
--- a/src/corelib/tools/qvarlengtharray.qdoc
+++ b/src/corelib/tools/qvarlengtharray.qdoc
@@ -189,6 +189,8 @@
/*! \fn bool QVarLengthArray::empty() const
\since 5.0
+ Returns \c true if the array has size 0; otherwise returns \c false.
+
Same as isEmpty(). Provided for STL-compatibility.
*/
@@ -285,7 +287,8 @@
\fn void QVarLengthArray::push_back(const T &t)
\since 5.0
- Same as append(). Provided for STL-compatibility.
+ Appends item \a t to the array, extending the array if necessary.
+ Provided for STL-compatibility.
*/
/*!
@@ -665,8 +668,7 @@
/*! \fn QVarLengthArray &QVarLengthArray::operator+=(const T &value)
\since 4.8
- Appends \a value to the array and returns a reference to this
- vector.
+ Appends \a value to the array and returns a reference to this vector.
\sa append(), operator<<()
*/
diff --git a/src/corelib/tools/qvector.cpp b/src/corelib/tools/qvector.cpp
index 4beb0f939c..89396540e0 100644
--- a/src/corelib/tools/qvector.cpp
+++ b/src/corelib/tools/qvector.cpp
@@ -565,6 +565,7 @@
/*! \fn void QVector::removeAt(int i)
\since 5.2
+ Removes the element at index position \a i.
Equivalent to
\code
remove(i);
@@ -588,6 +589,8 @@
/*! \fn T QVector::takeAt(int i)
\since 5.2
+ Removes the element at index position \a i and returns it.
+
Equivalent to
\code
T t = at(i);
@@ -907,7 +910,7 @@
/*! \fn bool QVector::empty() const
This function is provided for STL compatibility. It is equivalent
- to isEmpty(), returning true if the vector is empty; otherwise
+ to isEmpty(), returning \c true if the vector is empty; otherwise
returns \c false.
*/
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index 1e4a503778..863cf03439 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -9,7 +9,6 @@ HEADERS += \
tools/qarraydatapointer.h \
tools/qbitarray.h \
tools/qbytearray.h \
- tools/qbytearraylist.h \
tools/qbytearraymatcher.h \
tools/qbytedata_p.h \
tools/qcache.h \
@@ -78,7 +77,6 @@ SOURCES += \
tools/qarraydata.cpp \
tools/qbitarray.cpp \
tools/qbytearray.cpp \
- tools/qbytearraylist.cpp \
tools/qbytearraymatcher.cpp \
tools/qcollator.cpp \
tools/qcommandlineoption.cpp \
@@ -127,7 +125,8 @@ false: SOURCES += $$NO_PCH_SOURCES # Hack for QtCreator
SOURCES += tools/qelapsedtimer_mac.cpp
OBJECTIVE_SOURCES += tools/qlocale_mac.mm \
tools/qtimezoneprivate_mac.mm \
- tools/qstring_mac.mm
+ tools/qstring_mac.mm \
+ tools/qbytearray_mac.mm
}
else:blackberry {
SOURCES += tools/qelapsedtimer_unix.cpp tools/qlocale_blackberry.cpp tools/qtimezoneprivate_tz.cpp