summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-03-09 01:00:54 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2019-03-09 01:00:55 +0100
commit261c0dedac1d97b5960d27eedaa017d45050b654 (patch)
treef91c8e2a770f4c456f6465f28aecefc8c2bbeccf /src/corelib
parent830e06a3f8173621a99426e7da6ad9704eb701b3 (diff)
parentcaa74f16d41ebe65e1edbea219f799cf246d6067 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/io/qresource.cpp4
-rw-r--r--src/corelib/io/qtemporaryfile.cpp22
-rw-r--r--src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp8
-rw-r--r--src/corelib/itemmodels/qtransposeproxymodel.cpp5
-rw-r--r--src/corelib/kernel/qcore_mac.cpp23
-rw-r--r--src/corelib/kernel/qcore_mac_p.h1
-rw-r--r--src/corelib/kernel/qobject.h2
-rw-r--r--src/corelib/thread/qthread.cpp10
8 files changed, 48 insertions, 27 deletions
diff --git a/src/corelib/io/qresource.cpp b/src/corelib/io/qresource.cpp
index 1077e31797..e7d739b4dc 100644
--- a/src/corelib/io/qresource.cpp
+++ b/src/corelib/io/qresource.cpp
@@ -286,7 +286,7 @@ static inline QStringList *resourceSearchPaths()
decompress, use the \c{ZSTD_decompress} function from the zstd
library.
- \sa compressionAlgorithm(), isCopressed()
+ \sa compressionAlgorithm(), isCompressed()
*/
class QResourcePrivate {
@@ -558,7 +558,7 @@ bool QResource::isValid() const
check compressionAlgorithm() to verify what algorithm to use to decompress
the data.
- \sa data(), compressionType(), isFile()
+ \sa data(), compressionAlgorithm(), isFile()
*/
bool QResource::isCompressed() const
diff --git a/src/corelib/io/qtemporaryfile.cpp b/src/corelib/io/qtemporaryfile.cpp
index 7e3be9ef36..35bb465a04 100644
--- a/src/corelib/io/qtemporaryfile.cpp
+++ b/src/corelib/io/qtemporaryfile.cpp
@@ -912,16 +912,20 @@ QTemporaryFile *QTemporaryFile::createNativeFile(QFile &file)
file.open(QIODevice::ReadOnly);
//dump data
QTemporaryFile *ret = new QTemporaryFile;
- ret->open();
- file.seek(0);
- char buffer[1024];
- while(true) {
- qint64 len = file.read(buffer, 1024);
- if(len < 1)
- break;
- ret->write(buffer, len);
+ if (ret->open()) {
+ file.seek(0);
+ char buffer[1024];
+ while (true) {
+ qint64 len = file.read(buffer, 1024);
+ if (len < 1)
+ break;
+ ret->write(buffer, len);
+ }
+ ret->seek(0);
+ } else {
+ delete ret;
+ ret = nullptr;
}
- ret->seek(0);
//restore
if(wasOpen)
file.seek(old_off);
diff --git a/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp b/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp
index bbfe2dce16..a20024f468 100644
--- a/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp
+++ b/src/corelib/itemmodels/qconcatenatetablesproxymodel.cpp
@@ -103,7 +103,7 @@ QConcatenateTablesProxyModelPrivate::QConcatenateTablesProxyModelPrivate()
\since 5.13
\class QConcatenateTablesProxyModel
\inmodule QtCore
- \brief The QConcatenateTablesProxyModel class proxies multiple source models, concatenating their rows
+ \brief The QConcatenateTablesProxyModel class proxies multiple source models, concatenating their rows.
\ingroup model-view
@@ -163,7 +163,7 @@ QModelIndex QConcatenateTablesProxyModel::mapFromSource(const QModelIndex &sourc
}
/*!
- Returns the source index for a given proxy index.
+ Returns the source index for a given \a proxyIndex.
*/
QModelIndex QConcatenateTablesProxyModel::mapToSource(const QModelIndex &proxyIndex) const
{
@@ -232,8 +232,8 @@ bool QConcatenateTablesProxyModel::setItemData(const QModelIndex &proxyIndex, co
/*!
Returns the flags for the given index.
- If the index is valid, the flags come from the source model for this index.
- If the index is invalid (as used to determine if dropping onto an empty area
+ If the \a index is valid, the flags come from the source model for this \a index.
+ If the \a index is invalid (as used to determine if dropping onto an empty area
in the view is allowed, for instance), the flags from the first model are returned.
*/
Qt::ItemFlags QConcatenateTablesProxyModel::flags(const QModelIndex &index) const
diff --git a/src/corelib/itemmodels/qtransposeproxymodel.cpp b/src/corelib/itemmodels/qtransposeproxymodel.cpp
index f15435739c..d4f379bc64 100644
--- a/src/corelib/itemmodels/qtransposeproxymodel.cpp
+++ b/src/corelib/itemmodels/qtransposeproxymodel.cpp
@@ -162,8 +162,9 @@ void QTransposeProxyModelPrivate::onRowsAboutToBeMoved(const QModelIndex &source
/*!
\since 5.13
\class QTransposeProxyModel
- \brief This proxy transposes the source model
- \details This model will make the rows of the source model become columns of the proxy model and vice-versa.
+ \brief This proxy transposes the source model.
+
+ This model will make the rows of the source model become columns of the proxy model and vice-versa.
If the model is a tree, the parents will be transposed as well. For example, if an index in the source model had parent `index(2,0)`, it will have parent `index(0,2)` in the proxy.
*/
diff --git a/src/corelib/kernel/qcore_mac.cpp b/src/corelib/kernel/qcore_mac.cpp
index e78b2d1171..b048576f5b 100644
--- a/src/corelib/kernel/qcore_mac.cpp
+++ b/src/corelib/kernel/qcore_mac.cpp
@@ -65,6 +65,19 @@ QCFString::operator CFStringRef() const
#if defined(QT_USE_APPLE_UNIFIED_LOGGING)
+bool AppleUnifiedLogger::willMirrorToStderr()
+{
+ // When running under Xcode or LLDB, one or more of these variables will
+ // be set, which triggers libsystem_trace.dyld to log messages to stderr
+ // as well, via_os_log_impl_mirror_to_stderr. Un-setting these variables
+ // is not an option, as that would silence normal NSLog or os_log calls,
+ // so instead we skip our own stderr output. See rdar://36919139.
+ static bool willMirror = qEnvironmentVariableIsSet("OS_ACTIVITY_DT_MODE")
+ || qEnvironmentVariableIsSet("ACTIVITY_LOG_STDERR")
+ || qEnvironmentVariableIsSet("CFLOG_FORCE_STDERR");
+ return willMirror;
+}
+
QT_MAC_WEAK_IMPORT(_os_log_default);
bool AppleUnifiedLogger::messageHandler(QtMsgType msgType, const QMessageLogContext &context,
const QString &message, const QString &optionalSubsystem)
@@ -103,15 +116,7 @@ bool AppleUnifiedLogger::messageHandler(QtMsgType msgType, const QMessageLogCont
// system from redacting our log message.
os_log_with_type(log, logType, "%{public}s", qPrintable(message));
- // When running under Xcode or LLDB, one or more of these variables will
- // be set, which triggers libsystem_trace.dyld to log messages to stderr
- // as well, via_os_log_impl_mirror_to_stderr. Un-setting these variables
- // is not an option, as that would silence normal NSLog or os_log calls,
- // so instead we skip our own stderr output. See rdar://36919139.
- static bool mirroredToStderr = qEnvironmentVariableIsSet("OS_ACTIVITY_DT_MODE")
- || qEnvironmentVariableIsSet("ACTIVITY_LOG_STDERR")
- || qEnvironmentVariableIsSet("CFLOG_FORCE_STDERR");
- return mirroredToStderr;
+ return willMirrorToStderr();
}
os_log_type_t AppleUnifiedLogger::logTypeForMessageType(QtMsgType msgType)
diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h
index acb87f8a3c..f96e7358a2 100644
--- a/src/corelib/kernel/qcore_mac_p.h
+++ b/src/corelib/kernel/qcore_mac_p.h
@@ -202,6 +202,7 @@ class Q_CORE_EXPORT AppleUnifiedLogger
public:
static bool messageHandler(QtMsgType msgType, const QMessageLogContext &context, const QString &message,
const QString &subsystem = QString());
+ static bool willMirrorToStderr();
private:
static os_log_type_t logTypeForMessageType(QtMsgType msgType);
static os_log_t cachedLog(const QString &subsystem, const QString &category);
diff --git a/src/corelib/kernel/qobject.h b/src/corelib/kernel/qobject.h
index 52c1b8e555..63c5a9ad73 100644
--- a/src/corelib/kernel/qobject.h
+++ b/src/corelib/kernel/qobject.h
@@ -178,7 +178,7 @@ public:
#ifndef QT_NO_REGEXP
#if QT_DEPRECATED_SINCE(5, 13)
template<typename T>
- QT_DEPRECATED_X("Use findChildren(const RegularExpression &, ...) instead.")
+ QT_DEPRECATED_X("Use findChildren(const QRegularExpression &, ...) instead.")
inline QList<T> findChildren(const QRegExp &re, Qt::FindChildOptions options = Qt::FindChildrenRecursively) const
{
typedef typename std::remove_cv<typename std::remove_pointer<T>::type>::type ObjType;
diff --git a/src/corelib/thread/qthread.cpp b/src/corelib/thread/qthread.cpp
index 05bc064005..b023ae9ed2 100644
--- a/src/corelib/thread/qthread.cpp
+++ b/src/corelib/thread/qthread.cpp
@@ -818,6 +818,16 @@ void QThread::quit()
}
+void QThread::exit(int returnCode)
+{
+ Q_D(QThread);
+ d->data->quitNow = true;
+ for (int i = 0; i < d->data->eventLoops.size(); ++i) {
+ QEventLoop *eventLoop = d->data->eventLoops.at(i);
+ eventLoop->exit(returnCode);
+ }
+}
+
bool QThread::wait(unsigned long time)
{
Q_UNUSED(time);