summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/Qt5CoreConfigExtras.cmake.in10
-rw-r--r--src/corelib/animation/qparallelanimationgroup.cpp2
-rw-r--r--src/corelib/doc/qtcore.qdocconf2
-rw-r--r--src/corelib/doc/src/animation.qdoc6
-rw-r--r--src/corelib/doc/src/filestorage.qdoc2
-rw-r--r--src/corelib/global/qcompilerdetection.h5
-rw-r--r--src/corelib/global/qglobal.h1
-rw-r--r--src/corelib/global/qlogging.cpp29
-rw-r--r--src/corelib/global/qnamespace.qdoc7
-rw-r--r--src/corelib/io/qfileselector.cpp2
-rw-r--r--src/corelib/io/qiodevice.cpp2
-rw-r--r--src/corelib/io/qprocess.cpp2
-rw-r--r--src/corelib/io/qresource.cpp2
-rw-r--r--src/corelib/io/qstandardpaths.cpp10
-rw-r--r--src/corelib/io/qstandardpaths_android.cpp4
-rw-r--r--src/corelib/io/qstorageinfo_unix.cpp7
-rw-r--r--src/corelib/io/qurl.cpp21
-rw-r--r--src/corelib/io/qurlquery.cpp2
-rw-r--r--src/corelib/json/qjson.cpp5
-rw-r--r--src/corelib/json/qjsonarray.cpp13
-rw-r--r--src/corelib/json/qjsonobject.cpp2
-rw-r--r--src/corelib/json/qjsonvalue.cpp18
-rw-r--r--src/corelib/kernel/qabstracteventdispatcher.cpp2
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp22
-rw-r--r--src/corelib/kernel/qcoreevent.cpp10
-rw-r--r--src/corelib/kernel/qjni.cpp9
-rw-r--r--src/corelib/kernel/qjni_p.h8
-rw-r--r--src/corelib/kernel/qmetatype.cpp2
-rw-r--r--src/corelib/kernel/qpointer.cpp2
-rw-r--r--src/corelib/kernel/qtimer.cpp2
-rw-r--r--src/corelib/kernel/qvariant.cpp6
-rw-r--r--src/corelib/plugin/qpluginloader.cpp2
-rw-r--r--src/corelib/thread/qthread_unix.cpp6
-rw-r--r--src/corelib/thread/qwaitcondition_unix.cpp18
-rw-r--r--src/corelib/tools/qbytearray.cpp4
-rw-r--r--src/corelib/tools/qtimezoneprivate.cpp9
-rw-r--r--src/corelib/tools/qtimezoneprivate_p.h2
-rw-r--r--src/corelib/tools/qvector.h4
38 files changed, 179 insertions, 83 deletions
diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in
index 4387bedc44..7213a844f5 100644
--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
+++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
@@ -134,13 +134,13 @@ if (NOT TARGET Qt5::WinMain)
set(_isNotExcluded $<NOT:$<BOOL:$<TARGET_PROPERTY:Qt5_NO_LINK_QTMAIN>>>)
set(_isPolicyNEW $<TARGET_POLICY:CMP0020>)
get_target_property(_configs Qt5::Core IMPORTED_CONFIGURATIONS)
+ set_property(TARGET Qt5::Core APPEND PROPERTY
+ INTERFACE_LINK_LIBRARIES
+ $<$<AND:${_isExe},${_isWin32},${_isNotExcluded},${_isPolicyNEW}>:Qt5::WinMain>
+ )
+ # For backward compatibility with CMake < 2.8.12
foreach(_config ${_configs})
set_property(TARGET Qt5::Core APPEND PROPERTY
- INTERFACE_LINK_LIBRARIES
- $<$<AND:${_isExe},${_isWin32},${_isNotExcluded},${_isPolicyNEW}>:Qt5::WinMain>
- )
- # For backward compatibility with CMake < 2.8.12
- set_property(TARGET Qt5::Core APPEND PROPERTY
IMPORTED_LINK_INTERFACE_LIBRARIES_${_config}
$<$<AND:${_isExe},${_isWin32},${_isNotExcluded},${_isPolicyNEW}>:Qt5::WinMain>
)
diff --git a/src/corelib/animation/qparallelanimationgroup.cpp b/src/corelib/animation/qparallelanimationgroup.cpp
index d5a3ee751b..fc87cd4cc8 100644
--- a/src/corelib/animation/qparallelanimationgroup.cpp
+++ b/src/corelib/animation/qparallelanimationgroup.cpp
@@ -44,7 +44,7 @@
animations in parallel. The animation group finishes when the
longest lasting animation has finished.
- You can treat QParallelAnimation as any other QAbstractAnimation,
+ You can treat QParallelAnimationGroup as any other QAbstractAnimation,
e.g., pause, resume, or add it to other animation groups.
\code
diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf
index 5a14ba9088..f3aff83a8b 100644
--- a/src/corelib/doc/qtcore.qdocconf
+++ b/src/corelib/doc/qtcore.qdocconf
@@ -25,7 +25,7 @@ qhp.QtCore.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtcore/qtcore.tags
-depends += activeqt qtdbus qtgui qtwidgets qtnetwork qtdoc qtmacextras qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake
+depends += activeqt qtdbus qtgui qtwidgets qtnetwork qtdoc qtmacextras qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake qtwinextras
# depends += qtqml # Qt namespace collides with QtQml::Qt, see QTBUG-38630
headerdirs += ..
diff --git a/src/corelib/doc/src/animation.qdoc b/src/corelib/doc/src/animation.qdoc
index e70553090a..e5e67cf503 100644
--- a/src/corelib/doc/src/animation.qdoc
+++ b/src/corelib/doc/src/animation.qdoc
@@ -48,7 +48,7 @@
The animation framework aims to provide an easy way for creating animated
and smooth GUIs. By animating Qt properties, the framework provides great
- freedom for animating widgets and other {QObject}s. The framework can
+ freedom for animating widgets and other \l{QObject}s. The framework can
also be used with the Graphics View framework. Many of the concepts
available in the animation framework are also available in \l{Qt Quick},
where it offers a declarative way of defining animations. Much of the
@@ -57,7 +57,7 @@
In this overview, we explain the basics of its architecture. We
also show examples of the most common techniques that the
- framework allows for animating {QObject}s and graphics items.
+ framework allows for animating \l{QObject}s and graphics items.
\tableofcontents
@@ -85,7 +85,7 @@
over the property using an easing curve. So when you want to
animate a value, you can declare it as a property and make your
class a QObject. Note that this gives us great freedom in
- animating already existing widgets and other {QObject}s.
+ animating already existing widgets and other \l{QObject}s.
Complex animations can be constructed by building a tree structure
of \l{QAbstractAnimation}s. The tree is built by using
diff --git a/src/corelib/doc/src/filestorage.qdoc b/src/corelib/doc/src/filestorage.qdoc
index 62fb68ccdc..0cdb6b56ae 100644
--- a/src/corelib/doc/src/filestorage.qdoc
+++ b/src/corelib/doc/src/filestorage.qdoc
@@ -87,7 +87,7 @@ There are three general ways to use QTextStream when reading text files:
\list
\li Chunk by chunk, by calling \l{QBuffer::readLine()}{readLine()} or \l{QBuffer::readAll()}{readAll()}.
- \li Word by word. QTextStream supports streaming into {QString}s, {QByteArray}s
+ \li Word by word. QTextStream supports streaming into \l{QString}s, \l{QByteArray}s
and char* buffers. Words are delimited by space, and leading white space
is automatically skipped.
\li Character by character, by streaming into QChar or char types. This
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 6958912e67..0ca67df1e2 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -549,7 +549,10 @@
# define Q_COMPILER_UNRESTRICTED_UNIONS
# endif
# if __INTEL_COMPILER >= 1500
-# define Q_COMPILER_CONSTEXPR
+# if __INTEL_COMPILER * 100 + __INTEL_COMPILER_UPDATE >= 150001
+// the bug mentioned above is fixed in 15.0.1
+# define Q_COMPILER_CONSTEXPR
+# endif
# define Q_COMPILER_ALIGNAS
# define Q_COMPILER_ALIGNOF
# define Q_COMPILER_INHERITING_CONSTRUCTORS
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 554c5b658a..a171f0894b 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -882,6 +882,7 @@ QT_WARNING_DISABLE_MSVC(4530) /* C++ exception handler used, but unwind semantic
/* make use of decltype or GCC's __typeof__ extension */
template <typename T>
class QForeachContainer {
+ QForeachContainer &operator=(const QForeachContainer &) Q_DECL_EQ_DELETE;
public:
inline QForeachContainer(const T& t) : c(t), i(c.begin()), e(c.end()), control(1) { }
const T c;
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index d8f5b59c63..d9d21c535c 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -78,11 +78,12 @@
#ifndef QT_BOOTSTRAPPED
#if !defined QT_NO_REGULAREXPRESSION
-# if (defined(__GLIBC__) && defined(__GLIBCXX__)) || (__has_include(<cxxabi.h>) && __has_include(<execinfo.h>))
+# ifdef __UCLIBC__
+# if __UCLIBC_HAS_BACKTRACE__
+# define QLOGGING_HAVE_BACKTRACE
+# endif
+# elif (defined(__GLIBC__) && defined(__GLIBCXX__)) || (__has_include(<cxxabi.h>) && __has_include(<execinfo.h>))
# define QLOGGING_HAVE_BACKTRACE
-# include <qregularexpression.h>
-# include <cxxabi.h>
-# include <execinfo.h>
# endif
#endif
@@ -116,6 +117,12 @@ static QT_PREPEND_NAMESPACE(qint64) qt_gettid()
return qintptr(QThread::currentThreadId());
}
#endif
+
+#ifdef QLOGGING_HAVE_BACKTRACE
+# include <qregularexpression.h>
+# include <cxxabi.h>
+# include <execinfo.h>
+#endif
#endif // !QT_BOOTSTRAPPED
#include <stdio.h>
@@ -998,7 +1005,7 @@ QMessagePattern::QMessagePattern()
QMessagePattern::~QMessagePattern()
{
- for (int i = 0; literals[i] != 0; ++i)
+ for (int i = 0; literals[i]; ++i)
delete [] literals[i];
delete [] literals;
literals = 0;
@@ -1008,8 +1015,12 @@ QMessagePattern::~QMessagePattern()
void QMessagePattern::setPattern(const QString &pattern)
{
+ if (literals) {
+ for (int i = 0; literals[i]; ++i)
+ delete [] literals[i];
+ delete [] literals;
+ }
delete [] tokens;
- delete [] literals;
// scanner
QList<QString> lexemes;
@@ -1285,13 +1296,13 @@ QString qFormatLogMessage(QtMsgType type, const QMessageLogContext &context, con
message.append(QString::number(qlonglong(QThread::currentThread()->currentThread()), 16));
#ifdef QLOGGING_HAVE_BACKTRACE
} else if (token == backtraceTokenC) {
- QVarLengthArray<void*, 32> buffer(15 + pattern->backtraceDepth);
+ QVarLengthArray<void*, 32> buffer(7 + pattern->backtraceDepth);
int n = backtrace(buffer.data(), buffer.size());
if (n > 0) {
- QScopedPointer<char*, QScopedPointerPodDeleter> strings(backtrace_symbols(buffer.data(), n));
int numberPrinted = 0;
for (int i = 0; i < n && numberPrinted < pattern->backtraceDepth; ++i) {
- QString trace = QString::fromLatin1(strings.data()[i]);
+ QScopedPointer<char*, QScopedPointerPodDeleter> strings(backtrace_symbols(buffer.data() + i, 1));
+ QString trace = QString::fromLatin1(strings.data()[0]);
// The results of backtrace_symbols looks like this:
// /lib/libc.so.6(__libc_start_main+0xf3) [0x4a937413]
// The offset and function name are optional.
diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc
index 1be83caa06..ba3a621751 100644
--- a/src/corelib/global/qnamespace.qdoc
+++ b/src/corelib/global/qnamespace.qdoc
@@ -498,7 +498,7 @@
\value TextExpandTabs Makes the U+0009 (ASCII tab) character move to
the next tab stop.
\value TextShowMnemonic Displays the string "\&P" as \underline{P}
- (see QButton for an example). For an ampersand, use "\&\&".
+ For an ampersand, use "\&\&".
\value TextWordWrap Breaks lines at appropriate points, e.g. at word
boundaries.
\value TextWrapAnywhere Breaks lines anywhere, even within words.
@@ -902,8 +902,7 @@
on QWidget::contentsRect(). This is set by the widget's author.
\value WA_LayoutUsesWidgetRect Ignore the layout item rect from the style
- when laying out this widget with QLayout. This makes a difference in
- QMacStyle and QPlastiqueStyle for some widgets.
+ when laying out this widget with QLayout.
\value WA_MacNoClickThrough When a widget that has this attribute set
is clicked, and its window is inactive, the click will make the window
@@ -1162,7 +1161,7 @@
_NET_WM_WINDOW_TYPE X11 window property. See
http://standards.freedesktop.org/wm-spec/ for more details. This
attribute has no effect on non-X11 platforms. \b Note: Qt
- automatically sets this attribute for QMenus added to a QMenuBar.
+ automatically sets this attribute for QMenu objects added to a QMenuBar.
\value WA_X11NetWmWindowTypePopupMenu Adds _NET_WM_WINDOW_TYPE_POPUP_MENU
to the window's _NET_WM_WINDOW_TYPE X11 window property. See
diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp
index 32f55f3e2c..4ca07ba41d 100644
--- a/src/corelib/io/qfileselector.cpp
+++ b/src/corelib/io/qfileselector.cpp
@@ -231,7 +231,7 @@ static QString qrcScheme()
}
/*!
- This is a convenience version of select operating on QUrls. If the scheme is not file or qrc,
+ This is a convenience version of select operating on QUrl objects. If the scheme is not file or qrc,
\a filePath is returned immediately. Otherwise selection is applied to the path of \a filePath
and a QUrl is returned with the selected path and other QUrl parts the same as \a filePath.
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index 0aa4db34e5..ea7e7b2731 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -706,7 +706,7 @@ bool QIODevice::reset()
number of bytes to allocate in a buffer before reading.
Subclasses that reimplement this function must call the base
- implementation in order to include the size of QIODevices' buffer. Example:
+ implementation in order to include the size of the buffer of QIODevice. Example:
\snippet code/src_corelib_io_qiodevice.cpp 1
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index e7439e6f25..6451bae0ba 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -1456,7 +1456,7 @@ void QProcess::setStandardErrorFile(const QString &fileName, OpenMode mode)
The following shell command:
\snippet code/src_corelib_io_qprocess.cpp 2
- Can be accomplished with QProcesses with the following code:
+ Can be accomplished with QProcess with the following code:
\snippet code/src_corelib_io_qprocess.cpp 3
*/
void QProcess::setStandardOutputProcess(QProcess *destination)
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 606859032e..4b85645a90 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -197,7 +197,7 @@ Q_GLOBAL_STATIC(QStringList, resourceSearchPaths)
path requested in setFileName().
The unregisterResource() function removes a reference to a particular
- file. If there are QResources that currently reference resources related
+ file. If there are QResource objects that currently reference resources related
to the unregistered file, they will continue to be valid but the resource
file itself will be removed from the resource roots, and thus no further
QResource can be created pointing into this resource data. The resource
diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp
index 31939830e0..4fd429cad4 100644
--- a/src/corelib/io/qstandardpaths.cpp
+++ b/src/corelib/io/qstandardpaths.cpp
@@ -77,15 +77,10 @@ QT_BEGIN_NAMESPACE
this user, but should still be assumed to be unreachable by applications by
other users.
- The only exception is QStandardPaths::TempLocation (which is the same as
- QDir::tempPath()): the path returned may be application-specific, but files
- stored there may be accessed by other applications run by the same user.
-
Data interchange with other users is out of the scope of QStandardPaths.
\value DesktopLocation Returns the user's desktop directory. This is a generic value.
- On systems with no concept of a desktop, this is the same as
- QStandardPaths::HomeLocation.
+ On systems with no concept of a desktop.
\value DocumentsLocation Returns the directory containing user document files.
This is a generic value. The returned path is never empty.
\value FontsLocation Returns the directory containing user's fonts. This is a generic value.
@@ -118,9 +113,6 @@ QT_BEGIN_NAMESPACE
\value GenericCacheLocation Returns a directory location where user-specific non-essential
(cached) data, shared across applications, should be written. This is a generic value.
Note that the returned path may be empty if the system has no concept of shared cache.
- \value GenericDataLocation Returns a directory location where persistent
- data shared across applications can be stored. This is a generic value. The returned
- path is never empty.
\value RuntimeLocation Returns a directory location where runtime communication
files should be written, like Unix local sockets. This is a generic value.
The returned path may be empty on some systems.
diff --git a/src/corelib/io/qstandardpaths_android.cpp b/src/corelib/io/qstandardpaths_android.cpp
index 8c8e871a4b..350e5cdbea 100644
--- a/src/corelib/io/qstandardpaths_android.cpp
+++ b/src/corelib/io/qstandardpaths_android.cpp
@@ -57,7 +57,7 @@ static QJNIObjectPrivate applicationContext()
if (appCtx.isValid())
return appCtx;
- QJNIObjectPrivate activity = QtAndroidPrivate::activity();
+ QJNIObjectPrivate activity(QtAndroidPrivate::activity());
if (!activity.isValid())
return appCtx;
@@ -131,7 +131,7 @@ static QString getExternalFilesDir(const char *directoryField = 0)
if (!path.isEmpty())
return path;
- QJNIObjectPrivate activity = QtAndroidPrivate::activity();
+ QJNIObjectPrivate activity(QtAndroidPrivate::activity());
if (!activity.isValid())
return QString();
diff --git a/src/corelib/io/qstorageinfo_unix.cpp b/src/corelib/io/qstorageinfo_unix.cpp
index 7e23ac897d..45b32830cd 100644
--- a/src/corelib/io/qstorageinfo_unix.cpp
+++ b/src/corelib/io/qstorageinfo_unix.cpp
@@ -54,6 +54,7 @@
# include <sys/statvfs.h>
#elif defined(Q_OS_SOLARIS)
# include <sys/mnttab.h>
+# include <sys/statvfs.h>
#elif defined(Q_OS_HAIKU)
# include <Directory.h>
# include <Path.h>
@@ -210,17 +211,17 @@ inline bool QStorageIterator::next()
inline QString QStorageIterator::rootPath() const
{
- return QFile::decodeName(mnt->mnt_mountp);
+ return QFile::decodeName(mnt.mnt_mountp);
}
inline QByteArray QStorageIterator::fileSystemType() const
{
- return QByteArray(mnt->mnt_fstype);
+ return QByteArray(mnt.mnt_fstype);
}
inline QByteArray QStorageIterator::device() const
{
- return QByteArray(mnt->mnt_mntopts);
+ return QByteArray(mnt.mnt_mntopts);
}
#elif defined(Q_OS_ANDROID)
diff --git a/src/corelib/io/qurl.cpp b/src/corelib/io/qurl.cpp
index ad0a6b8d53..89f5aad97f 100644
--- a/src/corelib/io/qurl.cpp
+++ b/src/corelib/io/qurl.cpp
@@ -82,7 +82,7 @@
For the convenience of generating encoded URL strings or query
strings, there are two static functions called
fromPercentEncoding() and toPercentEncoding() which deal with
- percent encoding and decoding of QStrings.
+ percent encoding and decoding of QString objects.
Calling isRelative() will tell whether or not the URL is
relative. A relative URL can be resolved by passing it as argument
@@ -172,7 +172,7 @@
setters setting components of a URL; it is not permitted in
the QUrl constructor, in fromEncoded() or in setUrl().
For more information on this mode, see the documentation for
- QUrl::FullyDecoded.
+ \l {QUrl::ComponentFormattingOption}{QUrl::FullyDecoded}.
In TolerantMode, the parser has the following behaviour:
@@ -3083,6 +3083,21 @@ bool QUrl::hasFragment() const
URL does not contain a valid TLD, in which case the function returns
an empty string.
+ Note that this function considers a TLD to be any domain that allows users
+ to register subdomains under, including many home, dynamic DNS websites and
+ blogging providers. This is useful for determining whether two websites
+ belong to the same infrastructure and communication should be allowed, such
+ as browser cookies: two domains should be considered part of the same
+ website if they share at least one label in addition to the value
+ returned by this function.
+
+ \list
+ \li \c{foo.co.uk} and \c{foo.com} do not share a top-level domain
+ \li \c{foo.co.uk} and \c{bar.co.uk} share the \c{.co.uk} domain, but the next label is different
+ \li \c{www.foo.co.uk} and \c{ftp.foo.co.uk} share the same top-level domain and one more label,
+ so they are considered part of the same site
+ \endlist
+
If \a options includes EncodeUnicode, the returned string will be in
ASCII Compatible Encoding.
*/
@@ -4041,7 +4056,7 @@ QString QUrl::errorString() const
/*!
\since 5.1
- Converts a list of \a urls into a list of QStrings, using toString(\a options).
+ Converts a list of \a urls into a list of QString objects, using toString(\a options).
*/
QStringList QUrl::toStringList(const QList<QUrl> &urls, FormattingOptions options)
{
diff --git a/src/corelib/io/qurlquery.cpp b/src/corelib/io/qurlquery.cpp
index 6be7d3531f..77d1ab3e24 100644
--- a/src/corelib/io/qurlquery.cpp
+++ b/src/corelib/io/qurlquery.cpp
@@ -414,7 +414,7 @@ bool QUrlQuery::operator ==(const QUrlQuery &other) const
}
/*!
- Returns \c true if this QUrlQUery object contains no key-value pairs, such as
+ Returns \c true if this QUrlQuery object contains no key-value pairs, such as
after being default-constructed or after parsing an empty query string.
\sa setQuery(), clear()
diff --git a/src/corelib/json/qjson.cpp b/src/corelib/json/qjson.cpp
index 66078f3cc8..c3b58e59a5 100644
--- a/src/corelib/json/qjson.cpp
+++ b/src/corelib/json/qjson.cpp
@@ -200,6 +200,7 @@ bool Object::isValid() const
if (tableOffset + length*sizeof(offset) > size)
return false;
+ QString lastKey;
for (uint i = 0; i < length; ++i) {
offset entryOffset = table()[i];
if (entryOffset + sizeof(Entry) >= tableOffset)
@@ -208,8 +209,12 @@ bool Object::isValid() const
int s = e->size();
if (table()[i] + s > tableOffset)
return false;
+ QString key = e->key();
+ if (key < lastKey)
+ return false;
if (!e->value.isValid(this))
return false;
+ lastKey = key;
}
return true;
}
diff --git a/src/corelib/json/qjsonarray.cpp b/src/corelib/json/qjsonarray.cpp
index 1e4c668a4c..a993fd6ea4 100644
--- a/src/corelib/json/qjsonarray.cpp
+++ b/src/corelib/json/qjsonarray.cpp
@@ -531,8 +531,8 @@ bool QJsonArray::contains(const QJsonValue &value) const
\a i must be a valid index position in the array (i.e., \c{0 <= i <
size()}).
- The return value is of type QJsonValueRef, a helper class for QJsonArray
- and QJsonObject. When you get an object of type QJsonValueRef, you can
+ The return value is of type \keyword QJsonValueRef, a helper class for QJsonArray
+ and QJsonObject. When you get an object of type \keyword QJsonValueRef, you can
use it as if it were a reference to a QJsonValue. If you assign to it,
the assignment will apply to the character in the QJsonArray of QJsonObject
from which you got the reference.
@@ -731,13 +731,14 @@ bool QJsonArray::operator!=(const QJsonArray &other) const
/*! \fn QJsonValueRef QJsonArray::iterator::operator*() const
+
Returns a modifiable reference to the current item.
You can change the value of an item by using operator*() on the
left side of an assignment.
- The return value is of type QJsonValueRef, a helper class for QJsonArray
- and QJsonObject. When you get an object of type QJsonValueRef, you can
+ The return value is of type \keyword QJsonValueRef, a helper class for QJsonArray
+ and QJsonObject. When you get an object of type \keyword QJsonValueRef, you can
use it as if it were a reference to a QJsonValue. If you assign to it,
the assignment will apply to the character in the QJsonArray of QJsonObject
from which you got the reference.
@@ -756,8 +757,8 @@ bool QJsonArray::operator!=(const QJsonArray &other) const
This function is provided to make QJsonArray iterators behave like C++
pointers.
- The return value is of type QJsonValueRef, a helper class for QJsonArray
- and QJsonObject. When you get an object of type QJsonValueRef, you can
+ The return value is of type \keyword QJsonValueRef, a helper class for QJsonArray
+ and QJsonObject. When you get an object of type \keyword QJsonValueRef, you can
use it as if it were a reference to a QJsonValue. If you assign to it,
the assignment will apply to the character in the QJsonArray of QJsonObject
from which you got the reference.
diff --git a/src/corelib/json/qjsonobject.cpp b/src/corelib/json/qjsonobject.cpp
index bdedc3f17b..22bad6f8a2 100644
--- a/src/corelib/json/qjsonobject.cpp
+++ b/src/corelib/json/qjsonobject.cpp
@@ -264,6 +264,8 @@ QVariantHash QJsonObject::toVariantHash() const
/*!
Returns a list of all keys in this object.
+
+ The list is sorted lexographically.
*/
QStringList QJsonObject::keys() const
{
diff --git a/src/corelib/json/qjsonvalue.cpp b/src/corelib/json/qjsonvalue.cpp
index 306cc1d15b..4845d8c876 100644
--- a/src/corelib/json/qjsonvalue.cpp
+++ b/src/corelib/json/qjsonvalue.cpp
@@ -74,6 +74,20 @@ QT_BEGIN_NAMESPACE
conversions. This implies that converting to a type that is not stored in the value will return a default
constructed return value.
+ \section1 QJsonValueRef
+
+ QJsonValueRef is a helper class for QJsonArray and QJsonObject.
+ When you get an object of type QJsonValueRef, you can
+ use it as if it were a reference to a QJsonValue. If you assign to it,
+ the assignment will apply to the element in the QJsonArray or QJsonObject
+ from which you got the reference.
+
+ The following methods return QJsonValueRef:
+ \list
+ \li \l {QJsonArray}::operator[](int i)
+ \li \l {QJsonObject}::operator[](const QString & key) const
+ \endlist
+
\sa {JSON Support in Qt}, {JSON Save Game Example}
*/
@@ -419,13 +433,13 @@ QJsonValue QJsonValue::fromVariant(const QVariant &variant)
The QJsonValue types will be converted as follows:
- \value Null {QVariant::}{QVariant()}
+ \value Null \l {QVariant::}{QVariant()}
\value Bool QMetaType::Bool
\value Double QMetaType::Double
\value String QString
\value Array QVariantList
\value Object QVariantMap
- \value Undefined {QVariant::}{QVariant()}
+ \value Undefined \l {QVariant::}{QVariant()}
\sa fromVariant()
*/
diff --git a/src/corelib/kernel/qabstracteventdispatcher.cpp b/src/corelib/kernel/qabstracteventdispatcher.cpp
index 67ce7d45fc..0b5898a6b9 100644
--- a/src/corelib/kernel/qabstracteventdispatcher.cpp
+++ b/src/corelib/kernel/qabstracteventdispatcher.cpp
@@ -386,7 +386,7 @@ void QAbstractEventDispatcher::closingDown()
\note The filter function set here receives native messages,
that is, MSG or XEvent structs.
- For maximum portability, you should always try to use QEvents
+ For maximum portability, you should always try to use QEvent objects
and QObject::installEventFilter() whenever possible.
\sa QObject::installEventFilter()
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index 194c3f1cba..18a379f8b9 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -80,6 +80,11 @@
#ifdef Q_OS_WIN
# ifdef Q_OS_WINRT
# include "qeventdispatcher_winrt_p.h"
+# include "qfunctions_winrt.h"
+# include <wrl.h>
+# include <Windows.ApplicationModel.core.h>
+ using namespace ABI::Windows::ApplicationModel::Core;
+ using namespace Microsoft::WRL;
# else
# include "qeventdispatcher_win_p.h"
# endif
@@ -1244,6 +1249,19 @@ void QCoreApplication::exit(int returnCode)
QEventLoop *eventLoop = data->eventLoops.at(i);
eventLoop->exit(returnCode);
}
+#ifdef Q_OS_WINRT
+ qWarning("QCoreApplication::exit: It is not recommended to explicitly exit an application on Windows Store Apps");
+ ComPtr<ICoreApplication> app;
+ HRESULT hr = RoGetActivationFactory(Wrappers::HString::MakeReference(RuntimeClass_Windows_ApplicationModel_Core_CoreApplication).Get(),
+ IID_PPV_ARGS(&app));
+ RETURN_VOID_IF_FAILED("Could not acquire ICoreApplication object");
+ ComPtr<ICoreApplicationExit> appExit;
+
+ hr = app.As(&appExit);
+ RETURN_VOID_IF_FAILED("Could not acquire ICoreApplicationExit object");
+ hr = appExit->Exit();
+ RETURN_VOID_IF_FAILED("Could not exit application");
+#endif // Q_OS_WINRT
}
/*****************************************************************************
@@ -2405,7 +2423,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QMutex, libraryPathMutex, (QMutex::Recursive))
INSTALL/plugins, where \c INSTALL is the directory where Qt was
installed). The directory of the application executable (NOT the
working directory) is always added, as well as the colon separated
- entries of the QT_PLUGIN_PATH environment variable.
+ entries of the \c QT_PLUGIN_PATH environment variable.
If you want to iterate over the list, you can use the \l foreach
pseudo-keyword:
@@ -2550,7 +2568,7 @@ void QCoreApplication::removeLibraryPath(const QString &path)
\note Native event filters will be disabled when the application the
Qt::AA_MacPluginApplication attribute is set.
- For maximum portability, you should always try to use QEvents
+ For maximum portability, you should always try to use QEvent
and QObject::installEventFilter() whenever possible.
\sa QObject::installEventFilter()
diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp
index 301f123032..b2b22ad99c 100644
--- a/src/corelib/kernel/qcoreevent.cpp
+++ b/src/corelib/kernel/qcoreevent.cpp
@@ -58,7 +58,7 @@ QT_BEGIN_NAMESPACE
send events using QCoreApplication::sendEvent() and
QCoreApplication::postEvent() (spontaneous() returns \c false).
- QObjects receive events by having their QObject::event() function
+ \l {QObject}{QObjects} receive events by having their QObject::event() function
called. The function can be reimplemented in subclasses to
customize event handling and add additional event types;
QWidget::event() is a notable example. By default, events are
@@ -102,13 +102,13 @@ QT_BEGIN_NAMESPACE
\value ChildAdded An object gets a child (QChildEvent).
\value ChildPolished A widget child gets polished (QChildEvent).
\value ChildRemoved An object loses a child (QChildEvent).
- \value Clipboard The clipboard contents have changed (QClipboardEvent).
+ \value Clipboard The clipboard contents have changed.
\value Close Widget was closed (QCloseEvent).
\value CloseSoftwareInputPanel A widget wants to close the software input panel (SIP).
\value ContentsRectChange The margins of the widget's content rect changed.
\value ContextMenu Context popup menu (QContextMenuEvent).
\value CursorChange The widget's cursor has changed.
- \value DeferredDelete The object will be deleted after it has cleaned up (QDeferredDeleteEvent).
+ \value DeferredDelete The object will be deleted after it has cleaned up (QDeferredDeleteEvent)
\value DragEnter The cursor enters a widget during a drag and drop operation (QDragEnterEvent).
\value DragLeave The cursor leaves a widget during a drag and drop operation (QDragLeaveEvent).
\value DragMove A drag and drop operation is in progress (QDragMoveEvent).
@@ -116,7 +116,7 @@ QT_BEGIN_NAMESPACE
\value DynamicPropertyChange A dynamic property was added, changed, or removed from the object.
\value EnabledChange Widget's enabled state has changed.
\value Enter Mouse enters widget's boundaries (QEnterEvent).
- \value EnterEditFocus An editor widget gains focus for editing. QT_KEYPAD_NAVIGATION must be defined.
+ \value EnterEditFocus An editor widget gains focus for editing. \c QT_KEYPAD_NAVIGATION must be defined.
\value EnterWhatsThisMode Send to toplevel widgets when the application enters "What's This?" mode.
\value Expose Sent to a window when its on-screen contents are invalidated and need to be flushed from the backing store.
\value FileOpen File open request (QFileOpenEvent).
@@ -177,7 +177,7 @@ QT_BEGIN_NAMESPACE
\value MouseTrackingChange The mouse tracking state has changed.
\value Move Widget's position changed (QMoveEvent).
\value NativeGesture The system has detected a gesture (QNativeGestureEvent).
- \value OrientationChange The screens orientation has changes (QScreenOrientationChangeEvent)
+ \value OrientationChange The screens orientation has changes (QScreenOrientationChangeEvent).
\value Paint Screen update necessary (QPaintEvent).
\value PaletteChange Palette of the widget changed.
\value ParentAboutToChange The widget parent is about to change.
diff --git a/src/corelib/kernel/qjni.cpp b/src/corelib/kernel/qjni.cpp
index a7f98bc532..694463b9d8 100644
--- a/src/corelib/kernel/qjni.cpp
+++ b/src/corelib/kernel/qjni.cpp
@@ -96,7 +96,7 @@ static jclass loadClassDotEnc(const QString &classDotEnc, JNIEnv *env)
if (clazz != 0 || isCached)
return clazz;
- QJNIObjectPrivate classLoader = QtAndroidPrivate::classLoader();
+ QJNIObjectPrivate classLoader(QtAndroidPrivate::classLoader());
if (!classLoader.isValid())
return 0;
@@ -2239,6 +2239,13 @@ bool QJNIObjectPrivate::isValid() const
return d->m_jobject;
}
+QJNIObjectPrivate QJNIObjectPrivate::fromLocalRef(jobject lref)
+{
+ QJNIObjectPrivate o(lref);
+ QJNIEnvironmentPrivate()->DeleteLocalRef(lref);
+ return o;
+}
+
bool QJNIObjectPrivate::isSameObject(jobject obj) const
{
QJNIEnvironmentPrivate env;
diff --git a/src/corelib/kernel/qjni_p.h b/src/corelib/kernel/qjni_p.h
index a7859a800f..e79caed5b8 100644
--- a/src/corelib/kernel/qjni_p.h
+++ b/src/corelib/kernel/qjni_p.h
@@ -84,7 +84,10 @@ public:
QJNIObjectPrivate(const char *className, const char *sig, ...);
explicit QJNIObjectPrivate(jclass clazz);
QJNIObjectPrivate(jclass clazz, const char *sig, ...);
- QJNIObjectPrivate(jobject obj);
+ // In most cases you should never call this function with a local ref. unless you intend
+ // to manage the local ref. yourself.
+ // NOTE: see fromLocalRef() for converting a local ref. to QJNIObjectPrivate.
+ explicit QJNIObjectPrivate(jobject globalRef);
template <typename T>
T callMethod(const char *methodName,
@@ -183,6 +186,9 @@ public:
return *this;
}
+ // This function takes ownership of the jobject and releases the local ref. before returning.
+ static QJNIObjectPrivate fromLocalRef(jobject lref);
+
private:
friend class QAndroidJniObject;
diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp
index 8f79bf5645..8adb4a4903 100644
--- a/src/corelib/kernel/qmetatype.cpp
+++ b/src/corelib/kernel/qmetatype.cpp
@@ -201,6 +201,8 @@ struct DefinedTypesFilter {
\enum QMetaType::Type
These are the built-in types supported by QMetaType:
+ Read doc on QChar
+ Read doc on \l QChar
\value Void \c void
\value Bool \c bool
diff --git a/src/corelib/kernel/qpointer.cpp b/src/corelib/kernel/qpointer.cpp
index 2abed68826..2c872716d1 100644
--- a/src/corelib/kernel/qpointer.cpp
+++ b/src/corelib/kernel/qpointer.cpp
@@ -55,7 +55,7 @@
\li When using QPointer on a QWidget (or a subclass of QWidget), previously
the QPointer would be cleared by the QWidget destructor. Now, the QPointer
- is cleared by the QObject destructor (since this is when QWeakPointers are
+ is cleared by the QObject destructor (since this is when QWeakPointer objects are
cleared). Any QPointers tracking a widget will \b NOT be cleared before the
QWidget destructor destroys the children for the widget being tracked.
diff --git a/src/corelib/kernel/qtimer.cpp b/src/corelib/kernel/qtimer.cpp
index 3f98655988..b9109a96aa 100644
--- a/src/corelib/kernel/qtimer.cpp
+++ b/src/corelib/kernel/qtimer.cpp
@@ -91,7 +91,7 @@ QT_BEGIN_NAMESPACE
its work. This is the traditional way of implementing heavy work
in GUI applications, but as multithreading is nowadays becoming available on
more and more platforms, we expect that zero-millisecond
- QTimers will gradually be replaced by \l{QThread}s.
+ QTimer objects will gradually be replaced by \l{QThread}s.
\section1 Accuracy and Timer Resolution
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 34f4c6884f..3dc0805dd1 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -1410,13 +1410,13 @@ QVariant::QVariant(const char *val)
/*!
\fn QVariant::QVariant(const QMap<QString, QVariant> &val)
- Constructs a new variant with a map of QVariants, \a val.
+ Constructs a new variant with a map of \l {QVariant}s, \a val.
*/
/*!
\fn QVariant::QVariant(const QHash<QString, QVariant> &val)
- Constructs a new variant with a hash of QVariants, \a val.
+ Constructs a new variant with a hash of \l {QVariant}s, \a val.
*/
/*!
@@ -3610,7 +3610,7 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p)
Q_OBJECT macro.
If the QVariant contains a sequential container and \c{T} is QVariantList, the
- elements of the container will be converted into QVariants and returned as a QVariantList.
+ elements of the container will be converted into \l {QVariant}s and returned as a QVariantList.
\snippet code/src_corelib_kernel_qvariant.cpp 9
diff --git a/src/corelib/plugin/qpluginloader.cpp b/src/corelib/plugin/qpluginloader.cpp
index 8ed9199c60..0bdf9034ee 100644
--- a/src/corelib/plugin/qpluginloader.cpp
+++ b/src/corelib/plugin/qpluginloader.cpp
@@ -420,7 +420,7 @@ void Q_CORE_EXPORT qRegisterStaticPluginFunction(QStaticPlugin plugin)
/*!
Returns a list of static plugin instances (root components) held
by the plugin loader.
- \sa staticPlugins()
+ \sa staticPlugin()
*/
QObjectList QPluginLoader::staticInstances()
{
diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp
index f0ba7a7f07..996ed1779d 100644
--- a/src/corelib/thread/qthread_unix.cpp
+++ b/src/corelib/thread/qthread_unix.cpp
@@ -389,14 +389,13 @@ Qt::HANDLE QThread::currentThreadId() Q_DECL_NOTHROW
int QThread::idealThreadCount() Q_DECL_NOTHROW
{
- int cores = -1;
+ int cores = 1;
#if defined(Q_OS_HPUX)
// HP-UX
struct pst_dynamic psd;
if (pstat_getdynamic(&psd, sizeof(psd), 1, 0) == -1) {
perror("pstat_getdynamic");
- cores = -1;
} else {
cores = (int)psd.psd_proc_cnt;
}
@@ -408,7 +407,6 @@ int QThread::idealThreadCount() Q_DECL_NOTHROW
mib[1] = HW_NCPU;
if (sysctl(mib, 2, &cores, &len, NULL, 0) != 0) {
perror("sysctl");
- cores = -1;
}
#elif defined(Q_OS_IRIX)
// IRIX
@@ -443,9 +441,9 @@ int QThread::idealThreadCount() Q_DECL_NOTHROW
#else
// the rest: Linux, Solaris, AIX, Tru64
cores = (int)sysconf(_SC_NPROCESSORS_ONLN);
-#endif
if (cores == -1)
return 1;
+#endif
return cores;
}
diff --git a/src/corelib/thread/qwaitcondition_unix.cpp b/src/corelib/thread/qwaitcondition_unix.cpp
index 90dfcb7ba1..fd6af7db39 100644
--- a/src/corelib/thread/qwaitcondition_unix.cpp
+++ b/src/corelib/thread/qwaitcondition_unix.cpp
@@ -52,9 +52,12 @@
QT_BEGIN_NAMESPACE
#ifdef Q_OS_ANDROID
-// Android lacks pthread_condattr_setclock, but it does have a nice function
-// for relative waits. Use weakref so we can determine at runtime whether it is
-// present.
+// pthread_condattr_setclock is available only since Android 5.0. On older versions, there's
+// a private function for relative waits (hidden in 5.0).
+// Use weakref so we can determine at runtime whether each of them is present.
+static int local_condattr_setclock(pthread_condattr_t*, clockid_t)
+__attribute__((weakref("pthread_condattr_setclock")));
+
static int local_cond_timedwait_relative(pthread_cond_t*, pthread_mutex_t *, const timespec *)
__attribute__((weakref("__pthread_cond_timedwait_relative")));
#endif
@@ -70,10 +73,15 @@ void qt_initialize_pthread_cond(pthread_cond_t *cond, const char *where)
pthread_condattr_t condattr;
pthread_condattr_init(&condattr);
-#if !defined(Q_OS_MAC) && !defined(Q_OS_ANDROID) && !defined(Q_OS_HAIKU) && (_POSIX_MONOTONIC_CLOCK-0 >= 0)
+#if (_POSIX_MONOTONIC_CLOCK-0 >= 0)
+#if defined(Q_OS_ANDROID)
+ if (local_condattr_setclock && QElapsedTimer::clockType() == QElapsedTimer::MonotonicClock)
+ local_condattr_setclock(&condattr, CLOCK_MONOTONIC);
+#elif !defined(Q_OS_MAC) && !defined(Q_OS_HAIKU)
if (QElapsedTimer::clockType() == QElapsedTimer::MonotonicClock)
pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
#endif
+#endif
report_error(pthread_cond_init(cond, &condattr), where, "cv init");
pthread_condattr_destroy(&condattr);
}
@@ -108,7 +116,7 @@ public:
{
timespec ti;
#ifdef Q_OS_ANDROID
- if (Q_LIKELY(local_cond_timedwait_relative)) {
+ if (local_cond_timedwait_relative) {
ti.tv_sec = time / 1000;
ti.tv_nsec = time % 1000 * Q_UINT64_C(1000) * 1000;
return local_cond_timedwait_relative(&cond, &mutex, &ti);
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index d94167466d..eb96757457 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -786,7 +786,7 @@ static inline char qToLower(char c)
occurrences of a particular value with another, use one of the
two-parameter replace() overloads.
- {QByteArray}s can be compared using overloaded operators such as
+ \l{QByteArray}s can be compared using overloaded operators such as
operator<(), operator<=(), operator==(), operator>=(), and so on.
The comparison is based exclusively on the numeric values
of the characters and is very fast, but is not what a human would
@@ -831,7 +831,7 @@ static inline char qToLower(char c)
lastIndexOf(), operator<(), operator<=(), operator>(),
operator>=(), toLower() and toUpper().
- This issue does not apply to {QString}s since they represent
+ This issue does not apply to \l{QString}s since they represent
characters using Unicode.
\sa QString, QBitArray
diff --git a/src/corelib/tools/qtimezoneprivate.cpp b/src/corelib/tools/qtimezoneprivate.cpp
index 164db5ed0c..8e6a0a0578 100644
--- a/src/corelib/tools/qtimezoneprivate.cpp
+++ b/src/corelib/tools/qtimezoneprivate.cpp
@@ -625,6 +625,15 @@ QTimeZonePrivate *QUtcTimeZonePrivate::clone()
return new QUtcTimeZonePrivate(*this);
}
+QTimeZonePrivate::Data QUtcTimeZonePrivate::data(qint64 forMSecsSinceEpoch) const
+{
+ Data d = invalidData();
+ d.abbreviation = m_abbreviation;
+ d.atMSecsSinceEpoch = forMSecsSinceEpoch;
+ d.offsetFromUtc = m_offsetFromUtc;
+ return d;
+}
+
void QUtcTimeZonePrivate::init(const QByteArray &zoneId)
{
m_id = zoneId;
diff --git a/src/corelib/tools/qtimezoneprivate_p.h b/src/corelib/tools/qtimezoneprivate_p.h
index 803ba1f57a..e15ac801bc 100644
--- a/src/corelib/tools/qtimezoneprivate_p.h
+++ b/src/corelib/tools/qtimezoneprivate_p.h
@@ -186,6 +186,8 @@ public:
QTimeZonePrivate *clone() Q_DECL_OVERRIDE;
+ Data data(qint64 forMSecsSinceEpoch) const Q_DECL_OVERRIDE;
+
QLocale::Country country() const Q_DECL_OVERRIDE;
QString comment() const Q_DECL_OVERRIDE;
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index 5245c4ed10..9d5b749e79 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -154,7 +154,9 @@ public:
const const_iterator ce = this->cend(), cit = std::find(this->cbegin(), ce, t);
if (cit == ce)
return 0;
- const iterator e = end(), it = std::remove(c2m(cit), e, t);
+ // next operation detaches, so ce, cit may become invalidated:
+ const int firstFoundIdx = std::distance(this->cbegin(), cit);
+ const iterator e = end(), it = std::remove(begin() + firstFoundIdx, e, t);
const int result = std::distance(it, e);
erase(it, e);
return result;