diff options
author | Liang Qi <liang.qi@qt.io> | 2019-04-24 09:52:30 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2019-04-24 09:52:30 +0200 |
commit | dc373186841802f2dd17fcd243efdeca7d5433e9 (patch) | |
tree | 4fff0a3366b63db97ca5a8b04a220bb0b8c56450 /src/corelib | |
parent | 7d646508c8219408f90103ed13613db8d01a4065 (diff) | |
parent | cb10ec56f733c34d23c9e5511b19c1e508d0f13f (diff) |
Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
src/gui/util/qshaderformat.cpp
src/gui/util/qshaderformat_p.h
src/widgets/graphicsview/qgraphicsitem_p.h
Change-Id: Idafd88eb9a0a15b4af29f6143d009c1ec8ceecca
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/global/qglobal_p.h | 3 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemengine_win.cpp | 13 | ||||
-rw-r--r-- | src/corelib/itemmodels/qabstractitemmodel.cpp | 2 | ||||
-rw-r--r-- | src/corelib/kernel/qobjectdefs.h | 4 | ||||
-rw-r--r-- | src/corelib/tools/qdatetime.cpp | 3 | ||||
-rw-r--r-- | src/corelib/tools/qdatetime.h | 2 | ||||
-rw-r--r-- | src/corelib/tools/qlocale.cpp | 11 | ||||
-rw-r--r-- | src/corelib/tools/qlocale.qdoc | 2 |
8 files changed, 33 insertions, 7 deletions
diff --git a/src/corelib/global/qglobal_p.h b/src/corelib/global/qglobal_p.h index d52f6268e4..58bc8b7bf3 100644 --- a/src/corelib/global/qglobal_p.h +++ b/src/corelib/global/qglobal_p.h @@ -61,6 +61,9 @@ #endif #if defined(__cplusplus) +#ifdef Q_CC_MINGW +# include <unistd.h> // Define _POSIX_THREAD_SAFE_FUNCTIONS to obtain localtime_r() +#endif #include <time.h> QT_BEGIN_NAMESPACE diff --git a/src/corelib/io/qfilesystemengine_win.cpp b/src/corelib/io/qfilesystemengine_win.cpp index 2020e34f93..279918b812 100644 --- a/src/corelib/io/qfilesystemengine_win.cpp +++ b/src/corelib/io/qfilesystemengine_win.cpp @@ -310,9 +310,18 @@ static QString readSymLink(const QFileSystemEntry &link) const wchar_t* PathBuffer = &rdb->SymbolicLinkReparseBuffer.PathBuffer[offset]; result = QString::fromWCharArray(PathBuffer, length); } - // cut-off "//?/" and "/??/" - if (result.size() > 4 && result.at(0) == QLatin1Char('\\') && result.at(2) == QLatin1Char('?') && result.at(3) == QLatin1Char('\\')) + // cut-off "\\?\" and "\??\" + if (result.size() > 4 + && result.at(0) == QLatin1Char('\\') + && result.at(2) == QLatin1Char('?') + && result.at(3) == QLatin1Char('\\')) { result = result.mid(4); + // cut off UNC in addition when the link points at a UNC share + // in which case we need to prepend another backslash to get \\server\share + if (result.leftRef(3) == QLatin1String("UNC")) { + result.replace(0, 3, QLatin1Char('\\')); + } + } } free(rdb); CloseHandle(handle); diff --git a/src/corelib/itemmodels/qabstractitemmodel.cpp b/src/corelib/itemmodels/qabstractitemmodel.cpp index 664e16540b..d171b313e6 100644 --- a/src/corelib/itemmodels/qabstractitemmodel.cpp +++ b/src/corelib/itemmodels/qabstractitemmodel.cpp @@ -3619,7 +3619,7 @@ QModelIndex QAbstractTableModel::sibling(int row, int column, const QModelIndex bool QAbstractTableModel::hasChildren(const QModelIndex &parent) const { - if (parent.model() == this || !parent.isValid()) + if (!parent.isValid()) return rowCount(parent) > 0 && columnCount(parent) > 0; return false; } diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h index 418b8cf1d2..0bceab6fb4 100644 --- a/src/corelib/kernel/qobjectdefs.h +++ b/src/corelib/kernel/qobjectdefs.h @@ -515,7 +515,7 @@ struct Q_CORE_EXPORT QMetaObject Qt::ConnectionType type = Qt::AutoConnection, decltype(function()) *ret = nullptr) { return invokeMethodImpl(context, - new QtPrivate::QFunctorSlotObjectWithNoArgs<Func, decltype(function())>(function), + new QtPrivate::QFunctorSlotObjectWithNoArgs<Func, decltype(function())>(std::move(function)), type, ret); } @@ -527,7 +527,7 @@ struct Q_CORE_EXPORT QMetaObject invokeMethod(QObject *context, Func function, typename std::result_of<Func()>::type *ret) { return invokeMethodImpl(context, - new QtPrivate::QFunctorSlotObjectWithNoArgs<Func, decltype(function())>(function), + new QtPrivate::QFunctorSlotObjectWithNoArgs<Func, decltype(function())>(std::move(function)), Qt::AutoConnection, ret); } diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 969065ffee..6fa735dab7 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -58,6 +58,9 @@ #endif #include <cmath> +#ifdef Q_CC_MINGW +# include <unistd.h> // Define _POSIX_THREAD_SAFE_FUNCTIONS to obtain localtime_r() +#endif #include <time.h> #ifdef Q_OS_WIN # include <qt_windows.h> diff --git a/src/corelib/tools/qdatetime.h b/src/corelib/tools/qdatetime.h index fc901234ec..51d5dd9759 100644 --- a/src/corelib/tools/qdatetime.h +++ b/src/corelib/tools/qdatetime.h @@ -335,7 +335,7 @@ public: inline bool operator>(const QDateTime &other) const { return other < *this; } inline bool operator>=(const QDateTime &other) const { return !(*this < other); } -#if QT_DEPRECATED_SINCE(5, 2) +#if QT_DEPRECATED_SINCE(5, 2) // ### Qt 6: remove QT_DEPRECATED void setUtcOffset(int seconds); QT_DEPRECATED int utcOffset() const; #endif // QT_DEPRECATED_SINCE diff --git a/src/corelib/tools/qlocale.cpp b/src/corelib/tools/qlocale.cpp index 9f414b1b72..8e47d350d1 100644 --- a/src/corelib/tools/qlocale.cpp +++ b/src/corelib/tools/qlocale.cpp @@ -2482,6 +2482,17 @@ QString QLocale::toString(double i, char f, int prec) const Returns a QLocale object initialized to the "C" locale. + This locale is based on en_US but with various quirks of its own, such as + simplified number formatting and its own date formatting. It implements the + POSIX standards that describe the behavior of standard library functions of + the "C" programming language. + + Among other things, this means its collation order is based on the ASCII + values of letters, so that (for case-sensitive sorting) all upper-case + letters sort before any lower-case one (rather than each letter's upper- and + lower-case forms sorting adjacent to one another, before the next letter's + two forms). + \sa system() */ diff --git a/src/corelib/tools/qlocale.qdoc b/src/corelib/tools/qlocale.qdoc index 91b0ab6442..f36fd7d6fc 100644 --- a/src/corelib/tools/qlocale.qdoc +++ b/src/corelib/tools/qlocale.qdoc @@ -104,7 +104,7 @@ This enumerated type is used to specify a language. \value AnyLanguage - \value C The "C" locale is identical in behavior to English/UnitedStates. + \value C A simplified English locale; see QLocale::c() \value Abkhazian \value Afan Obsolete, please use Oromo |