summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-02-06 14:21:16 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-02-07 13:07:25 +0100
commita1fe728fa5bd6cb9e50cf317a58efcf4eea4de2c (patch)
tree0798ae897d111147238544826c79243b6f9a48a4 /src/corelib
parent57fe9bd2c6a361cf979d17d962abed5db17a1457 (diff)
parent65bd80ebfc1be81a196a861ade40ff874a3554f0 (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/gui/kernel/qguiapplication.cpp src/plugins/platforms/android/androidjnimain.cpp src/plugins/platforms/android/qandroidplatformintegration.cpp src/plugins/platforms/android/qandroidplatformintegration.h src/plugins/platforms/android/qandroidplatformopenglcontext.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/sql/doc/src/sql-driver.qdoc src/widgets/widgets/qtoolbararealayout.cpp Change-Id: Ifd7e58760c3cb6bd8a7d1dd32ef83b7ec190d41e
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/animation/qabstractanimation_p.h4
-rw-r--r--src/corelib/doc/qtcore.qdocconf2
-rw-r--r--src/corelib/global/qglobal.cpp8
-rw-r--r--src/corelib/global/qglobal.h8
-rw-r--r--src/corelib/global/qlogging.cpp43
-rw-r--r--src/corelib/io/qdir.cpp9
-rw-r--r--src/corelib/io/qfileselector.cpp18
-rw-r--r--src/corelib/io/qiodevice.cpp5
-rw-r--r--src/corelib/io/qloggingcategory.cpp2
-rw-r--r--src/corelib/itemmodels/qsortfilterproxymodel.cpp17
-rw-r--r--src/corelib/kernel/qobject.h4
-rw-r--r--src/corelib/kernel/qvariant.cpp6
-rw-r--r--src/corelib/plugin/qlibrary.cpp21
-rw-r--r--src/corelib/tools/qalgorithms.qdoc3
-rw-r--r--src/corelib/tools/qbitarray.cpp9
-rw-r--r--src/corelib/tools/qbytearray.cpp30
-rw-r--r--src/corelib/tools/qcommandlineoption.cpp6
-rw-r--r--src/corelib/tools/qrect.h2
-rw-r--r--src/corelib/tools/qstring.cpp2
-rw-r--r--src/corelib/tools/qstring.h8
-rw-r--r--src/corelib/tools/qvector.h7
21 files changed, 132 insertions, 82 deletions
diff --git a/src/corelib/animation/qabstractanimation_p.h b/src/corelib/animation/qabstractanimation_p.h
index 322de22caf..39d9cf0fe6 100644
--- a/src/corelib/animation/qabstractanimation_p.h
+++ b/src/corelib/animation/qabstractanimation_p.h
@@ -46,8 +46,8 @@
// W A R N I N G
// -------------
//
-// This file is not part of the Qt API. It exists for the convenience
-// of QIODevice. This header file may change from version to
+// This file is not part of the Qt API.
+// This header file may change from version to
// version without notice, or even be removed.
//
// We mean it.
diff --git a/src/corelib/doc/qtcore.qdocconf b/src/corelib/doc/qtcore.qdocconf
index fa5afb033c..18fdfb18f3 100644
--- a/src/corelib/doc/qtcore.qdocconf
+++ b/src/corelib/doc/qtcore.qdocconf
@@ -26,7 +26,7 @@ qhp.QtCore.subprojects.classes.sortPages = true
tagfile = ../../../doc/qtcore/qtcore.tags
-depends += qtgui qtwidgets qtnetwork qtdoc qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake
+depends += qtgui qtwidgets qtnetwork qtdoc qtmacextras qtquick qtlinguist qtdesigner qtconcurrent qtxml qmake
headerdirs += ..
diff --git a/src/corelib/global/qglobal.cpp b/src/corelib/global/qglobal.cpp
index e84c31eecf..fe10c493a7 100644
--- a/src/corelib/global/qglobal.cpp
+++ b/src/corelib/global/qglobal.cpp
@@ -1988,7 +1988,7 @@ const QSysInfo::WinVersion QSysInfo::WindowsVersion = QSysInfo::windowsVersion()
conditions that it would not otherwise know about. However, there is no
guarantee that the compiler will actually use those hints.
- This macro could be considered a "lighter" version of \l{Q_ASSERT}. While
+ This macro could be considered a "lighter" version of \l{Q_ASSERT()}. While
Q_ASSERT will abort the program's execution if the condition is false,
Q_ASSUME will tell the compiler not to generate code for those conditions.
Therefore, it is important that the assumptions always hold, otherwise
@@ -3359,7 +3359,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
If you need C++11 noexcept semantics, don't use this macro, use
Q_DECL_NOEXCEPT/Q_DECL_NOEXCEPT_EXPR instead.
- \sa Q_DECL_NOEXCEPT, Q_DECL_NOEXCEPT_EXPR
+ \sa Q_DECL_NOEXCEPT, Q_DECL_NOEXCEPT_EXPR()
*/
/*!
@@ -3413,7 +3413,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
function can't possibly throw, don't use this macro, use
Q_DECL_NOTHROW instead.
- \sa Q_DECL_NOTHROW, Q_DECL_NOEXCEPT_EXPR
+ \sa Q_DECL_NOTHROW, Q_DECL_NOEXCEPT_EXPR()
*/
/*!
@@ -3435,7 +3435,7 @@ bool QInternal::activateCallbacks(Callback cb, void **parameters)
function can't possibly throw, don't use this macro, use
Q_DECL_NOTHROW instead.
- \sa Q_DECL_NOTHROW, Q_DECL_NOEXCEPT_EXPR
+ \sa Q_DECL_NOTHROW, Q_DECL_NOEXCEPT
*/
/*!
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 1e9b20757d..6a6656a6f6 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -838,9 +838,13 @@ Q_CORE_EXPORT void qFreeAligned(void *ptr);
# pragma warning(disable: 4800) /* 'type' : forcing value to bool 'true' or 'false' (performance warning) */
# pragma warning(disable: 4097) /* typedef-name 'identifier1' used as synonym for class-name 'identifier2' */
# pragma warning(disable: 4706) /* assignment within conditional expression */
-# pragma warning(disable: 4786) /* 'identifier' : identifier was truncated to 'number' characters in the debug information */
+# if _MSC_VER <= 1310 // MSVC 2003
+# pragma warning(disable: 4786) /* 'identifier' : identifier was truncated to 'number' characters in the debug information */
+# endif
# pragma warning(disable: 4355) /* 'this' : used in base member initializer list */
-# pragma warning(disable: 4231) /* nonstandard extension used : 'identifier' before template explicit instantiation */
+# if _MSC_VER < 1800 // MSVC 2013
+# pragma warning(disable: 4231) /* nonstandard extension used : 'identifier' before template explicit instantiation */
+# endif
# pragma warning(disable: 4710) /* function not inlined */
# pragma warning(disable: 4530) /* C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc */
# elif defined(Q_CC_BOR)
diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp
index dbe28da120..10b0d63fb0 100644
--- a/src/corelib/global/qlogging.cpp
+++ b/src/corelib/global/qlogging.cpp
@@ -1244,6 +1244,32 @@ static void qDefaultMsgHandler(QtMsgType type, const char *buf)
qDefaultMessageHandler(type, emptyContext, QString::fromLocal8Bit(buf));
}
+#if defined(Q_COMPILER_THREAD_LOCAL) || (defined(Q_CC_MSVC) && !defined(Q_OS_WINCE))
+#if defined(Q_CC_MSVC)
+static __declspec(thread) bool msgHandlerGrabbed = false;
+#else
+static thread_local bool msgHandlerGrabbed = false;
+#endif
+
+static bool grabMessageHandler()
+{
+ if (msgHandlerGrabbed)
+ return false;
+
+ msgHandlerGrabbed = true;
+ return true;
+}
+
+static void ungrabMessageHandler()
+{
+ msgHandlerGrabbed = false;
+}
+
+#else
+static bool grabMessageHandler() { return true; }
+static void ungrabMessageHandler() { }
+#endif // (Q_COMPILER_THREAD_LOCAL) || ((Q_CC_MSVC) && !(Q_OS_WINCE))
+
static void qt_message_print(QtMsgType msgType, const QMessageLogContext &context, const QString &message)
{
#ifndef QT_BOOTSTRAPPED
@@ -1261,12 +1287,19 @@ static void qt_message_print(QtMsgType msgType, const QMessageLogContext &contex
if (!messageHandler)
messageHandler = qDefaultMessageHandler;
- // prefer new message handler over the old one
- if (msgHandler == qDefaultMsgHandler
- || messageHandler != qDefaultMessageHandler) {
- (*messageHandler)(msgType, context, message);
+ // prevent recursion in case the message handler generates messages
+ // itself, e.g. by using Qt API
+ if (grabMessageHandler()) {
+ // prefer new message handler over the old one
+ if (msgHandler == qDefaultMsgHandler
+ || messageHandler != qDefaultMessageHandler) {
+ (*messageHandler)(msgType, context, message);
+ } else {
+ (*msgHandler)(msgType, message.toLocal8Bit().constData());
+ }
+ ungrabMessageHandler();
} else {
- (*msgHandler)(msgType, message.toLocal8Bit().constData());
+ fprintf(stderr, "%s", message.toLocal8Bit().constData());
}
}
diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp
index 3075e0fb12..909143ecf3 100644
--- a/src/corelib/io/qdir.cpp
+++ b/src/corelib/io/qdir.cpp
@@ -716,11 +716,12 @@ QString QDir::absoluteFilePath(const QString &fileName) const
return fileName;
d->resolveAbsoluteEntry();
+ const QString absoluteDirPath = d->absoluteDirEntry.filePath();
if (fileName.isEmpty())
- return d->absoluteDirEntry.filePath();
- if (!d->absoluteDirEntry.isRoot())
- return d->absoluteDirEntry.filePath() % QLatin1Char('/') % fileName;
- return d->absoluteDirEntry.filePath() % fileName;
+ return absoluteDirPath;
+ if (!absoluteDirPath.endsWith(QLatin1Char('/')))
+ return absoluteDirPath % QLatin1Char('/') % fileName;
+ return absoluteDirPath % fileName;
}
/*!
diff --git a/src/corelib/io/qfileselector.cpp b/src/corelib/io/qfileselector.cpp
index 92d3564a0f..b4021c060f 100644
--- a/src/corelib/io/qfileselector.cpp
+++ b/src/corelib/io/qfileselector.cpp
@@ -102,7 +102,7 @@ QFileSelectorPrivate::QFileSelectorPrivate()
your code might look something like this:
\code
QString defaultsPath = "data/defaults.conf";
-#if defined(Q_OS_LINUX_ANDROID)
+#if defined(Q_OS_ANDROID)
defaultsPath = "data/android/defaults.conf";
#elif defined(Q_OS_BLACKBERRY)
defaultsPath = "data/blackberry/defaults.conf";
@@ -157,7 +157,7 @@ QFileSelectorPrivate::QFileSelectorPrivate()
Selectors normally available are
\list
\li platform, any of the following strings which match the platform the application is running
- on: android, blackberry, ios, mac, linux, wince, unix, windows.
+ on: android, blackberry, ios, osx, darwin, mac, linux, wince, unix, windows.
\li locale, same as QLocale::system().name().
\endlist
@@ -368,18 +368,22 @@ QStringList QFileSelectorPrivate::platformSelectors()
# endif
#elif defined(Q_OS_UNIX)
ret << QStringLiteral("unix");
-# if defined(Q_OS_LINUX_ANDROID)
+# if defined(Q_OS_ANDROID)
ret << QStringLiteral("android");
# elif defined(Q_OS_BLACKBERRY)
ret << QStringLiteral("blackberry");
# elif defined(Q_OS_QNX)
ret << QStringLiteral("qnx");
-# elif defined(Q_OS_IOS)
- ret << QStringLiteral("ios");
# elif defined(Q_OS_LINUX)
ret << QStringLiteral("linux");
-# elif defined(Q_OS_MAC)
- ret << QStringLiteral("mac");
+# elif defined(Q_OS_DARWIN)
+ ret << QStringLiteral("darwin");
+ ret << QStringLiteral("mac"); // compatibility synonym
+# if defined(Q_OS_IOS)
+ ret << QStringLiteral("ios");
+# elif defined(Q_OS_OSX)
+ ret << QStringLiteral("osx");
+# endif
# else
struct utsname u;
if (uname(&u) != -1)
diff --git a/src/corelib/io/qiodevice.cpp b/src/corelib/io/qiodevice.cpp
index a81b8580c4..53019e1ff4 100644
--- a/src/corelib/io/qiodevice.cpp
+++ b/src/corelib/io/qiodevice.cpp
@@ -259,9 +259,10 @@ QIODevicePrivate::~QIODevicePrivate()
\value NotOpen The device is not open.
\value ReadOnly The device is open for reading.
- \value WriteOnly The device is open for writing.
+ \value WriteOnly The device is open for writing. Note that this mode implies
+ Truncate.
\value ReadWrite The device is open for reading and writing.
- \value Append The device is opened in append mode, so that all data is
+ \value Append The device is opened in append mode so that all data is
written to the end of the file.
\value Truncate If possible, the device is truncated before it is opened.
All earlier contents of the device are lost.
diff --git a/src/corelib/io/qloggingcategory.cpp b/src/corelib/io/qloggingcategory.cpp
index 8c3ca5fd65..de77dd9a6e 100644
--- a/src/corelib/io/qloggingcategory.cpp
+++ b/src/corelib/io/qloggingcategory.cpp
@@ -72,7 +72,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QLoggingCategory, qtDefaultCategory,
\section1 Checking category configuration
QLoggingCategory provides \l isDebugEnabled(), \l isWarningEnabled(),
- \l isCriticalEnabled(), \l isTraceEnabled(), as well as \l isEnabled()
+ \l isCriticalEnabled(), as well as \l isEnabled()
to check whether messages for the given message type should be logged.
\note The qCDebug(), qCWarning(), qCCritical() macros prevent arguments
diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
index 68f6c2ebf2..ebc97ca2d9 100644
--- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp
+++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp
@@ -458,10 +458,21 @@ void QSortFilterProxyModelPrivate::sort()
*/
bool QSortFilterProxyModelPrivate::update_source_sort_column()
{
- Q_Q(QSortFilterProxyModel);
- QModelIndex proxy_index = q->index(0, proxy_sort_column, QModelIndex());
int old_source_sort_column = source_sort_column;
- source_sort_column = q->mapToSource(proxy_index).column();
+
+ if (proxy_sort_column == -1) {
+ source_sort_column = -1;
+ } else {
+ // We cannot use index mapping here because in case of a still-empty
+ // proxy model there's no valid proxy index we could map to source.
+ // So always use the root mapping directly instead.
+ Mapping *m = create_mapping(QModelIndex()).value();
+ if (proxy_sort_column < m->source_columns.size())
+ source_sort_column = m->source_columns.at(proxy_sort_column);
+ else
+ source_sort_column = -1;
+ }
+
return old_source_sort_column != source_sort_column;
}
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index 5197d98f19..ee6ef23139 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -206,9 +206,9 @@ public:
const char *member, Qt::ConnectionType type = Qt::AutoConnection) const;
#ifdef Q_QDOC
- static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type);
+ static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type = Qt::AutoConnection);
static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, Functor functor);
- static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type);
+ static QMetaObject::Connection connect(const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type = Qt::AutoConnection);
#else
//Connect a signal to a pointer to qobject member function
template <typename Func1, typename Func2>
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index 91ccf3996e..dd9a7693ca 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -2833,8 +2833,8 @@ static bool canConvertMetaObject(int fromId, int toId, QObject *fromObject)
\snippet code/src_corelib_kernel_qvariant.cpp 10
- \sa convert(), QSequentialIterable, qRegisterSequentialConverter(), QAssociativeIterable,
- qRegisterAssociativeConverter()
+ \sa convert(), QSequentialIterable, Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE(), QAssociativeIterable,
+ Q_DECLARE_ASSOCIATIVE_CONTAINER_METATYPE()
*/
bool QVariant::canConvert(int targetTypeId) const
{
@@ -3334,7 +3334,7 @@ QDebug operator<<(QDebug dbg, const QVariant::Type p)
\snippet code/src_corelib_kernel_qvariant.cpp 9
- \sa setValue(), fromValue(), canConvert(), qRegisterSequentialConverter()
+ \sa setValue(), fromValue(), canConvert(), Q_DECLARE_SEQUENTIAL_CONTAINER_METATYPE()
*/
/*! \fn bool QVariant::canConvert() const
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index 468f759189..9736950c89 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -374,6 +374,7 @@ private:
static QBasicMutex qt_library_mutex;
static QLibraryStore *qt_library_data = 0;
+static bool qt_library_data_once;
QLibraryStore::~QLibraryStore()
{
@@ -429,8 +430,11 @@ Q_DESTRUCTOR_FUNCTION(qlibraryCleanup)
// must be called with a locked mutex
QLibraryStore *QLibraryStore::instance()
{
- if (Q_UNLIKELY(!qt_library_data))
+ if (Q_UNLIKELY(!qt_library_data_once && !qt_library_data)) {
+ // only create once per process lifetime
qt_library_data = new QLibraryStore;
+ qt_library_data_once = true;
+ }
return qt_library_data;
}
@@ -440,12 +444,15 @@ inline QLibraryPrivate *QLibraryStore::findOrCreate(const QString &fileName, con
QLibraryStore *data = instance();
// check if this library is already loaded
- QLibraryPrivate *lib = data->libraryMap.value(fileName);
+ QLibraryPrivate *lib = 0;
+ if (Q_LIKELY(data))
+ lib = data->libraryMap.value(fileName);
if (!lib)
lib = new QLibraryPrivate(fileName, version);
// track this library
- data->libraryMap.insert(fileName, lib);
+ if (Q_LIKELY(data))
+ data->libraryMap.insert(fileName, lib);
lib->libraryRefCount.ref();
return lib;
@@ -464,9 +471,11 @@ inline void QLibraryStore::releaseLibrary(QLibraryPrivate *lib)
// no one else is using
Q_ASSERT(lib->libraryUnloadCount.load() == 0);
- QLibraryPrivate *that = data->libraryMap.take(lib->fileName);
- Q_ASSERT(lib == that);
- Q_UNUSED(that);
+ if (Q_LIKELY(data)) {
+ QLibraryPrivate *that = data->libraryMap.take(lib->fileName);
+ Q_ASSERT(lib == that);
+ Q_UNUSED(that);
+ }
delete lib;
}
diff --git a/src/corelib/tools/qalgorithms.qdoc b/src/corelib/tools/qalgorithms.qdoc
index 40eb2ed41d..8feb180248 100644
--- a/src/corelib/tools/qalgorithms.qdoc
+++ b/src/corelib/tools/qalgorithms.qdoc
@@ -662,9 +662,6 @@
This function requires the item type (in the example above,
QString) to implement \c operator<().
- See the \l{<QtAlgorithms>#binaryFind example}{detailed
- description} for an example usage.
-
\sa qLowerBound(), qUpperBound(), {random access iterators}
*/
diff --git a/src/corelib/tools/qbitarray.cpp b/src/corelib/tools/qbitarray.cpp
index 2e22cf8340..a6f22abce8 100644
--- a/src/corelib/tools/qbitarray.cpp
+++ b/src/corelib/tools/qbitarray.cpp
@@ -119,14 +119,6 @@ QT_BEGIN_NAMESPACE
\since 5.2
*/
-/*!
- \fn QBitArray &QBitArray::operator=(QBitArray &&other)
-
- Move-assigns \a other to this QBitArray instance.
-
- \since 5.2
-*/
-
/*! \fn QBitArray::QBitArray()
Constructs an empty bit array.
@@ -464,6 +456,7 @@ void QBitArray::fill(bool value, int begin, int end)
*/
/*! \fn QBitArray &QBitArray::operator=(QBitArray &&other)
+ \since 5.2
Moves \a other to this bit array and returns a reference to
this bit array.
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index a9cfd604c7..ab1167d0f6 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -1303,12 +1303,10 @@ void QByteArray::chop(int n)
returns a reference to this byte array. The Unicode data is
converted into 8-bit characters using QString::toUtf8().
- If the QString contains non-ASCII Unicode characters, using this
- operator can lead to loss of information. You can disable this
- operator by defining \c QT_NO_CAST_TO_ASCII when you compile your
- applications. You then need to call QString::toUtf8() (or
- QString::toLatin1() or QString::toUtf8() or QString::toLocal8Bit())
- explicitly if you want to convert the data to \c{const char *}.
+ You can disable this function by defining \c QT_NO_CAST_TO_ASCII when you
+ compile your applications. You then need to call QString::toUtf8() (or
+ QString::toLatin1() or QString::toLocal8Bit()) explicitly if you want to
+ convert the data to \c{const char *}.
*/
/*! \fn QByteArray &QByteArray::operator+=(const char *str)
@@ -1667,12 +1665,10 @@ QByteArray &QByteArray::append(const QByteArray &ba)
Appends the string \a str to this byte array. The Unicode data is
converted into 8-bit characters using QString::toUtf8().
- If the QString contains non-ASCII Unicode characters, using this
- function can lead to loss of information. You can disable this
- function by defining \c QT_NO_CAST_TO_ASCII when you compile your
- applications. You then need to call QString::toUtf8() (or
- QString::toLatin1() or QString::toUtf8() or QString::toLocal8Bit())
- explicitly if you want to convert the data to \c{const char *}.
+ You can disable this function by defining \c QT_NO_CAST_TO_ASCII when you
+ compile your applications. You then need to call QString::toUtf8() (or
+ QString::toLatin1() or QString::toLocal8Bit()) explicitly if you want to
+ convert the data to \c{const char *}.
*/
/*!
@@ -2148,12 +2144,10 @@ QByteArray &QByteArray::replace(char before, const QByteArray &after)
string \a after. The Unicode data is converted into 8-bit
characters using QString::toUtf8().
- If the QString contains non-ASCII Unicode characters, using this
- function can lead to loss of information. You can disable this
- function by defining \c QT_NO_CAST_TO_ASCII when you compile your
- applications. You then need to call QString::toUtf8() (or
- QString::toLatin1() or QString::toUtf8() or QString::toLocal8Bit())
- explicitly if you want to convert the data to \c{const char *}.
+ You can disable this function by defining \c QT_NO_CAST_TO_ASCII when you
+ compile your applications. You then need to call QString::toUtf8() (or
+ QString::toLatin1() or QString::toLocal8Bit()) explicitly if you want to
+ convert the data to \c{const char *}.
*/
/*! \fn QByteArray &QByteArray::replace(char before, const char *after)
diff --git a/src/corelib/tools/qcommandlineoption.cpp b/src/corelib/tools/qcommandlineoption.cpp
index 86f087674b..ccf9211b52 100644
--- a/src/corelib/tools/qcommandlineoption.cpp
+++ b/src/corelib/tools/qcommandlineoption.cpp
@@ -79,7 +79,7 @@ public:
This class is used to describe an option on the command line. It allows
different ways of defining the same option with multiple aliases possible.
It is also used to describe how the option is used - it may be a flag (e.g. \c{-v})
- or take an argument (e.g. \c{-o file}).
+ or take a value (e.g. \c{-o file}).
Examples:
\snippet code/src_corelib_tools_qcommandlineoption.cpp 0
@@ -232,8 +232,8 @@ void QCommandLineOptionPrivate::setNames(const QStringList &nameList)
for the documentation of the option in the help output. An option with names \c{o} and \c{output},
and a value name of \c{file} will appear as \c{-o, --output <file>}.
- Call QCommandLineParser::argument() if you expect the option to be present
- only once, and QCommandLineParser::arguments() if you expect that option
+ Call QCommandLineParser::value() if you expect the option to be present
+ only once, and QCommandLineParser::values() if you expect that option
to be present multiple times.
\sa valueName()
diff --git a/src/corelib/tools/qrect.h b/src/corelib/tools/qrect.h
index 62ebdd10cd..22696f9edf 100644
--- a/src/corelib/tools/qrect.h
+++ b/src/corelib/tools/qrect.h
@@ -512,7 +512,7 @@ public:
Q_DECL_CONSTEXPR inline QRectF translated(qreal dx, qreal dy) const;
Q_DECL_CONSTEXPR inline QRectF translated(const QPointF &p) const;
- inline void moveTo(qreal x, qreal t);
+ inline void moveTo(qreal x, qreal y);
inline void moveTo(const QPointF &p);
inline void setRect(qreal x, qreal y, qreal w, qreal h);
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 390a65aa23..f5e25f1de9 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -7845,7 +7845,7 @@ QString &QString::setRawData(const QChar *unicode, int size)
\snippet code/src_corelib_tools_qstring.cpp 6
- \sa QString, QLatin1Char, QStringLiteral
+ \sa QString, QLatin1Char, {QStringLiteral()}{QStringLiteral}
*/
/*! \fn QLatin1String::QLatin1String(const char *str)
diff --git a/src/corelib/tools/qstring.h b/src/corelib/tools/qstring.h
index 4432759b03..0b7ca1f444 100644
--- a/src/corelib/tools/qstring.h
+++ b/src/corelib/tools/qstring.h
@@ -1062,13 +1062,13 @@ inline QT_ASCII_CAST_WARN bool operator==(const char *s1, const QString &s2)
inline QT_ASCII_CAST_WARN bool operator!=(const char *s1, const QString &s2)
{ return QString::compare_helper(s2.constData(), s2.size(), s1, -1) != 0; }
inline QT_ASCII_CAST_WARN bool operator<(const char *s1, const QString &s2)
-{ return QString::compare_helper(s2.constData(), s2.size(), s1, -1) < 0; }
-inline QT_ASCII_CAST_WARN bool operator>(const char *s1, const QString &s2)
{ return QString::compare_helper(s2.constData(), s2.size(), s1, -1) > 0; }
+inline QT_ASCII_CAST_WARN bool operator>(const char *s1, const QString &s2)
+{ return QString::compare_helper(s2.constData(), s2.size(), s1, -1) < 0; }
inline QT_ASCII_CAST_WARN bool operator<=(const char *s1, const QString &s2)
-{ return QString::compare_helper(s2.constData(), s2.size(), s1, -1) <= 0; }
-inline QT_ASCII_CAST_WARN bool operator>=(const char *s1, const QString &s2)
{ return QString::compare_helper(s2.constData(), s2.size(), s1, -1) >= 0; }
+inline QT_ASCII_CAST_WARN bool operator>=(const char *s1, const QString &s2)
+{ return QString::compare_helper(s2.constData(), s2.size(), s1, -1) <= 0; }
inline QT_ASCII_CAST_WARN bool operator==(const char *s1, QLatin1String s2)
{ return QString::fromUtf8(s1) == s2; }
diff --git a/src/corelib/tools/qvector.h b/src/corelib/tools/qvector.h
index 505e1a32e4..075e8e83e8 100644
--- a/src/corelib/tools/qvector.h
+++ b/src/corelib/tools/qvector.h
@@ -254,7 +254,10 @@ private:
};
#ifdef Q_CC_MSVC
-# pragma warning ( disable : 4345 ) // behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized
+// behavior change: an object of POD type constructed with an initializer of the form ()
+// will be default-initialized
+# pragma warning ( push )
+# pragma warning ( disable : 4345 )
#endif
template <typename T>
@@ -270,7 +273,7 @@ void QVector<T>::defaultConstruct(T *from, T *to)
}
#ifdef Q_CC_MSVC
-# pragma warning ( default: 4345 )
+# pragma warning ( pop )
#endif
template <typename T>