From f24b247961e8a3d22ae385c3e29b7df2fd50b032 Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Tue, 21 Jan 2020 08:08:29 +0100 Subject: Doc: Add since version to enum value documentation Fixes: QTBUG-80980 Change-Id: I707c4f45d45cb088fb7419038a448d29a2e8dbf5 Reviewed-by: Leena Miettinen --- src/corelib/global/qnamespace.qdoc | 1 + 1 file changed, 1 insertion(+) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 1908fedead..31e1bcc0da 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -1181,6 +1181,7 @@ \value WA_StyleSheetTarget Indicates that the widget appearance was modified by a \l{Qt Style Sheets}{style sheet}. WA_StyleSheet will also be set. + This value was introduced in Qt 5.12. \value WA_TabletTracking Indicates that the widget has tablet tracking enabled. See QWidget::tabletTracking. -- cgit v1.2.3 From d6d98f782aeb798649c2bf5f7744065b7e86c035 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 22 Jan 2020 16:12:24 +0100 Subject: Deprecate locale-related DateFormat enum members Qt 6 shall remove all locale-dependence from Q(Date|Time)+. Task-number: QTBUG-80441 Change-Id: Iebaaa2bd776bccfe0d73c15f36cbdd456b71ca59 Reviewed-by: Fabian Kosmale --- src/corelib/global/qnamespace.h | 20 +++++++------- src/corelib/global/qnamespace.qdoc | 54 +++++++++++++++++++++++--------------- 2 files changed, 44 insertions(+), 30 deletions(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 8f40393a7e..ea2c635303 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the QtCore module of the Qt Toolkit. @@ -1267,14 +1267,16 @@ public: enum DateFormat { TextDate, // default Qt ISODate, // ISO 8601 - SystemLocaleDate, // deprecated - LocalDate = SystemLocaleDate, // deprecated - LocaleDate, // deprecated - SystemLocaleShortDate, - SystemLocaleLongDate, - DefaultLocaleShortDate, - DefaultLocaleLongDate, - RFC2822Date, // RFC 2822 (+ 850 and 1036 during parsing) +#if QT_DEPRECATED_SINCE(5, 15) + SystemLocaleDate Q_DECL_ENUMERATOR_DEPRECATED_X("Use QLocale"), + LocalDate Q_DECL_ENUMERATOR_DEPRECATED_X("Use QLocale") = 2, // i.e. SystemLocaleDate + LocaleDate Q_DECL_ENUMERATOR_DEPRECATED_X("Use QLocale"), + SystemLocaleShortDate Q_DECL_ENUMERATOR_DEPRECATED_X("Use QLocale"), + SystemLocaleLongDate Q_DECL_ENUMERATOR_DEPRECATED_X("Use QLocale"), + DefaultLocaleShortDate Q_DECL_ENUMERATOR_DEPRECATED_X("Use QLocale"), + DefaultLocaleLongDate Q_DECL_ENUMERATOR_DEPRECATED_X("Use QLocale"), +#endif + RFC2822Date = 8, // RFC 2822 (+ 850 and 1036 during parsing) ISODateWithMs }; diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 9acb978efc..8debee7bb5 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2019 The Qt Company Ltd. +** Copyright (C) 2020 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the documentation of the Qt Toolkit. @@ -709,26 +709,38 @@ \value ISODateWithMs \l{ISO 8601} extended format, including milliseconds if applicable. - \value SystemLocaleShortDate The \l{QLocale::ShortFormat}{short format} used - by the \l{QLocale::system()}{operating system}. - - \value SystemLocaleLongDate The \l{QLocale::LongFormat}{long format} used - by the \l{QLocale::system()}{operating system}. - - \value DefaultLocaleShortDate The \l{QLocale::ShortFormat}{short format} specified - by the \l{QLocale::setDefault()}{application's locale}. - - \value DefaultLocaleLongDate The \l{QLocale::LongFormat}{long format} used - by the \l{QLocale::setDefault()}{application's locale}. - - \value SystemLocaleDate \e{This enum value is deprecated.} Use Qt::SystemLocaleShortDate - instead (or Qt::SystemLocaleLongDate if you want long dates). - - \value LocaleDate \e{This enum value is deprecated.} Use Qt::DefaultLocaleShortDate - instead (or Qt::DefaultLocaleLongDate if you want long dates). - - \value LocalDate \e{This enum value is deprecated.} Use Qt::SystemLocaleShortDate - instead (or Qt::SystemLocaleLongDate if you want long dates). + \value SystemLocaleShortDate \e{This enum value is deprecated and + shall be removed in Qt 6.} Use QLocale's methods for converting + dates and times to and from strings, with the + \l{QLocale::ShortFormat}{short format} of + \l{QLocale::system()}{the locale used by the operating system}. + + \value SystemLocaleLongDate \e{This enum value is deprecated and + shall be removed in Qt 6.} Use QLocale's methods for converting + dates and times to and from strings, with the + \l{QLocale::LongFormat}{long format} of \l{QLocale::system()}{the + locale used by the operating system}. + + \value DefaultLocaleShortDate \e{This enum value is deprecated and + shall be removed in Qt 6.} Use QLocale's methods for converting + dates and times to and from strings, with the + \l{QLocale::ShortFormat}{short format} of + \l{QLocale::setDefault()}{the application's locale}. + + \value DefaultLocaleLongDate \e{This enum value is deprecated and + shall be removed in Qt 6.} Use QLocale's methods for converting + dates and times to and from strings, with the + \l{QLocale::LongFormat}{long format} \l{QLocale::setDefault()}{the + application's locale}. + + \value SystemLocaleDate \e{This enum value is deprecated and shall + be removed in Qt 6.} It is equivalent to SystemLocaleShortDate. + + \value LocaleDate \e{This enum value is deprecated and shall be + removed in Qt 6.} It is equivalent to DefaultLocaleShortDate. + + \value LocalDate \e{This enum value is deprecated and shall be + removed in Qt 6.} It is equivalent to SystemLocaleShortDate. \value RFC2822Date \l{RFC 2822}, \l{RFC 850} and \l{RFC 1036} format: either \c{[ddd,] dd MMM yyyy [hh:mm[:ss]][ ±tzoff]} -- cgit v1.2.3 From 5ac1516edd17eb4ddd94fe43a04fa4d736c50041 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 30 Jan 2020 15:16:18 +0100 Subject: Check for (__ARM_FP & 2) to verify 16-bit FP support It appears __ARM_FP16_FORMAT_IEEE is sometimes incorrectly set, and we need to double-check that 16-bit floating point is available in the __ARM_FP macro as well. Task-number: QTBUG-68314 Fixes: QTBUG-81461 Change-Id: I878d6b286aa31e21271163dc6c8f8038b9534c76 Reviewed-by: BogDan Vatra Reviewed-by: Thiago Macieira --- src/corelib/global/qfloat16.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qfloat16.cpp b/src/corelib/global/qfloat16.cpp index c868e879b7..0c9bb80cb2 100644 --- a/src/corelib/global/qfloat16.cpp +++ b/src/corelib/global/qfloat16.cpp @@ -205,7 +205,7 @@ f16cextern void qFloatFromFloat16_fast(float *out, const quint16 *in, qsizetype #undef f16cextern } -#elif defined(__ARM_FP16_FORMAT_IEEE) && defined(__ARM_NEON__) +#elif defined(__ARM_FP16_FORMAT_IEEE) && defined(__ARM_NEON__) && (__ARM_FP & 2) static inline bool hasFastF16() { return true; -- cgit v1.2.3 From a049325cc708b483ed1aadc6589419f4d74b19f3 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Mon, 20 Jan 2020 15:54:42 +0100 Subject: Win: work around (estimated) 32k char limit for OutputDebugString MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reaching a certain number of characters, OutputDebugString will just eat the string and not give any output. As there is no way of handling that error properly we divide the string into usable chunks. Fixes: QTBUG-80996 Change-Id: Ic7ef34c48c212cbaec3a03790d1020506b7b4319 Reviewed-by: Miguel Costa Reviewed-by: Friedemann Kleint Reviewed-by: Mårten Nordheim --- src/corelib/global/qlogging.cpp | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 5a7f8242de..c1dd04f03c 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -1669,14 +1669,34 @@ static bool android_default_message_handler(QtMsgType type, #endif //Q_OS_ANDROID #ifdef Q_OS_WIN +static void win_outputDebugString_helper(QStringView message) +{ + const int maxOutputStringLength = 32766; + static QBasicMutex m; + auto locker = qt_unique_lock(m); + // fast path: Avoid string copies if one output is enough + if (message.length() <= maxOutputStringLength) { + OutputDebugString(reinterpret_cast(message.utf16())); + } else { + wchar_t *messagePart = new wchar_t[maxOutputStringLength + 1]; + for (int i = 0; i < message.length(); i += maxOutputStringLength ) { + const int length = std::min(message.length() - i, maxOutputStringLength ); + const int len = message.mid(i, length).toWCharArray(messagePart); + Q_ASSERT(len == length); + messagePart[len] = 0; + OutputDebugString(messagePart); + } + delete[] messagePart; + } +} + static bool win_message_handler(QtMsgType type, const QMessageLogContext &context, const QString &message) { if (shouldLogToStderr()) return false; // Leave logging up to stderr handler - QString formattedMessage = qFormatLogMessage(type, context, message); - formattedMessage.append(QLatin1Char('\n')); - OutputDebugString(reinterpret_cast(formattedMessage.utf16())); + const QString formattedMessage = qFormatLogMessage(type, context, message).append('\n'); + win_outputDebugString_helper(formattedMessage); return true; // Prevent further output to stderr } @@ -1832,11 +1852,11 @@ static void qt_message_print(QtMsgType msgType, const QMessageLogContext &contex static void qt_message_print(const QString &message) { #if defined(Q_OS_WINRT) - OutputDebugString(reinterpret_cast(message.utf16())); + win_outputDebugString_helper(message); return; #elif defined(Q_OS_WIN) && !defined(QT_BOOTSTRAPPED) if (!shouldLogToStderr()) { - OutputDebugString(reinterpret_cast(message.utf16())); + win_outputDebugString_helper(message); return; } #endif -- cgit v1.2.3 From 056230cc9c3309823a93df0e34c92affb29df9e4 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 28 Jan 2020 14:32:06 -0800 Subject: qfloat16: include the tables in AVX2 binaries regardless Having a QtCore build optimized for AVX2 does not imply all user binaries and libraries are optimized the same way. Most of them will actually have been built for the base platform, which means they require access to these tables to operate if they are using qfloat16. Introduced by 5e40d3d982d014cd01db4dbe6aecc6ea6baf840a. Change-Id: If79a52e476594446baccfffd15ee2da9e3693cce Reviewed-by: Allan Sandfeld Jensen --- src/corelib/global/qfloat16tables.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qfloat16tables.cpp b/src/corelib/global/qfloat16tables.cpp index 3d764937d7..b87986d6b8 100644 --- a/src/corelib/global/qfloat16tables.cpp +++ b/src/corelib/global/qfloat16tables.cpp @@ -44,7 +44,7 @@ QT_BEGIN_NAMESPACE -#if !defined(__F16C__) && !defined(__ARM_FP16_FORMAT_IEEE) +#if !defined(__ARM_FP16_FORMAT_IEEE) const quint32 qfloat16::mantissatable[2048] = { 0, -- cgit v1.2.3 From c3050b6d96d636e53ead46c1009b83453565221c Mon Sep 17 00:00:00 2001 From: Sze Howe Koh Date: Sun, 26 Jan 2020 16:52:47 +0800 Subject: Rename Qt::ReturnByValue_t -> Qt::ReturnByValueConstant Copy the convention of QDeadlineTimer::ForeverConstant Task-number: QTBUG-48701 Change-Id: Ic7760b7ffec630f1cd47361f5adda3f17fffb9f6 Reviewed-by: Richard Moe Gustavsen Reviewed-by: Lars Knoll --- src/corelib/global/qnamespace.h | 2 +- src/corelib/global/qnamespace.qdoc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/corelib/global') diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index ea2c635303..17ae73536d 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -1770,7 +1770,7 @@ public: }; // QTBUG-48701 - enum ReturnByValue_t { ReturnByValue }; // ### Qt 7: Remove me + enum ReturnByValueConstant { ReturnByValue }; // ### Qt 7: Remove me #ifndef Q_QDOC // NOTE: Generally, do not add QT_Q_ENUM if a corresponding Q_Q_FLAG exists. diff --git a/src/corelib/global/qnamespace.qdoc b/src/corelib/global/qnamespace.qdoc index 6a84662323..708ecb11ab 100644 --- a/src/corelib/global/qnamespace.qdoc +++ b/src/corelib/global/qnamespace.qdoc @@ -3334,7 +3334,7 @@ */ /*! - \enum Qt::ReturnByValue_t + \enum Qt::ReturnByValueConstant \since 5.15 This is a dummy type, designed to help users transition from certain deprecated APIs to their replacement APIs. -- cgit v1.2.3