summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/codecs/qutfcodec.cpp19
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_io_qprocess.cpp2
-rw-r--r--src/corelib/doc/snippets/code/src_corelib_kernel_qmetaobject.cpp2
-rw-r--r--src/corelib/global/qglobal.cpp7
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp12
-rw-r--r--src/corelib/io/qprocess.cpp137
-rw-r--r--src/corelib/io/qprocess.h16
-rw-r--r--src/corelib/io/qsettings.cpp13
-rw-r--r--src/corelib/io/qstandardpaths_winrt.cpp6
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp30
-rw-r--r--src/corelib/itemmodels/qabstractproxymodel.cpp3
-rw-r--r--src/corelib/kernel/qobject.cpp2
-rw-r--r--src/corelib/kernel/qsharedmemory_win.cpp2
-rw-r--r--src/corelib/thread/qmutex_p.h2
-rw-r--r--src/corelib/tools/qcollator_win.cpp1
-rw-r--r--src/corelib/tools/qfreelist_p.h12
-rw-r--r--src/corelib/tools/qlocale_win.cpp6
-rw-r--r--src/corelib/tools/qmap.h6
18 files changed, 138 insertions, 140 deletions
diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp
index f16144771f..9139e61700 100644
--- a/src/corelib/codecs/qutfcodec.cpp
+++ b/src/corelib/codecs/qutfcodec.cpp
@@ -74,25 +74,22 @@ static inline bool simdEncodeAscii(uchar *&dst, const ushort *&nextAscii, const
__m128i packed = _mm_packus_epi16(data1, data2);
__m128i nonAscii = _mm_cmpgt_epi8(packed, _mm_setzero_si128());
+ // store, even if there are non-ASCII characters here
+ _mm_storeu_si128((__m128i*)dst, packed);
+
// n will contain 1 bit set per character in [data1, data2] that is non-ASCII (or NUL)
ushort n = ~_mm_movemask_epi8(nonAscii);
if (n) {
- // copy the front part that is still ASCII
- while (!(n & 1)) {
- *dst++ = *src++;
- n >>= 1;
- }
-
// find the next probable ASCII character
// we don't want to load 32 bytes again in this loop if we know there are non-ASCII
// characters still coming
- n = _bit_scan_reverse(n);
- nextAscii = src + n + 1;
+ nextAscii = src + _bit_scan_reverse(n) + 1;
+
+ n = _bit_scan_forward(n);
+ dst += n;
+ src += n;
return false;
}
-
- // pack
- _mm_storeu_si128((__m128i*)dst, packed);
}
return src == end;
}
diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qprocess.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qprocess.cpp
index b5d71079da..e9c3caae5b 100644
--- a/src/corelib/doc/snippets/code/src_corelib_io_qprocess.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_io_qprocess.cpp
@@ -121,7 +121,7 @@ process.start("dir \"My Documents\"");
//! [7]
QProcess process;
-process.start("dir \"\"\"My Documents\"\"\"");
+process.start("dir \"Epic 12\"\"\" Singles\"");
//! [7]
diff --git a/src/corelib/doc/snippets/code/src_corelib_kernel_qmetaobject.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qmetaobject.cpp
index c0675d6cf0..708cacdf6e 100644
--- a/src/corelib/doc/snippets/code/src_corelib_kernel_qmetaobject.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_kernel_qmetaobject.cpp
@@ -124,7 +124,7 @@ QMetaMethod::invoke: Unable to handle unregistered datatype 'MyType'
QString retVal;
QByteArray normalizedSignature = QMetaObject::normalizedSignature("compute(QString, int, double)");
int methodIndex = obj->metaObject()->indexOfMethod(normalizedSignature);
-QMetaMethod method = metaObject->method(methodIndex);
+QMetaMethod method = obj->metaObject()->method(methodIndex);
method.invoke(obj,
Qt::DirectConnection,
Q_RETURN_ARG(QString, retVal),
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 726117b515..4aa25e5450 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1841,8 +1841,9 @@ QSysInfo::MacVersion QSysInfo::macVersion()
{
#if defined(Q_OS_OSX)
SInt32 gestalt_version;
- if (Gestalt(gestaltSystemVersion, &gestalt_version) == noErr) {
- return QSysInfo::MacVersion(((gestalt_version & 0x00F0) >> 4) + 2);
+ if (Gestalt(gestaltSystemVersionMinor, &gestalt_version) == noErr) {
+ // add 2 because OS X 10.0 is 0x02 in the enum
+ return QSysInfo::MacVersion(gestalt_version + 2);
}
#elif defined(Q_OS_IOS)
return qt_ios_version(); // qtcore_mac_objc.mm
@@ -1992,6 +1993,8 @@ QSysInfo::WinVersion QSysInfo::windowsVersion()
winver = QSysInfo::WV_WINDOWS7;
else if (override == "WINDOWS8")
winver = QSysInfo::WV_WINDOWS8;
+ else if (override == "WINDOWS8_1")
+ winver = QSysInfo::WV_WINDOWS8_1;
}
#endif
#endif // !Q_OS_WINRT
diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp
index 8e3bacd6b7..1d79136422 100644
--- a/src/corelib/io/qfilesystemengine_win.cpp
+++ b/src/corelib/io/qfilesystemengine_win.cpp
@@ -1219,11 +1219,11 @@ QString QFileSystemEngine::rootPath()
if (FAILED(installedLocation.As(&item)))
return ret;
- HSTRING finalWinPath;
- if (FAILED(item->get_Path(&finalWinPath)))
+ HString finalWinPath;
+ if (FAILED(item->get_Path(finalWinPath.GetAddressOf())))
return ret;
- ret = QDir::fromNativeSeparators(QString::fromWCharArray(WindowsGetStringRawBuffer(finalWinPath, nullptr)));
+ ret = QDir::fromNativeSeparators(QString::fromWCharArray(finalWinPath.GetRawBuffer(nullptr)));
#else
QString ret = QString::fromLatin1(qgetenv("SystemDrive").constData());
@@ -1319,10 +1319,10 @@ QString QFileSystemEngine::tempPath()
ComPtr<IStorageItem> tempFolderItem;
if (FAILED(tempFolder.As(&tempFolderItem)))
return ret;
- HSTRING path;
- if (FAILED(tempFolderItem->get_Path(&path)))
+ HString path;
+ if (FAILED(tempFolderItem->get_Path(path.GetAddressOf())))
return ret;
- ret = QDir::fromNativeSeparators(QString::fromWCharArray(WindowsGetStringRawBuffer(path, nullptr)));
+ ret = QDir::fromNativeSeparators(QString::fromWCharArray(path.GetRawBuffer(nullptr)));
#endif // Q_OS_WINRT
if (ret.isEmpty()) {
#if !defined(Q_OS_WINCE)
diff --git a/src/corelib/io/qprocess.cpp b/src/corelib/io/qprocess.cpp
index 18391703da..9f9cba81ab 100644
--- a/src/corelib/io/qprocess.cpp
+++ b/src/corelib/io/qprocess.cpp
@@ -2015,15 +2015,12 @@ QByteArray QProcess::readAllStandardError()
}
/*!
- Starts the given \a program in a new process, if none is already
- running, passing the command line arguments in \a arguments. The OpenMode
- is set to \a mode.
+ Starts the given \a program in a new process, passing the command line
+ arguments in \a arguments.
The QProcess object will immediately enter the Starting state. If the
process starts successfully, QProcess will emit started(); otherwise,
- error() will be emitted. If the QProcess object is already running a
- process, a warning may be printed at the console, and the existing
- process will continue running.
+ error() will be emitted.
\note Processes are started asynchronously, which means the started()
and error() signals may be delayed. Call waitForStarted() to make
@@ -2032,9 +2029,18 @@ QByteArray QProcess::readAllStandardError()
\note No further splitting of the arguments is performed.
- \b{Windows:} Arguments that contain spaces are wrapped in quotes.
+ \b{Windows:} The arguments are quoted and joined into a command line
+ that is compatible with the CommandLineToArgvW() Windows function.
+ For programs that have different command line quoting requirements,
+ you need to use setNativeArguments().
- \sa pid(), started(), waitForStarted()
+ The OpenMode is set to \a mode.
+
+ If the QProcess object is already running a process, a warning may be
+ printed at the console, and the existing process will continue running
+ unaffected.
+
+ \sa pid(), started(), waitForStarted(), setNativeArguments()
*/
void QProcess::start(const QString &program, const QStringList &arguments, OpenMode mode)
{
@@ -2057,8 +2063,6 @@ void QProcess::start(const QString &program, const QStringList &arguments, OpenM
Starts the program set by setProgram() with arguments set by setArguments().
The OpenMode is set to \a mode.
- This method is a convenient alias to open().
-
\sa open(), setProgram(), setArguments()
*/
void QProcess::start(OpenMode mode)
@@ -2077,22 +2081,13 @@ void QProcess::start(OpenMode mode)
}
/*!
- Starts the program set by setProgram() in a new process, if none is already
- running, passing the command line arguments set by setArguments(). The OpenMode
- is set to \a mode.
-
- The QProcess object will immediately enter the Starting state. If the
- process starts successfully, QProcess will emit started(); otherwise,
- error() will be emitted. If the QProcess object is already running a
- process, a warning may be printed at the console, the function will return false,
- and the existing process will continue running.
+ Starts the program set by setProgram() with arguments set by setArguments().
+ The OpenMode is set to \a mode.
- \note Processes are started asynchronously, which means the started()
- and error() signals may be delayed. Call waitForStarted() to make
- sure the process has started (or has failed to start) and those signals
- have been emitted. In this regard, a true return value merly means the process
- was correcty initialized, not that the program was actually started.
+ This method is an alias for start(), and exists only to fully implement
+ the interface defined by QIODevice.
+ \sa start(), setProgram(), setArguments()
*/
bool QProcess::open(OpenMode mode)
{
@@ -2185,29 +2180,28 @@ static QStringList parseCombinedArgString(const QString &program)
/*!
\overload
- Starts the command \a command in a new process, if one is not already
- running. \a command is a single string of text containing both the
- program name and its arguments. The arguments are separated by one or
- more spaces. For example:
+ Starts the command \a command in a new process.
+ The OpenMode is set to \a mode.
+
+ \a command is a single string of text containing both the program name
+ and its arguments. The arguments are separated by one or more spaces.
+ For example:
\snippet code/src_corelib_io_qprocess.cpp 5
- The \a command string can also contain quotes, to ensure that arguments
- containing spaces are correctly supplied to the new process. For example:
+ Arguments containing spaces must be quoted to be correctly supplied to
+ the new process. For example:
\snippet code/src_corelib_io_qprocess.cpp 6
- If the QProcess object is already running a process, a warning may be
- printed at the console, and the existing process will continue running.
-
- Note that, on Windows, quotes need to be both escaped and quoted.
- For example, the above code would be specified in the following
- way to ensure that \c{"My Documents"} is used as the argument to
- the \c dir executable:
+ Literal quotes in the \a command string are represented by triple quotes.
+ For example:
\snippet code/src_corelib_io_qprocess.cpp 7
- The OpenMode is set to \a mode.
+ After the \a command string has been split and unquoted, this function
+ behaves like the overload which takes the arguments as a string list.
+
*/
void QProcess::start(const QString &command, OpenMode mode)
{
@@ -2243,7 +2237,7 @@ QString QProcess::program() const
\since 5.1
Set the \a program to use when starting the process.
- That function must be call before open()
+ This function must be called before start().
\sa start(), setArguments(), program()
*/
@@ -2274,7 +2268,7 @@ QStringList QProcess::arguments() const
\since 5.1
Set the \a arguments to pass to the called program when starting the process.
- That function must be call before open()
+ This function must be called before start().
\sa start(), setProgram(), arguments()
*/
@@ -2359,11 +2353,13 @@ QProcess::ExitStatus QProcess::exitStatus() const
The environment and working directory are inherited from the calling
process.
- On Windows, arguments that contain spaces are wrapped in quotes.
+ Argument handling is identical to the respective start() overload.
If the process cannot be started, -2 is returned. If the process
crashes, -1 is returned. Otherwise, the process' exit code is
returned.
+
+ \sa start()
*/
int QProcess::execute(const QString &program, const QStringList &arguments)
{
@@ -2378,15 +2374,21 @@ int QProcess::execute(const QString &program, const QStringList &arguments)
/*!
\overload
- Starts the program \a program in a new process. \a program is a
- single string of text containing both the program name and its
- arguments. The arguments are separated by one or more spaces.
+ Starts the program \a command in a new process, waits for it to finish,
+ and then returns the exit code.
+
+ Argument handling is identical to the respective start() overload.
+
+ After the \a command string has been split and unquoted, this function
+ behaves like the overload which takes the arguments as a string list.
+
+ \sa start()
*/
-int QProcess::execute(const QString &program)
+int QProcess::execute(const QString &command)
{
QProcess process;
process.setReadChannelMode(ForwardedChannels);
- process.start(program);
+ process.start(command);
if (!process.waitForFinished(-1))
return -2;
return process.exitStatus() == QProcess::NormalExit ? process.exitCode() : -1;
@@ -2396,24 +2398,24 @@ int QProcess::execute(const QString &program)
Starts the program \a program with the arguments \a arguments in a
new process, and detaches from it. Returns \c true on success;
otherwise returns \c false. If the calling process exits, the
- detached process will continue to live.
+ detached process will continue to run unaffected.
- Note that arguments that contain spaces are not passed to the
- process as separate arguments.
+ Argument handling is identical to the respective start() overload.
\b{Unix:} The started process will run in its own session and act
like a daemon.
- \b{Windows:} Arguments that contain spaces are wrapped in quotes.
- The started process will run as a regular standalone process.
-
The process will be started in the directory \a workingDirectory.
+ If \a workingDirectory is empty, the working directory is inherited
+ from the calling process.
\note On QNX, this may cause all application threads to
temporarily freeze.
If the function is successful then *\a pid is set to the process
identifier of the started process.
+
+ \sa start()
*/
bool QProcess::startDetached(const QString &program,
const QStringList &arguments,
@@ -2427,19 +2429,7 @@ bool QProcess::startDetached(const QString &program,
}
/*!
- Starts the program \a program with the given \a arguments in a
- new process, and detaches from it. Returns \c true on success;
- otherwise returns \c false. If the calling process exits, the
- detached process will continue to live.
-
- \note Arguments that contain spaces are not passed to the
- process as separate arguments.
-
- \b{Unix:} The started process will run in its own session and act
- like a daemon.
-
- \b{Windows:} Arguments that contain spaces are wrapped in quotes.
- The started process will run as a regular standalone process.
+ \internal
*/
bool QProcess::startDetached(const QString &program,
const QStringList &arguments)
@@ -2450,16 +2440,19 @@ bool QProcess::startDetached(const QString &program,
/*!
\overload
- Starts the program \a program in a new process. \a program is a
- single string of text containing both the program name and its
- arguments. The arguments are separated by one or more spaces.
+ Starts the command \a command in a new process, and detaches from it.
+ Returns \c true on success; otherwise returns \c false.
+
+ Argument handling is identical to the respective start() overload.
+
+ After the \a command string has been split and unquoted, this function
+ behaves like the overload which takes the arguments as a string list.
- The \a program string can also contain quotes, to ensure that arguments
- containing spaces are correctly supplied to the new process.
+ \sa start()
*/
-bool QProcess::startDetached(const QString &program)
+bool QProcess::startDetached(const QString &command)
{
- QStringList args = parseCombinedArgString(program);
+ QStringList args = parseCombinedArgString(command);
if (args.isEmpty())
return false;
diff --git a/src/corelib/io/qprocess.h b/src/corelib/io/qprocess.h
index 6be267f15f..94359acf00 100644
--- a/src/corelib/io/qprocess.h
+++ b/src/corelib/io/qprocess.h
@@ -209,12 +209,18 @@ public:
bool atEnd() const;
static int execute(const QString &program, const QStringList &arguments);
- static int execute(const QString &program);
+ static int execute(const QString &command);
- static bool startDetached(const QString &program, const QStringList &arguments, const QString &workingDirectory,
- qint64 *pid = 0);
- static bool startDetached(const QString &program, const QStringList &arguments);
- static bool startDetached(const QString &program);
+ static bool startDetached(const QString &program, const QStringList &arguments,
+ const QString &workingDirectory
+#if defined(Q_QDOC)
+ = QString()
+#endif
+ , qint64 *pid = 0);
+#if !defined(Q_QDOC)
+ static bool startDetached(const QString &program, const QStringList &arguments); // ### Qt6: merge overloads
+#endif
+ static bool startDetached(const QString &command);
static QStringList systemEnvironment();
diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp
index 63a0266948..1748170324 100644
--- a/src/corelib/io/qsettings.cpp
+++ b/src/corelib/io/qsettings.cpp
@@ -696,6 +696,9 @@ void QSettingsPrivate::iniEscapedString(const QString &str, QByteArray &result,
{
bool needsQuotes = false;
bool escapeNextIfDigit = false;
+ bool useCodec = codec && !str.startsWith(QLatin1String("@ByteArray("))
+ && !str.startsWith(QLatin1String("@Variant("));
+
int i;
int startPos = result.size();
@@ -748,12 +751,12 @@ void QSettingsPrivate::iniEscapedString(const QString &str, QByteArray &result,
result += (char)ch;
break;
default:
- if (ch <= 0x1F || (ch >= 0x7F && !codec)) {
+ if (ch <= 0x1F || (ch >= 0x7F && !useCodec)) {
result += "\\x";
result += QByteArray::number(ch, 16);
escapeNextIfDigit = true;
#ifndef QT_NO_TEXTCODEC
- } else if (codec) {
+ } else if (useCodec) {
// slow
result += codec->fromUnicode(str.at(i));
#endif
@@ -1084,10 +1087,10 @@ static QString windowsConfigPath(int type)
ComPtr<IStorageItem> localFolderItem;
if (FAILED(localFolder.As(&localFolderItem)))
return result;
- HSTRING path;
- if (FAILED(localFolderItem->get_Path(&path)))
+ HString path;
+ if (FAILED(localFolderItem->get_Path(path.GetAddressOf())))
return result;
- result = QString::fromWCharArray(WindowsGetStringRawBuffer(path, nullptr));
+ result = QString::fromWCharArray(path.GetRawBuffer(nullptr));
}
switch (type) {
diff --git a/src/corelib/io/qstandardpaths_winrt.cpp b/src/corelib/io/qstandardpaths_winrt.cpp
index 172ea3fc3d..aa3b710f52 100644
--- a/src/corelib/io/qstandardpaths_winrt.cpp
+++ b/src/corelib/io/qstandardpaths_winrt.cpp
@@ -90,10 +90,10 @@ QString QStandardPaths::writableLocation(StandardLocation type)
ComPtr<IStorageItem> settingsFolderItem;
if (FAILED(settingsFolder.As(&settingsFolderItem)))
break;
- HSTRING path;
- if (FAILED(settingsFolderItem->get_Path(&path)))
+ HString path;
+ if (FAILED(settingsFolderItem->get_Path(path.GetAddressOf())))
break;
- result = convertCharArray(WindowsGetStringRawBuffer(path, nullptr));
+ result = convertCharArray(path.GetRawBuffer(nullptr));
if (isTestModeEnabled())
result += QLatin1String("/qttest");
break;
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index 3e303e529c..fd70bcddce 100644
--- a/src/corelib/itemmodels/qabstractitemmodel.cpp
+++ b/src/corelib/itemmodels/qabstractitemmodel.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -1504,10 +1504,10 @@ QAbstractItemModel::~QAbstractItemModel()
*/
/*!
- \fn void QAbstractItemModel::rowsInserted(const QModelIndex &parent, int start, int end)
+ \fn void QAbstractItemModel::rowsInserted(const QModelIndex &parent, int first, int last)
This signal is emitted after rows have been inserted into the
- model. The new items are those between \a start and \a end
+ model. The new items are those between \a first and \a last
inclusive, under the given \a parent item.
\note Components connected to this signal use it to adapt to changes in the
@@ -1532,10 +1532,10 @@ QAbstractItemModel::~QAbstractItemModel()
*/
/*!
- \fn void QAbstractItemModel::rowsRemoved(const QModelIndex &parent, int start, int end)
+ \fn void QAbstractItemModel::rowsRemoved(const QModelIndex &parent, int first, int last)
This signal is emitted after rows have been removed from the model. The
- removed items are those between \a start and \a end inclusive, under the
+ removed items are those between \a first and \a last inclusive, under the
given \a parent item.
\note Components connected to this signal use it to adapt to changes
@@ -1546,10 +1546,10 @@ QAbstractItemModel::~QAbstractItemModel()
*/
/*!
- \fn void QAbstractItemModel::rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end)
+ \fn void QAbstractItemModel::rowsAboutToBeRemoved(const QModelIndex &parent, int first, int last)
This signal is emitted just before rows are removed from the model. The
- items that will be removed are those between \a start and \a end inclusive,
+ items that will be removed are those between \a first and \a last inclusive,
under the given \a parent item.
\note Components connected to this signal use it to adapt to changes
@@ -1624,10 +1624,10 @@ QAbstractItemModel::~QAbstractItemModel()
*/
/*!
- \fn void QAbstractItemModel::columnsInserted(const QModelIndex &parent, int start, int end)
+ \fn void QAbstractItemModel::columnsInserted(const QModelIndex &parent, int first, int last)
This signal is emitted after columns have been inserted into the model. The
- new items are those between \a start and \a end inclusive, under the given
+ new items are those between \a first and \a last inclusive, under the given
\a parent item.
\note Components connected to this signal use it to adapt to changes in the
@@ -1638,10 +1638,10 @@ QAbstractItemModel::~QAbstractItemModel()
*/
/*!
- \fn void QAbstractItemModel::columnsAboutToBeInserted(const QModelIndex &parent, int start, int end)
+ \fn void QAbstractItemModel::columnsAboutToBeInserted(const QModelIndex &parent, int first, int last)
This signal is emitted just before columns are inserted into the model. The
- new items will be positioned between \a start and \a end inclusive, under
+ new items will be positioned between \a first and \a last inclusive, under
the given \a parent item.
\note Components connected to this signal use it to adapt to changes in the
@@ -1652,10 +1652,10 @@ QAbstractItemModel::~QAbstractItemModel()
*/
/*!
- \fn void QAbstractItemModel::columnsRemoved(const QModelIndex &parent, int start, int end)
+ \fn void QAbstractItemModel::columnsRemoved(const QModelIndex &parent, int first, int last)
This signal is emitted after columns have been removed from the model.
- The removed items are those between \a start and \a end inclusive,
+ The removed items are those between \a first and \a last inclusive,
under the given \a parent item.
\note Components connected to this signal use it to adapt to changes in
@@ -1666,10 +1666,10 @@ QAbstractItemModel::~QAbstractItemModel()
*/
/*!
- \fn void QAbstractItemModel::columnsAboutToBeRemoved(const QModelIndex &parent, int start, int end)
+ \fn void QAbstractItemModel::columnsAboutToBeRemoved(const QModelIndex &parent, int first, int last)
This signal is emitted just before columns are removed from the model. The
- items to be removed are those between \a start and \a end inclusive, under
+ items to be removed are those between \a first and \a last inclusive, under
the given \a parent item.
\note Components connected to this signal use it to adapt to changes in the
diff --git a/src/corelib/itemmodels/qabstractproxymodel.cpp b/src/corelib/itemmodels/qabstractproxymodel.cpp
index d435c4bcf5..2f1f4921f7 100644
--- a/src/corelib/itemmodels/qabstractproxymodel.cpp
+++ b/src/corelib/itemmodels/qabstractproxymodel.cpp
@@ -377,8 +377,7 @@ bool QAbstractProxyModel::hasChildren(const QModelIndex &parent) const
*/
QModelIndex QAbstractProxyModel::sibling(int row, int column, const QModelIndex &idx) const
{
- Q_D(const QAbstractProxyModel);
- return mapFromSource(d->model->sibling(row, column, mapToSource(idx)));
+ return index(row, column, idx.parent());
}
/*!
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index c0773882f3..a8e9f4a7e9 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -515,7 +515,7 @@ void QMetaCallEvent::placeMetaCall(QObject *object)
\code
const bool wasBlocked = someQObject->blockSignals(true);
// no signals here
- someQObject->blockSignals(false);
+ someQObject->blockSignals(wasBlocked);
\endcode
except the code using QSignalBlocker is safe in the face of
diff --git a/src/corelib/kernel/qsharedmemory_win.cpp b/src/corelib/kernel/qsharedmemory_win.cpp
index b00434977b..fd79a7efea 100644
--- a/src/corelib/kernel/qsharedmemory_win.cpp
+++ b/src/corelib/kernel/qsharedmemory_win.cpp
@@ -148,6 +148,7 @@ bool QSharedMemoryPrivate::create(int size)
// Create the file mapping.
#if defined(Q_OS_WINPHONE)
Q_UNIMPLEMENTED();
+ Q_UNUSED(size)
hand = 0;
#elif defined(Q_OS_WINRT)
hand = CreateFileMappingFromApp(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, size, (PCWSTR)nativeKey.utf16());
@@ -169,6 +170,7 @@ bool QSharedMemoryPrivate::attach(QSharedMemory::AccessMode mode)
int permissions = (mode == QSharedMemory::ReadOnly ? FILE_MAP_READ : FILE_MAP_ALL_ACCESS);
#if defined(Q_OS_WINPHONE)
Q_UNIMPLEMENTED();
+ Q_UNUSED(mode)
memory = 0;
#elif defined(Q_OS_WINRT)
memory = (void *)MapViewOfFileFromApp(handle(), permissions, 0, 0);
diff --git a/src/corelib/thread/qmutex_p.h b/src/corelib/thread/qmutex_p.h
index bec2d934c1..dcaaed4cab 100644
--- a/src/corelib/thread/qmutex_p.h
+++ b/src/corelib/thread/qmutex_p.h
@@ -92,7 +92,7 @@ public:
bool wait(int timeout = -1);
void wakeUp() Q_DECL_NOTHROW;
- // Conrol the lifetime of the privates
+ // Control the lifetime of the privates
QAtomicInt refCount;
int id;
diff --git a/src/corelib/tools/qcollator_win.cpp b/src/corelib/tools/qcollator_win.cpp
index 9a672a0505..4141ba1205 100644
--- a/src/corelib/tools/qcollator_win.cpp
+++ b/src/corelib/tools/qcollator_win.cpp
@@ -155,6 +155,7 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const
#elif defined(Q_OS_WINPHONE)
int size = 0;
Q_UNIMPLEMENTED();
+ Q_UNUSED(string)
#else // Q_OS_WINPHONE
int size = LCMapStringEx(LOCALE_NAME_USER_DEFAULT, LCMAP_SORTKEY | d->collator,
reinterpret_cast<LPCWSTR>(string.constData()), string.size(),
diff --git a/src/corelib/tools/qfreelist_p.h b/src/corelib/tools/qfreelist_p.h
index 5e90a03d7f..ca946cbd8a 100644
--- a/src/corelib/tools/qfreelist_p.h
+++ b/src/corelib/tools/qfreelist_p.h
@@ -73,7 +73,7 @@ struct QFreeListElement
typedef T &ReferenceType;
T _t;
- int next;
+ QAtomicInt next;
inline ConstReferenceType t() const { return _t; }
inline ReferenceType t() { return _t; }
@@ -81,7 +81,7 @@ struct QFreeListElement
/*! \internal
- Element in a QFreeList without a paylout. ConstReferenceType and
+ Element in a QFreeList without a payload. ConstReferenceType and
ReferenceType are void, the t() functions return void and are empty.
*/
template <>
@@ -90,7 +90,7 @@ struct QFreeListElement<void>
typedef void ConstReferenceType;
typedef void ReferenceType;
- int next;
+ QAtomicInt next;
inline void t() const { }
inline void t() { }
@@ -172,7 +172,7 @@ class QFreeList
// qDebug("QFreeList: allocating %d elements (%ld bytes) with offset %d", size, size * sizeof(ElementType), offset);
ElementType *v = new ElementType[size];
for (int i = 0; i < size; ++i)
- v[i].next = offset + i + 1;
+ v[i].next.store(offset + i + 1);
return v;
}
@@ -254,7 +254,7 @@ inline int QFreeList<T, ConstantsType>::next()
}
}
- newid = v[at].next | (id & ~ConstantsType::IndexMask);
+ newid = v[at].next.load() | (id & ~ConstantsType::IndexMask);
} while (!_next.testAndSetRelaxed(id, newid));
// qDebug("QFreeList::next(): returning %d (_next now %d, serial %d)",
// id & ConstantsType::IndexMask,
@@ -273,7 +273,7 @@ inline void QFreeList<T, ConstantsType>::release(int id)
int x, newid;
do {
x = _next.loadAcquire();
- v[at].next = x & ConstantsType::IndexMask;
+ v[at].next.store(x & ConstantsType::IndexMask);
newid = incrementserial(x, id);
} while (!_next.testAndSetRelease(x, newid));
diff --git a/src/corelib/tools/qlocale_win.cpp b/src/corelib/tools/qlocale_win.cpp
index 1690dd83ee..4c44016fdf 100644
--- a/src/corelib/tools/qlocale_win.cpp
+++ b/src/corelib/tools/qlocale_win.cpp
@@ -663,10 +663,10 @@ QVariant QSystemLocalePrivate::uiLanguages()
unsigned int size;
languageList->get_Size(&size);
for (unsigned int i = 0; i < size; ++i) {
- HSTRING language;
- languageList->GetAt(i, &language);
+ HString language;
+ languageList->GetAt(i, language.GetAddressOf());
UINT32 length;
- PCWSTR rawString = WindowsGetStringRawBuffer(language, &length);
+ PCWSTR rawString = language.GetRawBuffer(&length);
result << QString::fromWCharArray(rawString, length);
}
#else // !Q_OS_WINPHONE
diff --git a/src/corelib/tools/qmap.h b/src/corelib/tools/qmap.h
index 76f8bd6f17..d7bd9c739c 100644
--- a/src/corelib/tools/qmap.h
+++ b/src/corelib/tools/qmap.h
@@ -102,9 +102,6 @@ struct Q_CORE_EXPORT QMapNodeBase
void setColor(Color c) { if (c == Black) p |= Black; else p &= ~Black; }
QMapNodeBase *parent() const { return reinterpret_cast<QMapNodeBase *>(p & ~Mask); }
void setParent(QMapNodeBase *pp) { p = (p & Mask) | quintptr(pp); }
-
- QMapNodeBase *minimumNode() { QMapNodeBase *n = this; while (n->left) n = n->left; return n; }
- const QMapNodeBase *minimumNode() const { const QMapNodeBase *n = this; while (n->left) n = n->left; return n; }
};
template <class Key, class T>
@@ -121,9 +118,6 @@ struct QMapNode : public QMapNodeBase
inline QMapNode *nextNode() { return static_cast<QMapNode *>(QMapNodeBase::nextNode()); }
inline QMapNode *previousNode() { return static_cast<QMapNode *>(QMapNodeBase::previousNode()); }
- QMapNode *minimumNode() { return static_cast<QMapNode *>(QMapNodeBase::minimumNode()); }
- const QMapNode *minimumNode() const { return static_cast<QMapNode *>(QMapNodeBase::minimumNode()); }
-
QMapNode<Key, T> *copy(QMapData<Key, T> *d) const;
void destroySubTree();