summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/animation/qabstractanimation.cpp7
-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_tools_qregexp.cpp2
-rw-r--r--src/corelib/global/qglobal.cpp7
-rw-r--r--src/corelib/global/qglobal.h4
-rw-r--r--src/corelib/global/qlogging.cpp36
-rw-r--r--src/corelib/io/qfiledevice.cpp7
-rw-r--r--src/corelib/io/qfileinfo.cpp11
-rw-r--r--src/corelib/io/qfileselector.cpp5
-rw-r--r--src/corelib/io/qfilesystemengine.cpp4
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp12
-rw-r--r--src/corelib/io/qfilesystemiterator_p.h4
-rw-r--r--src/corelib/io/qfilesystemiterator_unix.cpp15
-rw-r--r--src/corelib/io/qfilesystemwatcher_polling.cpp10
-rw-r--r--src/corelib/io/qprocess.cpp137
-rw-r--r--src/corelib/io/qprocess.h16
-rw-r--r--src/corelib/io/qsettings.cpp15
-rw-r--r--src/corelib/io/qstandardpaths_winrt.cpp6
-rw-r--r--src/corelib/io/qtemporarydir.cpp14
-rw-r--r--src/corelib/io/qtextstream.cpp4
-rw-r--r--src/corelib/io/qwindowspipereader.cpp1
-rw-r--r--src/corelib/io/qwindowspipewriter.cpp1
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.cpp30
-rw-r--r--src/corelib/itemmodels/qabstractproxymodel.cpp3
-rw-r--r--src/corelib/kernel/kernel.pri10
-rw-r--r--src/corelib/kernel/qcoreevent.h1
-rw-r--r--src/corelib/kernel/qeventdispatcher_win.cpp4
-rw-r--r--src/corelib/kernel/qmath.cpp84
-rw-r--r--src/corelib/kernel/qmath.qdoc95
-rw-r--r--src/corelib/kernel/qobject.cpp6
-rw-r--r--src/corelib/kernel/qppsattribute.cpp7
-rw-r--r--src/corelib/kernel/qppsobject.cpp18
-rw-r--r--src/corelib/kernel/qsharedmemory.cpp8
-rw-r--r--src/corelib/kernel/qsharedmemory_win.cpp2
-rw-r--r--src/corelib/plugin/quuid.cpp4
-rw-r--r--src/corelib/thread/qmutex_p.h2
-rw-r--r--src/corelib/tools/qchar.h3
-rw-r--r--src/corelib/tools/qcollator.cpp5
-rw-r--r--src/corelib/tools/qcollator_win.cpp1
-rw-r--r--src/corelib/tools/qdatetime.cpp24
-rw-r--r--src/corelib/tools/qfreelist_p.h2
-rw-r--r--src/corelib/tools/qhash.cpp8
-rw-r--r--src/corelib/tools/qlocale_win.cpp6
-rw-r--r--src/corelib/tools/qmap.h6
-rw-r--r--src/corelib/tools/qregexp.cpp4
-rw-r--r--src/corelib/tools/qsize.cpp2
-rw-r--r--src/corelib/tools/qstring.h3
-rw-r--r--src/corelib/tools/tools.pri4
49 files changed, 363 insertions, 318 deletions
diff --git a/src/corelib/animation/qabstractanimation.cpp b/src/corelib/animation/qabstractanimation.cpp
index f7bb1e91bd..95d7713cfe 100644
--- a/src/corelib/animation/qabstractanimation.cpp
+++ b/src/corelib/animation/qabstractanimation.cpp
@@ -253,8 +253,9 @@ QUnifiedTimer *QUnifiedTimer::instance()
void QUnifiedTimer::maybeUpdateAnimationsToCurrentTime()
{
- if (time.elapsed() - lastTick > 50)
- updateAnimationTimers(driver->elapsed());
+ qint64 elapsed = driver->elapsed();
+ if (elapsed - lastTick > 50)
+ updateAnimationTimers(elapsed);
}
void QUnifiedTimer::updateAnimationTimers(qint64 currentTick)
@@ -263,7 +264,7 @@ void QUnifiedTimer::updateAnimationTimers(qint64 currentTick)
if(insideTick)
return;
- qint64 totalElapsed = currentTick >= 0 ? currentTick : time.elapsed();
+ qint64 totalElapsed = currentTick >= 0 ? currentTick : driver->elapsed();
// ignore consistentTiming in case the pause timer is active
qint64 delta = (consistentTiming && !pauseTimer.isActive()) ?
diff --git a/src/corelib/codecs/qutfcodec.cpp b/src/corelib/codecs/qutfcodec.cpp
index c5f580e13d..4fb32dcc59 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_tools_qregexp.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qregexp.cpp
index 779fbaa723..530819a173 100644
--- a/src/corelib/doc/snippets/code/src_corelib_tools_qregexp.cpp
+++ b/src/corelib/doc/snippets/code/src_corelib_tools_qregexp.cpp
@@ -77,7 +77,7 @@ QRegExp mark("\\b" // word boundary
QRegExp rx("^\\d\\d?$"); // match integers 0 to 99
rx.indexIn("123"); // returns -1 (no match)
rx.indexIn("-6"); // returns -1 (no match)
-rx.indexIn("6"); // returns 0 (matched as position 0)
+rx.indexIn("6"); // returns 0 (matched at position 0)
//! [4]
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index 66664f0f2a..6b5638d336 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1770,8 +1770,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
@@ -1921,6 +1922,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/global/qglobal.h b/src/corelib/global/qglobal.h
index 391466448f..707e46dd40 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -45,11 +45,11 @@
#include <stddef.h>
-#define QT_VERSION_STR "5.3.0"
+#define QT_VERSION_STR "5.3.1"
/*
QT_VERSION is (major << 16) + (minor << 8) + patch.
*/
-#define QT_VERSION 0x050300
+#define QT_VERSION 0x050301
/*
can be used like #if (QT_VERSION >= QT_VERSION_CHECK(4, 4, 0))
*/
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index da26490d18..4a602e4b2b 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -1207,6 +1207,23 @@ static void android_default_message_handler(QtMsgType type,
static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &context,
const QString &buf)
{
+ // to determine logging destination and marking logging environment variable as deprecated
+ // ### remove when deprecated
+ struct LogDestination {
+ LogDestination(const char *deprecated, bool forceConsole) {
+ const char* replacement = "QT_LOGGING_TO_CONSOLE";
+ bool newEnv = qEnvironmentVariableIsSet(replacement);
+ bool oldEnv = qEnvironmentVariableIsSet(deprecated);
+ if (oldEnv && !newEnv && !forceConsole) {
+ fprintf(stderr, "Warning: Environment variable %s is deprecated, "
+ "use %s instead.\n", deprecated, replacement);
+ fflush(stderr);
+ }
+ toConsole = newEnv || oldEnv || forceConsole;
+ }
+ bool toConsole;
+ };
+
QString logMessage = qMessageFormatString(type, context, buf);
#if defined(Q_OS_WIN) && defined(QT_BUILD_CORE_LIB)
@@ -1217,12 +1234,19 @@ static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &con
#endif // Q_OS_WIN
#if defined(QT_USE_SLOG2)
- slog2_default_handler(type, logMessage.toLocal8Bit().constData());
+ static const bool logToConsole = qEnvironmentVariableIsSet("QT_LOGGING_TO_CONSOLE");
+ if (!logToConsole) {
+ slog2_default_handler(type, logMessage.toLocal8Bit().constData());
+ } else {
+ fprintf(stderr, "%s", logMessage.toLocal8Bit().constData());
+ fflush(stderr);
+ }
#elif defined(QT_USE_JOURNALD) && !defined(QT_BOOTSTRAPPED)
// We use isatty to catch the obvious case of someone running something interactively.
- // We also support an environment variable for Qt Creator use, or more complicated cases like subprocesses.
- static bool logToConsole = isatty(fileno(stdin)) || !qEnvironmentVariableIsEmpty("QT_NO_JOURNALD_LOG");
- if (Q_LIKELY(!logToConsole)) {
+ // We also support environment variables for Qt Creator use, or more complicated cases
+ // like subprocesses.
+ static const LogDestination logdest("QT_NO_JOURNALD_LOG", isatty(fileno(stdin)));
+ if (Q_LIKELY(!logdest.toConsole)) {
// remove trailing \n, systemd appears to want them newline-less
logMessage.chop(1);
systemd_default_message_handler(type, context, logMessage);
@@ -1231,8 +1255,8 @@ static void qDefaultMessageHandler(QtMsgType type, const QMessageLogContext &con
fflush(stderr);
}
#elif defined(Q_OS_ANDROID)
- static bool logToAndroid = qEnvironmentVariableIsEmpty("QT_ANDROID_PLAIN_LOG");
- if (logToAndroid) {
+ static const LogDestination logdest("QT_ANDROID_PLAIN_LOG", false);
+ if (!logdest.toConsole) {
android_default_message_handler(type, context, logMessage);
} else {
fprintf(stderr, "%s", logMessage.toLocal8Bit().constData());
diff --git a/src/corelib/io/qfiledevice.cpp b/src/corelib/io/qfiledevice.cpp
index d2c8d37d4a..f7e58a7bed 100644
--- a/src/corelib/io/qfiledevice.cpp
+++ b/src/corelib/io/qfiledevice.cpp
@@ -139,10 +139,9 @@ void QFileDevicePrivate::setError(QFileDevice::FileError err, int errNum)
are returned and on Windows the rights of the current user are
returned. This behavior might change in a future Qt version.
- Note that Qt does not by default check for permissions on NTFS
- file systems, as this may decrease the performance of file
- handling considerably. It is possible to force permission checking
- on NTFS by including the following code in your source:
+ \note On NTFS file systems, ownership and permissions checking is
+ disabled by default for performance reasons. To enable it,
+ include the following line:
\snippet ntfsp.cpp 0
diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp
index 2cf97ef94e..60f7e47e62 100644
--- a/src/corelib/io/qfileinfo.cpp
+++ b/src/corelib/io/qfileinfo.cpp
@@ -271,6 +271,17 @@ QDateTime &QFileInfoPrivate::getFileTime(QAbstractFileEngine::FileTime request)
groupId(). You can examine a file's permissions and ownership in a
single statement using the permission() function.
+ \note On NTFS file systems, ownership and permissions checking is
+ disabled by default for performance reasons. To enable it,
+ include the following line:
+
+ \snippet ntfsp.cpp 0
+
+ Permission checking is then turned on and off by incrementing and
+ decrementing \c qt_ntfs_permission_lookup by 1.
+
+ \snippet ntfsp.cpp 1
+
\section1 Performance Issues
Some of QFileInfo's functions query the file system, but for
diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp
index b4021c060f..0fa1f02f5c 100644
--- a/src/corelib/io/qfileselector.cpp
+++ b/src/corelib/io/qfileselector.cpp
@@ -365,6 +365,11 @@ QStringList QFileSelectorPrivate::platformSelectors()
ret << QStringLiteral("windows");
# if defined(Q_OS_WINCE)
ret << QStringLiteral("wince");
+# elif defined(Q_OS_WINRT)
+ ret << QStringLiteral("winrt");
+# if defined(Q_OS_WINPHONE)
+ ret << QStringLiteral("winphone");
+# endif
# endif
#elif defined(Q_OS_UNIX)
ret << QStringLiteral("unix");
diff --git a/src/corelib/io/qfilesystemengine.cpp b/src/corelib/io/qfilesystemengine.cpp
index 53cf6158ad..8b6ceebc62 100644
--- a/src/corelib/io/qfilesystemengine.cpp
+++ b/src/corelib/io/qfilesystemengine.cpp
@@ -224,7 +224,7 @@ bool QFileSystemEngine::fillMetaData(int fd, QFileSystemMetaData &data)
return false;
}
-#if defined(Q_OS_QNX)
+#if defined(QT_EXT_QNX_READDIR_R)
static void fillStat64fromStat32(struct stat64 *statBuf64, const struct stat &statBuf32)
{
statBuf64->st_mode = statBuf32.st_mode;
@@ -289,7 +289,7 @@ void QFileSystemMetaData::fillFromStatBuf(const QT_STATBUF &statBuffer)
void QFileSystemMetaData::fillFromDirEnt(const QT_DIRENT &entry)
{
-#if defined(Q_OS_QNX)
+#if defined(QT_EXT_QNX_READDIR_R)
knownFlagsMask = 0;
entryFlags = 0;
for (dirent_extra *extra = _DEXTRA_FIRST(&entry); _DEXTRA_VALID(extra, &entry);
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/qfilesystemiterator_p.h b/src/corelib/io/qfilesystemiterator_p.h
index 4164020359..18a9c2dbda 100644
--- a/src/corelib/io/qfilesystemiterator_p.h
+++ b/src/corelib/io/qfilesystemiterator_p.h
@@ -95,10 +95,10 @@ private:
#else
QT_DIR *dir;
QT_DIRENT *dirEntry;
-#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) || defined(QT_EXT_QNX_READDIR_R)
// for readdir_r
QScopedPointer<QT_DIRENT, QScopedPointerPodDeleter> mt_file;
-#if defined(Q_OS_QNX) && defined(__EXT_QNX__READDIR_R)
+#if defined(QT_EXT_QNX_READDIR_R)
// for _readdir_r
size_t direntSize;
#endif
diff --git a/src/corelib/io/qfilesystemiterator_unix.cpp b/src/corelib/io/qfilesystemiterator_unix.cpp
index 0b59aa169a..0f9bbd8a29 100644
--- a/src/corelib/io/qfilesystemiterator_unix.cpp
+++ b/src/corelib/io/qfilesystemiterator_unix.cpp
@@ -70,7 +70,7 @@ QFileSystemIterator::QFileSystemIterator(const QFileSystemEntry &entry, QDir::Fi
if (!nativePath.endsWith('/'))
nativePath.append('/');
-#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN)
+#if defined(_POSIX_THREAD_SAFE_FUNCTIONS) && !defined(Q_OS_CYGWIN) || defined(QT_EXT_QNX_READDIR_R)
// ### Race condition; we should use fpathconf and dirfd().
size_t maxPathName = ::pathconf(nativePath.constData(), _PC_NAME_MAX);
if (maxPathName == size_t(-1))
@@ -81,13 +81,14 @@ QFileSystemIterator::QFileSystemIterator(const QFileSystemEntry &entry, QDir::Fi
Q_CHECK_PTR(p);
mt_file.reset(p);
-#if defined(Q_OS_QNX) && defined(__EXT_QNX__READDIR_R)
+#if defined(QT_EXT_QNX_READDIR_R)
direntSize = maxPathName;
- // Include extra stat information in the readdir() call (d_stat member of dirent_extra_stat).
- // This is used in QFileSystemMetaData::fillFromDirEnt() to avoid extra stat() calls when iterating
- // over directories
- if (dircntl(dir, D_SETFLAG, D_FLAG_STAT) == -1)
+ // Include extra stat information in the readdir() call (d_stat member of
+ // dirent_extra_stat). This is used in QFileSystemMetaData::fillFromDirEnt() to
+ // avoid extra stat() calls when iterating over directories
+ int flags = dircntl(dir, D_GETFLAG) | D_FLAG_STAT | D_FLAG_FILTER;
+ if (dircntl(dir, D_SETFLAG, flags) == -1)
lastError = errno;
#endif
#endif
@@ -105,7 +106,7 @@ bool QFileSystemIterator::advance(QFileSystemEntry &fileEntry, QFileSystemMetaDa
if (!dir)
return false;
-#if defined(Q_OS_QNX) && defined(QT_EXT_QNX_READDIR_R)
+#if defined(QT_EXT_QNX_READDIR_R)
lastError = QT_EXT_QNX_READDIR_R(dir, mt_file.data(), &dirEntry, direntSize);
if (lastError)
return false;
diff --git a/src/corelib/io/qfilesystemwatcher_polling.cpp b/src/corelib/io/qfilesystemwatcher_polling.cpp
index 689f05bb1b..401f95ae82 100644
--- a/src/corelib/io/qfilesystemwatcher_polling.cpp
+++ b/src/corelib/io/qfilesystemwatcher_polling.cpp
@@ -65,14 +65,16 @@ QStringList QPollingFileSystemWatcherEngine::addPaths(const QStringList &paths,
if (!fi.exists())
continue;
if (fi.isDir()) {
- if (!directories->contains(path))
- directories->append(path);
+ if (directories->contains(path))
+ continue;
+ directories->append(path);
if (!path.endsWith(QLatin1Char('/')))
fi = QFileInfo(path + QLatin1Char('/'));
this->directories.insert(path, fi);
} else {
- if (!files->contains(path))
- files->append(path);
+ if (files->contains(path))
+ continue;
+ files->append(path);
this->files.insert(path, fi);
}
it.remove();
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 321525ca18..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) {
@@ -1752,7 +1755,7 @@ bool QConfFileSettingsPrivate::readIniLine(const QByteArray &data, int &dataPos,
if (i == lineStart + 1) {
char ch;
- while (i < dataLen && ((ch = data.at(i) != '\n') && ch != '\r'))
+ while (i < dataLen && (((ch = data.at(i)) != '\n') && ch != '\r'))
++i;
lineStart = i;
} else if (!inQuotes) {
diff --git a/src/corelib/io/qstandardpaths_winrt.cpp b/src/corelib/io/qstandardpaths_winrt.cpp
index bd72de11bb..84a3930ee0 100644
--- a/src/corelib/io/qstandardpaths_winrt.cpp
+++ b/src/corelib/io/qstandardpaths_winrt.cpp
@@ -89,10 +89,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/io/qtemporarydir.cpp b/src/corelib/io/qtemporarydir.cpp
index 2c526847b4..1e615956d7 100644
--- a/src/corelib/io/qtemporarydir.cpp
+++ b/src/corelib/io/qtemporarydir.cpp
@@ -218,25 +218,25 @@ QTemporaryDir::QTemporaryDir()
}
/*!
- Constructs a QTemporaryFile with a template name of \a templateName.
+ Constructs a QTemporaryDir with a template of \a templatePath.
- If \a templateName is a relative path, the path will be relative to the
+ If \a templatePath is a relative path, the path will be relative to the
current working directory. You can use QDir::tempPath() to construct \a
- templateName if you want use the system's temporary directory.
+ templatePath if you want use the system's temporary directory.
- If the \a templateName ends with XXXXXX it will be used as the dynamic portion
+ If the \a templatePath ends with XXXXXX it will be used as the dynamic portion
of the directory name, otherwise it will be appended.
Unlike QTemporaryFile, XXXXXX in the middle of the template string is not supported.
\sa QDir::tempPath()
*/
-QTemporaryDir::QTemporaryDir(const QString &templateName)
+QTemporaryDir::QTemporaryDir(const QString &templatePath)
: d_ptr(new QTemporaryDirPrivate)
{
- if (templateName.isEmpty())
+ if (templatePath.isEmpty())
d_ptr->create(defaultTemplateName());
else
- d_ptr->create(templateName);
+ d_ptr->create(templatePath);
}
/*!
diff --git a/src/corelib/io/qtextstream.cpp b/src/corelib/io/qtextstream.cpp
index 163b087436..288a939ab2 100644
--- a/src/corelib/io/qtextstream.cpp
+++ b/src/corelib/io/qtextstream.cpp
@@ -569,7 +569,9 @@ void QTextStreamPrivate::flushWriteBuffer()
#endif
// convert from unicode to raw data
- QByteArray data = codec->fromUnicode(writeBuffer.data(), writeBuffer.size(), &writeConverterState);
+ // codec might be null if we're already inside global destructors (QTestCodec::codecForLocale returned null)
+ QByteArray data = Q_LIKELY(codec) ? codec->fromUnicode(writeBuffer.data(), writeBuffer.size(), &writeConverterState)
+ : writeBuffer.toLatin1();
#else
QByteArray data = writeBuffer.toLocal8Bit();
#endif
diff --git a/src/corelib/io/qwindowspipereader.cpp b/src/corelib/io/qwindowspipereader.cpp
index df65aebcff..7dd2125e70 100644
--- a/src/corelib/io/qwindowspipereader.cpp
+++ b/src/corelib/io/qwindowspipereader.cpp
@@ -318,6 +318,7 @@ bool QWindowsPipeReader::waitForPipeClosed(int msecs)
QElapsedTimer stopWatch;
stopWatch.start();
forever {
+ waitForReadyRead(0);
checkPipeState();
if (pipeBroken)
return true;
diff --git a/src/corelib/io/qwindowspipewriter.cpp b/src/corelib/io/qwindowspipewriter.cpp
index daa8068734..daad542705 100644
--- a/src/corelib/io/qwindowspipewriter.cpp
+++ b/src/corelib/io/qwindowspipewriter.cpp
@@ -40,7 +40,6 @@
****************************************************************************/
#include "qwindowspipewriter_p.h"
-#include <string.h>
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp
index 4241fe08ca..ad5722626e 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/kernel.pri b/src/corelib/kernel/kernel.pri
index 1fec528b31..819c10e99f 100644
--- a/src/corelib/kernel/kernel.pri
+++ b/src/corelib/kernel/kernel.pri
@@ -164,11 +164,17 @@ vxworks {
blackberry {
SOURCES += \
- kernel/qeventdispatcher_blackberry.cpp \
+ kernel/qeventdispatcher_blackberry.cpp
+ HEADERS += \
+ kernel/qeventdispatcher_blackberry_p.h
+}
+
+qqnx_pps {
+ LIBS_PRIVATE += -lpps
+ SOURCES += \
kernel/qppsattribute.cpp \
kernel/qppsobject.cpp
HEADERS += \
- kernel/qeventdispatcher_blackberry_p.h \
kernel/qppsattribute_p.h \
kernel/qppsattributeprivate_p.h \
kernel/qppsobject_p.h \
diff --git a/src/corelib/kernel/qcoreevent.h b/src/corelib/kernel/qcoreevent.h
index 3ee0eaaa61..8b58fdf55f 100644
--- a/src/corelib/kernel/qcoreevent.h
+++ b/src/corelib/kernel/qcoreevent.h
@@ -323,6 +323,7 @@ private:
friend class QGraphicsViewPrivate;
friend class QGraphicsScene;
friend class QGraphicsScenePrivate;
+ friend class QWidgetWindow;
#ifndef QT_NO_GESTURES
friend class QGestureManager;
#endif
diff --git a/src/corelib/kernel/qeventdispatcher_win.cpp b/src/corelib/kernel/qeventdispatcher_win.cpp
index 7debf0d774..64ad2ff0d3 100644
--- a/src/corelib/kernel/qeventdispatcher_win.cpp
+++ b/src/corelib/kernel/qeventdispatcher_win.cpp
@@ -435,10 +435,10 @@ static inline UINT inputTimerMask()
UINT result = QS_TIMER | QS_INPUT | QS_RAWINPUT;
// QTBUG 28513, QTBUG-29097, QTBUG-29435: QS_TOUCH, QS_POINTER became part of
// QS_INPUT in Windows Kit 8. They should not be used when running on pre-Windows 8.
-#if WINVER > 0x0602
+#if WINVER > 0x0601
if (QSysInfo::WindowsVersion < QSysInfo::WV_WINDOWS8)
result &= ~(QS_TOUCH | QS_POINTER);
-#endif // WINVER > 0x0602
+#endif // WINVER > 0x0601
return result;
}
diff --git a/src/corelib/kernel/qmath.cpp b/src/corelib/kernel/qmath.cpp
index b1860fa24a..9f276b4ca9 100644
--- a/src/corelib/kernel/qmath.cpp
+++ b/src/corelib/kernel/qmath.cpp
@@ -303,88 +303,4 @@ const qreal qt_sine_table[QT_SINE_TABLE_SIZE] = {
qreal(-0.024541228522912448)
};
-/*!
- \headerfile <QtMath>
- \title Generic Math Declarations
- \ingroup funclists
-
- \brief The <QtMath> header file includes generic math declarations.
-
- These functions are partly convenience definitions for basic
- operations, for instance not available in the Standard Template Library et
- al.
-*/
-
-/*!
- \fn float qDegreesToRadians(float degrees)
- \relates <QtMath>
- \since 5.1
-
- \brief The function converts the \a degrees in float to radians.
-
- The purpose of the function is to aid the conversion as such a convenient
- function is not part of the Standard Template Library, i.e. in <cmath> or
- elsewhere.
-
- Example:
-
- \snippet code/src_corelib_kernel_qmath.cpp 0
-
- \sa qRadiansToDegrees()
-*/
-
-/*!
- \fn double qDegreesToRadians(double degrees)
- \relates <QtMath>
- \since 5.1
-
- \brief The function converts the \a degrees in double to radians.
-
- The purpose of the function is to aid the conversion as such a convenient
- function is not part of the Standard Template Library, i.e. in <cmath> or
- elsewhere.
-
- Example:
-
- \snippet code/src_corelib_kernel_qmath.cpp 1
-
- \sa qRadiansToDegrees()
-*/
-
-/*!
- \fn float qRadiansToDegrees(float radians)
- \relates <QtMath>
- \since 5.1
-
- \brief The function converts the \a radians in float to degrees.
-
- The purpose of the function is to aid the conversion as such a convenient
- function is not part of the Standard Template Library, i.e. in <cmath> or
- elsewhere.
-
- Example:
-
- \snippet code/src_corelib_kernel_qmath.cpp 2
-
- \sa qDegreesToRadians()
-*/
-
-/*!
- \fn double qRadiansToDegrees(double radians)
- \relates <QtMath>
- \since 5.1
-
- \brief The function converts the \a radians in double to degrees.
-
- The purpose of the function is to aid the conversion as such a convenient
- function is not part of the Standard Template Library, i.e. in <cmath> or
- elsewhere.
-
- Example:
-
- \snippet code/src_corelib_kernel_qmath.cpp 3
-
- \sa qDegreesToRadians()
-*/
-
QT_END_NAMESPACE
diff --git a/src/corelib/kernel/qmath.qdoc b/src/corelib/kernel/qmath.qdoc
index 06d8db9277..04dbbb0a3b 100644
--- a/src/corelib/kernel/qmath.qdoc
+++ b/src/corelib/kernel/qmath.qdoc
@@ -26,10 +26,15 @@
****************************************************************************/
/*!
- \headerfile <QtCore/qmath.h>
- \title Math Functions
+ \headerfile <QtMath>
+ \title Generic Math Functions
\ingroup funclists
- \brief The <QtCore/qmath.h> header provides various math functions.
+
+ \brief The <QtMath> header file provides various math functions.
+
+ These functions are partly convenience definitions for basic math operations
+ not available in the C or Standard Template Libraries.
+
\pagekeywords math trigonometry qmath floor ceiling absolute sine cosine tangent inverse tan exponent power natural logarithm
*/
@@ -40,7 +45,7 @@
The ceiling is the smallest integer that is not less than \a v.
For example, if \a v is 41.2, then the ceiling is 42.
- \relates <QtCore/qmath.h>
+ \relates <QtMath>
\sa qFloor()
*/
@@ -51,7 +56,7 @@
The floor is the largest integer that is not greater than \a v.
For example, if \a v is 41.2, then the floor is 41.
- \relates <QtCore/qmath.h>
+ \relates <QtMath>
\sa qCeil()
*/
@@ -59,14 +64,14 @@
\fn qreal qFabs(qreal v)
Returns the absolute value of \a v as a qreal.
- \relates <QtCore/qmath.h>
+ \relates <QtMath>
*/
/*!
\fn qreal qSin(qreal v)
Returns the sine of the angle \a v in radians.
- \relates <QtCore/qmath.h>
+ \relates <QtMath>
\sa qCos(), qTan()
*/
@@ -74,7 +79,7 @@
\fn qreal qCos(qreal v)
Returns the cosine of an angle \a v in radians.
- \relates <QtCore/qmath.h>
+ \relates <QtMath>
\sa qSin(), qTan()
*/
@@ -82,7 +87,7 @@
\fn qreal qTan(qreal v)
Returns the tangent of an angle \a v in radians.
- \relates <QtCore/qmath.h>
+ \relates <QtMath>
\sa qSin(), qCos()
*/
@@ -91,7 +96,7 @@
Returns the arccosine of \a v as an angle in radians.
Arccosine is the inverse operation of cosine.
- \relates <QtCore/qmath.h>
+ \relates <QtMath>
\sa qAtan(), qAsin(), qCos()
*/
@@ -100,7 +105,7 @@
Returns the arcsine of \a v as an angle in radians.
Arcsine is the inverse operation of sine.
- \relates <QtCore/qmath.h>
+ \relates <QtMath>
\sa qSin(), qAtan(), qAcos()
*/
@@ -109,7 +114,7 @@
Returns the arctangent of \a v as an angle in radians.
Arctangent is the inverse operation of tangent.
- \relates <QtCore/qmath.h>
+ \relates <QtMath>
\sa qTan(), qAcos(), qAsin()
*/
@@ -118,7 +123,7 @@
Returns the arctangent of a point specified by the coordinates \a y and \a x.
This function will return the angle (argument) of that point.
- \relates <QtCore/qmath.h>
+ \relates <QtMath>
\sa qAtan()
*/
@@ -127,7 +132,7 @@
Returns the square root of \a v.
This function returns a NaN if \a v is a negative number.
- \relates <QtCore/qmath.h>
+ \relates <QtMath>
\sa qPow()
*/
@@ -135,7 +140,7 @@
\fn qreal qLn(qreal v)
Returns the natural logarithm of \a v. Natural logarithm uses base e.
- \relates <QtCore/qmath.h>
+ \relates <QtMath>
\sa qExp()
*/
@@ -143,7 +148,7 @@
\fn qreal qExp(qreal v)
Returns the exponential function of \c e to the power of \a v.
- \relates <QtCore/qmath.h>
+ \relates <QtMath>
\sa qLn()
*/
@@ -152,6 +157,62 @@
Returns the value of \a x raised to the power of \a y.
That is, \a x is the base and \a y is the exponent.
- \relates <QtCore/qmath.h>
+ \relates <QtMath>
\sa qSqrt()
*/
+
+/*!
+ \fn float qDegreesToRadians(float degrees)
+ \relates <QtMath>
+ \since 5.1
+
+ This function converts the \a degrees in float to radians.
+
+ Example:
+
+ \snippet code/src_corelib_kernel_qmath.cpp 0
+
+ \sa qRadiansToDegrees()
+*/
+
+/*!
+ \fn double qDegreesToRadians(double degrees)
+ \relates <QtMath>
+ \since 5.1
+
+ This function converts the \a degrees in double to radians.
+
+ Example:
+
+ \snippet code/src_corelib_kernel_qmath.cpp 1
+
+ \sa qRadiansToDegrees()
+*/
+
+/*!
+ \fn float qRadiansToDegrees(float radians)
+ \relates <QtMath>
+ \since 5.1
+
+ This function converts the \a radians in float to degrees.
+
+ Example:
+
+ \snippet code/src_corelib_kernel_qmath.cpp 2
+
+ \sa qDegreesToRadians()
+*/
+
+/*!
+ \fn double qRadiansToDegrees(double radians)
+ \relates <QtMath>
+ \since 5.1
+
+ This function converts the \a radians in double to degrees.
+
+ Example:
+
+ \snippet code/src_corelib_kernel_qmath.cpp 3
+
+ \sa qDegreesToRadians()
+*/
diff --git a/src/corelib/kernel/qobject.cpp b/src/corelib/kernel/qobject.cpp
index 0a504657a3..38e55b7aa9 100644
--- a/src/corelib/kernel/qobject.cpp
+++ b/src/corelib/kernel/qobject.cpp
@@ -513,7 +513,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
@@ -4436,6 +4436,8 @@ void qDeleteInEventHandler(QObject *o)
\snippet code/src_corelib_kernel_qobject.cpp 46
The connection will automatically disconnect if the sender is destroyed.
+ However, you should take care that any objects used within the functor
+ are still alive when the signal is emitted.
\note If the compiler does not support C++11 variadic templates, the number
of arguments in the signal or slot are limited to 6, and the functor object
@@ -4473,6 +4475,8 @@ void qDeleteInEventHandler(QObject *o)
The connection will automatically disconnect if the sender or the context
is destroyed.
+ However, you should take care that any objects used within the functor
+ are still alive when the signal is emitted.
\note If the compiler does not support C++11 variadic templates, the number
of arguments in the signal or slot are limited to 6, and the functor object
diff --git a/src/corelib/kernel/qppsattribute.cpp b/src/corelib/kernel/qppsattribute.cpp
index f6745d2354..93d7ae756e 100644
--- a/src/corelib/kernel/qppsattribute.cpp
+++ b/src/corelib/kernel/qppsattribute.cpp
@@ -127,8 +127,7 @@ QPpsAttribute QPpsAttributePrivate::createPpsAttribute(const QPpsAttributeMap &v
//
///////////////////////////
-QPpsAttribute::QPpsAttribute():
- d(new QPpsAttributePrivate())
+QPpsAttribute::QPpsAttribute() : d(new QPpsAttributePrivate())
{
}
@@ -136,7 +135,7 @@ QPpsAttribute::~QPpsAttribute()
{
}
-QPpsAttribute::QPpsAttribute(const QPpsAttribute &other): d(other.d)
+QPpsAttribute::QPpsAttribute(const QPpsAttribute &other) : d(other.d)
{
}
@@ -147,7 +146,7 @@ QPpsAttribute &QPpsAttribute::operator=(const QPpsAttribute &other)
}
#ifdef Q_COMPILER_RVALUE_REFS
-QPpsAttribute::QPpsAttribute(QPpsAttribute &&other): d(other.d)
+QPpsAttribute::QPpsAttribute(QPpsAttribute &&other) : d(other.d)
{
other.d->type = QPpsAttribute::None;
}
diff --git a/src/corelib/kernel/qppsobject.cpp b/src/corelib/kernel/qppsobject.cpp
index eb8e69baff..1095ad51da 100644
--- a/src/corelib/kernel/qppsobject.cpp
+++ b/src/corelib/kernel/qppsobject.cpp
@@ -94,12 +94,12 @@ Q_GLOBAL_STATIC(QPpsMaxSize, ppsMaxSize)
//
///////////////////////////////////////////////////////////////////////////////
-QPpsObjectPrivate::QPpsObjectPrivate(const QString &path) :
- notifier(0),
- path(path),
- error(EOK),
- fd(-1),
- readyReadEnabled(true)
+QPpsObjectPrivate::QPpsObjectPrivate(const QString &path)
+ : notifier(0),
+ path(path),
+ error(EOK),
+ fd(-1),
+ readyReadEnabled(true)
{
}
@@ -490,9 +490,9 @@ void QPpsObjectPrivate::encodeObject(pps_encoder_t *encoder, const QVariantMap &
//
///////////////////////////////////////////////////////////////////////////////
-QPpsObject::QPpsObject(const QString &path, QObject *parent) :
- QObject(parent),
- d_ptr(new QPpsObjectPrivate(path))
+QPpsObject::QPpsObject(const QString &path, QObject *parent)
+ : QObject(parent),
+ d_ptr(new QPpsObjectPrivate(path))
{
}
diff --git a/src/corelib/kernel/qsharedmemory.cpp b/src/corelib/kernel/qsharedmemory.cpp
index 407a6a4e02..cde42c4f6e 100644
--- a/src/corelib/kernel/qsharedmemory.cpp
+++ b/src/corelib/kernel/qsharedmemory.cpp
@@ -125,11 +125,9 @@ QSharedMemoryPrivate::makePlatformSafeKey(const QString &key,
or writing to the shared memory, and remember to release the lock
with unlock() after you are done.
- Unlike QtSharedMemory, QSharedMemory automatically destroys the
- shared memory segment when the last instance of QSharedMemory is
- detached from the segment, and no references to the segment
- remain. Do not mix using QtSharedMemory and QSharedMemory. Port
- everything to QSharedMemory.
+ QSharedMemory automatically destroys the shared memory segment when
+ the last instance of QSharedMemory is detached from the segment, and
+ no references to the segment remain.
\warning QSharedMemory changes the key in a Qt-specific way, unless otherwise
specified. Interoperation with non-Qt applications is achieved by first creating
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/plugin/quuid.cpp b/src/corelib/plugin/quuid.cpp
index 183a16a7ad..ac66bd00ce 100644
--- a/src/corelib/plugin/quuid.cpp
+++ b/src/corelib/plugin/quuid.cpp
@@ -50,11 +50,11 @@
#endif
QT_BEGIN_NAMESPACE
+static const char digits[] = "0123456789abcdef";
+
template <class Char, class Integral>
void _q_toHex(Char *&dst, Integral value)
{
- static const char digits[] = "0123456789abcdef";
-
value = qToBigEndian(value);
const char* p = reinterpret_cast<const char*>(&value);
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/qchar.h b/src/corelib/tools/qchar.h
index 1955758fca..24c757f9f4 100644
--- a/src/corelib/tools/qchar.h
+++ b/src/corelib/tools/qchar.h
@@ -353,7 +353,8 @@ public:
inline Direction direction() const { return QChar::direction(ucs); }
inline JoiningType joiningType() const { return QChar::joiningType(ucs); }
#if QT_DEPRECATED_SINCE(5, 3)
- QT_DEPRECATED inline Joining joining() const {
+ QT_DEPRECATED inline Joining joining() const
+ {
switch (QChar::joiningType(ucs)) {
case QChar::Joining_Causing: return QChar::Center;
case QChar::Joining_Dual: return QChar::Dual;
diff --git a/src/corelib/tools/qcollator.cpp b/src/corelib/tools/qcollator.cpp
index 9c97d6b158..f7dfaa7d33 100644
--- a/src/corelib/tools/qcollator.cpp
+++ b/src/corelib/tools/qcollator.cpp
@@ -205,6 +205,11 @@ QLocale QCollator::locale() const
By default this mode is off.
+ \note On Windows, this functionality makes use of the \l{ICU} library. If Qt was
+ compiled without ICU support, it falls back to code using native Windows API,
+ which only works from Windows 7 onwards. On older versions of Windows, it will not work
+ and a warning will be emitted at runtime.
+
\sa numericMode()
*/
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/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index e38a5f569a..d6f1d6c942 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -253,7 +253,7 @@ static QString toOffsetString(Qt::DateFormat format, int offset)
return result.arg(offset >= 0 ? QLatin1Char('+') : QLatin1Char('-'))
.arg(qAbs(offset) / SECS_PER_HOUR, 2, 10, QLatin1Char('0'))
- .arg((offset / 60) % 60, 2, 10, QLatin1Char('0'));
+ .arg((qAbs(offset) / 60) % 60, 2, 10, QLatin1Char('0'));
}
// Parse offset in [+-]HH[:]MM format
@@ -265,17 +265,24 @@ static int fromOffsetString(const QString &offsetString, bool *valid)
if (size < 2 || size > 6)
return 0;
+ // sign will be +1 for a positive and -1 for a negative offset
+ int sign;
+
// First char must be + or -
- const QChar sign = offsetString.at(0);
- if (sign != QLatin1Char('+') && sign != QLatin1Char('-'))
+ const QChar signChar = offsetString.at(0);
+ if (signChar == QLatin1Char('+'))
+ sign = 1;
+ else if (signChar == QLatin1Char('-'))
+ sign = -1;
+ else
return 0;
// Split the hour and minute parts
- QStringList parts = offsetString.split(QLatin1Char(':'));
+ QStringList parts = offsetString.mid(1).split(QLatin1Char(':'));
if (parts.count() == 1) {
// [+-]HHMM format
- parts.append(parts.at(0).mid(3));
- parts[0] = parts.at(0).left(3);
+ parts.append(parts.at(0).mid(2));
+ parts[0] = parts.at(0).left(2);
}
bool ok = false;
@@ -288,7 +295,7 @@ static int fromOffsetString(const QString &offsetString, bool *valid)
return 0;
*valid = true;
- return ((hour * 60) + minute) * 60;
+ return sign * ((hour * 60) + minute) * 60;
}
/*****************************************************************************
@@ -2398,6 +2405,9 @@ static bool qt_localtime(qint64 msecsSinceEpoch, QDate *localDate, QTime *localT
local.tm_year = sysTime.wYear - 1900;
}
#elif !defined(QT_NO_THREAD) && defined(_POSIX_THREAD_SAFE_FUNCTIONS)
+ // localtime() is required to work as if tzset() was called before it.
+ // localtime_r() does not have this requirement, so make an explicit call.
+ qt_tzset();
// Use the reentrant version of localtime() where available
// as is thread-safe and doesn't use a shared static data area
tm *res = 0;
diff --git a/src/corelib/tools/qfreelist_p.h b/src/corelib/tools/qfreelist_p.h
index 5e90a03d7f..69b7fc67a0 100644
--- a/src/corelib/tools/qfreelist_p.h
+++ b/src/corelib/tools/qfreelist_p.h
@@ -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 <>
diff --git a/src/corelib/tools/qhash.cpp b/src/corelib/tools/qhash.cpp
index ca645636e4..7200ea7993 100644
--- a/src/corelib/tools/qhash.cpp
+++ b/src/corelib/tools/qhash.cpp
@@ -222,12 +222,13 @@ uint qHash(QLatin1String key, uint seed) Q_DECL_NOTHROW
*/
static uint qt_create_qhash_seed()
{
+ uint seed = 0;
+
+#ifndef QT_BOOTSTRAPPED
QByteArray envSeed = qgetenv("QT_HASH_SEED");
if (!envSeed.isNull())
return envSeed.toUInt();
- uint seed = 0;
-
#ifdef Q_OS_UNIX
int randomfd = qt_safe_open("/dev/urandom", O_RDONLY);
if (randomfd == -1)
@@ -254,17 +255,16 @@ static uint qt_create_qhash_seed()
seed ^= timestamp;
seed ^= (timestamp >> 32);
-#ifndef QT_BOOTSTRAPPED
quint64 pid = QCoreApplication::applicationPid();
seed ^= pid;
seed ^= (pid >> 32);
-#endif // QT_BOOTSTRAPPED
quintptr seedPtr = reinterpret_cast<quintptr>(&seed);
seed ^= seedPtr;
#if QT_POINTER_SIZE == 8
seed ^= (seedPtr >> 32);
#endif
+#endif // QT_BOOTSTRAPPED
return seed;
}
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();
diff --git a/src/corelib/tools/qregexp.cpp b/src/corelib/tools/qregexp.cpp
index cadf2da019..fbcd271f1d 100644
--- a/src/corelib/tools/qregexp.cpp
+++ b/src/corelib/tools/qregexp.cpp
@@ -388,7 +388,7 @@ int qFindString(const QChar *haystack, int haystackLen, int from,
Note: Quantifiers are normally "greedy". They always match as much
text as they can. For example, \b{0+} matches the first zero it
finds and all the consecutive zeros after the first zero. Applied
- to '20005', it matches'2\underline{000}5'. Quantifiers can be made
+ to '20005', it matches '2\underline{000}5'. Quantifiers can be made
non-greedy, see setMinimal().
\target capturing parentheses
@@ -678,7 +678,7 @@ int qFindString(const QChar *haystack, int haystackLen, int from,
QRegExp can match case insensitively using setCaseSensitivity(),
and can use non-greedy matching, see setMinimal(). By
default QRegExp uses full regexps but this can be changed with
- setWildcard(). Searching can be forward with indexIn() or backward
+ setPatternSyntax(). Searching can be done forward with indexIn() or backward
with lastIndexIn(). Captured text can be accessed using
capturedTexts() which returns a string list of all captured
strings, or using cap() which returns the captured string for the
diff --git a/src/corelib/tools/qsize.cpp b/src/corelib/tools/qsize.cpp
index b53eced298..c9a6ffa03a 100644
--- a/src/corelib/tools/qsize.cpp
+++ b/src/corelib/tools/qsize.cpp
@@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
width and height can be swapped using the transpose() function.
The isValid() function determines if a size is valid (a valid size
- has both width and height greater than zero). The isEmpty()
+ has both width and height greater than or equal to zero). The isEmpty()
function returns \c true if either of the width and height is less
than, or equal to, zero, while the isNull() function returns \c true
only if both the width and the height is zero.
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index 359d0c49e5..3985bc76fe 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -949,7 +949,8 @@ public:
QChar::Direction direction() const { return QChar(*this).direction(); }
QChar::JoiningType joiningType() const { return QChar(*this).joiningType(); }
#if QT_DEPRECATED_SINCE(5, 3)
- QT_DEPRECATED QChar::Joining joining() const {
+ QT_DEPRECATED QChar::Joining joining() const
+ {
switch (QChar(*this).joiningType()) {
case QChar::Joining_Causing: return QChar::Center;
case QChar::Joining_Dual: return QChar::Dual;
diff --git a/src/corelib/tools/tools.pri b/src/corelib/tools/tools.pri
index 863cf03439..57a9591060 100644
--- a/src/corelib/tools/tools.pri
+++ b/src/corelib/tools/tools.pri
@@ -163,10 +163,10 @@ contains(QT_CONFIG,icu) {
LIBS_PRIVATE += -lsicuin -lsicuuc -lsicudt
}
} else {
- LIBS_PRIVATE += -licuin -licuuc
+ LIBS_PRIVATE += -licuin -licuuc -licudt
}
} else {
- LIBS_PRIVATE += -licui18n -licuuc
+ LIBS_PRIVATE += -licui18n -licuuc -licudata
}
} else: win32 {
SOURCES += tools/qcollator_win.cpp