diff options
Diffstat (limited to 'src/corelib')
100 files changed, 241 insertions, 77 deletions
diff --git a/src/corelib/arch/qatomic_cxx11.h b/src/corelib/arch/qatomic_cxx11.h index d0135b1b51..4c9001a7cd 100644 --- a/src/corelib/arch/qatomic_cxx11.h +++ b/src/corelib/arch/qatomic_cxx11.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2011 Thiago Macieira <thiago@kde.org> +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/arch/qatomic_msvc.h b/src/corelib/arch/qatomic_msvc.h index f8633179a9..62d54ded55 100644 --- a/src/corelib/arch/qatomic_msvc.h +++ b/src/corelib/arch/qatomic_msvc.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp index 230ec1ccb3..f1054ceb98 100644 --- a/src/corelib/codecs/qutfcodec.cpp +++ b/src/corelib/codecs/qutfcodec.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2013 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/codecs/qutfcodec_p.h b/src/corelib/codecs/qutfcodec_p.h index cb789f935d..152fe174c4 100644 --- a/src/corelib/codecs/qutfcodec_p.h +++ b/src/corelib/codecs/qutfcodec_p.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2013 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/global/archdetect.cpp b/src/corelib/global/archdetect.cpp index 35db0875e5..8a88c2f5c8 100644 --- a/src/corelib/global/archdetect.cpp +++ b/src/corelib/global/archdetect.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2014 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the FOO module of the Qt Toolkit. diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 21040dde38..eec8b5223b 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2014 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h index 69e67e2523..c5ff82c10a 100644 --- a/src/corelib/global/qendian.h +++ b/src/corelib/global/qendian.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp index c02528491e..1227445f1e 100644 --- a/src/corelib/global/qglobal.cpp +++ b/src/corelib/global/qglobal.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2015 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -3540,7 +3540,11 @@ int qrand() \snippet code/src_corelib_global_qglobal.cpp 33 - \sa Q_FOREACH() + \note Since Qt 5.7, the use of this macro is discouraged. It will + be removed in a future version of Qt. Please use C++11 range-for, + possibly with qAsConst(), as needed. + + \sa qAsConst() */ /*! @@ -3552,7 +3556,76 @@ int qrand() This macro is available even when \c no_keywords is specified using the \c .pro file's \c CONFIG variable. - \sa foreach() + \note Since Qt 5.7, the use of this macro is discouraged. It will + be removed in a future version of Qt. Please use C++11 range-for, + possibly with qAsConst(), as needed. + + \sa qAsConst() +*/ + +/*! + \fn qAsConst(T &t) + \relates <QtGlobal> + \since 5.7 + + Returns \a t cast to \c{const T}. + + This function is a Qt implementation of C++17's std::as_const(), + a cast function like std::move(). But while std::move() turns + lvalues into rvalues, this function turns non-const lvalues into + const lvalues. Like std::as_const(), it doesn't work on rvalues, + because it cannot be efficiently implemented for rvalues without + leaving dangling references. + + Its main use in Qt is to prevent implicitly-shared Qt containers + from detaching: + \code + QString s = ...; + for (QChar ch : s) // detaches 's' (performs a deep-copy if 's' was shared) + process(ch); + for (QChar ch : qAsConst(s)) // ok, no detach attempt + process(ch); + \endcode + + Of course, in this case, you could (and probably should) have declared + \c s as \c const in the first place: + \code + const QString s = ...; + for (QChar ch : s) // ok, no detach attempt on const objects + process(ch); + \endcode + but often that is not easily possible. + + It is important to note that qAsConst() does not copy its argument, + it just performs a \c{const_cast<const T&>(t)}. This is also the reason + why it is designed to fail for rvalues: The returned reference would go + stale too soon. So while this works (but detaches the returned object): + \code + for (QChar ch : funcReturningQString()) + process(ch); // OK, the returned object is kept alive for the loop's duration + \endcode + + this would not: + \code + for (QChar ch : qAsConst(funcReturningQString())) + process(ch); // ERROR: ch is copied from deleted memory + \endcode + + To prevent this construct from compiling (and failing at runtime), qAsConst() has + a second, deleted, overload which binds to rvalues. +*/ + +/*! + \fn qAsConst(const T &&t) + \relates <QtGlobal> + \since 5.7 + \overload + + This overload is deleted to prevent a dangling reference in code like + \code + for (QChar ch : qAsConst(funcReturningQString())) + process(ch); // ERROR: ch is copied from deleted memory + \endcode */ /*! diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 2025758522..69840996dc 100644 --- a/src/corelib/global/qglobal.h +++ b/src/corelib/global/qglobal.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2014 Intel Corporation. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/global/qglobalstatic.cpp b/src/corelib/global/qglobalstatic.cpp index 84ed82694d..d1c522a79a 100644 --- a/src/corelib/global/qglobalstatic.cpp +++ b/src/corelib/global/qglobalstatic.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Intel Corporation. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/global/qglobalstatic.h b/src/corelib/global/qglobalstatic.h index 507897880c..4fb3c4f91f 100644 --- a/src/corelib/global/qglobalstatic.h +++ b/src/corelib/global/qglobalstatic.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2012 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index ebb52acd58..ce838622bc 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2014 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 94a2864041..2441de16cd 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -1,8 +1,8 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2014 Olivier Goffart <ogoffart@woboq.com> -** Copyright (C) 2014 Intel Corporation. +** Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com> +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h index b32f63c5f5..f58e062dbd 100644 --- a/src/corelib/global/qnumeric_p.h +++ b/src/corelib/global/qnumeric_p.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2015 Intel Corporation. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/global/qprocessordetection.h b/src/corelib/global/qprocessordetection.h index 0f258f75cf..8c1e041a17 100644 --- a/src/corelib/global/qprocessordetection.h +++ b/src/corelib/global/qprocessordetection.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/global/qsysinfo.h b/src/corelib/global/qsysinfo.h index d5d6fd760c..b74fc80468 100644 --- a/src/corelib/global/qsysinfo.h +++ b/src/corelib/global/qsysinfo.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index 559499476e..2b4f6ebab4 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/global/qversiontagging.cpp b/src/corelib/global/qversiontagging.cpp index 60edd79c7f..e3d4037a16 100644 --- a/src/corelib/global/qversiontagging.cpp +++ b/src/corelib/global/qversiontagging.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 Intel Corporation. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/global/qversiontagging.h b/src/corelib/global/qversiontagging.h index 60fc46f035..706e7e07ff 100644 --- a/src/corelib/global/qversiontagging.h +++ b/src/corelib/global/qversiontagging.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2015 Intel Corporation. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/forkfd_qt.cpp b/src/corelib/io/forkfd_qt.cpp index 2a5aca27a2..9bb102e18f 100644 --- a/src/corelib/io/forkfd_qt.cpp +++ b/src/corelib/io/forkfd_qt.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2014 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qdebug.cpp b/src/corelib/io/qdebug.cpp index 79c160144e..ffa7867d18 100644 --- a/src/corelib/io/qdebug.cpp +++ b/src/corelib/io/qdebug.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2014 Intel Corporation. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -357,7 +357,7 @@ QDebug &QDebug::resetFormat() stream->space = true; if (stream->context.version > 1) stream->flags = 0; - stream->setVerbosity(Stream::defaultVerbosity); + stream->setVerbosity(Stream::DefaultVerbosity); return *this; } diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index 23c5a34fd0..5087e3b532 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -65,14 +66,14 @@ class Q_CORE_EXPORT QDebug friend class QMessageLogger; friend class QDebugStateSaverPrivate; struct Stream { - enum { defaultVerbosity = 2, verbosityShift = 29, verbosityMask = 0x7 }; + enum { DefaultVerbosity = 2, VerbosityShift = 29, VerbosityMask = 0x7 }; Stream(QIODevice *device) : ts(device), ref(1), type(QtDebugMsg), - space(true), message_output(false), flags(defaultVerbosity << verbosityShift) {} + space(true), message_output(false), flags(DefaultVerbosity << VerbosityShift) {} Stream(QString *string) : ts(string, QIODevice::WriteOnly), ref(1), type(QtDebugMsg), - space(true), message_output(false), flags(defaultVerbosity << verbosityShift) {} + space(true), message_output(false), flags(DefaultVerbosity << VerbosityShift) {} Stream(QtMsgType t) : ts(&buffer, QIODevice::WriteOnly), ref(1), type(t), - space(true), message_output(true), flags(defaultVerbosity << verbosityShift) {} + space(true), message_output(true), flags(DefaultVerbosity << VerbosityShift) {} QTextStream ts; QString buffer; int ref; @@ -90,12 +91,12 @@ class Q_CORE_EXPORT QDebug void setFlag(FormatFlag flag) { if (context.version > 1) { flags |= flag; } } void unsetFlag(FormatFlag flag) { if (context.version > 1) { flags &= ~flag; } } int verbosity() const - { return context.version > 1 ? (flags >> verbosityShift) & verbosityMask : int(Stream::defaultVerbosity); } + { return context.version > 1 ? (flags >> VerbosityShift) & VerbosityMask : int(Stream::DefaultVerbosity); } void setVerbosity(int v) { if (context.version > 1) { - flags &= ~(verbosityMask << verbosityShift); - flags |= (v & verbosityMask) << verbosityShift; + flags &= ~(VerbosityMask << VerbosityShift); + flags |= (v & VerbosityMask) << VerbosityShift; } } // added in 5.4 diff --git a/src/corelib/io/qfile.h b/src/corelib/io/qfile.h index e7419681e7..a2a1b25248 100644 --- a/src/corelib/io/qfile.h +++ b/src/corelib/io/qfile.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp index a84a03837d..7a9a4b581c 100644 --- a/src/corelib/io/qfileselector.cpp +++ b/src/corelib/io/qfileselector.cpp @@ -1,6 +1,7 @@ /*************************************************************************** ** ** Copyright (C) 2013 BlackBerry Limited. All rights reserved. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp index 7509307839..2cda4d6bda 100644 --- a/src/corelib/io/qfsfileengine.cpp +++ b/src/corelib/io/qfsfileengine.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qipaddress.cpp b/src/corelib/io/qipaddress.cpp index 010e034d26..13636ebb8b 100644 --- a/src/corelib/io/qipaddress.cpp +++ b/src/corelib/io/qipaddress.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2012 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qipaddress_p.h b/src/corelib/io/qipaddress_p.h index 34e9235763..52fa9c05ad 100644 --- a/src/corelib/io/qipaddress_p.h +++ b/src/corelib/io/qipaddress_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2012 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qlockfile_unix.cpp b/src/corelib/io/qlockfile_unix.cpp index 14ad103c4e..3455305858 100644 --- a/src/corelib/io/qlockfile_unix.cpp +++ b/src/corelib/io/qlockfile_unix.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2013 David Faure <faure+bluesystems@kde.org> +** Copyright (C) 2016 Intel Corporation. ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp index b9c345947b..55938bc5f8 100644 --- a/src/corelib/io/qprocess.cpp +++ b/src/corelib/io/qprocess.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2015 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h index 2e7552b863..89e20c80a9 100644 --- a/src/corelib/io/qprocess_p.h +++ b/src/corelib/io/qprocess_p.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 0ab26b9e78..eeca8b48cf 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index 6b281747e7..6097e85052 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp index da17298789..02318d427a 100644 --- a/src/corelib/io/qstandardpaths.cpp +++ b/src/corelib/io/qstandardpaths.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp index c5a98bbbe6..563913bc12 100644 --- a/src/corelib/io/qtemporarydir.cpp +++ b/src/corelib/io/qtemporarydir.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp index 513cb281f1..9d3689736c 100644 --- a/src/corelib/io/qtextstream.cpp +++ b/src/corelib/io/qtextstream.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qtextstream_p.h b/src/corelib/io/qtextstream_p.h index 9c144ffdfd..684cff6aa1 100644 --- a/src/corelib/io/qtextstream_p.h +++ b/src/corelib/io/qtextstream_p.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp index ed119f61b6..7b1fee31b4 100644 --- a/src/corelib/io/qurl.cpp +++ b/src/corelib/io/qurl.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2012 Intel Corporation. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qurl.h b/src/corelib/io/qurl.h index 56b41fb5b7..947b3bbb55 100644 --- a/src/corelib/io/qurl.h +++ b/src/corelib/io/qurl.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2012 Intel Corporation. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qurl_p.h b/src/corelib/io/qurl_p.h index f455fa58f5..49dcdeb144 100644 --- a/src/corelib/io/qurl_p.h +++ b/src/corelib/io/qurl_p.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2012 Intel Corporation. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qurlidna.cpp b/src/corelib/io/qurlidna.cpp index 5b5bcfe99b..11b2280cd1 100644 --- a/src/corelib/io/qurlidna.cpp +++ b/src/corelib/io/qurlidna.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qurlquery.cpp b/src/corelib/io/qurlquery.cpp index 6748971a5d..a6351d3a21 100644 --- a/src/corelib/io/qurlquery.cpp +++ b/src/corelib/io/qurlquery.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2012 Intel Corporation. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qurlquery.h b/src/corelib/io/qurlquery.h index 12f234cd9b..092d002543 100644 --- a/src/corelib/io/qurlquery.h +++ b/src/corelib/io/qurlquery.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2012 Intel Corporation. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/io/qurlrecode.cpp b/src/corelib/io/qurlrecode.cpp index a8ddd01d34..de6476de84 100644 --- a/src/corelib/io/qurlrecode.cpp +++ b/src/corelib/io/qurlrecode.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2012 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/json/qjson_p.h b/src/corelib/json/qjson_p.h index 770f2c3785..5f6484728a 100644 --- a/src/corelib/json/qjson_p.h +++ b/src/corelib/json/qjson_p.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/json/qjsonparser.cpp b/src/corelib/json/qjsonparser.cpp index dee15644ae..9bafcc4c5f 100644 --- a/src/corelib/json/qjsonparser.cpp +++ b/src/corelib/json/qjsonparser.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2013 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/json/qjsonwriter.cpp b/src/corelib/json/qjsonwriter.cpp index b22c491265..b1544c749d 100644 --- a/src/corelib/json/qjsonwriter.cpp +++ b/src/corelib/json/qjsonwriter.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2013 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/kernel/qcore_unix.cpp b/src/corelib/kernel/qcore_unix.cpp index 94b0bdba39..23b98430bc 100644 --- a/src/corelib/kernel/qcore_unix.cpp +++ b/src/corelib/kernel/qcore_unix.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/kernel/qcore_unix_p.h b/src/corelib/kernel/qcore_unix_p.h index f5c23723b6..11da70e008 100644 --- a/src/corelib/kernel/qcore_unix_p.h +++ b/src/corelib/kernel/qcore_unix_p.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 61193b2721..c49994a98d 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2015 Intel Corporation. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index 5953282416..3de8b2e7c9 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/kernel/qeventdispatcher_unix.cpp b/src/corelib/kernel/qeventdispatcher_unix.cpp index 36d751a227..87478e0e01 100644 --- a/src/corelib/kernel/qeventdispatcher_unix.cpp +++ b/src/corelib/kernel/qeventdispatcher_unix.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp index d3242b6e67..73cefdafd7 100644 --- a/src/corelib/kernel/qeventdispatcher_win.cpp +++ b/src/corelib/kernel/qeventdispatcher_win.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/kernel/qmimedata.cpp b/src/corelib/kernel/qmimedata.cpp index 36944af0e0..84e680dbd9 100644 --- a/src/corelib/kernel/qmimedata.cpp +++ b/src/corelib/kernel/qmimedata.cpp @@ -46,6 +46,12 @@ QT_BEGIN_NAMESPACE +static inline QString textUriListLiteral() { return QStringLiteral("text/uri-list"); } +static inline QString textHtmlLiteral() { return QStringLiteral("text/html"); } +static inline QString textPlainLiteral() { return QStringLiteral("text/plain"); } +static inline QString applicationXColorLiteral() { return QStringLiteral("application/x-color"); } +static inline QString applicationXQtImageLiteral() { return QStringLiteral("application/x-qt-image"); } + struct QMimeDataStruct { QString format; @@ -107,7 +113,7 @@ QVariant QMimeDataPrivate::retrieveTypedData(const QString &format, QVariant::Ty // Text data requested: fallback to URL data if available if (format == QLatin1String("text/plain") && !data.isValid()) { - data = retrieveTypedData(QLatin1String("text/uri-list"), QVariant::List); + data = retrieveTypedData(textUriListLiteral(), QVariant::List); if (data.type() == QVariant::Url) { data = QVariant(data.toUrl().toDisplayString()); } else if (data.type() == QVariant::List) { @@ -331,7 +337,7 @@ QMimeData::~QMimeData() QList<QUrl> QMimeData::urls() const { Q_D(const QMimeData); - QVariant data = d->retrieveTypedData(QLatin1String("text/uri-list"), QVariant::List); + QVariant data = d->retrieveTypedData(textUriListLiteral(), QVariant::List); QList<QUrl> urls; if (data.type() == QVariant::Url) urls.append(data.toUrl()); @@ -365,7 +371,7 @@ void QMimeData::setUrls(const QList<QUrl> &urls) for (int i = 0; i < numUrls; ++i) list.append(urls.at(i)); - d->setData(QLatin1String("text/uri-list"), list); + d->setData(textUriListLiteral(), list); } /*! @@ -378,7 +384,7 @@ void QMimeData::setUrls(const QList<QUrl> &urls) */ bool QMimeData::hasUrls() const { - return hasFormat(QLatin1String("text/uri-list")); + return hasFormat(textUriListLiteral()); } @@ -391,7 +397,7 @@ bool QMimeData::hasUrls() const QString QMimeData::text() const { Q_D(const QMimeData); - QVariant data = d->retrieveTypedData(QLatin1String("text/plain"), QVariant::String); + QVariant data = d->retrieveTypedData(textPlainLiteral(), QVariant::String); return data.toString(); } @@ -404,7 +410,7 @@ QString QMimeData::text() const void QMimeData::setText(const QString &text) { Q_D(QMimeData); - d->setData(QLatin1String("text/plain"), text); + d->setData(textPlainLiteral(), text); } /*! @@ -415,7 +421,7 @@ void QMimeData::setText(const QString &text) */ bool QMimeData::hasText() const { - return hasFormat(QLatin1String("text/plain")) || hasUrls(); + return hasFormat(textPlainLiteral()) || hasUrls(); } /*! @@ -427,7 +433,7 @@ bool QMimeData::hasText() const QString QMimeData::html() const { Q_D(const QMimeData); - QVariant data = d->retrieveTypedData(QLatin1String("text/html"), QVariant::String); + QVariant data = d->retrieveTypedData(textHtmlLiteral(), QVariant::String); return data.toString(); } @@ -440,7 +446,7 @@ QString QMimeData::html() const void QMimeData::setHtml(const QString &html) { Q_D(QMimeData); - d->setData(QLatin1String("text/html"), html); + d->setData(textHtmlLiteral(), html); } /*! @@ -451,7 +457,7 @@ void QMimeData::setHtml(const QString &html) */ bool QMimeData::hasHtml() const { - return hasFormat(QLatin1String("text/html")); + return hasFormat(textHtmlLiteral()); } /*! @@ -469,7 +475,7 @@ bool QMimeData::hasHtml() const QVariant QMimeData::imageData() const { Q_D(const QMimeData); - return d->retrieveTypedData(QLatin1String("application/x-qt-image"), QVariant::Image); + return d->retrieveTypedData(applicationXQtImageLiteral(), QVariant::Image); } /*! @@ -486,7 +492,7 @@ QVariant QMimeData::imageData() const void QMimeData::setImageData(const QVariant &image) { Q_D(QMimeData); - d->setData(QLatin1String("application/x-qt-image"), image); + d->setData(applicationXQtImageLiteral(), image); } /*! @@ -497,7 +503,7 @@ void QMimeData::setImageData(const QVariant &image) */ bool QMimeData::hasImage() const { - return hasFormat(QLatin1String("application/x-qt-image")); + return hasFormat(applicationXQtImageLiteral()); } /*! @@ -516,7 +522,7 @@ bool QMimeData::hasImage() const QVariant QMimeData::colorData() const { Q_D(const QMimeData); - return d->retrieveTypedData(QLatin1String("application/x-color"), QVariant::Color); + return d->retrieveTypedData(applicationXColorLiteral(), QVariant::Color); } /*! @@ -529,7 +535,7 @@ QVariant QMimeData::colorData() const void QMimeData::setColorData(const QVariant &color) { Q_D(QMimeData); - d->setData(QLatin1String("application/x-color"), color); + d->setData(applicationXColorLiteral(), color); } @@ -541,7 +547,7 @@ void QMimeData::setColorData(const QVariant &color) */ bool QMimeData::hasColor() const { - return hasFormat(QLatin1String("application/x-color")); + return hasFormat(applicationXColorLiteral()); } /*! @@ -622,7 +628,9 @@ QStringList QMimeData::formats() const { Q_D(const QMimeData); QStringList list; - for (int i=0; i<d->dataList.size(); i++) + const int size = d->dataList.size(); + list.reserve(size); + for (int i = 0; i < size; ++i) list += d->dataList.at(i).format; return list; } diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp index da9ac13795..b9e8b2573e 100644 --- a/src/corelib/kernel/qobject.cpp +++ b/src/corelib/kernel/qobject.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Copyright (C) 2013 Olivier Goffart <ogoffart@woboq.com> ** Contact: https://www.qt.io/licensing/ ** diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h index 59d5ea50e8..2a6e24533a 100644 --- a/src/corelib/kernel/qobjectdefs.h +++ b/src/corelib/kernel/qobjectdefs.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp index a11d5e7ed6..80accc0cb8 100644 --- a/src/corelib/kernel/qtimer.cpp +++ b/src/corelib/kernel/qtimer.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/kernel/qtimerinfo_unix.cpp b/src/corelib/kernel/qtimerinfo_unix.cpp index e362b250ca..8f5e8c9523 100644 --- a/src/corelib/kernel/qtimerinfo_unix.cpp +++ b/src/corelib/kernel/qtimerinfo_unix.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/kernel/qtranslator.cpp b/src/corelib/kernel/qtranslator.cpp index b88578dd89..bbfccf3f3a 100644 --- a/src/corelib/kernel/qtranslator.cpp +++ b/src/corelib/kernel/qtranslator.cpp @@ -91,6 +91,8 @@ static const uchar magic[MagicLength] = { 0xcd, 0x21, 0x1c, 0xbf, 0x60, 0xa1, 0xbd, 0xdd }; +static inline QString dotQmLiteral() { return QStringLiteral(".qm"); } + static bool match(const uchar *found, uint foundLen, const char *target, uint targetLen) { // catch the case if \a found has a zero-terminating symbol and \a len includes it. @@ -484,6 +486,7 @@ bool QTranslator::load(const QString & filename, const QString & directory, prefix += QLatin1Char('/'); } + const QString suffixOrDotQM = suffix.isNull() ? dotQmLiteral() : suffix; QString fname = filename; QString realname; QString delims; @@ -492,7 +495,7 @@ bool QTranslator::load(const QString & filename, const QString & directory, for (;;) { QFileInfo fi; - realname = prefix + fname + (suffix.isNull() ? QString::fromLatin1(".qm") : suffix); + realname = prefix + fname + suffixOrDotQM; fi.setFile(realname); if (fi.isReadable() && fi.isFile()) break; @@ -638,7 +641,7 @@ static QString find_translation(const QLocale & locale, if (!path.isEmpty() && !path.endsWith(QLatin1Char('/'))) path += QLatin1Char('/'); } - const QString suffixOrDotQM = suffix.isNull() ? QStringLiteral(".qm") : suffix; + const QString suffixOrDotQM = suffix.isNull() ? dotQmLiteral() : suffix; QString realname; realname += path + filename + prefix; // using += in the hope for some reserve capacity diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp index 01351f97ff..5feb7a409b 100644 --- a/src/corelib/kernel/qvariant.cpp +++ b/src/corelib/kernel/qvariant.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Copyright (C) 2015 Olivier Goffart <ogoffart@woboq.com> ** Contact: https://www.qt.io/licensing/ ** @@ -445,7 +446,7 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) break; #endif case QVariant::Bool: - *str = QLatin1String(d->data.b ? "true" : "false"); + *str = d->data.b ? QStringLiteral("true") : QStringLiteral("false"); break; case QVariant::ByteArray: *str = QString::fromUtf8(v_cast<QByteArray>(d)->constData()); @@ -559,7 +560,9 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) if (d->type == QVariant::List) { QStringList *slst = static_cast<QStringList *>(result); const QVariantList *list = v_cast<QVariantList >(d); - for (int i = 0; i < list->size(); ++i) + const int size = list->size(); + slst->reserve(size); + for (int i = 0; i < size; ++i) slst->append(list->at(i).toString()); } else if (d->type == QVariant::String) { QStringList *slst = static_cast<QStringList *>(result); @@ -825,7 +828,9 @@ static bool convert(const QVariant::Private *d, int t, void *result, bool *ok) if (d->type == QVariant::StringList) { QVariantList *lst = static_cast<QVariantList *>(result); const QStringList *slist = v_cast<QStringList>(d); - for (int i = 0; i < slist->size(); ++i) + const int size = slist->size(); + lst->reserve(size); + for (int i = 0; i < size; ++i) lst->append(QVariant(slist->at(i))); } else if (qstrcmp(QMetaType::typeName(d->type), "QList<QVariant>") == 0) { *static_cast<QVariantList *>(result) = diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index ab47b9d7f2..9babfa4d91 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2013 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/plugin/qlibrary_p.h b/src/corelib/plugin/qlibrary_p.h index 7bb4c96f97..c3bdc5a832 100644 --- a/src/corelib/plugin/qlibrary_p.h +++ b/src/corelib/plugin/qlibrary_p.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/plugin/qmachparser.cpp b/src/corelib/plugin/qmachparser.cpp index 2f45258ad7..c136ef3797 100644 --- a/src/corelib/plugin/qmachparser.cpp +++ b/src/corelib/plugin/qmachparser.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/plugin/qmachparser_p.h b/src/corelib/plugin/qmachparser_p.h index 45842e3ffb..0df7a98f96 100644 --- a/src/corelib/plugin/qmachparser_p.h +++ b/src/corelib/plugin/qmachparser_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/thread/qatomic.cpp b/src/corelib/thread/qatomic.cpp index 444413d0b6..23e816af64 100644 --- a/src/corelib/thread/qatomic.cpp +++ b/src/corelib/thread/qatomic.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/thread/qatomic.h b/src/corelib/thread/qatomic.h index 5941c8a65a..bbfc11f6c0 100644 --- a/src/corelib/thread/qatomic.h +++ b/src/corelib/thread/qatomic.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/thread/qbasicatomic.h b/src/corelib/thread/qbasicatomic.h index 7e19c3ff43..5ea8bbe770 100644 --- a/src/corelib/thread/qbasicatomic.h +++ b/src/corelib/thread/qbasicatomic.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2011 Thiago Macieira <thiago@kde.org> +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/thread/qgenericatomic.h b/src/corelib/thread/qgenericatomic.h index da5bf97305..06bb4bc8f1 100644 --- a/src/corelib/thread/qgenericatomic.h +++ b/src/corelib/thread/qgenericatomic.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2011 Thiago Macieira <thiago@kde.org> +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/thread/qmutex.cpp b/src/corelib/thread/qmutex.cpp index bf977a4ad0..8d9fa82a7a 100644 --- a/src/corelib/thread/qmutex.cpp +++ b/src/corelib/thread/qmutex.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2012 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Copyright (C) 2012 Olivier Goffart <ogoffart@woboq.com> ** Contact: https://www.qt.io/licensing/ ** diff --git a/src/corelib/thread/qmutex_linux.cpp b/src/corelib/thread/qmutex_linux.cpp index fcda9e8e5e..89eb3da203 100644 --- a/src/corelib/thread/qmutex_linux.cpp +++ b/src/corelib/thread/qmutex_linux.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2012 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/thread/qmutex_p.h b/src/corelib/thread/qmutex_p.h index 7d84d4e250..20cc5f1f5e 100644 --- a/src/corelib/thread/qmutex_p.h +++ b/src/corelib/thread/qmutex_p.h @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2012 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Copyright (C) 2012 Olivier Goffart <ogoffart@woboq.com> ** Contact: https://www.qt.io/licensing/ ** diff --git a/src/corelib/thread/qreadwritelock.cpp b/src/corelib/thread/qreadwritelock.cpp index 8e3fc52069..117da2e30b 100644 --- a/src/corelib/thread/qreadwritelock.cpp +++ b/src/corelib/thread/qreadwritelock.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp index f119e1a0ae..14209d8d8c 100644 --- a/src/corelib/thread/qthread.cpp +++ b/src/corelib/thread/qthread.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/thread/qthread_p.h b/src/corelib/thread/qthread_p.h index 823d1b207d..39a41f1ef4 100644 --- a/src/corelib/thread/qthread_p.h +++ b/src/corelib/thread/qthread_p.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index 3350ae6e5d..f456e56a9c 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/thread/qwaitcondition_unix.cpp b/src/corelib/thread/qwaitcondition_unix.cpp index 385a39ca9b..2a98fd2897 100644 --- a/src/corelib/thread/qwaitcondition_unix.cpp +++ b/src/corelib/thread/qwaitcondition_unix.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qbitarray.cpp b/src/corelib/tools/qbitarray.cpp index d251b44056..446e09b1c0 100644 --- a/src/corelib/tools/qbitarray.cpp +++ b/src/corelib/tools/qbitarray.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp index 4a5ca997a9..2efe3c1a86 100644 --- a/src/corelib/tools/qbytearray.cpp +++ b/src/corelib/tools/qbytearray.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2014 Intel Corporation. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qbytearray.h b/src/corelib/tools/qbytearray.h index 8ba6866f0e..19c1f25bc7 100644 --- a/src/corelib/tools/qbytearray.h +++ b/src/corelib/tools/qbytearray.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qbytearraylist.h b/src/corelib/tools/qbytearraylist.h index 441c368f7c..bc8b08b380 100644 --- a/src/corelib/tools/qbytearraylist.h +++ b/src/corelib/tools/qbytearraylist.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Copyright (C) 2014 by Southwest Research Institute (R) ** Contact: https://www.qt.io/licensing/ ** diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index ae83943b7e..96c188666d 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qelapsedtimer_unix.cpp b/src/corelib/tools/qelapsedtimer_unix.cpp index 7f65d1cf36..1e672531c8 100644 --- a/src/corelib/tools/qelapsedtimer_unix.cpp +++ b/src/corelib/tools/qelapsedtimer_unix.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp index 9cd2180cdc..d1f079e07b 100644 --- a/src/corelib/tools/qhash.cpp +++ b/src/corelib/tools/qhash.cpp @@ -2,6 +2,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Copyright (C) 2012 Giuseppe D'Angelo <dangelog@gmail.com>. ** Contact: https://www.qt.io/licensing/ ** diff --git a/src/corelib/tools/qlist.cpp b/src/corelib/tools/qlist.cpp index c046374b0c..7dd02bf954 100644 --- a/src/corelib/tools/qlist.cpp +++ b/src/corelib/tools/qlist.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2015 Intel Corporation. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 90d2f99943..323a40cf1b 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/tools/qlocale_p.h index dd35708558..a2cfecb933 100644 --- a/src/corelib/tools/qlocale_p.h +++ b/src/corelib/tools/qlocale_p.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qlocale_tools.cpp b/src/corelib/tools/qlocale_tools.cpp index d8d399a8b6..a6a699fa16 100644 --- a/src/corelib/tools/qlocale_tools.cpp +++ b/src/corelib/tools/qlocale_tools.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2014 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/tools/qlocale_win.cpp index 95e3c594e4..88bfada515 100644 --- a/src/corelib/tools/qlocale_win.cpp +++ b/src/corelib/tools/qlocale_win.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qsharedpointer.cpp b/src/corelib/tools/qsharedpointer.cpp index 66204d6031..cb8511d0ed 100644 --- a/src/corelib/tools/qsharedpointer.cpp +++ b/src/corelib/tools/qsharedpointer.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index bc277447aa..a946191cde 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qsimd.cpp b/src/corelib/tools/qsimd.cpp index bde3f79b29..f2caaaa538 100644 --- a/src/corelib/tools/qsimd.cpp +++ b/src/corelib/tools/qsimd.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2012 Intel Corporation. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qsimd_p.h b/src/corelib/tools/qsimd_p.h index e165d54947..c771037427 100644 --- a/src/corelib/tools/qsimd_p.h +++ b/src/corelib/tools/qsimd_p.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 32e10dec21..9b98f4322b 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -1,7 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. -** Copyright (C) 2015 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -8800,7 +8800,6 @@ Since this class is only used to refer to string data, and does not take ownership of it, no memory is freed when instances are destroyed. */ - /*! \fn int QStringRef::position() const @@ -9039,6 +9038,19 @@ bool operator<(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW */ /*! + \fn QChar QStringRef::operator[](int position) const + \since 5.7 + + Returns the character at the given index \a position in the + string reference. + + The \a position must be a valid index position in the string + reference (i.e., 0 <= \a position < size()). + + \sa at() +*/ + +/*! \fn void QStringRef::clear() Clears the contents of the string reference by making it null and empty. diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h index 0e3b1f2f82..ddaab1f544 100644 --- a/src/corelib/tools/qstring.h +++ b/src/corelib/tools/qstring.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -1461,6 +1462,7 @@ public: inline const QChar at(int i) const { Q_ASSERT(uint(i) < uint(size())); return m_string->at(i + m_position); } + QChar operator[](int i) const { return at(i); } #if !defined(QT_NO_CAST_FROM_ASCII) && !defined(QT_RESTRICTED_CAST_FROM_ASCII) // ASCII compatibility diff --git a/src/corelib/tools/qstring_compat.cpp b/src/corelib/tools/qstring_compat.cpp index f868c2fbe6..300f8467b1 100644 --- a/src/corelib/tools/qstring_compat.cpp +++ b/src/corelib/tools/qstring_compat.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2013 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qstringalgorithms_p.h b/src/corelib/tools/qstringalgorithms_p.h index 6516c640e7..d7127517e0 100644 --- a/src/corelib/tools/qstringalgorithms_p.h +++ b/src/corelib/tools/qstringalgorithms_p.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2014 Intel Corporation. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qstringlist.h b/src/corelib/tools/qstringlist.h index ee5d8176af..e01f9e16e8 100644 --- a/src/corelib/tools/qstringlist.h +++ b/src/corelib/tools/qstringlist.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qtimezoneprivate_tz.cpp b/src/corelib/tools/qtimezoneprivate_tz.cpp index 0b5f6bb80e..3fcc8833e8 100644 --- a/src/corelib/tools/qtimezoneprivate_tz.cpp +++ b/src/corelib/tools/qtimezoneprivate_tz.cpp @@ -627,8 +627,15 @@ void QTzTimeZonePrivate::init(const QByteArray &ianaId) // Translate the TZ file into internal format // Translate the array index based tz_abbrind into list index - m_abbreviations = abbrevMap.values(); - QList<int> abbrindList = abbrevMap.keys(); + const int size = abbrevMap.size(); + m_abbreviations.clear(); + m_abbreviations.reserve(size); + QVector<int> abbrindList; + abbrindList.reserve(size); + for (auto it = abbrevMap.cbegin(), end = abbrevMap.cend(); it != end; ++it) { + m_abbreviations.append(it.value()); + abbrindList.append(it.key()); + } for (int i = 0; i < typeList.size(); ++i) typeList[i].tz_abbrind = abbrindList.indexOf(typeList.at(i).tz_abbrind); diff --git a/src/corelib/tools/qvector_msvc.cpp b/src/corelib/tools/qvector_msvc.cpp index 59f4ba4902..cee343e72b 100644 --- a/src/corelib/tools/qvector_msvc.cpp +++ b/src/corelib/tools/qvector_msvc.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2014 Intel Corporation +** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. diff --git a/src/corelib/tools/qversionnumber.cpp b/src/corelib/tools/qversionnumber.cpp index a84cfc5efa..97e5da8b3c 100644 --- a/src/corelib/tools/qversionnumber.cpp +++ b/src/corelib/tools/qversionnumber.cpp @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Copyright (C) 2014 Keith Gardner <kreios4004@gmail.com> ** Contact: https://www.qt.io/licensing/ ** diff --git a/src/corelib/tools/qversionnumber.h b/src/corelib/tools/qversionnumber.h index 014bed2ae0..2aaa6201f7 100644 --- a/src/corelib/tools/qversionnumber.h +++ b/src/corelib/tools/qversionnumber.h @@ -1,6 +1,7 @@ /**************************************************************************** ** ** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2016 Intel Corporation. ** Copyright (C) 2014 Keith Gardner <kreios4004@gmail.com> ** Contact: https://www.qt.io/licensing/ ** |