From d391d4db49bd8a7da8516af9c8ff8083a927bf79 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 5 Dec 2018 10:28:17 +0100 Subject: Fusion: Don't draw the background of the lineedit when drawing the frame MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since only the frame is being drawn here, it should only draw the outline. Otherwise it will override any background drawing done via a stylesheet. Change-Id: I408fc44743747ad369c700b3d52935bfc8826f11 Fixes: QTBUG-71950 Reviewed-by: Friedemann Kleint Reviewed-by: Tor Arne Vestbø --- src/widgets/styles/qfusionstyle.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src') diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index df151067df..c565932889 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -725,7 +725,6 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem, // Draw Outline painter->setPen( QPen(hasFocus ? highlightedOutline : outline)); - painter->setBrush(option->palette.base()); painter->drawRoundedRect(r.adjusted(0, 0, -1, -1), 2, 2); if (hasFocus) { -- cgit v1.2.3 From ed90c306f2033eec4a6ac3aa356b2ea41e601160 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 4 Dec 2018 10:36:44 +0100 Subject: Fix addition of the wasm platform plugin Add the plugin; do not replace the whole SUBDIRS value. Fixes: QTBUG-70375 Change-Id: Id40a69f54dfde5eb88894323c7e1146b6cad5a75 Reviewed-by: Friedemann Kleint --- src/plugins/platforms/platforms.pro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro index 5bf2b77421..db2a31d1a5 100644 --- a/src/plugins/platforms/platforms.pro +++ b/src/plugins/platforms/platforms.pro @@ -46,7 +46,7 @@ haiku { SUBDIRS += haiku } -wasm: SUBDIRS = wasm +wasm: SUBDIRS += wasm qtConfig(mirclient): SUBDIRS += mirclient -- cgit v1.2.3 From d43ac840e5d5a0a2df9e8adce276c956c98be6aa Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 4 Dec 2018 18:42:54 +0100 Subject: Specify the date-time spec when setting max time QDateTimeEdit::setMaximumTime() constructed a QDateTime from the given time and its current max date without propagating its existing spec; it thus got a local time. All other QDateTimeEdit methods setting bounds do propagate the spec. So bring setMaximumTime() in line with the others. Fixes: QTBUG-71311 Change-Id: Ic97d22185f76bed46bc8d2884b131942874d9a0a Reviewed-by: Anton Kudryavtsev Reviewed-by: Konstantin Shegunov Reviewed-by: Thiago Macieira --- src/widgets/widgets/qdatetimeedit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index 68bfd175ff..c66400f423 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -553,7 +553,7 @@ void QDateTimeEdit::setMaximumTime(const QTime &max) { Q_D(QDateTimeEdit); if (max.isValid()) { - const QDateTime m(d->maximum.toDate(), max); + const QDateTime m(d->maximum.toDate(), max, d->spec); setMaximumDateTime(m); } } -- cgit v1.2.3 From d99b3c451b31b935be914e6238fa631dba0aafc6 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Mon, 10 Dec 2018 08:33:14 +0100 Subject: ANGLE: Dynamically load D3D compiler from a list If the default compiler cannot be found, load it from a list of DLL names, including a non-versioned proxy DLL provided by Qt. On Desktop Windows, the default compiler can also be specified by an environment variable, QT_D3DCOMPILER_DLL. Change-Id: I590bb11e58339451d187860c449b0209c1ca0578 Reviewed-by: Dmitry Kazakov Reviewed-by: Andre de la Rocha Reviewed-by: Ville Voutilainen --- .../src/libANGLE/renderer/d3d/HLSLCompiler.cpp | 25 +++++++++ ...Dynamically-load-D3D-compiler-from-a-list.patch | 59 ++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 src/angle/patches/0012-ANGLE-Dynamically-load-D3D-compiler-from-a-list.patch (limited to 'src') diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp index b38765070b..5d47308d67 100644 --- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp +++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp @@ -14,6 +14,10 @@ #include "libANGLE/histogram_macros.h" #include "third_party/trace_event/trace_event.h" +#ifndef QT_D3DCOMPILER_DLL +#define QT_D3DCOMPILER_DLL D3DCOMPILER_DLL +#endif + #if ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO == ANGLE_ENABLED namespace { @@ -130,6 +134,27 @@ gl::Error HLSLCompiler::ensureInitialized() } #endif // ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES + // Load the compiler DLL specified by the environment, or default to QT_D3DCOMPILER_DLL + const wchar_t *defaultCompiler = _wgetenv(L"QT_D3DCOMPILER_DLL"); + if (!defaultCompiler) + defaultCompiler = QT_D3DCOMPILER_DLL; + + const wchar_t *compilerDlls[] = { + defaultCompiler, + L"d3dcompiler_47.dll", + L"d3dcompiler_46.dll", + L"d3dcompiler_43.dll", + 0 + }; + + // Load the first available known compiler DLL + for (int i = 0; compilerDlls[i]; ++i) + { + mD3DCompilerModule = LoadLibrary(compilerDlls[i]); + if (mD3DCompilerModule) + break; + } + if (!mD3DCompilerModule) { // Load the version of the D3DCompiler DLL associated with the Direct3D version ANGLE was built with. diff --git a/src/angle/patches/0012-ANGLE-Dynamically-load-D3D-compiler-from-a-list.patch b/src/angle/patches/0012-ANGLE-Dynamically-load-D3D-compiler-from-a-list.patch new file mode 100644 index 0000000000..7009dec1ba --- /dev/null +++ b/src/angle/patches/0012-ANGLE-Dynamically-load-D3D-compiler-from-a-list.patch @@ -0,0 +1,59 @@ +From dff9676c60c51fa7af0749e1cb54305f112183e3 Mon Sep 17 00:00:00 2001 +From: Oliver Wolff +Date: Mon, 10 Dec 2018 08:33:14 +0100 +Subject: [PATCH] ANGLE: Dynamically load D3D compiler from a list + +If the default compiler cannot be found, load it from a list of DLL names, +including a non-versioned proxy DLL provided by Qt. On Desktop Windows, +the default compiler can also be specified by an environment variable, +QT_D3DCOMPILER_DLL. +--- + src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp | 25 +++++++++++++++++++++++++ + 1 file changed, 25 insertions(+) + +diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp +index b38765070..5d47308d6 100644 +--- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp ++++ b/src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp +@@ -14,6 +14,10 @@ + #include "libANGLE/histogram_macros.h" + #include "third_party/trace_event/trace_event.h" + ++#ifndef QT_D3DCOMPILER_DLL ++#define QT_D3DCOMPILER_DLL D3DCOMPILER_DLL ++#endif ++ + #if ANGLE_APPEND_ASSEMBLY_TO_SHADER_DEBUG_INFO == ANGLE_ENABLED + namespace + { +@@ -130,6 +134,27 @@ gl::Error HLSLCompiler::ensureInitialized() + } + #endif // ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES + ++ // Load the compiler DLL specified by the environment, or default to QT_D3DCOMPILER_DLL ++ const wchar_t *defaultCompiler = _wgetenv(L"QT_D3DCOMPILER_DLL"); ++ if (!defaultCompiler) ++ defaultCompiler = QT_D3DCOMPILER_DLL; ++ ++ const wchar_t *compilerDlls[] = { ++ defaultCompiler, ++ L"d3dcompiler_47.dll", ++ L"d3dcompiler_46.dll", ++ L"d3dcompiler_43.dll", ++ 0 ++ }; ++ ++ // Load the first available known compiler DLL ++ for (int i = 0; compilerDlls[i]; ++i) ++ { ++ mD3DCompilerModule = LoadLibrary(compilerDlls[i]); ++ if (mD3DCompilerModule) ++ break; ++ } ++ + if (!mD3DCompilerModule) + { + // Load the version of the D3DCompiler DLL associated with the Direct3D version ANGLE was built with. +-- +2.15.0.windows.1 + -- cgit v1.2.3 From 9400a120ead81b0fa63d968b8d9ac9bde8addc43 Mon Sep 17 00:00:00 2001 From: Paul Wicking Date: Tue, 11 Dec 2018 13:17:07 +0100 Subject: Doc: Fix typo in snippet Resolves "reference to non-static member function must be called" error. Fixes: QTBUG-72403 Change-Id: Iebd865ff553736df43548b72b45ed3f4711fffc1 Reviewed-by: Jesus Fernandez --- src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp b/src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp index 50afe7c0ff..c4dd9fea18 100644 --- a/src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp +++ b/src/gui/doc/snippets/code/src_gui_vulkan_qvulkaninstance.cpp @@ -102,7 +102,7 @@ } bool event(QEvent *e) { - if (e->type == QEvent::UpdateRequest) + if (e->type() == QEvent::UpdateRequest) render(); return QWindow::event(e); } -- cgit v1.2.3 From 9fbce8d5cbcc9d8d255328d6ec040db0510ca289 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 10 Dec 2018 11:06:26 +0100 Subject: Avoid crash in blitting or fast draw when QPointF is too big Change-Id: I88182d5d95fda15d33836f16dee78167685b3765 Fixes: QTBUG-72392 Reviewed-by: Friedemann Kleint Reviewed-by: Tim Jenssen --- src/gui/painting/qpaintengine_raster.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp index 7caaf3a8fa..90b6d16551 100644 --- a/src/gui/painting/qpaintengine_raster.cpp +++ b/src/gui/painting/qpaintengine_raster.cpp @@ -997,6 +997,10 @@ void QRasterPaintEnginePrivate::drawImage(const QPointF &pt, { if (alpha == 0 || !clip.isValid()) return; + if (pt.x() > qreal(clip.right()) || pt.y() > qreal(clip.bottom())) + return; + if ((pt.x() + img.width()) < qreal(clip.left()) || (pt.y() + img.height()) < qreal(clip.top())) + return; Q_ASSERT(img.depth() >= 8); @@ -1063,6 +1067,10 @@ void QRasterPaintEnginePrivate::blitImage(const QPointF &pt, { if (!clip.isValid()) return; + if (pt.x() > qreal(clip.right()) || pt.y() > qreal(clip.bottom())) + return; + if ((pt.x() + img.width()) < qreal(clip.left()) || (pt.y() + img.height()) < qreal(clip.top())) + return; Q_ASSERT(img.depth() >= 8); -- cgit v1.2.3 From 6b52c1834daec628bab5a384e1dfd039937b375d Mon Sep 17 00:00:00 2001 From: "R.J.V. Bertin" Date: Wed, 5 Dec 2018 18:47:47 +0100 Subject: Offscreen QPA: use a CoreText font database on macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this applications using the Offscreen QPA don't have access to any fonts on macOS and thus cannot render text correctly. Task-number: QTBUG-72335 Change-Id: I8e58c066365d0231d0993ad3b480d957a32f7f7b Reviewed-by: Tor Arne Vestbø Reviewed-by: Allan Sandfeld Jensen Reviewed-by: Friedemann Kleint --- src/plugins/platforms/offscreen/qoffscreenintegration.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp index 01cd254501..9815be16a3 100644 --- a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp +++ b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp @@ -45,6 +45,7 @@ #include #if defined(Q_OS_MAC) #include +#include #else #include #endif @@ -67,6 +68,8 @@ QT_BEGIN_NAMESPACE +class QCoreTextFontEngine; + template class QOffscreenEventDispatcher : public BaseEventDispatcher { @@ -101,7 +104,7 @@ QOffscreenIntegration::QOffscreenIntegration() { #if defined(Q_OS_UNIX) #if defined(Q_OS_MAC) - m_fontDatabase.reset(new QPlatformFontDatabase()); + m_fontDatabase.reset(new QCoreTextFontDatabaseEngineFactory); #else m_fontDatabase.reset(new QGenericUnixFontDatabase()); #endif -- cgit v1.2.3 From ab448f731ecd8437c7c5c8b96a0e7f419ec3a7ca Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 2 Oct 2018 19:02:29 +0200 Subject: Handle QCollator with locale C by delegating to QString Previously, the C locale was treated as English because each back-end takes the locale's bcp47Name(), which maps C to en. However, the C locale has its own rules; which QString helpfully implements; so we can delegate to it in this case. Extended this to sort keys, where possible. Clean up existing implementations in the process. Extended tst_QCollator::compare() with some cases to check this. That required wrapping the test's calls to collator.compare() in a sign canonicalizer, since it can return any -ve for < or +ve for >, not just -1 and +1 for these cases (and it'd be rash to hard-code specific negative and positive values, as they may vary between backends). [ChangeLog][QtCore][QCollator] Added support for collation in the C locale, albeit this is only well-defined for ASCII. Collation sort keys remain unsupported on Darwin. Fixes: QTBUG-58621 Change-Id: I327010d90f09bd1b1816f5590cb124e3d423e61d Reviewed-by: Thiago Macieira --- src/corelib/tools/qcollator.cpp | 3 ++- src/corelib/tools/qcollator_icu.cpp | 4 ++++ src/corelib/tools/qcollator_macx.cpp | 20 +++++++++++++++++ src/corelib/tools/qcollator_p.h | 1 + src/corelib/tools/qcollator_posix.cpp | 41 ++++++++++++++++++++--------------- src/corelib/tools/qcollator_win.cpp | 7 ++++++ 6 files changed, 57 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/qcollator.cpp b/src/corelib/tools/qcollator.cpp index 1cf223aae6..4315d35a52 100644 --- a/src/corelib/tools/qcollator.cpp +++ b/src/corelib/tools/qcollator.cpp @@ -79,7 +79,6 @@ QT_BEGIN_NAMESPACE QCollator::QCollator(const QLocale &locale) : d(new QCollatorPrivate(locale)) { - d->init(); } /*! @@ -323,6 +322,8 @@ bool QCollator::ignorePunctuation() const methods directly. But if the string is compared repeatedly (e.g. when sorting a whole list of strings), it's usually faster to create the sort keys for each string and then sort using the keys. + + \note Not supported with the C (a.k.a. POSIX) locale on Darwin. */ /*! diff --git a/src/corelib/tools/qcollator_icu.cpp b/src/corelib/tools/qcollator_icu.cpp index fd621983d3..ab45b9a1a1 100644 --- a/src/corelib/tools/qcollator_icu.cpp +++ b/src/corelib/tools/qcollator_icu.cpp @@ -55,6 +55,8 @@ QT_BEGIN_NAMESPACE void QCollatorPrivate::init() { cleanup(); + if (isC()) + return; UErrorCode status = U_ZERO_ERROR; QByteArray name = QLocalePrivate::get(locale)->bcp47Name('_'); @@ -140,6 +142,8 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const { if (d->dirty) d->init(); + if (d->isC()) + return QCollatorSortKey(new QCollatorSortKeyPrivate(string.toUtf8())); if (d->collator) { QByteArray result(16 + string.size() + (string.size() >> 2), Qt::Uninitialized); diff --git a/src/corelib/tools/qcollator_macx.cpp b/src/corelib/tools/qcollator_macx.cpp index 9aa59a81dc..42e67e0c12 100644 --- a/src/corelib/tools/qcollator_macx.cpp +++ b/src/corelib/tools/qcollator_macx.cpp @@ -55,6 +55,15 @@ QT_BEGIN_NAMESPACE void QCollatorPrivate::init() { cleanup(); + /* + LocaleRefFromLocaleString() will accept "POSIX" as the locale name, but + the locale it produces (named "pos") doesn't implement the [A-Z] < [a-z] + behavior we expect of the C locale. We can use QStringView to get round + that for collation, but this leaves no way to do a sort key. + */ + if (isC()) + return; + LocaleRef localeRef; int rc = LocaleRefFromLocaleString(QLocalePrivate::get(locale)->bcp47Name().constData(), &localeRef); if (rc != 0) @@ -92,6 +101,8 @@ int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2) con { if (d->dirty) d->init(); + if (!d->collator) + return QStringView(s1, len1).compare(QStringView(s2, len2), caseSensitivity()); SInt32 result; Boolean equivalent; @@ -104,6 +115,7 @@ int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2) con return 0; return result < 0 ? -1 : 1; } + int QCollator::compare(const QString &str1, const QString &str2) const { return compare(str1.constData(), str1.size(), str2.constData(), str2.size()); @@ -118,6 +130,11 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const { if (d->dirty) d->init(); + if (!d->collator) { + // What should (or even *can*) we do here ? (See init()'s comment.) + qWarning("QCollator doesn't support sort keys for the C locale on Darwin"); + return QCollatorSortKey(nullptr); + } //Documentation recommends having it 5 times as big as the input QVector ret(string.size() * 5); @@ -136,6 +153,9 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const int QCollatorSortKey::compare(const QCollatorSortKey &key) const { + if (!d.data()) + return 0; + SInt32 order; UCCompareCollationKeys(d->m_key.data(), d->m_key.size(), key.d->m_key.data(), key.d->m_key.size(), diff --git a/src/corelib/tools/qcollator_p.h b/src/corelib/tools/qcollator_p.h index e89c08447c..361c3fb987 100644 --- a/src/corelib/tools/qcollator_p.h +++ b/src/corelib/tools/qcollator_p.h @@ -110,6 +110,7 @@ public: QCollatorPrivate(const QLocale &locale) : locale(locale) {} ~QCollatorPrivate() { cleanup(); } + bool isC() { return locale.language() == QLocale::C; } void clear() { cleanup(); diff --git a/src/corelib/tools/qcollator_posix.cpp b/src/corelib/tools/qcollator_posix.cpp index 42413a4a82..81f97a02e1 100644 --- a/src/corelib/tools/qcollator_posix.cpp +++ b/src/corelib/tools/qcollator_posix.cpp @@ -48,10 +48,12 @@ QT_BEGIN_NAMESPACE void QCollatorPrivate::init() { - if (locale != QLocale()) - qWarning("Only default locale supported with the posix collation implementation"); - if (caseSensitivity != Qt::CaseSensitive) - qWarning("Case insensitive sorting unsupported in the posix collation implementation"); + if (!isC()) { + if (locale != QLocale()) + qWarning("Only C and default locale supported with the posix collation implementation"); + if (caseSensitivity != Qt::CaseSensitive) + qWarning("Case insensitive sorting unsupported in the posix collation implementation"); + } if (numericMode) qWarning("Numeric mode unsupported in the posix collation implementation"); if (ignorePunctuation) @@ -73,14 +75,16 @@ static void stringToWCharArray(QVarLengthArray &ret, const QString &str int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2) const { - QVarLengthArray array1, array2; - stringToWCharArray(array1, QString(s1, len1)); - stringToWCharArray(array2, QString(s2, len2)); - return std::wcscoll(array1.constData(), array2.constData()); + return compare(QString::fromRawData(s1, len1), QString::fromRawData(s2, len2)); } int QCollator::compare(const QString &s1, const QString &s2) const { + if (d->isC()) + return s1.compare(s2, caseSensitivity()); + if (d->dirty) + d->init(); + QVarLengthArray array1, array2; stringToWCharArray(array1, s1); stringToWCharArray(array2, s2); @@ -89,10 +93,7 @@ int QCollator::compare(const QString &s1, const QString &s2) const int QCollator::compare(const QStringRef &s1, const QStringRef &s2) const { - if (d->dirty) - d->init(); - - return compare(s1.constData(), s1.size(), s2.constData(), s2.size()); + return compare(s1.toString(), s2.toString()); } QCollatorSortKey QCollator::sortKey(const QString &string) const @@ -102,14 +103,18 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const QVarLengthArray original; stringToWCharArray(original, string); - QVector result(string.size()); - size_t size = std::wcsxfrm(result.data(), original.constData(), string.size()); - if (size > uint(result.size())) { + QVector result(original.size()); + if (d->isC()) { + std::copy(original.cbegin(), original.cend(), result.begin()); + } else { + size_t size = std::wcsxfrm(result.data(), original.constData(), string.size()); + if (size > uint(result.size())) { + result.resize(size+1); + size = std::wcsxfrm(result.data(), original.constData(), string.size()); + } result.resize(size+1); - size = std::wcsxfrm(result.data(), original.constData(), string.size()); + result[size] = 0; } - result.resize(size+1); - result[size] = 0; return QCollatorSortKey(new QCollatorSortKeyPrivate(std::move(result))); } diff --git a/src/corelib/tools/qcollator_win.cpp b/src/corelib/tools/qcollator_win.cpp index 5a838c1b50..35142bb8b8 100644 --- a/src/corelib/tools/qcollator_win.cpp +++ b/src/corelib/tools/qcollator_win.cpp @@ -60,6 +60,8 @@ extern LCID qt_inIsoNametoLCID(const char *name); void QCollatorPrivate::init() { collator = 0; + if (isC()) + return; #ifndef USE_COMPARESTRINGEX localeID = qt_inIsoNametoLCID(QLocalePrivate::get(locale)->bcp47Name().constData()); @@ -86,6 +88,9 @@ void QCollatorPrivate::cleanup() int QCollator::compare(const QChar *s1, int len1, const QChar *s2, int len2) const { + if (d->isC()) + return QString::compare_helper(s1, len1, s2, len2, d->caseSensitivity); + if (d->dirty) d->init(); @@ -119,6 +124,8 @@ QCollatorSortKey QCollator::sortKey(const QString &string) const { if (d->dirty) d->init(); + if (d->isC()) + return QCollatorSortKey(new QCollatorSortKeyPrivate(string)); #ifndef USE_COMPARESTRINGEX int size = LCMapStringW(d->localeID, LCMAP_SORTKEY | d->collator, -- cgit v1.2.3 From 589f9f179cd0f570db22f15941625d911f6b7721 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 4 Dec 2018 12:51:12 +0100 Subject: QFileDialog: Remember last visited directory correctly QFileDialogPrivate::init() sets the working directory derived from the URL passed in, causing the lastVisitedDir to be set. This in turn prevented the restoreState() logic from setting the directory retrieved from the file. Clear lastVisitedDir in init() in case the initial URL was invalid. Fixes: QTBUG-70798 Change-Id: I19084e24eb6d469330c4dd8c50495b4996279189 Reviewed-by: Richard Moe Gustavsen --- src/widgets/dialogs/qfiledialog.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 69496dbd29..eb3479b3e0 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -2866,7 +2866,11 @@ void QFileDialogPrivate::init(const QUrl &directory, const QString &nameFilter, q->setFileMode(QFileDialog::AnyFile); if (!nameFilter.isEmpty()) q->setNameFilter(nameFilter); + // QTBUG-70798, prevent the default blocking the restore logic. + const bool dontStoreDir = !directory.isValid() && !lastVisitedDir()->isValid(); q->setDirectoryUrl(workingDirectory(directory)); + if (dontStoreDir) + lastVisitedDir()->clear(); if (directory.isLocalFile()) q->selectFile(initialSelection(directory)); else -- cgit v1.2.3 From da37291f285403f748d8fd9f8103d341f3082d45 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Sun, 11 Nov 2018 15:27:01 +0000 Subject: When warning about invalid style override also print available ones Change-Id: Ia017a342648a1f1e1185e74ddec1a77cb6dcfebe Reviewed-by: Friedemann Kleint --- src/widgets/kernel/qapplication.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 2410daf047..f9db6155af 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -1064,8 +1064,10 @@ QStyle *QApplication::style() if (!QApplicationPrivate::styleOverride.isEmpty()) { const QString style = QApplicationPrivate::styleOverride.toLower(); app_style = QStyleFactory::create(style); - if (!app_style) - qWarning("QApplication: invalid style override passed, ignoring it."); + if (Q_UNLIKELY(!app_style)) { + qWarning("QApplication: invalid style override passed, ignoring it.\n" + " Available styles: %s", qPrintable(QStyleFactory::keys().join(QLatin1String(", ")))); + } } if (!app_style) app_style = QStyleFactory::create(QApplicationPrivate::desktopStyleKey()); -- cgit v1.2.3 From d1cafa3ebac00f60cab3ca2beed6ebf2e6579a94 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 12 Dec 2018 10:46:32 +0100 Subject: qt_imageFromWinHBITMAP(): Fix memory corruption when converting from bitmaps with low depths Insufficient memory was allocated when asking GetDIBits() to convert to 32bit. Fix allocation size and use a QScopedArrayPointer. Fixes: QTBUG-72343 Change-Id: I45f79c913a243316e01bc6efed08e50ccc7d25f4 Reviewed-by: Eirik Aavitsland --- src/gui/image/qpixmap_win.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/image/qpixmap_win.cpp b/src/gui/image/qpixmap_win.cpp index b8d13ac092..b5f8d43041 100644 --- a/src/gui/image/qpixmap_win.cpp +++ b/src/gui/image/qpixmap_win.cpp @@ -422,8 +422,11 @@ static QImage imageFromWinHBITMAP_GetDiBits(HBITMAP bitmap, bool forceQuads, int if (info.bmiHeader.biHeight > 0) // Force top-down info.bmiHeader.biHeight = -info.bmiHeader.biHeight; info.bmiHeader.biCompression = BI_RGB; // Extract using no compression (can be BI_BITFIELD) - if (forceQuads) + size_t allocSize = info.bmiHeader.biSizeImage; + if (forceQuads) { info.bmiHeader.biBitCount = 32; + allocSize = info.bmiHeader.biWidth * qAbs(info.bmiHeader.biHeight) * 4; + } const QImage::Format imageFormat = imageFromWinHBITMAP_Format(info.bmiHeader, hbitmapFormat); if (imageFormat == QImage::Format_Invalid) { @@ -431,7 +434,7 @@ static QImage imageFromWinHBITMAP_GetDiBits(HBITMAP bitmap, bool forceQuads, int return QImage(); } - QScopedPointer data(new uchar[info.bmiHeader.biSizeImage]); + QScopedArrayPointer data(new uchar[allocSize]); if (!GetDIBits(displayDc, bitmap, 0, qAbs(info.bmiHeader.biHeight), data.data(), &info, DIB_RGB_COLORS)) { qErrnoWarning("%s: GetDIBits() failed to get data.", __FUNCTION__); return QImage(); -- cgit v1.2.3 From 2c6ec2c653af7f04bb98c6403b2e406cd493a8ab Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 4 Dec 2018 14:02:26 -0800 Subject: Fix tautological compare in error checking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit size is size_t, so it's never less than zero. Fixes: QTBUG-72286 Change-Id: Idd0c85a4e7b64f9c9c7dfffd156d404d0de5ed8d Reviewed-by: Oliver Wolff Reviewed-by: Mårten Nordheim --- src/corelib/codecs/qwindowscodec.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/codecs/qwindowscodec.cpp b/src/corelib/codecs/qwindowscodec.cpp index 813d3c8153..6b703f7517 100644 --- a/src/corelib/codecs/qwindowscodec.cpp +++ b/src/corelib/codecs/qwindowscodec.cpp @@ -179,7 +179,7 @@ QString QWindowsLocalCodec::convertToUnicodeCharByChar(const char *chars, int le #else QString s; size_t size = mbstowcs(NULL, mb, length); - if (size < 0) { + if (size == size_t(-1)) { Q_ASSERT("Error in CE TextCodec"); return QString(); } -- cgit v1.2.3 From 32fd79a20fb9b99913bba1537067f5dc8dd96a38 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 30 Nov 2018 16:53:12 +0100 Subject: QAbstractSlider: fix invertedControls having no effect for left/right keys There was a comment in the code that said: // It seems we need to use invertedAppearance for Left and right, otherwise, things look weird. It's not clear what that was referring to, but in its current state, a slider with invertedControls set to true will not behave as expected: pressing the left arrow key will decrease its value instead of increasing it, and vice versa for the right arrow key. As stated in the documentation (and by its name), invertedAppearance only controls the appearance of the slider, and not the effect of key events. Remove the comment and use invertedControls instead. Change-Id: I13296cbda9244413978ef0d7f0856065f74fd0bf Fixes: QTBUG-25988 Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qabstractslider.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/widgets/widgets/qabstractslider.cpp b/src/widgets/widgets/qabstractslider.cpp index 99ee1eccb7..2172ebc99c 100644 --- a/src/widgets/widgets/qabstractslider.cpp +++ b/src/widgets/widgets/qabstractslider.cpp @@ -829,7 +829,6 @@ void QAbstractSlider::keyPressEvent(QKeyEvent *ev) break; #endif - // It seems we need to use invertedAppearance for Left and right, otherwise, things look weird. case Qt::Key_Left: #ifdef QT_KEYPAD_NAVIGATION // In QApplication::KeypadNavigationDirectional, we want to change the slider @@ -848,9 +847,9 @@ void QAbstractSlider::keyPressEvent(QKeyEvent *ev) else #endif if (isRightToLeft()) - action = d->invertedAppearance ? SliderSingleStepSub : SliderSingleStepAdd; + action = d->invertedControls ? SliderSingleStepSub : SliderSingleStepAdd; else - action = !d->invertedAppearance ? SliderSingleStepSub : SliderSingleStepAdd; + action = !d->invertedControls ? SliderSingleStepSub : SliderSingleStepAdd; break; case Qt::Key_Right: #ifdef QT_KEYPAD_NAVIGATION @@ -868,9 +867,9 @@ void QAbstractSlider::keyPressEvent(QKeyEvent *ev) else #endif if (isRightToLeft()) - action = d->invertedAppearance ? SliderSingleStepAdd : SliderSingleStepSub; + action = d->invertedControls ? SliderSingleStepAdd : SliderSingleStepSub; else - action = !d->invertedAppearance ? SliderSingleStepAdd : SliderSingleStepSub; + action = !d->invertedControls ? SliderSingleStepAdd : SliderSingleStepSub; break; case Qt::Key_Up: #ifdef QT_KEYPAD_NAVIGATION -- cgit v1.2.3 From 3c3a2eb3cea0bbb0b45e43278421e051c253e434 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 14 Dec 2018 09:27:15 +0100 Subject: uic: Generate version check macros around newly introduced palette color role MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change ebd3a13b807c6af2684b42d3912549caf7ef82aa introduced a new QPaletter::PlaceholderText color role which causes the uic-generated code not to compile when using Qt Designer embedded in Qt Creator with older (5.9 LTS) kits. Generate a version check macro to fix this. Change-Id: I6d9f7edb0c6047c2f64ef3357b29f91655c52aac Fixes: QTBUG-72555 Reviewed-by: Lars Knoll Reviewed-by: Christian Ehrlicher Reviewed-by: André Hartmann --- src/tools/uic/cpp/cppwriteinitialization.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/uic/cpp/cppwriteinitialization.cpp b/src/tools/uic/cpp/cppwriteinitialization.cpp index 4f6ac1eb97..7ab6c31cb2 100644 --- a/src/tools/uic/cpp/cppwriteinitialization.cpp +++ b/src/tools/uic/cpp/cppwriteinitialization.cpp @@ -35,6 +35,7 @@ #include "globaldefs.h" #include +#include #include #include @@ -1765,6 +1766,13 @@ QString WriteInitialization::domColor2QString(const DomColor *c) .arg(c->elementBlue()); } +static inline QVersionNumber colorRoleVersionAdded(const QString &roleName) +{ + if (roleName == QLatin1String("PlaceholderText")) + return QVersionNumber(5, 12, 0); + return QVersionNumber(); +} + void WriteInitialization::writeColorGroup(DomColorGroup *colorGroup, const QString &group, const QString &paletteName) { if (!colorGroup) @@ -1785,10 +1793,19 @@ void WriteInitialization::writeColorGroup(DomColorGroup *colorGroup, const QStri const auto &colorRoles = colorGroup->elementColorRole(); for (const DomColorRole *colorRole : colorRoles) { if (colorRole->hasAttributeRole()) { + const QString roleName = colorRole->attributeRole(); + const QVersionNumber versionAdded = colorRoleVersionAdded(roleName); const QString brushName = writeBrushInitialization(colorRole->elementBrush()); + if (!versionAdded.isNull()) { + m_output << "#if QT_VERSION >= QT_VERSION_CHECK(" + << versionAdded.majorVersion() << ", " << versionAdded.minorVersion() + << ", " << versionAdded.microVersion() << ")\n"; + } m_output << m_indent << paletteName << ".setBrush(" << group - << ", " << "QPalette::" << colorRole->attributeRole() + << ", " << "QPalette::" << roleName << ", " << brushName << ");\n"; + if (!versionAdded.isNull()) + m_output << "#endif\n"; } } } -- cgit v1.2.3 From 3e4f8aa8f434d791b3dfe9450bad85b82406d4b3 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 11 Dec 2018 12:48:12 -0800 Subject: Doc: fix null pointer passing to fprintf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When these docs were written, the context.file and context.function pointers were never null. But in commit d78fb442d750b33afe2e41f31588ec94 (Qt 5.4), we made the logging pass null pointers in release builds. The C standard does not say that passing null pointers is permitted. In fact, it says "If no l length modifier is present, the argument shall be a pointer to the initial element of an array of character type." and that's pretty explicit that it needs to point to the initial element of a string. Fixes: QTBUG-72478 Change-Id: I4ac1156702324f0fb814fffd156f624ffefa1445 Reviewed-by: Topi Reiniö --- src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp index 0248640369..03904659f5 100644 --- a/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_global_qglobal.cpp @@ -279,21 +279,23 @@ const TInputType &myMin(const TInputType &value1, const TInputType &value2) void myMessageOutput(QtMsgType type, const QMessageLogContext &context, const QString &msg) { QByteArray localMsg = msg.toLocal8Bit(); + const char *file = context.file ? context.file : ""; + const char *function = context.function ? context.function : ""; switch (type) { case QtDebugMsg: - fprintf(stderr, "Debug: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function); + fprintf(stderr, "Debug: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function); break; case QtInfoMsg: - fprintf(stderr, "Info: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function); + fprintf(stderr, "Info: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function); break; case QtWarningMsg: - fprintf(stderr, "Warning: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function); + fprintf(stderr, "Warning: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function); break; case QtCriticalMsg: - fprintf(stderr, "Critical: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function); + fprintf(stderr, "Critical: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function); break; case QtFatalMsg: - fprintf(stderr, "Fatal: %s (%s:%u, %s)\n", localMsg.constData(), context.file, context.line, context.function); + fprintf(stderr, "Fatal: %s (%s:%u, %s)\n", localMsg.constData(), file, context.line, function); break; } } -- cgit v1.2.3 From a227ea5bd5af50ac6f874ecf764858a43c53cada Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 10 Dec 2018 15:18:07 +0100 Subject: Fix warnings building with --std=c++11 and gcc 8 Silence warnings about signed constants being shifted out of int range. Change-Id: I5dc397de71f4de09e54ce3cbc0f8e3a1cf977b03 Reviewed-by: Thiago Macieira --- src/corelib/io/qdebug.h | 2 +- src/opengl/qgl.cpp | 2 +- src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/corelib/io/qdebug.h b/src/corelib/io/qdebug.h index ae1869f89e..9d1ce51da5 100644 --- a/src/corelib/io/qdebug.h +++ b/src/corelib/io/qdebug.h @@ -96,7 +96,7 @@ class Q_CORE_EXPORT QDebug void setVerbosity(int v) { if (context.version > 1) { - flags &= ~(VerbosityMask << VerbosityShift); + flags &= ~(uint(VerbosityMask) << VerbosityShift); flags |= (v & VerbosityMask) << VerbosityShift; } } diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index a5556ccee3..ba4a1dcaa1 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -157,7 +157,7 @@ class QGLDefaultOverlayFormat: public QGLFormat public: inline QGLDefaultOverlayFormat() { - setOption(QGL::FormatOption(0xffff << 16)); // turn off all options + setOption(QGL::FormatOption(0xffffU << 16)); // turn off all options setOption(QGL::DirectRendering); setPlane(1); } diff --git a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp index 7b4f6aa107..04a5026395 100644 --- a/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp +++ b/src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp @@ -591,7 +591,7 @@ static void convertRGBToARGB_helper(const uchar *src, uint *dst, int width, int uchar green = src[x + 1]; uchar blue = src[x + 1 + offs]; LcdFilter::filterPixel(red, green, blue); - *dd++ = (0xFF << 24) | (red << 16) | (green << 8) | blue; + *dd++ = (0xFFU << 24) | (red << 16) | (green << 8) | blue; } dst += width; src += src_pitch; @@ -616,7 +616,7 @@ static void convertRGBToARGB_V_helper(const uchar *src, uint *dst, int width, in uchar green = src[x + src_pitch]; uchar blue = src[x + src_pitch + offs]; LcdFilter::filterPixel(red, green, blue); - *dst++ = (0XFF << 24) | (red << 16) | (green << 8) | blue; + *dst++ = (0XFFU << 24) | (red << 16) | (green << 8) | blue; } src += 3*src_pitch; } @@ -637,7 +637,7 @@ static inline void convertGRAYToARGB(const uchar *src, uint *dst, int width, int const uchar * const e = p + width; while (p < e) { uchar gray = *p++; - *dst++ = (0xFF << 24) | (gray << 16) | (gray << 8) | gray; + *dst++ = (0xFFU << 24) | (gray << 16) | (gray << 8) | gray; } src += src_pitch; } -- cgit v1.2.3 From e80bf655e922e9864f8843b5e7bbb47019a6d95a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 7 Dec 2017 19:30:07 +0100 Subject: configure: verify header presence against sources in addition to the actual library resolution, also resolve the headers belonging to the library, to validate the include path, and possibly ensure that the right version of the library is present. the "include" entries were moved out of the "test" objects, and renamed to "headers". this cleanly permits libraries without compile tests. the headers were not put into the sources, because the variance among the includes is generally orthogonal to the variance among the libraries. note that this - like the library resolution - provides no support for darwin frameworks. consequently, the opengl libraries are excluded from the conversion on darwin. similarly, wasm is excluded (centrally), because emcc is magic and would need advanced wizardry to be dealt with. Change-Id: Ib390c75371efa2badcfec9b74274047ce67c3e5a Reviewed-by: Joerg Bornemann Reviewed-by: Paul Wicking --- src/corelib/configure.json | 22 +++++----- src/gui/configure.json | 80 ++++++++++++++++++----------------- src/network/configure.json | 2 +- src/plugins/sqldrivers/configure.json | 33 ++++++--------- src/plugins/sqldrivers/configure.pri | 4 +- src/printsupport/configure.json | 2 +- 6 files changed, 71 insertions(+), 72 deletions(-) (limited to 'src') diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 183eb3a13e..81448174b6 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -24,9 +24,9 @@ "doubleconversion": { "label": "DoubleConversion", "test": { - "include": "double-conversion/double-conversion.h", "main": "(void) double_conversion::StringToDoubleConverter::NO_FLAGS;" }, + "headers": "double-conversion/double-conversion.h", "sources": [ "-ldouble-conversion" ] @@ -35,7 +35,6 @@ "label": "GLib", "test": { "head": "typedef struct _GMainContext GMainContext;", - "include": "glib.h", "main": [ "g_thread_init(NULL);", "(void) g_main_context_default();", @@ -43,6 +42,7 @@ "g_source_add_poll(NULL, NULL);" ] }, + "headers": "glib.h", "sources": [ { "type": "pkgConfig", "args": "glib-2.0 gthread-2.0" } ] @@ -58,7 +58,6 @@ "icu": { "label": "ICU", "test": { - "include": [ "unicode/utypes.h", "unicode/ucol.h", "unicode/ustring.h" ], "main": [ "UErrorCode status = U_ZERO_ERROR;", "UCollator *collator = ucol_open(\"ru_RU\", &status);", @@ -66,6 +65,7 @@ " ucol_close(collator);" ] }, + "headers": [ "unicode/utypes.h", "unicode/ucol.h", "unicode/ustring.h" ], "sources": [ { "builds": { @@ -84,9 +84,9 @@ "journald": { "label": "journald", "test": { - "include": [ "systemd/sd-journal.h", "syslog.h" ], "main": "sd_journal_send(\"PRIORITY=%i\", LOG_INFO, NULL);" }, + "headers": [ "systemd/sd-journal.h", "syslog.h" ], "sources": [ { "type": "pkgConfig", "args": "libsystemd" }, { "type": "pkgConfig", "args": "libsystemd-journal" } @@ -95,7 +95,6 @@ "libatomic": { "label": "64 bit atomics", "test": { - "include": [ "atomic", "cstdint" ], "tail": [ "void test(volatile std::atomic &a)", "{", @@ -114,6 +113,7 @@ ], "qmake": "CONFIG += c++11" }, + "headers": [ "atomic", "cstdint" ], "sources": [ "", "-latomic" @@ -122,13 +122,13 @@ "libdl": { "label": "dlopen()", "test": { - "include": "dlfcn.h", "main": [ "dlclose(dlopen(0, 0));", "dlsym(RTLD_DEFAULT, 0);", "dlerror();" ] }, + "headers": "dlfcn.h", "sources": [ "", "-ldl" @@ -137,9 +137,9 @@ "librt": { "label": "clock_gettime()", "test": { - "include": [ "unistd.h", "time.h" ], "main": "timespec ts; clock_gettime(CLOCK_REALTIME, &ts);" }, + "headers": [ "unistd.h", "time.h" ], "sources": [ "", "-lrt" @@ -148,9 +148,9 @@ "lttng-ust": { "label": "lttng-ust", "test": { - "include": "lttng/ust-events.h", "main": "lttng_session_destroy(nullptr);" }, + "headers": "lttng/ust-events.h", "sources": [ { "type": "pkgConfig", "args": "lttng-ust" }, "-llttng-ust" @@ -161,13 +161,13 @@ "label": "PCRE2", "test": { "head": "#define PCRE2_CODE_UNIT_WIDTH 16", - "include": "pcre2.h", "tail": [ "#if (PCRE2_MAJOR < 10) || ((PCRE2_MAJOR == 10) && (PCRE2_MINOR < 20))", "# error This PCRE version is not supported", "#endif" ] }, + "headers": "pcre2.h", "sources": [ { "type": "pkgConfig", "args": "libpcre2-16" }, "-lpcre2-16" @@ -176,12 +176,12 @@ "pps": { "label": "PPS", "test": { - "include": "sys/pps.h", "main": [ "pps_decoder_t decoder;", "pps_decoder_initialize(&decoder, NULL);" ] }, + "headers": "sys/pps.h", "sources": [ "-lpps" ] @@ -189,10 +189,10 @@ "slog2": { "label": "slog2", "test": { - "include": "sys/slog2.h", "main": "slog2_set_default_buffer((slog2_buffer_t)-1);" }, "export": "", + "headers": "sys/slog2.h", "sources": [ "-lslog2" ] diff --git a/src/gui/configure.json b/src/gui/configure.json index 7585e9c8d4..d0cca08b75 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -67,7 +67,6 @@ "label": "Direct 2D", "export": "", "test": { - "include": [ "d3d11_1.h", "d2d1_1.h", "d2d1_1helper.h", "dxgi1_2.h", "wrl.h", "dwrite.h" ], "tail": "using Microsoft::WRL::ComPtr;", "main": [ "ComPtr d2dFactory;", @@ -76,6 +75,7 @@ "(void) surface;" ] }, + "headers": [ "d3d11_1.h", "d2d1_1.h", "d2d1_1helper.h", "dxgi1_2.h", "wrl.h", "dwrite.h" ], "sources": [ "-ld2d1 -ldwrite -ld3d11" ] @@ -83,13 +83,13 @@ "directfb": { "label": "DirectFB", "test": { - "include": "directfb.h", "tail": [ "#ifdef __typeof__", "# error DirectFB headers are unclean and cannot compile", "#endif" ] }, + "headers": "directfb.h", "sources": [ { "type": "pkgConfig", "args": "directfb" } ] @@ -98,13 +98,13 @@ "label": "DirectWrite", "export": "", "test": { - "include": [ "dwrite.h", "d2d1.h" ], "main": [ "IDWriteFactory *factory = 0;", "DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory),", " (IUnknown **)(&factory));" ] }, + "headers": [ "dwrite.h", "d2d1.h" ], "sources": [ "-ldwrite" ] @@ -117,15 +117,12 @@ "#include ", "extern \"C\" {" ], - "include": [ - "xf86drmMode.h", - "xf86drm.h" - ], "tail": [ "}" ], "main": "(void) drmModeGetCrtc(0, 0);" }, + "headers": [ "xf86drmMode.h", "xf86drm.h" ], "sources": [ { "type": "pkgConfig", "args": "libdrm" }, { "libs": "-ldrm", "condition": "!config.integrity" }, @@ -135,12 +132,12 @@ "egl": { "label": "EGL", "test": { - "include": "EGL/egl.h", "main": [ "EGLint x = 0; EGLDisplay dpy = 0; EGLContext ctx = 0;", "eglDestroyContext(dpy, ctx);" ] }, + "headers": "EGL/egl.h", "sources": [ { "type": "pkgConfig", "args": "egl" }, { "type": "makeSpec", "spec": "EGL" } @@ -149,7 +146,6 @@ "freetype": { "label": "FreeType", "test": { - "include": "ft2build.h", "tail": [ "#include FT_FREETYPE_H", "#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20200)", @@ -160,6 +156,7 @@ "FT_Face face = 0;" ] }, + "headers": "ft2build.h", "sources": [ { "type": "pkgConfig", "args": "freetype2" }, { "type": "freetype", "libs": "-lfreetype", "condition": "!config.wasm" }, @@ -172,7 +169,6 @@ "fontconfig": { "label": "Fontconfig", "test": { - "include": "fontconfig/fontconfig.h", "tail": [ "#ifndef FC_RGBA_UNKNOWN", "# error This version of fontconfig is tool old, it is missing the FC_RGBA_UNKNOWN define", @@ -182,6 +178,7 @@ "FcPattern *pattern = 0;" ] }, + "headers": "fontconfig/fontconfig.h", "sources": [ { "type": "pkgConfig", "args": "fontconfig" }, { "type": "freetype", "libs": "-lfontconfig" } @@ -196,12 +193,12 @@ "#include ", "extern \"C\" {" ], - "include": "gbm.h", "tail": [ "}" ], "main": "gbm_surface *surface = 0;" }, + "headers": "gbm.h", "sources": [ { "type": "pkgConfig", "args": "gbm" } ] @@ -209,7 +206,6 @@ "harfbuzz": { "label": "HarfBuzz", "test": { - "include": "harfbuzz/hb.h", "tail": [ "#if !HB_VERSION_ATLEAST(1, 6, 0)", "# error This version of harfbuzz is too old.", @@ -224,6 +220,7 @@ "hb_buffer_destroy(buffer);" ] }, + "headers": "harfbuzz/hb.h", "sources": [ "-lharfbuzz" ] @@ -232,9 +229,9 @@ "label": "IMF", "export": "", "test": { - "include": "imf/imf_client.h", "main": "imf_client_init();" }, + "headers": "imf/imf_client.h", "sources": [ "-linput_client" ] @@ -242,9 +239,9 @@ "lgmon": { "label": "lgmon", "test": { - "include": "lgmon.h", "main": "lgmon_supported(getpid());" }, + "headers": "lgmon.h", "sources": [ "-llgmon" ] @@ -252,9 +249,9 @@ "libinput": { "label": "libinput", "test": { - "include": "libinput.h", "main": "libinput_udev_create_context(NULL, NULL, NULL);" }, + "headers": "libinput.h", "sources": [ { "type": "pkgConfig", "args": "libinput" } ] @@ -266,7 +263,6 @@ "#include ", "#include " ], - "include": "device/hiddriver.h", "main": [ "HIDDriver *driver;", "uintptr_t devicecontext;", @@ -274,6 +270,7 @@ "gh_hid_enum_devices(driver, &device_id, &devicecontext);" ] }, + "headers": "device/hiddriver.h", "sources": [ { "libs": "-lhiddev -lusbhid -lusb" } ] @@ -286,7 +283,6 @@ "#include ", "extern \"C\" {" ], - "include": "jpeglib.h", "tail": [ "}", "", @@ -294,6 +290,7 @@ ], "main": "jpeg_create_compress(cinfo);" }, + "headers": "jpeglib.h", "sources": [ { "libs": "-llibjpeg", "condition": "config.msvc" }, "-ljpeg" @@ -302,9 +299,9 @@ "libpng": { "label": "libpng", "test": { - "include": "png.h", "main": "(void) png_create_read_struct(PNG_LIBPNG_VER_STRING,0,0,0);" }, + "headers": "png.h", "sources": [ { "type": "pkgConfig", "args": "libpng" }, { "libs": "-llibpng16", "condition": "config.msvc" }, @@ -320,13 +317,13 @@ "mirclient": { "label": "Mir client libraries", "test": { - "include": [ "mir_toolkit/mir_client_library.h", "ubuntu/application/lifecycle_delegate.h", "EGL/egl.h" ], "tail": "static void surfaceCreateCallback(MirSurface*, void*) {}", "main": [ "u_application_lifecycle_delegate_new();", "mir_surface_create(0, surfaceCreateCallback, 0);" ] }, + "headers": [ "mir_toolkit/mir_client_library.h", "ubuntu/application/lifecycle_delegate.h", "EGL/egl.h" ], "sources": [ { "type": "pkgConfig", "args": "egl mirclient ubuntu-platform-api libcontent-hub >= 0.2.0" } ] @@ -334,12 +331,12 @@ "mtdev": { "label": "mtdev", "test": { - "include": "mtdev.h", "main": [ "mtdev m;", "mtdev_open(&m, 0);" ] }, + "headers": "mtdev.h", "sources": [ { "type": "pkgConfig", "args": "mtdev" } ] @@ -352,7 +349,6 @@ "# include ", "#else", "# define GL_GLEXT_PROTOTYPES", - "# include ", "#endif" ], "main": [ @@ -363,6 +359,12 @@ "glEnd();" ] }, + "headers": [ + { + "condition": "!config.darwin", + "headers": "GL/gl.h" + } + ], "sources": [ { "type": "pkgConfig", "args": "gl", "condition": "!config.darwin" }, { "type": "makeSpec", "spec": "OPENGL" } @@ -376,7 +378,6 @@ "# include ", "#else", "# define GL_GLEXT_PROTOTYPES", - "# include ", "#endif" ], "main": [ @@ -384,6 +385,12 @@ "glClear(GL_COLOR_BUFFER_BIT);" ] }, + "headers": [ + { + "condition": "!config.darwin", + "headers": "GLES2/gl2.h" + } + ], "sources": [ { "type": "pkgConfig", "args": "glesv2", "condition": "!config.darwin" }, { "type": "makeSpec", "spec": "OPENGL_ES2" } @@ -392,9 +399,9 @@ "openvg": { "label": "OpenVG", "test": { - "include": "VG/openvg.h", "main": "VGint i = 2; vgFlush();" }, + "headers": "VG/openvg.h", "sources": [ { "type": "pkgConfig", "args": "vg" }, { "type": "makeSpec", "spec": "OPENVG" } @@ -403,9 +410,9 @@ "tslib": { "label": "tslib", "test": { - "include": "tslib.h", "main": "ts_open(\"foo\", 0);" }, + "headers": "tslib.h", "sources": [ "-lts" ] @@ -417,10 +424,6 @@ "#include ", "extern \"C\" {" ], - "include": [ - "mediactl/mediactl.h", - "mediactl/v4l2subdev.h" - ], "tail": [ "}" ], @@ -431,6 +434,7 @@ "v4l2_subdev_set_format(nullptr, nullptr, 0, V4L2_SUBDEV_FORMAT_ACTIVE);" ] }, + "headers": [ "mediactl/mediactl.h", "mediactl/v4l2subdev.h" ], "sources": [ { "type": "pkgConfig", "args": "libv4l2 libmediactl" }, "-lmediactl -lv4l2 -lv4l2subdev" @@ -447,9 +451,9 @@ "wayland_server": { "label": "Wayland Server", "test": { - "include": "wayland-server.h", "main": "wl_display_create();" }, + "headers": "wayland-server.h", "sources": [ { "type": "pkgConfig", "args": "wayland-server" } ] @@ -457,12 +461,12 @@ "xlib": { "label": "XLib", "test": { - "include": "X11/Xlib.h", "main": [ "Display *d = XOpenDisplay(NULL);", "XCloseDisplay(d);" ] }, + "headers": "X11/Xlib.h", "sources": [ { "type": "makeSpec", "spec": "X11" } ] @@ -476,7 +480,6 @@ "xcb": { "label": "XCB >= 1.9 (core)", "test": { - "include": "xcb/xcb.h", "main": [ "int primaryScreen = 0;", "(void)xcb_connect(\"\", &primaryScreen);", @@ -484,6 +487,7 @@ "int xcbScreenError = XCB_CONN_CLOSED_INVALID_SCREEN;" ] }, + "headers": "xcb/xcb.h", "sources": [ { "type": "pkgConfig", "args": "xcb >= 1.9" }, "-lxcb" @@ -517,9 +521,9 @@ "xcb_xlib": { "label": "XCB Xlib", "test": { - "include": "X11/Xlib-xcb.h", "main": "(void) XGetXCBConnection((Display *)0);" }, + "headers": "X11/Xlib-xcb.h", "sources": [ { "type": "pkgConfig", "args": "x11-xcb" }, "-lX11-xcb" @@ -533,13 +537,13 @@ "// xkb.h is using a variable called 'explicit', which is a reserved keyword in C++", "#define explicit dont_use_cxx_explicit" ], - "include": "xcb/xkb.h", "tail": "#undef explicit", "main": [ "// This takes more arguments in xcb-xkb < 1.10.", "xcb_xkb_get_kbd_by_name_unchecked(NULL, 0, 0, 0, 0);" ] }, + "headers": "xcb/xkb.h", "sources": [ { "type": "pkgConfig", "args": "xcb-xkb >= 1.10" }, "-lxcb-xkb" @@ -549,7 +553,6 @@ "xcb_render": { "label": "XCB XRender", "test": { - "include": "xcb/render.h", "tail": [ "// 'template' is used as a function argument name in xcb_renderutil.h", "#define template template_param", @@ -572,6 +575,7 @@ " formatsReply, XCB_PICT_STANDARD_ARGB_32);" ] }, + "headers": "xcb/render.h", "sources": [ { "type": "pkgConfig", "args": "xcb-renderutil xcb-render" }, "-lxcb-render-util -lxcb-render" @@ -581,7 +585,6 @@ "xcb_glx": { "label": "XCB GLX", "test": { - "include": "xcb/glx.h", "main": [ "int primaryScreen = 0;", "xcb_connection_t *connection = 0;", @@ -591,6 +594,7 @@ "xcb_glx_query_version_reply(connection, xglx_query_cookie, &error);" ] }, + "headers": "xcb/glx.h", "sources": [ { "type": "pkgConfig", "args": "xcb-glx" }, "-lxcb-glx" @@ -600,7 +604,6 @@ "xcb_xinput": { "label": "XCB XInput", "test": { - "include": "xcb/xinput.h", "main": [ "xcb_connection_t *connection = 0;", "xcb_generic_error_t *error = 0;", @@ -609,6 +612,7 @@ "xcb_input_xi_query_version_reply(connection, xinput_query_cookie, &error);" ] }, + "headers": "xcb/xinput.h", "sources": [ { "type": "pkgConfig", "args": "xcb-xinput >= 1.12" }, "-lxcb-xinput" @@ -618,9 +622,9 @@ "xkbcommon": { "label": "xkbcommon >= 0.5.0", "test": { - "include": [ "xkbcommon/xkbcommon.h" ], "main": "xkb_context_new(XKB_CONTEXT_NO_FLAGS);" }, + "headers": [ "xkbcommon/xkbcommon.h" ], "sources": [ { "type": "pkgConfig", "args": "xkbcommon >= 0.5.0" } ] @@ -628,9 +632,9 @@ "xkbcommon_x11": { "label": "xkbcommon-x11", "test": { - "include": [ "xkbcommon/xkbcommon-x11.h" ], "main": "xkb_x11_get_core_keyboard_device_id(nullptr);" }, + "headers": [ "xkbcommon/xkbcommon-x11.h" ], "sources": [ { "type": "pkgConfig", "args": "xkbcommon-x11" } ] diff --git a/src/network/configure.json b/src/network/configure.json index 019f8378c7..01ed1249e0 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -39,13 +39,13 @@ "libproxy": { "label": "libproxy", "test": { - "include": [ "proxy.h" ], "main": [ "pxProxyFactory *factory = px_proxy_factory_new();", "px_proxy_factory_get_proxies(factory, \"http://qt-project.org\");", "px_proxy_factory_free(factory);" ] }, + "headers": "proxy.h", "sources": [ "-lproxy" ] diff --git a/src/plugins/sqldrivers/configure.json b/src/plugins/sqldrivers/configure.json index 4802d3b04d..cd20eef1df 100644 --- a/src/plugins/sqldrivers/configure.json +++ b/src/plugins/sqldrivers/configure.json @@ -39,9 +39,8 @@ "libraries": { "db2": { "label": "DB2 (IBM)", - "test": { - "include": [ "sqlcli.h", "sqlcli1.h" ] - }, + "test": {}, + "headers": [ "sqlcli.h", "sqlcli1.h" ], "sources": [ { "libs": "-ldb2cli", "condition": "config.win32" }, { "libs": "-ldb2", "condition": "!config.win32" } @@ -49,9 +48,8 @@ }, "ibase": { "label": "InterBase", - "test": { - "include": "ibase.h" - }, + "test": {}, + "headers": "ibase.h", "sources": [ { "libs": "-lgds32_ms", "condition": "config.win32" }, { "libs": "-lgds", "condition": "!config.win32" } @@ -65,9 +63,9 @@ "# include ", "#endif" ], - "include": "mysql.h", "main": "mysql_get_client_version();" }, + "headers": "mysql.h", "sources": [ { "type": "mysqlConfig", "query": "--libs_r", "cleanlibs": true }, { "type": "mysqlConfig", "query": "--libs", "cleanlibs": true }, @@ -81,12 +79,12 @@ "psql": { "label": "PostgreSQL", "test": { - "include": "libpq-fe.h", "main": [ "PQescapeBytea(0, 0, 0);", "PQunescapeBytea(0, 0);" ] }, + "headers": "libpq-fe.h", "sources": [ { "type": "pkgConfig", "args": "libpq" }, { "type": "psqlConfig" }, @@ -96,9 +94,8 @@ }, "tds": { "label": "TDS (Sybase)", - "test": { - "include": [ "sybfront.h", "sybdb.h" ] - }, + "test": {}, + "headers": [ "sybfront.h", "sybdb.h" ], "sources": [ { "type": "sybaseEnv", "libs": "-lNTWDBLIB", "condition": "config.win32" }, { "type": "sybaseEnv", "libs": "-lsybdb", "condition": "!config.win32" } @@ -106,9 +103,8 @@ }, "oci": { "label": "OCI (Oracle)", - "test": { - "include": "oci.h" - }, + "test": {}, + "headers": "oci.h", "sources": [ { "libs": "-loci", "condition": "config.win32" }, { "libs": "-lclntsh", "condition": "!config.win32" } @@ -122,12 +118,12 @@ "# include ", "#endif" ], - "include": [ "sql.h", "sqlext.h" ], "main": [ "SQLHANDLE env;", "SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &env);" ] }, + "headers": [ "sql.h", "sqlext.h" ], "sources": [ { "libs": "-lodbc32", "condition": "config.win32" }, { "libs": "-liodbc", "condition": "config.darwin" }, @@ -136,9 +132,8 @@ }, "sqlite2": { "label": "SQLite (version 2)", - "test": { - "include": "sqlite.h" - }, + "test": {}, + "headers": "sqlite.h", "sources": [ "-lsqlite" ] @@ -147,9 +142,9 @@ "label": "SQLite (version 3)", "export": "sqlite", "test": { - "include": "sqlite3.h", "main": "sqlite3_open_v2(0, 0, 0, 0);" }, + "headers": "sqlite3.h", "sources": [ { "type": "pkgConfig", "args": "sqlite3" }, "-lsqlite3" diff --git a/src/plugins/sqldrivers/configure.pri b/src/plugins/sqldrivers/configure.pri index 747a47e7b8..84c8114c7b 100644 --- a/src/plugins/sqldrivers/configure.pri +++ b/src/plugins/sqldrivers/configure.pri @@ -9,7 +9,7 @@ defineTest(qtConfLibrary_psqlConfig) { !qtConfResolvePathLibs($${1}.libs, $$libdir, -lpq): \ return(false) qtRunLoggedCommand("$$pg_config --includedir", includedir)|return(false) - !qtConfResolvePathIncs($${1}.includedir, $$includedir): \ + !qtConfResolvePathIncs($${1}.includedir, $$includedir, $$2): \ return(false) return(true) } @@ -63,7 +63,7 @@ defineTest(qtConfLibrary_mysqlConfig) { includedir = for (id, rawincludedir): \ includedir += $$clean_path($$id) - !qtConfResolvePathIncs($${1}.includedir, $$includedir): \ + !qtConfResolvePathIncs($${1}.includedir, $$includedir, $$2): \ return(false) return(true) } diff --git a/src/printsupport/configure.json b/src/printsupport/configure.json index abc704fa18..7183d2e737 100644 --- a/src/printsupport/configure.json +++ b/src/printsupport/configure.json @@ -17,9 +17,9 @@ "cups": { "label": "CUPS", "test": { - "include": "cups/cups.h", "main": "cupsGetNamedDest(CUPS_HTTP_DEFAULT, NULL, NULL); // CUPS 1.4 test" }, + "headers": "cups/cups.h", "sources": [ "-lcups" ] -- cgit v1.2.3 From 649ee12aba2ee92781f0ab888d21a1bdb440b7da Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Fri, 14 Dec 2018 20:59:55 +0100 Subject: QRegularExpression: anchor wildcard pattern The current implementation of wildcardToRegularExpression doesn't anchor the pattern which makes it not narrow enough for globbing patterns. This patch fixes that by applying anchoredPattern before returning the wildcard pattern. [ChangeLog][QtCore][QRegularExpression] The wildcardToRegularExpression method now returns a properly anchored pattern. Change-Id: I7bee73389d408cf42499652e4fb854517a8125b5 Fixes: QTBUG-72539 Reviewed-by: Thiago Macieira --- src/corelib/io/qdir.cpp | 3 +-- src/corelib/tools/qregularexpression.cpp | 2 +- src/widgets/dialogs/qfilesystemmodel.cpp | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/corelib/io/qdir.cpp b/src/corelib/io/qdir.cpp index 7df461ddce..3007ffb958 100644 --- a/src/corelib/io/qdir.cpp +++ b/src/corelib/io/qdir.cpp @@ -2127,10 +2127,9 @@ QString QDir::rootPath() bool QDir::match(const QStringList &filters, const QString &fileName) { for (QStringList::ConstIterator sit = filters.constBegin(); sit != filters.constEnd(); ++sit) { - QString wildcard = QRegularExpression::wildcardToRegularExpression(*sit); // Insensitive exact match // (see Notes for QRegExp Users in QRegularExpression's documentation) - QRegularExpression rx(QRegularExpression::anchoredPattern(wildcard), + QRegularExpression rx(QRegularExpression::wildcardToRegularExpression(*sit), QRegularExpression::CaseInsensitiveOption); if (rx.match(fileName).hasMatch()) return true; diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp index 908e7ff0d6..831fa28de0 100644 --- a/src/corelib/tools/qregularexpression.cpp +++ b/src/corelib/tools/qregularexpression.cpp @@ -1992,7 +1992,7 @@ QString QRegularExpression::wildcardToRegularExpression(const QString &pattern) } } - return rx; + return anchoredPattern(rx); } /*! diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index 8b3549c3f5..d29f74e93d 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -2032,8 +2032,7 @@ bool QFileSystemModelPrivate::passNameFilters(const QFileSystemNode *node) const : QRegularExpression::CaseInsensitiveOption; for (const auto &nameFilter : nameFilters) { - const QString wildcard = QRegularExpression::wildcardToRegularExpression(nameFilter); - QRegularExpression rx(QRegularExpression::anchoredPattern(wildcard), options); + QRegularExpression rx(QRegularExpression::wildcardToRegularExpression(nameFilter), options); QRegularExpressionMatch match = rx.match(node->fileName); if (match.hasMatch()) return true; -- cgit v1.2.3 From 41c1866d3e8d30dfc1e7b29123ff2b834e7489f7 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Mon, 3 Dec 2018 13:39:15 +0100 Subject: Fix QRegularExpressionMatch capture-related documentation The documentation is not explicit enough about the content of the returned list of capturedList nor the element 0 when calling captured or its friends. The first element (aka element 0) is the whole string captured when one or more groups are used. Change-Id: I3c59ebfc9f6d762dd4d8aaf8f5c0de24359f53d7 Reviewed-by: Edward Welbourne Reviewed-by: Sze Howe Koh --- src/corelib/tools/qregularexpression.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/tools/qregularexpression.cpp b/src/corelib/tools/qregularexpression.cpp index 831fa28de0..bdaa2d3243 100644 --- a/src/corelib/tools/qregularexpression.cpp +++ b/src/corelib/tools/qregularexpression.cpp @@ -2138,6 +2138,9 @@ int QRegularExpressionMatch::lastCapturedIndex() const If the \a nth capturing group did not capture a string, or if there is no such capturing group, returns a null QString. + \note The implicit capturing group number 0 captures the substring matched + by the entire pattern. + \sa capturedRef(), capturedView(), lastCapturedIndex(), capturedStart(), capturedEnd(), capturedLength(), QString::isNull() */ @@ -2160,6 +2163,9 @@ QString QRegularExpressionMatch::captured(int nth) const If the \a nth capturing group did not capture a string, or if there is no such capturing group, returns a null QStringRef. + \note The implicit capturing group number 0 captures the substring matched + by the entire pattern. + \sa captured(), capturedView(), lastCapturedIndex(), capturedStart(), capturedEnd(), capturedLength(), QStringRef::isNull() */ @@ -2184,6 +2190,9 @@ QStringRef QRegularExpressionMatch::capturedRef(int nth) const If the \a nth capturing group did not capture a string, or if there is no such capturing group, returns a null QStringView. + \note The implicit capturing group number 0 captures the substring matched + by the entire pattern. + \sa captured(), capturedRef(), lastCapturedIndex(), capturedStart(), capturedEnd(), capturedLength(), QStringView::isNull() */ @@ -2296,7 +2305,9 @@ QStringView QRegularExpressionMatch::capturedView(QStringView name) const /*! Returns a list of all strings captured by capturing groups, in the order - the groups themselves appear in the pattern string. + the groups themselves appear in the pattern string. The list includes the + implicit capturing group number 0, capturing the substring matched by the + entire pattern. */ QStringList QRegularExpressionMatch::capturedTexts() const { -- cgit v1.2.3 From a5eabac96de54706de55497b16a46dc2223ac6e9 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Sun, 9 Dec 2018 08:38:57 +0100 Subject: moc: add support for C++11 enum struct C++11 added the new enum class key as well as enum struct. While the former is likely the most known and used, the later can be used in the same contexts and with the same effects. Currently moc doesn't parse enum struct while it does for enum class. This patch fixes this. [ChangeLog][moc] moc now parses enum struct the same way as enum class therefore that keyword can be used with the Q_ENUM macro as well as Q_FLAG and Q_DECLARE_FLAGS. Change-Id: Iaac3814ad63a15ee4d91b281d451e786b510449c Reviewed-by: Olivier Goffart (Woboq GmbH) Reviewed-by: Simon Hausmann --- src/tools/moc/moc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index 61a5542c83..7272df4265 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -260,7 +260,7 @@ bool Moc::parseEnum(EnumDef *def) { bool isTypdefEnum = false; // typedef enum { ... } Foo; - if (test(CLASS)) + if (test(CLASS) || test(STRUCT)) def->isEnumClass = true; if (test(IDENTIFIER)) { -- cgit v1.2.3 From 8571abc09720d17a60361b8ab88d5eb8110d9dea Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 14 Dec 2018 12:49:18 -0800 Subject: Remove "x" that was clearly a typo Or something I used for debugging. Change-Id: I61ce366d57bc46c89db5fffd15704e1d010749b6 Reviewed-by: Allan Sandfeld Jensen --- src/corelib/global/qnumeric_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h index 5326d9485b..0a6db9afcd 100644 --- a/src/corelib/global/qnumeric_p.h +++ b/src/corelib/global/qnumeric_p.h @@ -231,7 +231,7 @@ QT_WARNING_POP // size_t. Implementations for 8- and 16-bit types will work but may not be as // efficient. Implementations for 64-bit may be missing on 32-bit platforms. -#if (defined(Q_CC_GNU) && (Q_CC_GNU >= 500) || (defined(Q_CC_INTEL) && !defined(Q_OS_WIN))) || QT_HAS_BUILTIN(__builtin_add_overflowx) +#if (defined(Q_CC_GNU) && (Q_CC_GNU >= 500) || (defined(Q_CC_INTEL) && !defined(Q_OS_WIN))) || QT_HAS_BUILTIN(__builtin_add_overflow) // GCC 5, ICC 18, and Clang 3.8 have builtins to detect overflows template inline -- cgit v1.2.3 From ae825a48dcb702cef6b9b5dc0cb24c5192fc4b63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 14 Dec 2018 12:55:04 +0100 Subject: Set point size, not just pixel size, when creating HarfBuzz fonts for shaping Otherwise HarfBuzz will fall back to using default font sizes, e.g. 12.0 in the CoreText backend. hb_coretext_font_create() already does the right thing, but we're not using that function, we create the hb_font_t ourselves in _hb_qt_font_create(). The mismatch didn't matter for vector-based fonts as the metrics (presumably) scale linearly, but for bitmap-based font such as Emojis they don't, and we ended up with advances that were way too large (increasingly so the larger the font point size). Change-Id: I4781dda965c745853732026da91590d8506ec3f5 Reviewed-by: Simon Hausmann --- src/gui/text/qharfbuzzng.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/gui/text/qharfbuzzng.cpp b/src/gui/text/qharfbuzzng.cpp index 21f880e7be..2f25aea92b 100644 --- a/src/gui/text/qharfbuzzng.cpp +++ b/src/gui/text/qharfbuzzng.cpp @@ -689,6 +689,8 @@ _hb_qt_font_create(QFontEngine *fe) hb_font_set_scale(font, QFixed(x_ppem).value(), -QFixed(y_ppem).value()); hb_font_set_ppem(font, x_ppem, y_ppem); + hb_font_set_ptem(font, fe->fontDef.pointSize); + return font; } -- cgit v1.2.3 From 582237a593421b3e98470a03f29459d02662e9ec Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Mon, 26 Nov 2018 10:05:15 +1000 Subject: wasm: send mouse release to proper window MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the mouse is released, it gets the current window to send the event to from the pointer position. If the release happens out of the browser viewport, that window is null and the release event essentially gets ignored. This change keeps the last known QWindow object to send the event to until the release. Also replace hardcoded emscripten events with enum names. Task-number: QTBUG-71948 Change-Id: I354d14479a43489f210cca31d6b9e0f65d083bb0 Fixes: QTBUG-71948 Reviewed-by: Edward Welbourne Reviewed-by: Mikhail Svetkin Reviewed-by: Morten Johan Sørvig --- .../platforms/wasm/qwasmeventtranslator.cpp | 27 +++++++++++++--------- src/plugins/platforms/wasm/qwasmeventtranslator.h | 1 + 2 files changed, 17 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/wasm/qwasmeventtranslator.cpp b/src/plugins/platforms/wasm/qwasmeventtranslator.cpp index a3fdcd1025..8ab109f03c 100644 --- a/src/plugins/platforms/wasm/qwasmeventtranslator.cpp +++ b/src/plugins/platforms/wasm/qwasmeventtranslator.cpp @@ -63,6 +63,7 @@ EMSCRIPTEN_BINDINGS(mouse_module) { QWasmEventTranslator::QWasmEventTranslator(QObject *parent) : QObject(parent) , draggedWindow(nullptr) + , lastWindow(nullptr) , pressedButtons(Qt::NoButton) , resizeMode(QWasmWindow::ResizeNone) { @@ -370,15 +371,16 @@ void QWasmEventTranslator::processMouse(int eventType, const EmscriptenMouseEven Qt::KeyboardModifiers modifiers = translateMouseEventModifier(mouseEvent); QWindow *window2 = QWasmIntegration::get()->compositor()->windowAt(point, 5); + if (window2 != nullptr) + lastWindow = window2; + QWasmWindow *htmlWindow = static_cast(window2->handle()); - bool onFrame = false; - if (window2 && !window2->geometry().contains(point)) - onFrame = true; - QPoint localPoint(point.x() - window2->geometry().x(), point.y() - window2->geometry().y()); + bool interior = window2 && window2->geometry().contains(point); + QPoint localPoint(point.x() - window2->geometry().x(), point.y() - window2->geometry().y()); switch (eventType) { - case 5: //down + case EMSCRIPTEN_EVENT_MOUSEDOWN: { if (window2) window2->raise(); @@ -403,7 +405,7 @@ void QWasmEventTranslator::processMouse(int eventType, const EmscriptenMouseEven htmlWindow->injectMousePressed(localPoint, point, button, modifiers); break; } - case 6: //up + case EMSCRIPTEN_EVENT_MOUSEUP: { pressedButtons.setFlag(translateMouseButton(mouseEvent->button), false); buttonEventType = QEvent::MouseButtonRelease; @@ -414,7 +416,6 @@ void QWasmEventTranslator::processMouse(int eventType, const EmscriptenMouseEven pressedWindow = nullptr; } - if (mouseEvent->button == 0) { draggedWindow = nullptr; resizeMode = QWasmWindow::ResizeNone; @@ -424,7 +425,7 @@ void QWasmEventTranslator::processMouse(int eventType, const EmscriptenMouseEven oldWindow->injectMouseReleased(localPoint, point, button, modifiers); break; } - case 8://move //drag event + case EMSCRIPTEN_EVENT_MOUSEMOVE: // drag event { buttonEventType = QEvent::MouseMove; if (!(htmlWindow->m_windowState & Qt::WindowFullScreen) && !(htmlWindow->m_windowState & Qt::WindowMaximized)) { @@ -440,11 +441,15 @@ void QWasmEventTranslator::processMouse(int eventType, const EmscriptenMouseEven } break; } - default: + default: // MOUSELEAVE MOUSEENTER break; }; - - if (window2 && !onFrame) { + if (!window2 && buttonEventType == QEvent::MouseButtonRelease) { + window2 = lastWindow; + lastWindow = nullptr; + interior = true; + } + if (window2 && interior) { QWindowSystemInterface::handleMouseEvent( window2, timestamp, localPoint, point, pressedButtons, button, buttonEventType, modifiers); } diff --git a/src/plugins/platforms/wasm/qwasmeventtranslator.h b/src/plugins/platforms/wasm/qwasmeventtranslator.h index 11430a57a2..f3dff8e48c 100644 --- a/src/plugins/platforms/wasm/qwasmeventtranslator.h +++ b/src/plugins/platforms/wasm/qwasmeventtranslator.h @@ -197,6 +197,7 @@ private: private: QWindow *draggedWindow; QWindow *pressedWindow; + QWindow *lastWindow; Qt::MouseButtons pressedButtons; QWasmWindow::ResizeMode resizeMode; -- cgit v1.2.3 From 87b20009cc63d3a51e2eb93cd8492c77157b283b Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Tue, 11 Dec 2018 13:29:53 +1000 Subject: wasm: do not revise url of queries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I think this may have been for some POST method form queries, but obviously was missing something. Task-number: QTBUG-72382 Change-Id: I59016776aeedf4b5599b3b44af70610babb0a61e Reviewed-by: Edward Welbourne Reviewed-by: Morten Johan Sørvig Reviewed-by: Ryan Chu --- src/network/access/qnetworkreplywasmimpl.cpp | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'src') diff --git a/src/network/access/qnetworkreplywasmimpl.cpp b/src/network/access/qnetworkreplywasmimpl.cpp index 23ca62acd4..e8ca4d4084 100644 --- a/src/network/access/qnetworkreplywasmimpl.cpp +++ b/src/network/access/qnetworkreplywasmimpl.cpp @@ -315,17 +315,9 @@ void QNetworkReplyWasmImplPrivate::doSendRequest() val xhr = val::global("XMLHttpRequest").new_(); std::string verb = q->methodName().toStdString(); - QUrl url; QString extraDataString; - if (request.url().hasQuery()) { //strip query from url - extraDataString = request.url().query(QUrl::FullyEncoded); - QString urlStr = request.url().toString(); - url.setUrl(urlStr.left(urlStr.indexOf("?"))); - } else { - url = request.url(); - } - xhr.call("open", verb, url.toString().toStdString()); + xhr.call("open", verb, request.url().toString().toStdString()); xhr.set("onerror", val::module_property("QNetworkReplyWasmImplPrivate_requestErrorCallback")); xhr.set("onload", val::module_property("QNetworkReplyWasmImplPrivate_loadCallback")); -- cgit v1.2.3 From 3ccdeb4b58b681bb3a0a43f926f81fd94f527680 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 12 Dec 2018 11:54:54 +0100 Subject: Remove specialized multi font engine on Windows This was added as a platform-specific implementation of the multi engine in 2005, before this code was generalized, and it currently only has the purpose of special handling loadEngine(). The way this was special handled was by creating a new QFontEngine for every fallback family *every* time, never checking if the font engine already exists in the cache (like the superclass implementation does). The result of this was that if you had 500 fonts and each of them had 500 fallback fonts, and made a loop that would load all of them, then you would get 250000 font engines. At some point before this, we would run out of available handles and crash. There shouldn't be any need to have special handling of fallback font loading on Windows (i.e. all the platform specific parts should go through the normal mechanisms in QPA), so lets just go through the superclass implementation instead. [ChangeLog][Windows][Text] Reduced the number of font engines that are created when loading new fonts, fixing crashes in some special cases where a large number of fonts are created during a short period of time. Fixes: QTBUG-70032 Change-Id: I05040dd458e820510685e8c6df8f31876d9bdb89 Reviewed-by: Friedemann Kleint --- .../fontdatabases/windows/qwindowsfontdatabase.cpp | 5 - .../fontdatabases/windows/qwindowsfontdatabase_p.h | 1 - .../fontdatabases/windows/qwindowsfontengine.cpp | 114 --------------------- .../fontdatabases/windows/qwindowsfontengine_p.h | 10 -- 4 files changed, 130 deletions(-) (limited to 'src') diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp index 9ff50bdf05..40ac46df85 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp @@ -1264,11 +1264,6 @@ QWindowsFontDatabase::~QWindowsFontDatabase() removeApplicationFonts(); } -QFontEngineMulti *QWindowsFontDatabase::fontEngineMulti(QFontEngine *fontEngine, QChar::Script script) -{ - return new QWindowsMultiFontEngine(fontEngine, script); -} - QFontEngine * QWindowsFontDatabase::fontEngine(const QFontDef &fontDef, void *handle) { const QString faceName(static_cast(handle)); diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h index 9d0aa7f723..afba86bbe1 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h @@ -98,7 +98,6 @@ public: void populateFontDatabase() override; void populateFamily(const QString &familyName) override; - QFontEngineMulti *fontEngineMulti(QFontEngine *fontEngine, QChar::Script script) override; QFontEngine *fontEngine(const QFontDef &fontDef, void *handle) override; QFontEngine *fontEngine(const QByteArray &fontData, qreal pixelSize, QFont::HintingPreference hintingPreference) override; QStringList fallbacksForFamily(const QString &family, QFont::Style style, QFont::StyleHint styleHint, QChar::Script script) const override; diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp b/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp index 2a41209225..d1d11883c1 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontengine.cpp @@ -1199,120 +1199,6 @@ void QWindowsFontEngine::initFontInfo(const QFontDef &request, } } -/*! - \class QWindowsMultiFontEngine - \brief Standard Windows Multi font engine. - \internal - \ingroup qt-lighthouse-win - - "Merges" several font engines that have gaps in the - supported writing systems. - - Will probably be superseded by a common Free Type font engine in Qt 5.X. -*/ -QWindowsMultiFontEngine::QWindowsMultiFontEngine(QFontEngine *fe, int script) - : QFontEngineMulti(fe, script) -{ -} - -#ifndef QT_NO_DIRECTWRITE -static QString msgDirectWriteFunctionFailed(HRESULT hr, const char *function, - const QString &fam, const QString &substitute) -{ - _com_error error(hr); - QString result; - QTextStream str(&result); - str << function << " failed for \"" << fam << '"'; - if (substitute != fam) - str << " (substitute: \"" << substitute << "\")"; - str << ": error " << hex << showbase << ulong(hr) << ' ' << noshowbase << dec - << ": " << QString::fromWCharArray(error.ErrorMessage()); - return result; -} -#endif // !QT_NO_DIRECTWRITE - -QFontEngine *QWindowsMultiFontEngine::loadEngine(int at) -{ - QFontEngine *fontEngine = engine(0); - QSharedPointer data; - LOGFONT lf; - -#ifndef QT_NO_DIRECTWRITE - if (fontEngine->type() == QFontEngine::DirectWrite) { - QWindowsFontEngineDirectWrite *fe = static_cast(fontEngine); - lf = QWindowsFontDatabase::fontDefToLOGFONT(fe->fontDef, QString()); - - data = fe->fontEngineData(); - } else -#endif - { - QWindowsFontEngine *fe = static_cast(fontEngine); - lf = fe->m_logfont; - - data = fe->fontEngineData(); - } - - const QString fam = fallbackFamilyAt(at - 1); - const int faceNameLength = qMin(fam.length(), LF_FACESIZE - 1); - memcpy(lf.lfFaceName, fam.utf16(), faceNameLength * sizeof(wchar_t)); - lf.lfFaceName[faceNameLength] = 0; - -#ifndef QT_NO_DIRECTWRITE - if (fontEngine->type() == QFontEngine::DirectWrite) { - const QString nameSubstitute = QWindowsFontEngineDirectWrite::fontNameSubstitute(fam); - if (nameSubstitute != fam) { - const int nameSubstituteLength = qMin(nameSubstitute.length(), LF_FACESIZE - 1); - memcpy(lf.lfFaceName, nameSubstitute.utf16(), nameSubstituteLength * sizeof(wchar_t)); - lf.lfFaceName[nameSubstituteLength] = 0; - } - - HFONT hfont = CreateFontIndirect(&lf); - if (hfont == nullptr) { - qErrnoWarning("%s: CreateFontIndirect failed", __FUNCTION__); - } else { - HGDIOBJ oldFont = SelectObject(data->hdc, hfont); - - IDWriteFontFace *directWriteFontFace = nullptr; - QWindowsFontEngineDirectWrite *fedw = nullptr; - HRESULT hr = data->directWriteGdiInterop->CreateFontFaceFromHdc(data->hdc, &directWriteFontFace); - if (SUCCEEDED(hr)) { - Q_ASSERT(directWriteFontFace); - fedw = new QWindowsFontEngineDirectWrite(directWriteFontFace, - fontEngine->fontDef.pixelSize, - data); - fedw->fontDef.weight = fontEngine->fontDef.weight; - if (fontEngine->fontDef.style > QFont::StyleNormal) - fedw->fontDef.style = fontEngine->fontDef.style; - fedw->fontDef.family = fam; - fedw->fontDef.hintingPreference = fontEngine->fontDef.hintingPreference; - fedw->fontDef.stretch = fontEngine->fontDef.stretch; - } else { - qWarning("%s: %s", __FUNCTION__, - qPrintable(msgDirectWriteFunctionFailed(hr, "CreateFontFace", fam, nameSubstitute))); - } - - SelectObject(data->hdc, oldFont); - DeleteObject(hfont); - - if (fedw != nullptr) - return fedw; - } - } -#endif - - // Get here if original font is not DirectWrite or DirectWrite creation failed for some - // reason - - QFontEngine *fe = new QWindowsFontEngine(fam, lf, data); - fe->fontDef.weight = fontEngine->fontDef.weight; - if (fontEngine->fontDef.style > QFont::StyleNormal) - fe->fontDef.style = fontEngine->fontDef.style; - fe->fontDef.family = fam; - fe->fontDef.hintingPreference = fontEngine->fontDef.hintingPreference; - fe->fontDef.stretch = fontEngine->fontDef.stretch; - return fe; -} - bool QWindowsFontEngine::supportsTransformation(const QTransform &transform) const { // Support all transformations for ttf files, and translations for raster fonts diff --git a/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h b/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h index a151cf7343..2b575a9b45 100644 --- a/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h +++ b/src/platformsupport/fontdatabases/windows/qwindowsfontengine_p.h @@ -67,8 +67,6 @@ class QWindowsFontEngineData; class QWindowsFontEngine : public QFontEngine { Q_DISABLE_COPY(QWindowsFontEngine) - friend class QWindowsMultiFontEngine; - public: QWindowsFontEngine(const QString &name, LOGFONT lf, const QSharedPointer &fontEngineData); @@ -169,14 +167,6 @@ private: mutable int designAdvancesSize = 0; }; -class QWindowsMultiFontEngine : public QFontEngineMulti -{ -public: - explicit QWindowsMultiFontEngine(QFontEngine *fe, int script); - - QFontEngine *loadEngine(int at) override; -}; - QT_END_NAMESPACE Q_DECLARE_METATYPE(HFONT) -- cgit v1.2.3 From 1ef9859e7e0b0d2a88acd287b5b1e4bea8b27ae8 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 12 Dec 2017 12:21:16 +0100 Subject: configure: refactor directx checks properly atomize the libraries and express their dependencies, and adjust the project files accordingly. note that we don't try to use any additional paths, as all SDKs we currently support have built-in directx 11 support: - msvc2013 comes with win sdk 8.1; that is also used for win7 targets - mingw-64 5.3 (though this one is missing fxc, which is why the code path for using an external sdk for that remains) Change-Id: Ib44e389ef46567308293c2bbcad20a96e8ef70c7 Reviewed-by: Joerg Bornemann Reviewed-by: Oliver Wolff --- src/angle/src/common/gles_common.pri | 6 +- src/angle/src/libEGL/libEGL.pro | 5 +- src/gui/configure.json | 177 ++++++++++++++++----- src/gui/configure.pri | 19 +-- .../fontdatabases/windows/windows.pri | 9 +- src/platformsupport/fontdatabases/winrt/winrt.pri | 4 +- src/plugins/platforms/direct2d/direct2d.pro | 3 +- src/plugins/platforms/platforms.pro | 6 +- src/plugins/platforms/windows/windows.pri | 2 + src/plugins/platforms/winrt/winrt.pro | 3 +- 10 files changed, 168 insertions(+), 66 deletions(-) (limited to 'src') diff --git a/src/angle/src/common/gles_common.pri b/src/angle/src/common/gles_common.pri index fdd0e45971..70b65dd4cc 100644 --- a/src/angle/src/common/gles_common.pri +++ b/src/angle/src/common/gles_common.pri @@ -8,11 +8,11 @@ INCLUDEPATH += \ # Remember to adapt src/gui/configure.* if the Direct X version changes. !winrt: \ - LIBS_PRIVATE += -ld3d9 + QMAKE_USE_PRIVATE += d3d9 winrt: \ - LIBS_PRIVATE += -ld3dcompiler -ldxgi -ld3d11 + QMAKE_USE_PRIVATE += d3dcompiler d3d11 dxgi -LIBS_PRIVATE += -ldxguid +QMAKE_USE_PRIVATE += dxguid STATICLIBS = translator preprocessor for(libname, STATICLIBS) { diff --git a/src/angle/src/libEGL/libEGL.pro b/src/angle/src/libEGL/libEGL.pro index 889f39890e..912ff7825e 100644 --- a/src/angle/src/libEGL/libEGL.pro +++ b/src/angle/src/libEGL/libEGL.pro @@ -1,9 +1,10 @@ include(../common/common.pri) DEF_FILE_TARGET = $${TARGET} TARGET = $$qtLibraryTarget($${LIBEGL_NAME}) -winrt: LIBS_PRIVATE += -ld3d11 +winrt: QMAKE_USE_PRIVATE += d3d11 +QMAKE_USE_PRIVATE += dxguid -LIBS_PRIVATE += -ldxguid -L$$QT_BUILD_TREE/lib -l$$qtLibraryTarget($${LIBGLESV2_NAME}) +LIBS_PRIVATE += -L$$QT_BUILD_TREE/lib -l$$qtLibraryTarget($${LIBGLESV2_NAME}) DEFINES += GL_APICALL= GL_GLEXT_PROTOTYPES= EGLAPI= LIBEGL_IMPLEMENTATION diff --git a/src/gui/configure.json b/src/gui/configure.json index d0cca08b75..dd48567cb9 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -63,21 +63,79 @@ "-lbcm_host" ] }, - "direct2d": { - "label": "Direct 2D", - "export": "", + "dxguid": { + "label": "DirectX GUID", + "sources": [ + "-ldxguid" + ] + }, + "dxgi": { + "label": "DirectX GI", + "headers": "dxgi.h", + "sources": [ + "-ldxgi" + ] + }, + "dxgi1_2": { + "label": "DirectX GI 1.2", "test": { - "tail": "using Microsoft::WRL::ComPtr;", "main": [ - "ComPtr d2dFactory;", - "D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, d2dFactory.ReleaseAndGetAddressOf());", - "ComPtr surface;", + "// fails with mingw-w64 5.4.0 - declaration is missing from header", + "IDXGISurface1 *surface;", "(void) surface;" ] }, - "headers": [ "d3d11_1.h", "d2d1_1.h", "d2d1_1helper.h", "dxgi1_2.h", "wrl.h", "dwrite.h" ], + "headers": "dxgi1_2.h", + "sources": [ + "-ldxgi" + ] + }, + "d3d9": { + "label": "Direct3D 9", + "headers": "d3d9.h", + "sources": [ + "-ld3d9" + ] + }, + "d3d11": { + "label": "Direct3D 11", + "headers": "d3d11.h", + "sources": [ + "-ld3d11" + ] + }, + "d3d11_1": { + "label": "Direct3D 11.1", + "headers": "d3d11_1.h", + "sources": [ + "-ld3d11" + ] + }, + "d3dcompiler": { + "label": "Direct3D Shader Compiler Library", + "headers": "d3dcompiler.h", + "sources": [ + "-ld3dcompiler" + ] + }, + "d2d1": { + "label": "Direct2D 1", + "headers": [ "d2d1.h", "d2d1helper.h" ], + "sources": [ + "-ld2d1" + ] + }, + "d2d1_1": { + "label": "Direct2D 1.1", + "test": { + "main": [ + "ID2D1Factory1 *d2dFactory;", + "D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, &d2dFactory);" + ] + }, + "headers": [ "d2d1_1.h", "d2d1_1helper.h" ], "sources": [ - "-ld2d1 -ldwrite -ld3d11" + "-ld2d1" ] }, "directfb": { @@ -94,9 +152,8 @@ { "type": "pkgConfig", "args": "directfb" } ] }, - "directwrite": { + "dwrite": { "label": "DirectWrite", - "export": "", "test": { "main": [ "IDWriteFactory *factory = 0;", @@ -104,7 +161,29 @@ " (IUnknown **)(&factory));" ] }, - "headers": [ "dwrite.h", "d2d1.h" ], + "headers": "dwrite.h", + "sources": [ + "-ldwrite" + ] + }, + "dwrite_1": { + "label": "DirectWrite 1", + "headers": "dwrite_1.h", + "sources": [ + "-ldwrite" + ] + }, + "dwrite_2": { + "label": "DirectWrite 2", + "test": { + "main": [ + "IUnknown *factory = 0;", + "(void)(size_t(DWRITE_E_NOCOLOR) + sizeof(IDWriteFontFace2));", + "DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory2),", + " &factory);" + ] + }, + "headers": "dwrite_2.h", "sources": [ "-ldwrite" ] @@ -650,7 +729,7 @@ }, "testTypeAliases": { - "files": [ "directX" ] + "files": [ "fxc" ] }, "tests": { @@ -665,26 +744,10 @@ ] } }, - "directwrite2": { - "label": "DirectWrite 2", - "type": "compile", - "test": { - "include": [ "dwrite_2.h", "d2d1.h" ], - "main": [ - "IUnknown *factory = 0;", - "(void)(size_t(DWRITE_E_NOCOLOR) + sizeof(IDWriteFontFace2));", - "DWriteCreateFactory(DWRITE_FACTORY_TYPE_SHARED, __uuidof(IDWriteFactory2),", - " &factory);" - ] - }, - "use": "directwrite" - }, - "directx": { - "label": "DirectX SDK", - "type": "directX", + "fxc": { + "label": "Direct3D Shader Compiler", + "type": "fxc", "files": [ - "d3dcompiler.h", - "d3d11.lib", "fxc.exe" ] }, @@ -944,7 +1007,7 @@ "angle": { "label": "ANGLE", "autoDetect": "features.opengles2 || features.opengl-dynamic", - "condition": "config.win32 && tests.directx", + "condition": "features.dxguid && tests.fxc && (features.direct3d9 || (config.winrt && features.direct3d11 && libs.d3dcompiler))", "output": [ "publicFeature", { "type": "define", "name": "QT_OPENGL_ES_2_ANGLE" } @@ -971,19 +1034,59 @@ "directwrite": { "label": "DirectWrite", "emitIf": "config.win32", - "condition": "libs.directwrite", + "condition": "libs.dwrite", + "output": [ "privateFeature" ] + }, + "directwrite1": { + "label": "DirectWrite 1", + "emitIf": "config.win32", + "condition": "libs.dwrite_1", "output": [ "privateFeature" ] }, "directwrite2": { "label": "DirectWrite 2", "emitIf": "config.win32", - "condition": "features.directwrite && tests.directwrite2", + "condition": "features.directwrite1 && libs.dwrite_2", + "output": [ "privateFeature" ] + }, + "dxguid": { + "label": "DirectX GUID", + "condition": "config.win32 && libs.dxguid", + "output": [ "privateFeature" ] + }, + "direct3d9": { + "label": "Direct 3D 9", + "condition": "config.win32 && !config.winrt && libs.d3d9", + "output": [ "privateFeature" ] + }, + "dxgi": { + "label": "DirectX GI", + "condition": "config.win32 && libs.dxgi", + "output": [ "privateFeature" ] + }, + "dxgi1_2": { + "label": "DirectX GI 1.2", + "condition": "features.dxgi && libs.dxgi1_2", + "output": [ "privateFeature" ] + }, + "direct3d11": { + "label": "Direct 3D 11", + "condition": "features.dxgi && libs.d3d11", + "output": [ "privateFeature" ] + }, + "direct3d11_1": { + "label": "Direct 3D 11.1", + "condition": "features.direct3d11 && features.dxgi1_2 && libs.d3d11_1", "output": [ "privateFeature" ] }, "direct2d": { "label": "Direct 2D", - "section": "Platform plugins", - "condition": "config.win32 && !config.winrt && libs.direct2d", + "condition": "config.win32 && !config.winrt && features.direct3d11 && libs.d2d1", + "output": [ "privateFeature" ] + }, + "direct2d1_1": { + "label": "Direct 2D 1.1", + "condition": "features.direct2d && libs.d2d1_1", "output": [ "privateFeature" ] }, "evdev": { diff --git a/src/gui/configure.pri b/src/gui/configure.pri index e21489ec28..c264b387fc 100644 --- a/src/gui/configure.pri +++ b/src/gui/configure.pri @@ -15,29 +15,16 @@ defineTest(qtConfLibrary_freetype) { return(true) } -# Check for Direct X SDK (include, lib, and direct shader compiler 'fxc'). +# Check for Direct X shader compiler 'fxc'. # Up to Direct X SDK June 2010 and for MinGW, this is pointed to by the # DXSDK_DIR variable. Starting with Windows Kit 8, it is included in -# the Windows SDK. Checking for the header is not sufficient, since it -# is also present in MinGW. -defineTest(qtConfTest_directX) { +# the Windows SDK. +defineTest(qtConfTest_fxc) { dxdir = $$getenv("DXSDK_DIR") !isEmpty(dxdir) { - EXTRA_INCLUDEPATH += $$dxdir/include - equals(QT_ARCH, x86_64): \ - EXTRA_LIBDIR += $$dxdir/lib/x64 - else: \ - EXTRA_LIBDIR += $$dxdir/lib/x86 EXTRA_PATH += $$dxdir/Utilities/bin/x86 } - $$qtConfEvaluate("features.sse2") { - ky = $$size($${1}.files._KEYS_) - $${1}.files._KEYS_ += $$ky - # Not present on MinGW-32 - $${1}.files.$${ky} = "intrin.h" - } - qtConfTest_files($${1}): return(true) return(false) } diff --git a/src/platformsupport/fontdatabases/windows/windows.pri b/src/platformsupport/fontdatabases/windows/windows.pri index 0e64084cf1..9c529f55ea 100644 --- a/src/platformsupport/fontdatabases/windows/windows.pri +++ b/src/platformsupport/fontdatabases/windows/windows.pri @@ -15,9 +15,14 @@ qtConfig(freetype) { HEADERS += $$PWD/qwindowsfontdatabase_ft_p.h } -qtConfig(directwrite) { - qtConfig(directwrite2): \ +qtConfig(directwrite):qtConfig(direct2d) { + qtConfig(directwrite2) { + QMAKE_USE_PRIVATE += dwrite_2 DEFINES *= QT_USE_DIRECTWRITE2 + } else { + QMAKE_USE_PRIVATE += dwrite + } + QMAKE_USE_PRIVATE += d2d1 SOURCES += $$PWD/qwindowsfontenginedirectwrite.cpp HEADERS += $$PWD/qwindowsfontenginedirectwrite_p.h diff --git a/src/platformsupport/fontdatabases/winrt/winrt.pri b/src/platformsupport/fontdatabases/winrt/winrt.pri index 291ada220f..7617df2e7a 100644 --- a/src/platformsupport/fontdatabases/winrt/winrt.pri +++ b/src/platformsupport/fontdatabases/winrt/winrt.pri @@ -8,4 +8,6 @@ HEADERS += \ DEFINES += __WRL_NO_DEFAULT_LIB__ -LIBS += -lws2_32 -ldwrite +LIBS += -lws2_32 + +QMAKE_USE_PRIVATE += dwrite_1 diff --git a/src/plugins/platforms/direct2d/direct2d.pro b/src/plugins/platforms/direct2d/direct2d.pro index 3bfd02bdc8..9764272632 100644 --- a/src/plugins/platforms/direct2d/direct2d.pro +++ b/src/plugins/platforms/direct2d/direct2d.pro @@ -8,7 +8,8 @@ QT += \ qtConfig(accessibility): QT += accessibility_support-private qtConfig(vulkan): QT += vulkan_support-private -LIBS += -ldwmapi -ld2d1 -ld3d11 -ldwrite -lversion -lgdi32 +LIBS += -ldwmapi -lversion -lgdi32 +QMAKE_USE_PRIVATE += dwrite_1 d2d1_1 d3d11_1 dxgi1_2 include(../windows/windows.pri) diff --git a/src/plugins/platforms/platforms.pro b/src/plugins/platforms/platforms.pro index db2a31d1a5..acc55adf6f 100644 --- a/src/plugins/platforms/platforms.pro +++ b/src/plugins/platforms/platforms.pro @@ -14,10 +14,10 @@ qtConfig(xcb) { uikit:!watchos: SUBDIRS += ios osx: SUBDIRS += cocoa -win32:!winrt: SUBDIRS += windows -winrt: SUBDIRS += winrt +win32:!winrt:qtConfig(direct3d9): SUBDIRS += windows +winrt:qtConfig(direct3d11): SUBDIRS += winrt -qtConfig(direct2d) { +qtConfig(direct3d11_1):qtConfig(direct2d1_1):qtConfig(directwrite1) { SUBDIRS += direct2d } diff --git a/src/plugins/platforms/windows/windows.pri b/src/plugins/platforms/windows/windows.pri index db06a6a2a3..7004d7e854 100644 --- a/src/plugins/platforms/windows/windows.pri +++ b/src/plugins/platforms/windows/windows.pri @@ -9,6 +9,8 @@ mingw: LIBS *= -luuid # For the dialog helpers: LIBS += -lshlwapi -lshell32 -ladvapi32 -lwtsapi32 +QMAKE_USE_PRIVATE += d3d9/nolink + DEFINES *= QT_NO_CAST_FROM_ASCII QT_NO_FOREACH SOURCES += \ diff --git a/src/plugins/platforms/winrt/winrt.pro b/src/plugins/platforms/winrt/winrt.pro index 6a847465e4..43132a1a76 100644 --- a/src/plugins/platforms/winrt/winrt.pro +++ b/src/plugins/platforms/winrt/winrt.pro @@ -8,7 +8,8 @@ QT += \ DEFINES *= QT_NO_CAST_FROM_ASCII __WRL_NO_DEFAULT_LIB__ -LIBS += -lws2_32 -ld3d11 +LIBS += -lws2_32 +QMAKE_USE_PRIVATE += d3d11 SOURCES = \ main.cpp \ -- cgit v1.2.3 From 7a481fce28b0ffbb77f8631673009bf9bf615088 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Tue, 12 Dec 2017 20:02:55 +0100 Subject: configure: detect fxc.exe more thoroughly When building ANGLE, we need the shader compiler (fxc.exe), which is not shipped with MinGW. Previously, we required an installed DirectX SDK. For Windows versions >= 8, the DX SDK is also part of the Windows Kit, so we also allow the user to specify the location of the Windows Kit. We also detect fxc on 64-bit hosts now, and in newer SDK versions which version the binary directory. The detected binary is now exported by configure, so the ANGLE project file does not need to duplicate the logic anymore. Task-number: QTBUG-52487 Change-Id: I41a17992909041dd84291b69498195cc8b8fab8a Reviewed-by: Joerg Bornemann --- src/angle/src/common/common.pri | 16 +--------------- src/gui/configure.json | 11 +++-------- src/gui/configure.pri | 31 +++++++++++++++++++++++++++---- 3 files changed, 31 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/angle/src/common/common.pri b/src/angle/src/common/common.pri index b64dbd3e36..df29269786 100644 --- a/src/angle/src/common/common.pri +++ b/src/angle/src/common/common.pri @@ -22,21 +22,7 @@ lib_replace.replace = \$\$\$\$[QT_INSTALL_LIBS] lib_replace.CONFIG = path QMAKE_PRL_INSTALL_REPLACE += lib_replace -# DirectX is included in the Windows 8 Kit, but everything else requires the DX SDK. -winrt|msvc { - FXC = fxc.exe -} else { - DX_DIR = $$(DXSDK_DIR) - isEmpty(DX_DIR) { - error("Cannot determine DirectX SDK location. Please set DXSDK_DIR environment variable.") - } - - equals(QMAKE_TARGET.arch, x86_64) { - FXC = \"$${DX_DIR}Utilities\\bin\\x64\\fxc.exe\" - } else { - FXC = \"$${DX_DIR}Utilities\\bin\\x86\\fxc.exe\" - } -} +FXC = $$shell_quote($$shell_path($$QMAKE_FXC_LOCATION)) win32 { VERSION = $$MODULE_VERSION diff --git a/src/gui/configure.json b/src/gui/configure.json index dd48567cb9..db78c7900c 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -728,10 +728,6 @@ } }, - "testTypeAliases": { - "files": [ "fxc" ] - }, - "tests": { "angle_d3d11_qdtd": { "label": "D3D11_QUERY_DATA_TIMESTAMP_DISJOINT", @@ -747,9 +743,7 @@ "fxc": { "label": "Direct3D Shader Compiler", "type": "fxc", - "files": [ - "fxc.exe" - ] + "log": "value" }, "drm_atomic": { "label": "DRM Atomic API", @@ -1010,7 +1004,8 @@ "condition": "features.dxguid && tests.fxc && (features.direct3d9 || (config.winrt && features.direct3d11 && libs.d3dcompiler))", "output": [ "publicFeature", - { "type": "define", "name": "QT_OPENGL_ES_2_ANGLE" } + { "type": "define", "name": "QT_OPENGL_ES_2_ANGLE" }, + { "type": "varAssign", "name": "QMAKE_FXC_LOCATION", "value": "tests.fxc.value" } ] }, "angle_d3d11_qdtd": { diff --git a/src/gui/configure.pri b/src/gui/configure.pri index c264b387fc..1b95449a10 100644 --- a/src/gui/configure.pri +++ b/src/gui/configure.pri @@ -20,12 +20,35 @@ defineTest(qtConfLibrary_freetype) { # DXSDK_DIR variable. Starting with Windows Kit 8, it is included in # the Windows SDK. defineTest(qtConfTest_fxc) { - dxdir = $$getenv("DXSDK_DIR") - !isEmpty(dxdir) { - EXTRA_PATH += $$dxdir/Utilities/bin/x86 + !mingw { + fxc = $$qtConfFindInPath("fxc.exe") + } else { + equals(QMAKE_HOST.arch, x86_64): \ + fns = x64/fxc.exe + else: \ + fns = x86/fxc.exe + dxdir = $$(DXSDK_DIR) + !isEmpty(dxdir) { + fxc = $$dxdir/Utilities/bin/$$fns + } else { + winkitbindir = $$(WindowsSdkVerBinPath) + !isEmpty(winkitbindir) { + fxc = $$winkitbindir/$$fns + } else { + winkitdir = $$(WindowsSdkDir) + !isEmpty(winkitdir): \ + fxc = $$winkitdir/bin/$$fns + } + } } - qtConfTest_files($${1}): return(true) + !isEmpty(fxc):exists($$fxc) { + $${1}.value = $$clean_path($$fxc) + export($${1}.value) + $${1}.cache += value + export($${1}.cache) + return(true) + } return(false) } -- cgit v1.2.3 From 65463764f24210c755d6f48930162e67a5de7e9b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 17 Jan 2018 12:44:45 +0100 Subject: configure: properly atomize xcb-syslibs as it is now cheap to test for individual libraries and headers, split the xcb_syslibs monster-library into its parts. the compile test remains a single blob, though, as that didn't get any cheaper. whether it's worth keeping it in the first place is debatable. Change-Id: Id7cae7925bb4d77069437512abecf14feea749f2 Reviewed-by: Gatis Paeglis --- src/gui/configure.json | 129 ++++++++++++++++++++++++------ src/plugins/platforms/xcb/xcb_qpa_lib.pro | 5 +- 2 files changed, 107 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/gui/configure.json b/src/gui/configure.json index db78c7900c..67378114ca 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -557,7 +557,7 @@ ] }, "xcb": { - "label": "XCB >= 1.9 (core)", + "label": "XCB >= 1.9", "test": { "main": [ "int primaryScreen = 0;", @@ -572,30 +572,86 @@ "-lxcb" ] }, - "xcb_syslibs": { - "label": "XCB (extensions)", - "test": { - "include": [ - "xcb/xcb.h", - "xcb/xfixes.h", - "xcb/xcb_image.h", - "xcb/xcb_keysyms.h", - "xcb/xinerama.h", - "xcb/sync.h", - "xcb/randr.h", - "xcb/shm.h", - "xcb/xcb_icccm.h" - ], - "main": [ - "int primaryScreen = 0;", - "(void) xcb_connect(\"\", &primaryScreen);" - ] - }, + "xcb_icccm": { + "label": "XCB ICCCM >= 0.3.9", + "headers": "xcb/xcb_icccm.h", "sources": [ - { "type": "pkgConfig", - "args": "xcb xcb-shm xcb-sync xcb-xfixes xcb-xinerama xcb-randr xcb-image xcb-keysyms xcb-icccm xcb-shape" }, - "-lxcb -lxcb-shm -lxcb-sync -lxcb-xfixes -lxcb-xinerama -lxcb-randr -lxcb-image -lxcb-keysyms -lxcb-icccm -lxcb-shape" - ] + { "type": "pkgConfig", "args": "xcb-icccm >= 0.3.9" }, + "-lxcb-icccm" + ], + "use": "xcb" + }, + "xcb_image": { + "label": "XCB Image >= 0.3.9", + "headers": "xcb/xcb_image.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-image >= 0.3.9" }, + "-lxcb-image" + ], + "use": "xcb_shm xcb" + }, + "xcb_keysyms": { + "label": "XCB Keysyms >= 0.3.9", + "headers": "xcb/xcb_keysyms.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-keysyms >= 0.3.9" }, + "-lxcb-keysyms" + ], + "use": "xcb" + }, + "xcb_randr": { + "label": "XCB RandR", + "headers": "xcb/randr.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-randr" }, + "-lxcb-randr" + ], + "use": "xcb" + }, + "xcb_shape": { + "label": "XCB Shape", + "headers": "xcb/shape.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-shape" }, + "-lxcb-shape" + ], + "use": "xcb" + }, + "xcb_shm": { + "label": "XCB SHM", + "headers": "xcb/shm.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-shm" }, + "-lxcb-shm" + ], + "use": "xcb" + }, + "xcb_sync": { + "label": "XCB Sync", + "headers": "xcb/sync.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-sync" }, + "-lxcb-sync" + ], + "use": "xcb" + }, + "xcb_xfixes": { + "label": "XCB Xfixes", + "headers": "xcb/xfixes.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-xfixes" }, + "-lxcb-xfixes" + ], + "use": "xcb" + }, + "xcb_xinerama": { + "label": "XCB Xinerama", + "headers": "xcb/xinerama.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-xinerama" }, + "-lxcb-xinerama" + ], + "use": "xcb" }, "xcb_xlib": { "label": "XCB Xlib", @@ -982,6 +1038,29 @@ "type": "qpaDefaultPlatform", "log": "value" }, + "xcb_syslibs": { + "label": "XCB (extensions)", + "type": "compile", + "test": { + "include": [ + "xcb/xcb.h", + "xcb/xcb_image.h", + "xcb/xcb_keysyms.h", + "xcb/randr.h", + "xcb/shape.h", + "xcb/shm.h", + "xcb/sync.h", + "xcb/xfixes.h", + "xcb/xinerama.h", + "xcb/xcb_icccm.h" + ], + "main": [ + "int primaryScreen = 0;", + "(void) xcb_connect(\"\", &primaryScreen);" + ] + }, + "use": "xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama xcb" + }, "x11prefix": { "label": "X11 prefix", "type": "getPkgConfigVariable", @@ -1420,7 +1499,7 @@ "enable": "input.xcb == 'system'", "disable": "input.xcb == 'qt'", "autoDetect": "!config.darwin", - "condition": "features.xcb && libs.xcb_syslibs", + "condition": "features.xcb && tests.xcb_syslibs", "output": [ "privateFeature" ] }, "x11-prefix": { diff --git a/src/plugins/platforms/xcb/xcb_qpa_lib.pro b/src/plugins/platforms/xcb/xcb_qpa_lib.pro index 9883617ab6..f4ca9cc81d 100644 --- a/src/plugins/platforms/xcb/xcb_qpa_lib.pro +++ b/src/plugins/platforms/xcb/xcb_qpa_lib.pro @@ -95,12 +95,13 @@ qtConfig(vulkan) { } !qtConfig(system-xcb) { - QMAKE_USE += xcb-static xcb + QMAKE_USE += xcb-static } else { qtConfig(xcb-render): QMAKE_USE += xcb_render qtConfig(xcb-xinput): QMAKE_USE += xcb_xinput - QMAKE_USE += xcb_syslibs + QMAKE_USE += xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama } +QMAKE_USE += xcb QMAKE_USE += xkbcommon qtConfig(xkb) { -- cgit v1.2.3 From 5485a085e6d9af34a2ce0b86abf91b0b693b9d05 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 13 Jul 2018 18:56:22 +0200 Subject: configure: optimize the openssl feature structure don't run the openssl_headers test pointlessly when openssl-linked is selected but its test fails. implementing this cleanly required creating a separate openssl-runtime feature, including 'redirecting' the -openssl option (which is just an alias for -openssl-runtime) to it. simplify the openssl-linked conditions: while "anything but the value that enables it" in the 'disable' field effectively means "don't auto-detect it", it's better to be explicit about that. Change-Id: I6b117cc50711bb64d090fcfdb89ff009c60ed86c Reviewed-by: Timur Pocheptsov Reviewed-by: Joerg Bornemann --- src/network/configure.json | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/network/configure.json b/src/network/configure.json index 01ed1249e0..3f1cb7893b 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -195,20 +195,24 @@ }, "openssl": { "label": "OpenSSL", - "enable": "input.openssl == 'yes' || input.openssl == 'linked' || input.openssl == 'runtime'", - "disable": "input.openssl == 'no' || input.ssl == 'no'", - "autoDetect": "!config.winrt && !config.wasm", - "condition": "!features.securetransport && (features.openssl-linked || libs.openssl_headers)", + "enable": "false", + "condition": "features.openssl-runtime || features.openssl-linked", "output": [ "privateFeature", { "type": "publicQtConfig", "condition": "!features.openssl-linked" }, { "type": "define", "negative": true, "name": "QT_NO_OPENSSL" } ] }, + "openssl-runtime": { + "autoDetect": "!config.winrt && !config.wasm", + "enable": "input.openssl == 'yes' || input.openssl == 'runtime'", + "disable": "input.openssl == 'no' || input.openssl == 'linked' || input.ssl == 'no'", + "condition": "!features.securetransport && libs.openssl_headers" + }, "openssl-linked": { "label": " Qt directly linked to OpenSSL", + "autoDetect": false, "enable": "input.openssl == 'linked'", - "disable": "input.openssl != 'linked'", "condition": "!features.securetransport && libs.openssl", "output": [ "privateFeature", -- cgit v1.2.3 From c07ab93c204c134509032d7c3d50f31ee913c57c Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 3 May 2018 16:46:56 +0200 Subject: configure: adjust openssl lib names on mingw both the mingw and msvc build have a "lib" prefix on the libraries. this makes the msvc build unconventional, so it needs an extra source. for the mingw build, otoh, this is the expected setup, so the source used for unix will work just fine. this doesn't fix any actual bug, because mingw will apparently resolve -llibfoo to libfoo.a even though only liblibfoo.a and libfoo.lib are documented (on mingw.org). however, this mix of conventions is ugly and should be avoided. Change-Id: I32b1621e4ac15db1f071c08ced738bfdafdcc11b Reviewed-by: Timur Pocheptsov Reviewed-by: Joerg Bornemann --- src/network/configure.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/network/configure.json b/src/network/configure.json index 3f1cb7893b..4e4426342f 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -77,9 +77,12 @@ }, { "libs": "-llibssl -llibcrypto", - "condition": "config.win32" + "condition": "config.msvc" }, - { "libs": "-lssl -lcrypto", "condition": "!config.win32" } + { + "libs": "-lssl -lcrypto", + "condition": "!config.msvc" + } ] } }, -- cgit v1.2.3 From c15afc16ac0d71f1b61ad6154df3a7994e18cc26 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 3 May 2018 16:58:00 +0200 Subject: configure: remove openssl placeholder source there is no particular reason to exclude static builds from the default. misses are cheap now, so it's fine if nothing is found. this affects only the legacy pre-1.1 library names under windows. Change-Id: I998b9f7bfcce42ec990a236bb44372c4d6b3f631 Reviewed-by: Timur Pocheptsov --- src/network/configure.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src') diff --git a/src/network/configure.json b/src/network/configure.json index 4e4426342f..076a1c24a7 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -66,14 +66,9 @@ "test": "openssl", "sources": [ { "type": "openssl" }, - { - "comment": "placeholder for OPENSSL_{PATH,LIBS{,_{DEBUG,RELEASE}}}", - "libs": "", - "condition": "config.win32 && !features.shared" - }, { "libs": "-lssleay32 -llibeay32", - "condition": "config.win32 && features.shared" + "condition": "config.win32" }, { "libs": "-llibssl -llibcrypto", -- cgit v1.2.3 From 10adbc4f0f2d60bc714b304266865bebcce0f909 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 13 Jul 2018 20:26:46 +0200 Subject: configure: inline corewlan test we have support for objc++ since 591edbb11. Change-Id: I5f430fd7c410913d4532627d18529b077f794035 Reviewed-by: Joerg Bornemann --- src/network/configure.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/network/configure.json b/src/network/configure.json index 076a1c24a7..e823ed9d2f 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -26,7 +26,11 @@ "corewlan": { "label": "CoreWLan", "export": "", - "test": "corewlan", + "test": { + "lang": "objc++", + "main": "[CWInterface interfaceWithName:@\"en2\"];" + }, + "headers": [ "CoreWLAN/CoreWLAN.h", "CoreWLAN/CWInterface.h" ], "sources": [ "-framework CoreWLAN -framework Foundation" ] -- cgit v1.2.3 From 53ae00d03c4065ca2235dc41636be0274d074c57 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 13 Jul 2018 21:13:46 +0200 Subject: configure: inline a few more tests these were new on dev while the original migration happened on 5.9, or came from new changes which hadn't adapted yet. Change-Id: I5e48437061a97e6df6e93881c98471455e177631 Reviewed-by: Joerg Bornemann --- src/corelib/configure.json | 34 +++++++++++++++++++++++++++++----- src/gui/configure.json | 33 ++++++++++++++++++++++++++++++--- 2 files changed, 59 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 81448174b6..eb213398ca 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -277,7 +277,10 @@ "cxx11_random": { "label": "C++11 ", "type": "compile", - "test": "unix/cxx11_random" + "test": { + "include": "random", + "main": "std::mt19937 mt(0);" + } }, "eventfd": { "label": "eventfd", @@ -295,22 +298,43 @@ "futimens": { "label": "futimens()", "type": "compile", - "test": "unix/futimens" + "test": { + "include": "sys/stat.h", + "main": "futimens(-1, 0);", + "qmake": [ + "# Block futimens() on Apple platforms unless it's available on ALL", + "# deployment targets. This simplifies the logic at the call site", + "# dramatically, as it isn't strictly needed compared to futimes().", + "darwin: QMAKE_CXXFLAGS += -Werror=unguarded-availability" + ] + } }, "futimes": { "label": "futimes()", "type": "compile", - "test": "unix/futimes" + "test": { + "include": "sys/time.h", + "main": "futimes(-1, 0);" + } }, "getauxval": { "label": "getauxval()", "type": "compile", - "test": "unix/getauxval" + "test": { + "include": "sys/auxv.h", + "main": "(void) getauxval(AT_NULL);" + } }, "getentropy": { "label": "getentropy()", "type": "compile", - "test": "unix/getentropy" + "test": { + "include": "unistd.h", + "main": [ + "char buf[32];", + "(void) getentropy(buf, sizeof(buf));" + ] + } }, "posix-iconv": { "label": "POSIX iconv", diff --git a/src/gui/configure.json b/src/gui/configure.json index 67378114ca..caa6f065f0 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -521,7 +521,23 @@ }, "vulkan": { "label": "Vulkan", - "test": "qpa/vulkan", + "test": { + "comment": "Note: Qt does not rely on linking to a Vulkan library directly.", + "tail": [ + "// The pData parameter has changed from uint32_t* to void* at some point.", + "// Ensure the headers have the updated one to prevent compile errors later on.", + "PFN_vkCmdUpdateBuffer cmdUpdBuf;", + "void testUpdateBuffer(VkCommandBuffer commandBuffer, VkBuffer dstBuffer, VkDeviceSize dstOffset, VkDeviceSize dataSize, const void* pData)", + "{", + " cmdUpdBuf(commandBuffer, dstBuffer, dstOffset, dataSize, pData);", + "}" + ], + "main": [ + "VkInstanceCreateInfo info;", + "testUpdateBuffer(0, 0, 0, 0, 0);" + ] + }, + "headers": "vulkan/vulkan.h", "sources": [ { "type": "pkgConfig", "args": "vulkan" }, { "type": "makeSpec", "spec": "VULKAN" } @@ -776,7 +792,15 @@ }, "xrender": { "label": "XRender for native painting", - "test": "x11/xrender", + "test": { + "tail": [ + "#if RENDER_MAJOR == 0 && RENDER_MINOR < 5", + "# error Required Xrender version 0.6 not found.", + "#endif" + ], + "main": "XRenderPictFormat *format = 0;" + }, + "headers": "X11/extensions/Xrender.h", "sources": [ "-lXrender" ], @@ -1030,7 +1054,10 @@ "opengles32": { "label": "OpenGL ES 3.2", "type": "compile", - "test": "unix/opengles32", + "test": { + "include": "GLES3/gl32.h", + "main": "glFramebufferTexture(GL_TEXTURE_2D, GL_DEPTH_STENCIL_ATTACHMENT, 1, 0);" + }, "use": "opengl_es2" }, "qpa_default_platform": { -- cgit v1.2.3 From 7863be311570fa219066df5fe8720d5b92ddb680 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sat, 8 Dec 2018 19:58:00 +0100 Subject: QTableView: Fix keyboard navigation with disabled rows The keyboard navigation with MovePageUp/Down and MoveEnd did not honor disabled cells in all cases which lead to inconsistencies in the navigation (esp. since MoveHome does honor them correctly). Therefore make sure that all four move operations work consistent by refactoring the code to use common functions. Fixes: QTBUG-72400 Change-Id: I63fa3b626510d21c66f4f9b2b1bfb3261728ecaf Reviewed-by: Friedemann Kleint Reviewed-by: Luca Beldi Reviewed-by: Samuel Gaist Reviewed-by: Richard Moe Gustavsen --- src/widgets/itemviews/qtableview.cpp | 103 +++++++++++++++++++++++++++-------- src/widgets/itemviews/qtableview_p.h | 20 +++---- 2 files changed, 91 insertions(+), 32 deletions(-) (limited to 'src') diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp index 9725a768de..9c509583e6 100644 --- a/src/widgets/itemviews/qtableview.cpp +++ b/src/widgets/itemviews/qtableview.cpp @@ -764,6 +764,66 @@ bool QTableViewPrivate::spanContainsSection(const QHeaderView *header, int logic return false; } +/*! + \internal + Searches for the next cell which is available for e.g. keyboard navigation + The search is done by row +*/ +int QTableViewPrivate::nextActiveVisualRow(int rowToStart, int column, int limit, + SearchDirection searchDirection) const +{ + const int lc = logicalColumn(column); + int visualRow = rowToStart; + const auto isCellActive = [this](int vr, int lc) + { + const int lr = logicalRow(vr); + return !isRowHidden(lr) && isCellEnabled(lr, lc); + }; + switch (searchDirection) { + case SearchDirection::Increasing: + if (visualRow < limit) { + while (!isCellActive(visualRow, lc)) { + if (++visualRow == limit) + return rowToStart; + } + } + break; + case SearchDirection::Decreasing: + while (visualRow > limit && !isCellActive(visualRow, lc)) + --visualRow; + break; + } + return visualRow; +} + +/*! + \internal + Searches for the next cell which is available for e.g. keyboard navigation + The search is done by column +*/ +int QTableViewPrivate::nextActiveVisualColumn(int row, int columnToStart, int limit, + SearchDirection searchDirection) const +{ + const int lr = logicalRow(row); + int visualColumn = columnToStart; + const auto isCellActive = [this](int lr, int vc) + { + const int lc = logicalColumn(vc); + return !isColumnHidden(lc) && isCellEnabled(lr, lc); + }; + switch (searchDirection) { + case SearchDirection::Increasing: + while (visualColumn < limit && !isCellActive(lr, visualColumn)) + ++visualColumn; + break; + case SearchDirection::Decreasing: + while (visualColumn > limit && !isCellActive(lr, visualColumn)) + --visualColumn; + break; + } + return visualColumn; +} + /*! \internal Returns the visual rect for the given \a span. @@ -1800,35 +1860,34 @@ QModelIndex QTableView::moveCursor(CursorAction cursorAction, Qt::KeyboardModifi break; } case MoveHome: - visualColumn = 0; - while (visualColumn < right && d->isVisualColumnHiddenOrDisabled(visualRow, visualColumn)) - ++visualColumn; - if (modifiers & Qt::ControlModifier) { - visualRow = 0; - while (visualRow < bottom && d->isVisualRowHiddenOrDisabled(visualRow, visualColumn)) - ++visualRow; - } + visualColumn = d->nextActiveVisualColumn(visualRow, 0, right, + QTableViewPrivate::SearchDirection::Increasing); + if (modifiers & Qt::ControlModifier) + visualRow = d->nextActiveVisualRow(0, visualColumn, bottom, + QTableViewPrivate::SearchDirection::Increasing); break; case MoveEnd: - visualColumn = right; + visualColumn = d->nextActiveVisualColumn(visualRow, right, -1, + QTableViewPrivate::SearchDirection::Decreasing); if (modifiers & Qt::ControlModifier) - visualRow = bottom; + visualRow = d->nextActiveVisualRow(bottom, current.column(), -1, + QTableViewPrivate::SearchDirection::Decreasing); break; case MovePageUp: { - int newRow = rowAt(visualRect(current).bottom() - d->viewport->height()); - if (newRow == -1) { - int visualRow = 0; - while (visualRow < bottom && isRowHidden(d->logicalRow(visualRow))) - ++visualRow; - newRow = d->logicalRow(visualRow); - } - return d->model->index(newRow, current.column(), d->root); + int newLogicalRow = rowAt(visualRect(current).bottom() - d->viewport->height()); + int visualRow = (newLogicalRow == -1 ? 0 : d->visualRow(newLogicalRow)); + visualRow = d->nextActiveVisualRow(visualRow, current.column(), bottom, + QTableViewPrivate::SearchDirection::Increasing); + newLogicalRow = d->logicalRow(visualRow); + return d->model->index(newLogicalRow, current.column(), d->root); } case MovePageDown: { - int newRow = rowAt(visualRect(current).top() + d->viewport->height()); - if (newRow == -1) - newRow = d->logicalRow(bottom); - return d->model->index(newRow, current.column(), d->root); + int newLogicalRow = rowAt(visualRect(current).top() + d->viewport->height()); + int visualRow = (newLogicalRow == -1 ? bottom : d->visualRow(newLogicalRow)); + visualRow = d->nextActiveVisualRow(visualRow, current.column(), -1, + QTableViewPrivate::SearchDirection::Decreasing); + newLogicalRow = d->logicalRow(visualRow); + return d->model->index(newLogicalRow, current.column(), d->root); }} d->visualCursor = QPoint(visualColumn, visualRow); diff --git a/src/widgets/itemviews/qtableview_p.h b/src/widgets/itemviews/qtableview_p.h index 805787597c..a50e6b6410 100644 --- a/src/widgets/itemviews/qtableview_p.h +++ b/src/widgets/itemviews/qtableview_p.h @@ -234,16 +234,16 @@ public: inline bool isCellEnabled(int row, int column) const { return isIndexEnabled(model->index(row, column, root)); } - inline bool isVisualRowHiddenOrDisabled(int row, int column) const { - int r = logicalRow(row); - int c = logicalColumn(column); - return isRowHidden(r) || !isCellEnabled(r, c); - } - inline bool isVisualColumnHiddenOrDisabled(int row, int column) const { - int r = logicalRow(row); - int c = logicalColumn(column); - return isColumnHidden(c) || !isCellEnabled(r, c); - } + + enum class SearchDirection + { + Increasing, + Decreasing + }; + int nextActiveVisualRow(int rowToStart, int column, int limit, + SearchDirection searchDirection) const; + int nextActiveVisualColumn(int row, int columnToStart, int limit, + SearchDirection searchDirection) const; QRect visualSpanRect(const QSpanCollection::Span &span) const; -- cgit v1.2.3 From 7fc427ba23a624a433d93e1c604d870656835305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thorbj=C3=B8rn=20Lund=20Martsum?= Date: Tue, 4 Dec 2018 13:31:39 +0100 Subject: QToolTip - set correct screen before resize In order to get a correctly not truncated size we need the hint to be calculated based on the screen it is about to be shown on. This patch places some code in QWidgetPrivate that is used by QMenu and QToolTip + can be used to solve similar problems in the future. Task-number: QTBUG-72306 Change-Id: I58c058761f71b4a7675b6a078be62aa813ead752 Reviewed-by: Morten Kristensen Reviewed-by: Oliver Wolff --- src/widgets/kernel/qtooltip.cpp | 9 +++++++++ src/widgets/kernel/qwidget.cpp | 21 +++++++++++++++++++++ src/widgets/kernel/qwidget_p.h | 2 ++ src/widgets/widgets/qmenu.cpp | 20 ++------------------ src/widgets/widgets/qmenu_p.h | 1 - 5 files changed, 34 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp index 2e6575c163..9d8b0062f5 100644 --- a/src/widgets/kernel/qtooltip.cpp +++ b/src/widgets/kernel/qtooltip.cpp @@ -41,6 +41,7 @@ #endif #include +#include #include #include @@ -127,6 +128,7 @@ public: ~QTipLabel(); static QTipLabel *instance; + void adjustTooltipScreen(const QPoint &pos); void updateSize(const QPoint &pos); bool eventFilter(QObject *, QEvent *) override; @@ -222,6 +224,12 @@ void QTipLabel::reuseTip(const QString &text, int msecDisplayTime, const QPoint void QTipLabel::updateSize(const QPoint &pos) { +#ifndef Q_OS_WINRT + // ### The code below does not always work well on WinRT + // (e.g COIN fails an auto test - tst_QToolTip::qtbug64550_stylesheet - QTBUG-72652) + d_func()->setScreenForPoint(pos); +#endif + // Ensure that we get correct sizeHints by placing this window on the right screen. QFontMetrics fm(font()); QSize extra(1, 0); // Make it look good with the default ToolTip font on Mac, which has a small descent. @@ -229,6 +237,7 @@ void QTipLabel::updateSize(const QPoint &pos) ++extra.rheight(); QSize sh = sizeHint(); if (wordWrap()) { + // ### When the above WinRT code is fixed, windowhandle should be used to find the screen. QScreen *screen = QGuiApplication::screenAt(pos); if (!screen) screen = QGuiApplication::primaryScreen(); diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index bcfae46155..2a94b25ec9 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -2571,6 +2571,27 @@ void QWidgetPrivate::createWinId() } } +/*! +\internal +Ensures that the widget is set on the screen point is on. This is handy getting a correct +size hint before a resize in e.g QMenu and QToolTip +*/ + +void QWidgetPrivate::setScreenForPoint(const QPoint &pos) +{ + Q_Q(QWidget); + if (!q->isWindow()) + return; + // Find the screen for pos and make the widget undertand it is on that screen. + const QScreen *currentScreen = windowHandle() ? windowHandle()->screen() : nullptr; + QScreen *actualScreen = QGuiApplication::screenAt(pos); + if (actualScreen && currentScreen != actualScreen) { + if (!windowHandle()) // Try to create a window handle if not created. + createWinId(); + if (windowHandle()) + windowHandle()->setScreen(actualScreen); + } +} /*! \internal diff --git a/src/widgets/kernel/qwidget_p.h b/src/widgets/kernel/qwidget_p.h index be45c4c868..6f1ce67c4c 100644 --- a/src/widgets/kernel/qwidget_p.h +++ b/src/widgets/kernel/qwidget_p.h @@ -355,6 +355,8 @@ public: void createRecursively(); void createWinId(); + void setScreenForPoint(const QPoint &pos); + void createTLExtra(); void createExtra(); void deleteExtra(); diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp index c79e88f094..e3c29ff6ee 100644 --- a/src/widgets/widgets/qmenu.cpp +++ b/src/widgets/widgets/qmenu.cpp @@ -896,23 +896,6 @@ void QMenuPrivate::_q_overrideMenuActionDestroyed() menuAction=defaultMenuAction; } -void QMenuPrivate::adjustMenuScreen(const QPoint &p) -{ - Q_Q(QMenu); - // The windowHandle must point to the screen where the menu will be shown. - // The (item) size calculations depend on the menu screen, - // so a wrong screen would often cause wrong sizes (on high DPI) - const QScreen *currentScreen = q->windowHandle() ? q->windowHandle()->screen() : nullptr; - QScreen *actualScreen = QGuiApplication::screenAt(p); - if (actualScreen && currentScreen != actualScreen) { - if (!q->windowHandle()) // Try to create a window handle if not created. - createWinId(); - if (q->windowHandle()) - q->windowHandle()->setScreen(actualScreen); - itemsDirty = true; - } -} - void QMenuPrivate::updateLayoutDirection() { Q_Q(QMenu); @@ -2375,7 +2358,8 @@ void QMenu::popup(const QPoint &p, QAction *atAction) d->motions = 0; d->doChildEffects = true; d->updateLayoutDirection(); - d->adjustMenuScreen(p); + // Ensure that we get correct sizeHints by placing this window on the right screen. + d->setScreenForPoint(p); const bool contextMenu = d->isContextMenu(); if (d->lastContextMenu != contextMenu) { diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h index 721a35bf90..f740919dc7 100644 --- a/src/widgets/widgets/qmenu_p.h +++ b/src/widgets/widgets/qmenu_p.h @@ -456,7 +456,6 @@ public: bool hasMouseMoved(const QPoint &globalPos); - void adjustMenuScreen(const QPoint &p); void updateLayoutDirection(); QPointer platformMenu; -- cgit v1.2.3 From 71b2de1f1d041ac3a7c932d02b6860c450d7c924 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 14 Dec 2018 09:14:19 +0100 Subject: Windows: Use the ptPaperSize information to set the paper size In some cases the DEVMODE structure is not updated with the selected paper size, whereas the ptPaperSize structure is always set to the right paper size. Therefore we set the page size on the printer to this after the page dialog is shown. Change-Id: Ieafd486232aca6e930f73a8131b7196ddecea305 Reviewed-by: Friedemann Kleint --- src/printsupport/dialogs/qpagesetupdialog_win.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/printsupport/dialogs/qpagesetupdialog_win.cpp b/src/printsupport/dialogs/qpagesetupdialog_win.cpp index 23fff82f25..464381bbe4 100644 --- a/src/printsupport/dialogs/qpagesetupdialog_win.cpp +++ b/src/printsupport/dialogs/qpagesetupdialog_win.cpp @@ -134,6 +134,8 @@ int QPageSetupDialog::exec() QDialog::setVisible(false); if (result) { engine->setGlobalDevMode(psd.hDevNames, psd.hDevMode); + d->printer->setPageSize(QPageSize(QSizeF(psd.ptPaperSize.x / multiplier, psd.ptPaperSize.y / multiplier), + layout.units() == QPageLayout::Inch ? QPageSize::Inch : QPageSize::Millimeter)); const QMarginsF margins(psd.rtMargin.left, psd.rtMargin.top, psd.rtMargin.right, psd.rtMargin.bottom); d->printer->setPageMargins(margins / multiplier, layout.units()); -- cgit v1.2.3 From 1fbd8caca6423622047512fa881817ae7cf55522 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 13 Sep 2018 14:38:11 -0700 Subject: Merge some code to simplify maintenance Change-Id: I8f261579aad648fdb4f0fffd15541369e3625461 Reviewed-by: Samuel Gaist Reviewed-by: Thiago Macieira --- src/corelib/tools/qstring.cpp | 89 ++++++++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index d20c46774d..380ea408d3 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -265,29 +265,32 @@ const ushort *QtPrivate::qustrchr(QStringView str, ushort c) noexcept const ushort *e = reinterpret_cast(str.end()); #ifdef __SSE2__ + // Using the PMOVMSKB instruction, we get two bits for each character + // we compare. __m128i mch = _mm_set1_epi32(c | (c << 16)); + auto hasMatch = [mch, &n](__m128i data, ushort validityMask) { + __m128i result = _mm_cmpeq_epi16(data, mch); + uint mask = uint(_mm_movemask_epi8(result)); + if ((mask & validityMask) == 0) + return false; + uint idx = qCountTrailingZeroBits(mask); + n += idx / 2; + return true; + }; // we're going to read n[0..7] (16 bytes) for (const ushort *next = n + 8; next <= e; n = next, next += 8) { __m128i data = _mm_loadu_si128(reinterpret_cast(n)); - __m128i result = _mm_cmpeq_epi16(data, mch); - uint mask = _mm_movemask_epi8(result); - if (ushort(mask)) { - // found a match - return n + (qCountTrailingZeroBits(mask) >> 1); - } + if (hasMatch(data, 0xffff)) + return n; } # if !defined(__OPTIMIZE_SIZE__) // we're going to read n[0..3] (8 bytes) if (e - n > 3) { __m128i data = _mm_loadl_epi64(reinterpret_cast(n)); - __m128i result = _mm_cmpeq_epi16(data, mch); - uint mask = _mm_movemask_epi8(result); - if (uchar(mask)) { - // found a match - return n + (qCountTrailingZeroBits(mask) >> 1); - } + if (hasMatch(data, 0xff)) + return n; n += 4; } @@ -874,6 +877,19 @@ static int ucstrncmp(const QChar *a, const QChar *b, size_t l) const QChar *end = a + l; qptrdiff offset = 0; + // Using the PMOVMSKB instruction, we get two bits for each character + // we compare. + int retval; + auto isDifferent = [a, b, &offset, &retval](__m128i a_data, __m128i b_data) { + __m128i result = _mm_cmpeq_epi16(a_data, b_data); + uint mask = ~uint(_mm_movemask_epi8(result)); + if (ushort(mask) == 0) + return false; + uint idx = qCountTrailingZeroBits(mask); + retval = a[offset + idx / 2].unicode() - b[offset + idx / 2].unicode(); + return true; + }; + // we're going to read a[0..15] and b[0..15] (32 bytes) for ( ; a + offset + 16 <= end; offset += 16) { #ifdef __AVX2__ @@ -902,13 +918,8 @@ static int ucstrncmp(const QChar *a, const QChar *b, size_t l) if (a + offset + 8 <= end) { __m128i a_data = _mm_loadu_si128(reinterpret_cast(a + offset)); __m128i b_data = _mm_loadu_si128(reinterpret_cast(b + offset)); - __m128i result = _mm_cmpeq_epi16(a_data, b_data); - uint mask = ~_mm_movemask_epi8(result); - if (ushort(mask)) { - // found a different character - uint idx = qCountTrailingZeroBits(mask); - return a[offset + idx / 2].unicode() - b[offset + idx / 2].unicode(); - } + if (isDifferent(a_data, b_data)) + return retval; offset += 8; } @@ -917,13 +928,8 @@ static int ucstrncmp(const QChar *a, const QChar *b, size_t l) if (a + offset + 4 <= end) { __m128i a_data = _mm_loadl_epi64(reinterpret_cast(a + offset)); __m128i b_data = _mm_loadl_epi64(reinterpret_cast(b + offset)); - __m128i result = _mm_cmpeq_epi16(a_data, b_data); - uint mask = ~_mm_movemask_epi8(result); - if (uchar(mask)) { - // found a different character - uint idx = qCountTrailingZeroBits(mask); - return a[offset + idx / 2].unicode() - b[offset + idx / 2].unicode(); - } + if (isDifferent(a_data, b_data)) + return retval; offset += 4; } @@ -1018,6 +1024,19 @@ static int ucstrncmp(const QChar *a, const uchar *c, size_t l) __m128i nullmask = _mm_setzero_si128(); qptrdiff offset = 0; + // Using the PMOVMSKB instruction, we get two bits for each character + // we compare. + int retval; + auto isDifferent = [uc, c, &offset, &retval](__m128i a_data, __m128i b_data) { + __m128i result = _mm_cmpeq_epi16(a_data, b_data); + uint mask = ~uint(_mm_movemask_epi8(result)); + if (ushort(mask) == 0) + return false; + uint idx = qCountTrailingZeroBits(mask); + retval = uc[offset + idx / 2] - c[offset + idx / 2]; + return true; + }; + // we're going to read uc[offset..offset+15] (32 bytes) // and c[offset..offset+15] (16 bytes) for ( ; uc + offset + 15 < e; offset += 16) { @@ -1061,13 +1080,8 @@ static int ucstrncmp(const QChar *a, const uchar *c, size_t l) __m128i secondHalf = mm_load8_zero_extend(c + offset); __m128i ucdata = _mm_loadu_si128((const __m128i*)(uc + offset)); - __m128i result = _mm_cmpeq_epi16(secondHalf, ucdata); - uint mask = ~_mm_movemask_epi8(result); - if (ushort(mask)) { - // found a different character - uint idx = qCountTrailingZeroBits(mask); - return uc[offset + idx / 2] - c[offset + idx / 2]; - } + if (isDifferent(ucdata, secondHalf)) + return retval; // still matched offset += 8; @@ -1080,13 +1094,8 @@ static int ucstrncmp(const QChar *a, const uchar *c, size_t l) __m128i secondHalf = _mm_unpacklo_epi8(chunk, nullmask); __m128i ucdata = _mm_loadl_epi64(reinterpret_cast(uc + offset)); - __m128i result = _mm_cmpeq_epi8(secondHalf, ucdata); - uint mask = ~_mm_movemask_epi8(result); - if (uchar(mask)) { - // found a different character - uint idx = qCountTrailingZeroBits(mask); - return uc[offset + idx / 2] - c[offset + idx / 2]; - } + if (isDifferent(ucdata, secondHalf)) + return retval; // still matched offset += 4; -- cgit v1.2.3 From 482da2e4d2376767172a9a014321822e90fa6096 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Thu, 13 Sep 2018 14:24:24 -0700 Subject: Add an AVX2 code path to qustrchr The new loop does 32 bytes (16 code units) at a time Change-Id: I8f261579aad648fdb4f0fffd155412a4d77428e9 Reviewed-by: Allan Sandfeld Jensen --- src/corelib/tools/qstring.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src') diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 380ea408d3..d50a28abc5 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -265,9 +265,27 @@ const ushort *QtPrivate::qustrchr(QStringView str, ushort c) noexcept const ushort *e = reinterpret_cast(str.end()); #ifdef __SSE2__ + bool loops = true; // Using the PMOVMSKB instruction, we get two bits for each character // we compare. +# if defined(__AVX2__) && !defined(__OPTIMIZE_SIZE__) + // we're going to read n[0..15] (32 bytes) + __m256i mch256 = _mm256_set1_epi32(c | (c << 16)); + for (const ushort *next = n + 16; next <= e; n = next, next += 16) { + __m256i data = _mm256_loadu_si256(reinterpret_cast(n)); + __m256i result = _mm256_cmpeq_epi16(data, mch256); + uint mask = uint(_mm256_movemask_epi8(result)); + if (mask) { + uint idx = qCountTrailingZeroBits(mask); + return n + idx / 2; + } + } + loops = false; + __m128i mch = _mm256_castsi256_si128(mch256); +# else __m128i mch = _mm_set1_epi32(c | (c << 16)); +# endif + auto hasMatch = [mch, &n](__m128i data, ushort validityMask) { __m128i result = _mm_cmpeq_epi16(data, mch); uint mask = uint(_mm_movemask_epi8(result)); @@ -283,6 +301,11 @@ const ushort *QtPrivate::qustrchr(QStringView str, ushort c) noexcept __m128i data = _mm_loadu_si128(reinterpret_cast(n)); if (hasMatch(data, 0xffff)) return n; + + if (!loops) { + n += 8; + break; + } } # if !defined(__OPTIMIZE_SIZE__) -- cgit v1.2.3 From c41c5159d7d7688d61bdd1b013278302bb0116fb Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Sun, 16 Dec 2018 11:02:58 -0800 Subject: Doc: mark QMetaObject::invokeMethod overloads as threadsafe Fixes: QTBUG-72599 Change-Id: I61ce366d57bc46c89db5fffd1570e578a7979749 Reviewed-by: Giuseppe D'Angelo Reviewed-by: Paul Wicking --- src/corelib/kernel/qmetaobject.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src') diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index c642cd07f2..5de2717078 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -1381,6 +1381,8 @@ static inline QByteArray findMethodCandidates(const QMetaObject *metaObject, con } /*! + \threadsafe + Invokes the \a member (a signal or a slot name) on the object \a obj. Returns \c true if the member could be invoked. Returns \c false if there is no such member or the parameters did not match. @@ -1570,6 +1572,7 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase * QGenericArgument val7 = QGenericArgument(), QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument()); + \threadsafe \overload invokeMethod() This overload always invokes the member using the connection type Qt::AutoConnection. @@ -1588,6 +1591,7 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase * QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument()) + \threadsafe \overload invokeMethod() This overload can be used if the return value of the member is of no interest. @@ -1606,6 +1610,7 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase * QGenericArgument val8 = QGenericArgument(), QGenericArgument val9 = QGenericArgument()) + \threadsafe \overload invokeMethod() This overload invokes the member using the connection type Qt::AutoConnection and @@ -1617,6 +1622,7 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase * \since 5.10 + \threadsafe \overload Invokes the \a function in the event loop of \a context. \a function can be a functor @@ -1630,6 +1636,7 @@ bool QMetaObject::invokeMethodImpl(QObject *object, QtPrivate::QSlotObjectBase * \since 5.10 + \threadsafe \overload Invokes the \a function in the event loop of \a context using the connection type Qt::AutoConnection. -- cgit v1.2.3 From 1387f1910bde3743dc181bac9d92e86fb64691ef Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Thu, 13 Dec 2018 20:48:49 +1000 Subject: wasm: emit finished after QNetworkReply abort MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I23445f5e0c936b82aa5d65b261d456a563deab9a Fixes: QTBUG-72516 Reviewed-by: Morten Johan Sørvig --- src/network/access/qnetworkreplywasmimpl.cpp | 31 +++++++++++++++++++--------- src/network/access/qnetworkreplywasmimpl_p.h | 4 ++++ 2 files changed, 25 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/network/access/qnetworkreplywasmimpl.cpp b/src/network/access/qnetworkreplywasmimpl.cpp index e8ca4d4084..3bfe927c9f 100644 --- a/src/network/access/qnetworkreplywasmimpl.cpp +++ b/src/network/access/qnetworkreplywasmimpl.cpp @@ -222,11 +222,17 @@ QByteArray QNetworkReplyWasmImpl::methodName() const void QNetworkReplyWasmImpl::close() { + setFinished(true); + emit finished(); + QNetworkReply::close(); } void QNetworkReplyWasmImpl::abort() { + Q_D(const QNetworkReplyWasmImpl); + d->doAbort(); + close(); } @@ -307,24 +313,29 @@ void QNetworkReplyWasmImplPrivate::setReplyAttributes(quintptr data, int statusC handler->q_func()->setAttribute(QNetworkRequest::HttpReasonPhraseAttribute, statusReason); } +void QNetworkReplyWasmImplPrivate::doAbort() const +{ + m_xhr.call("abort"); +} + void QNetworkReplyWasmImplPrivate::doSendRequest() { Q_Q(QNetworkReplyWasmImpl); totalDownloadSize = 0; - val xhr = val::global("XMLHttpRequest").new_(); + m_xhr = val::global("XMLHttpRequest").new_(); std::string verb = q->methodName().toStdString(); QString extraDataString; - xhr.call("open", verb, request.url().toString().toStdString()); + m_xhr.call("open", verb, request.url().toString().toStdString()); - xhr.set("onerror", val::module_property("QNetworkReplyWasmImplPrivate_requestErrorCallback")); - xhr.set("onload", val::module_property("QNetworkReplyWasmImplPrivate_loadCallback")); - xhr.set("onprogress", val::module_property("QNetworkReplyWasmImplPrivate_progressCallback")); - xhr.set("onreadystatechange", val::module_property("QNetworkReplyWasmImplPrivate_responseHeadersCallback")); + m_xhr.set("onerror", val::module_property("QNetworkReplyWasmImplPrivate_requestErrorCallback")); + m_xhr.set("onload", val::module_property("QNetworkReplyWasmImplPrivate_loadCallback")); + m_xhr.set("onprogress", val::module_property("QNetworkReplyWasmImplPrivate_progressCallback")); + m_xhr.set("onreadystatechange", val::module_property("QNetworkReplyWasmImplPrivate_responseHeadersCallback")); - xhr.set("data-handler", val(quintptr(reinterpret_cast(this)))); + m_xhr.set("data-handler", val(quintptr(reinterpret_cast(this)))); QByteArray contentType = request.rawHeader("Content-Type"); @@ -343,7 +354,7 @@ void QNetworkReplyWasmImplPrivate::doSendRequest() } if (contentType.contains("json")) { if (!extraDataString.isEmpty()) { - xhr.set("responseType", val("json")); + m_xhr.set("responseType", val("json")); dataToSend = val(extraDataString.toStdString()); } } @@ -360,9 +371,9 @@ void QNetworkReplyWasmImplPrivate::doSendRequest() } // set request headers for (auto header : request.rawHeaderList()) { - xhr.call("setRequestHeader", header.toStdString(), request.rawHeader(header).toStdString()); + m_xhr.call("setRequestHeader", header.toStdString(), request.rawHeader(header).toStdString()); } - xhr.call("send", dataToSend); + m_xhr.call("send", dataToSend); } void QNetworkReplyWasmImplPrivate::emitReplyError(QNetworkReply::NetworkError errorCode, const QString &errorString) diff --git a/src/network/access/qnetworkreplywasmimpl_p.h b/src/network/access/qnetworkreplywasmimpl_p.h index 69c90de41a..e1e6bf4e24 100644 --- a/src/network/access/qnetworkreplywasmimpl_p.h +++ b/src/network/access/qnetworkreplywasmimpl_p.h @@ -62,6 +62,7 @@ #include #include +#include QT_BEGIN_NAMESPACE @@ -134,6 +135,9 @@ public: QIODevice *outgoingData; QSharedPointer outgoingDataBuffer; + emscripten::val m_xhr = emscripten::val::null(); + void doAbort() const; + static QNetworkReply::NetworkError statusCodeFromHttp(int httpStatusCode, const QUrl &url); Q_DECLARE_PUBLIC(QNetworkReplyWasmImpl) }; -- cgit v1.2.3 From b6cd5fdc6b7c799a80126659f35801af9a26601a Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 3 May 2018 17:21:03 +0200 Subject: configure: inline openssl test sources Change-Id: I47c1c43b5db30cf1d59de9c6c20ca83abef2cf8c Reviewed-by: Joerg Bornemann --- src/network/configure.json | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/network/configure.json b/src/network/configure.json index e823ed9d2f..10c4f87a2e 100644 --- a/src/network/configure.json +++ b/src/network/configure.json @@ -57,7 +57,17 @@ "openssl_headers": { "label": "OpenSSL Headers", "export": "openssl", - "test": "openssl", + "test": { + "tail": [ + "#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x10000000L", + "# error OpenSSL >= 1.0.0 is required", + "#endif", + "#if OPENSSL_VERSION_NUMBER-0 >= 0x10002000L && !defined(OPENSSL_NO_EC) && !defined(SSL_CTRL_SET_CURVES)", + "# error OpenSSL was reported as >= 1.0.2 but is missing required features, possibly it's libressl which is unsupported", + "#endif" + ] + }, + "headers": [ "openssl/ssl.h", "openssl/opensslv.h" ], "sources": [ { "comment": "placeholder for OPENSSL_PATH", @@ -67,7 +77,10 @@ }, "openssl": { "label": "OpenSSL", - "test": "openssl", + "test": { + "inherit": "openssl_headers", + "main": "SSL_free(SSL_new(0));" + }, "sources": [ { "type": "openssl" }, { @@ -149,7 +162,14 @@ "openssl11": { "label": "OpenSSL 1.1 support", "type": "compile", - "test": "unix/openssl11", + "test": { + "include": "openssl/opensslv.h", + "tail": [ + "#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x10100000L", + "# error OpenSSL >= 1.1 is required", + "#endif" + ] + }, "use": "openssl" }, "dtls": { -- cgit v1.2.3 From 98689cd2f9d3e9e4dac33ccf6679b90d4b39284f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 16 Jul 2018 12:10:19 +0200 Subject: configure: enable inline tests to refer to PWD ... and use that to inline the xlocalescanprint test. Change-Id: I0973133d7f9ecc9a38b70dc4b83df174a35b2b1f Reviewed-by: Joerg Bornemann --- src/corelib/configure.json | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/configure.json b/src/corelib/configure.json index eb213398ca..3b33e6158b 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -467,7 +467,38 @@ "xlocalescanprint": { "label": "xlocale.h (or equivalents)", "type": "compile", - "test": "xlocalescanprint" + "test": { + "files": { + "qglobal.h": [ + "#ifndef QGLOBAL_H", + "#define QGLOBAL_H", + "#endif" + ] + }, + "tail": [ + "#define QT_BEGIN_NAMESPACE", + "#define QT_END_NAMESPACE", + "", + "#ifdef _MSVC_VER", + "#define Q_CC_MSVC _MSVC_VER", + "#endif", + "", + "#define QT_NO_DOUBLECONVERSION", + "", + "#include QDSP_P_H" + ], + "main": [ + "#ifdef _MSVC_VER", + "_locale_t invalidLocale = NULL;", + "#else", + "locale_t invalidLocale = NULL;", + "#endif", + "double a = 3.4;", + "qDoubleSnprintf(argv[0], 1, invalidLocale, \"invalid format\", a);", + "qDoubleSscanf(argv[0], invalidLocale, \"invalid format\", &a, &argc);" + ], + "qmake": "DEFINES += QDSP_P_H=$$shell_quote(\\\"@PWD@/tools/qdoublescanprint_p.h\\\")" + } } }, -- cgit v1.2.3 From 52934d74be7d882f3f584a348ce29bedff7fa7a7 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 16 Jul 2018 14:10:42 +0200 Subject: configure: modernize iconv use use library objects for all variants, and inline the tests. Change-Id: I029f9a6655a783dab4a22abf601aadbb484c03af Reviewed-by: Joerg Bornemann --- src/corelib/codecs/codecs.pri | 3 +-- src/corelib/configure.json | 54 ++++++++++++++++++++++++++++++++----------- 2 files changed, 42 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/corelib/codecs/codecs.pri b/src/corelib/codecs/codecs.pri index f1bbde1d69..5d500ce521 100644 --- a/src/corelib/codecs/codecs.pri +++ b/src/corelib/codecs/codecs.pri @@ -56,8 +56,7 @@ qtConfig(textcodec) { qtConfig(iconv) { HEADERS += codecs/qiconvcodec_p.h SOURCES += codecs/qiconvcodec.cpp - qtConfig(gnu-libiconv): \ - QMAKE_USE_PRIVATE += iconv + QMAKE_USE_PRIVATE += iconv } win32 { diff --git a/src/corelib/configure.json b/src/corelib/configure.json index 3b33e6158b..a22a7459bd 100644 --- a/src/corelib/configure.json +++ b/src/corelib/configure.json @@ -47,14 +47,52 @@ { "type": "pkgConfig", "args": "glib-2.0 gthread-2.0" } ] }, + "posix_iconv": { + "label": "POSIX iconv", + "export": "iconv", + "test": { + "main": [ + "iconv_t x = iconv_open(\"\", \"\");", + "char *inp, *outp;", + "size_t inbytes, outbytes;", + "iconv(x, &inp, &inbytes, &outp, &outbytes);", + "iconv_close(x);" + ] + }, + "headers": "iconv.h", + "sources": [ + { "libs": "-liconv", "condition": "config.openbsd || config.haiku" }, + { "libs": "", "condition": "!(config.openbsd || config.haiku)" } + ] + }, "gnu_iconv": { "label": "GNU libiconv", "export": "iconv", - "test": "gnu-libiconv", + "test": { + "main": [ + "iconv_t x = iconv_open(\"\", \"\");", + "const char *inp;", + "char *outp;", + "size_t inbytes, outbytes;", + "iconv(x, &inp, &inbytes, &outp, &outbytes);", + "iconv_close(x);" + ] + }, + "headers": "iconv.h", "sources": [ "-liconv" ] }, + "sun_iconv": { + "label": "SUN libiconv", + "export": "iconv", + "test": { + "inherit": "gnu_iconv" + }, + "sources": [ + "" + ] + }, "icu": { "label": "ICU", "test": { @@ -336,16 +374,6 @@ ] } }, - "posix-iconv": { - "label": "POSIX iconv", - "type": "compile", - "test": "iconv" - }, - "sun-iconv": { - "label": "SUN libiconv", - "type": "compile", - "test": "sun-libiconv" - }, "inotify": { "label": "inotify", "type": "compile", @@ -576,14 +604,14 @@ "label": "POSIX iconv", "enable": "input.iconv == 'posix'", "disable": "input.iconv == 'sun' || input.iconv == 'gnu' || input.iconv == 'no'", - "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && tests.posix-iconv", + "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && libs.posix_iconv", "output": [ "privateFeature" ] }, "sun-libiconv": { "label": "SUN iconv", "enable": "input.iconv == 'sun'", "disable": "input.iconv == 'posix' || input.iconv == 'gnu' || input.iconv == 'no'", - "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && tests.sun-iconv" + "condition": "!config.win32 && !config.qnx && !config.android && !config.darwin && !features.posix-libiconv && libs.sun_iconv" }, "gnu-libiconv": { "label": "GNU iconv", -- cgit v1.2.3 From 23207d1d2386d97b9d27f2af385d70f80c14ab95 Mon Sep 17 00:00:00 2001 From: Sune Vuorela Date: Sun, 16 Dec 2018 13:52:45 +0100 Subject: Empty filenames does not exist If empty paths is passed to the unix filesystem engine, we get a warning about empty filename passed to function, before returning false. Fix this by testing for empty string first, and don't send empty string to file engine. The current warning leads to code like if (!filename.isEmpty() && QFile::exists(filename)) { // } rather than the slightly cleaner if (QFile::exists(filename)) { // } Change-Id: I0207324889ec22e5a072c28d58337d117b0153b1 Reviewed-by: Thiago Macieira Reviewed-by: Mitch Curtis --- src/corelib/io/qfileinfo.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/corelib/io/qfileinfo.cpp b/src/corelib/io/qfileinfo.cpp index 26078a6c71..185e061d8f 100644 --- a/src/corelib/io/qfileinfo.cpp +++ b/src/corelib/io/qfileinfo.cpp @@ -703,6 +703,8 @@ bool QFileInfo::exists() const */ bool QFileInfo::exists(const QString &file) { + if (file.isEmpty()) + return false; QFileSystemEntry entry(file); QFileSystemMetaData data; QAbstractFileEngine *engine = -- cgit v1.2.3 From 3a74a3b5a644ac196942c717d31cd5f8438f3c0b Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Thu, 20 Dec 2018 09:13:26 +0100 Subject: QSQL: add support for PostgreSQL 11 Add support for PostgreSQL 11 by adding QPSQLDriver::Version11 and use it in qMakePSQLVersion(). [ChangeLog][QSQL][PostgreSQL] Added support for PostgreSQL 11 Fixes: QTBUG-71642 Change-Id: Ie3cd3a81fd00084b587457b91b4e92c2e7001172 Reviewed-by: Andy Shaw Reviewed-by: Robert Szefner --- src/plugins/sqldrivers/psql/qsql_psql.cpp | 4 +++- src/plugins/sqldrivers/psql/qsql_psql_p.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/sqldrivers/psql/qsql_psql.cpp b/src/plugins/sqldrivers/psql/qsql_psql.cpp index bf0493b0c3..7ad9db1ea8 100644 --- a/src/plugins/sqldrivers/psql/qsql_psql.cpp +++ b/src/plugins/sqldrivers/psql/qsql_psql.cpp @@ -1060,8 +1060,10 @@ static QPSQLDriver::Protocol qMakePSQLVersion(int vMaj, int vMin) } case 10: return QPSQLDriver::Version10; + case 11: + return QPSQLDriver::Version11; default: - if (vMaj > 10) + if (vMaj > 11) return QPSQLDriver::UnknownLaterVersion; break; } diff --git a/src/plugins/sqldrivers/psql/qsql_psql_p.h b/src/plugins/sqldrivers/psql/qsql_psql_p.h index 2873a9f851..7e1849d857 100644 --- a/src/plugins/sqldrivers/psql/qsql_psql_p.h +++ b/src/plugins/sqldrivers/psql/qsql_psql_p.h @@ -92,6 +92,7 @@ public: Version9_5 = 21, Version9_6 = 22, Version10 = 23, + Version11 = 24, UnknownLaterVersion = 100000 }; -- cgit v1.2.3 From b45c1e1c0e3dd838543c1e8d4725d9436367a16a Mon Sep 17 00:00:00 2001 From: Sami Nurmenniemi Date: Wed, 12 Dec 2018 13:45:16 +0200 Subject: Add possibility to configure QNX display order MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add environmental variable QT_QPA_QNX_DISPLAY_CONFIG for pointing to a file containing display order. Configuration file format is: { "displayOrder": [ 3, 1 ] } Task-number: QTBUG-66394 Change-Id: I8c20eb2b5cf35617d5a030213f5d4d68e62ace85 Reviewed-by: Kari Oikarinen Reviewed-by: Pasi Petäjäjärvi --- src/plugins/platforms/qnx/qqnxintegration.cpp | 114 +++++++++++++++++++++++++- src/plugins/platforms/qnx/qqnxintegration.h | 2 + 2 files changed, 112 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/qnx/qqnxintegration.cpp b/src/plugins/platforms/qnx/qqnxintegration.cpp index 8c8521325c..db79780407 100644 --- a/src/plugins/platforms/qnx/qqnxintegration.cpp +++ b/src/plugins/platforms/qnx/qqnxintegration.cpp @@ -88,7 +88,10 @@ #include #include - +#include +#include +#include +#include #include #if defined(QQNXINTEGRATION_DEBUG) @@ -490,6 +493,108 @@ void QQnxIntegration::removeWindow(screen_window_t qnxWindow) m_windowMapper.remove(qnxWindow); } +/*! + Get display ID for given \a display + + Returns -1 for failure, otherwise returns display ID + */ +static int getIdOfDisplay(screen_display_t display) +{ + int displayId; + if (screen_get_display_property_iv(display, + SCREEN_PROPERTY_ID, + &displayId) == 0) { + return displayId; + } + return -1; +} + +/*! + Read JSON configuration file for the QNX display order + + Returns true if file was read successfully and fills \a requestedDisplays + */ +static bool getRequestedDisplays(QJsonArray &requestedDisplays) +{ + // Check if display configuration file is provided + QByteArray json = qgetenv("QT_QPA_QNX_DISPLAY_CONFIG"); + if (json.isEmpty()) + return false; + + // Check if configuration file exists + QFile file(QString::fromUtf8(json)); + if (!file.open(QFile::ReadOnly)) { + qWarning() << "Could not open config file" << json << "for reading"; + return false; + } + + // Read config file and check it's json + const QJsonDocument doc = QJsonDocument::fromJson(file.readAll()); + if (!doc.isObject()) { + qWarning() << "Invalid config file" << json + << "- no top-level JSON object"; + return false; + } + + // Read the requested display order + const QJsonObject object = doc.object(); + requestedDisplays = object.value(QLatin1String("displayOrder")).toArray(); + + return true; +} + +/*! + Match \a availableDisplays with display order defined in a json file + pointed to by QT_QPA_QNX_DISPLAY_CONFIG. Display order must use same + identifiers as defined for displays in graphics.conf. Number of + available displays must be specified in \a displayCount + + An example configuration is below: + \badcode + { + "displayOrder": [ 3, 1 ] + } + \endcode + + Returns ordered list of displays. If no order was specified, returns + displays in the same order as in the original list. +*/ +QList QQnxIntegration::sortDisplays(screen_display_t *availableDisplays, int displayCount) +{ + // Intermediate list for sorting + QList allDisplays; + for (int i = 0; i < displayCount; i++) + allDisplays.append(&availableDisplays[i]); + + // Read requested display order if available + QJsonArray requestedDisplays; + if (!getRequestedDisplays(requestedDisplays)) + return allDisplays; + + // Go through all the requested displays IDs + QList orderedDisplays; + for (const QJsonValue &value : qAsConst(requestedDisplays)) { + int requestedValue = value.toInt(); + + // Move all displays with matching ID from the intermediate list + // to the beginning of the ordered list + QMutableListIterator iter(allDisplays); + while (iter.hasNext()) { + screen_display_t *display = iter.next(); + if (getIdOfDisplay(*display) == requestedValue) { + orderedDisplays.append(display); + iter.remove(); + break; + } + } + } + + // Place all unordered displays to the end of list + orderedDisplays.append(allDisplays); + + return orderedDisplays; +} + void QQnxIntegration::createDisplays() { qIntegrationDebug(); @@ -508,15 +613,16 @@ void QQnxIntegration::createDisplays() screen_display_t *displays = (screen_display_t *)alloca(sizeof(screen_display_t) * displayCount); result = screen_get_context_property_pv(m_screenContext, SCREEN_PROPERTY_DISPLAYS, (void **)displays); + QList orderedDisplays = sortDisplays(displays, displayCount); Q_SCREEN_CRITICALERROR(result, "Failed to query displays"); // If it's primary, we create a QScreen for it even if it's not attached // since Qt will dereference QGuiApplication::primaryScreen() - createDisplay(displays[0], /*isPrimary=*/true); + createDisplay(*orderedDisplays[0], /*isPrimary=*/true); for (int i=1; i sortDisplays(screen_display_t *displays, + int displayCount); screen_context_t m_screenContext; QQnxScreenEventThread *m_screenEventThread; -- cgit v1.2.3 From e6880e7cd145fe07651e8afdfd4a15d57b810024 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 20 Dec 2018 09:27:09 +0100 Subject: Fix text shifting vertically when elided When eliding text we would check for the existence of the ellipsis character and fall back to using the dot if it was not available. However, when font merging was in use, we would also use ellipsis from a fallback font if available. This could cause the metrics of the text to increase if the fallback font had larger metrics, and the result was that text could shift when elided. It is better to prefer the dot from the current font than to use the ellipsis from a fallback, so we only use the ellipsis if it is in the main font. [ChangeLog][QtGui][Text] Fixed a bug where eliding text could change the height of its bounding rectangle for certain fonts. Fixes: QTBUG-72553 Change-Id: Ib27fc65302465ddce661801bcc5ae32e55f1aeb9 Reviewed-by: Simon Hausmann --- src/gui/text/qtextengine.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src') diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 8de16038ad..bdb5592e9e 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -3192,6 +3192,16 @@ QString QTextEngine::elidedText(Qt::TextElideMode mode, const QFixed &width, int QChar ellipsisChar(0x2026); + // We only want to use the ellipsis character if it is from the main + // font (not one of the fallbacks), since using a fallback font + // will affect the metrics of the text, potentially causing it to shift + // when it is being elided. + if (engine->type() == QFontEngine::Multi) { + QFontEngineMulti *multiEngine = static_cast(engine); + multiEngine->ensureEngineAt(0); + engine = multiEngine->engine(0); + } + glyph_t glyph = engine->glyphIndex(ellipsisChar.unicode()); QGlyphLayout glyphs; -- cgit v1.2.3 From 28b2232e7818f560bcd6c57f09ef42f2363e5338 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Thu, 20 Dec 2018 12:17:30 +0100 Subject: Don't dither antialiasing on glyphs when converting to mono When glyphs are converted to monochrome from an alpha map, it does not make sense to apply high quality dithering, because the result will be that some the subpixels along the edges that cover only part of a pixel are filled. This causes the glyphs to look jagged and ugly. Instead, we use ThresholdDither to fill all pixels that are >= 50% opacity. [ChangeLog][QtGui][Text] Improved appearance of monochrome text on some platforms. Fixes: QTBUG-69702 Change-Id: I0f44a8d73f6b9f1eb59f297d66438575f1e9db10 Reviewed-by: Allan Sandfeld Jensen --- src/gui/painting/qtextureglyphcache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index 2a7e0eaa0c..99b04aaba6 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -335,7 +335,7 @@ void QImageTextureGlyphCache::fillTexture(const Coord &c, glyph_t g, QFixed subP // TODO optimize this mask = mask.alphaChannel(); mask.invertPixels(); - mask = mask.convertToFormat(QImage::Format_Mono); + mask = mask.convertToFormat(QImage::Format_Mono, Qt::ThresholdDither); } int mw = qMin(mask.width(), c.w); -- cgit v1.2.3 From 4aac07d0237cd4895f670ae2df6a8844ab91b699 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 2 Nov 2018 10:36:20 +0100 Subject: Android: Add support for setting/getting html and uris from clipboard This also updates the used API to use ClipData and not the deprecated ClipboardManager API. [ChangeLog][Platform Specific Changes][Android] QClipboard now supports HTML and URI data. Fixes: QTBUG-47835 Fixes: QTBUG-71503 Change-Id: I43f82bfc63b3d159087c0fb6c840c186a370e20c Reviewed-by: Eskil Abrahamsen Blomfeldt --- .../src/org/qtproject/qt5/android/QtNative.java | 131 +++++++++++++++++++-- .../platforms/android/androidjniclipboard.cpp | 68 ++++++++--- .../platforms/android/androidjniclipboard.h | 5 +- .../android/qandroidplatformclipboard.cpp | 11 +- .../platforms/android/qandroidplatformclipboard.h | 5 +- 5 files changed, 180 insertions(+), 40 deletions(-) (limited to 'src') diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java index adc67e93fb..5562c010aa 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java @@ -47,6 +47,7 @@ import java.util.concurrent.Semaphore; import android.app.Activity; import android.app.Service; import android.content.Context; +import android.content.ContentResolver; import android.content.Intent; import android.content.pm.PackageManager; import android.content.pm.ActivityInfo; @@ -57,6 +58,7 @@ import android.os.IBinder; import android.os.Looper; import android.content.ClipboardManager; import android.content.ClipboardManager.OnPrimaryClipChangedListener; +import android.content.ClipData; import android.util.Log; import android.view.ContextMenu; import android.view.KeyEvent; @@ -98,7 +100,9 @@ public class QtNative private static ClipboardManager m_clipboardManager = null; private static Method m_checkSelfPermissionMethod = null; private static Boolean m_tabletEventSupported = null; + private static boolean m_usePrimaryClip = false; public static QtThread m_qtThread = new QtThread(); + private static Method m_addItemMethod = null; private static final Runnable runPendingCppRunnablesRunnable = new Runnable() { @Override public void run() { @@ -697,26 +701,133 @@ public class QtNative } } + private static void clearClipData() + { + m_usePrimaryClip = false; + } private static void setClipboardText(String text) { - if (m_clipboardManager != null) - m_clipboardManager.setText(text); + if (m_clipboardManager != null) { + ClipData clipData = ClipData.newPlainText("text/plain", text); + updatePrimaryClip(clipData); + } } public static boolean hasClipboardText() { - if (m_clipboardManager != null) - return m_clipboardManager.hasText(); - else - return false; + if (m_clipboardManager != null && m_clipboardManager.hasPrimaryClip()) { + ClipData primaryClip = m_clipboardManager.getPrimaryClip(); + for (int i = 0; i < primaryClip.getItemCount(); ++i) + if (primaryClip.getItemAt(i).getText() != null) + return true; + } + return false; } private static String getClipboardText() { - if (m_clipboardManager != null) - return m_clipboardManager.getText().toString(); - else - return ""; + if (m_clipboardManager != null && m_clipboardManager.hasPrimaryClip()) { + ClipData primaryClip = m_clipboardManager.getPrimaryClip(); + for (int i = 0; i < primaryClip.getItemCount(); ++i) + if (primaryClip.getItemAt(i).getText() != null) + return primaryClip.getItemAt(i).getText().toString(); + } + return ""; + } + + private static void updatePrimaryClip(ClipData clipData) + { + if (m_usePrimaryClip) { + ClipData clip = m_clipboardManager.getPrimaryClip(); + if (Build.VERSION.SDK_INT >= 26) { + if (m_addItemMethod == null) { + Class[] cArg = new Class[2]; + cArg[0] = ContentResolver.class; + cArg[1] = ClipData.Item.class; + try { + m_addItemMethod = m_clipboardManager.getClass().getMethod("addItem", cArg); + } catch (Exception e) { + } + } + } + if (m_addItemMethod != null) { + try { + m_addItemMethod.invoke(m_activity.getContentResolver(), clipData.getItemAt(0)); + } catch (Exception e) { + e.printStackTrace(); + } + } else { + clip.addItem(clipData.getItemAt(0)); + } + m_clipboardManager.setPrimaryClip(clip); + } else { + m_clipboardManager.setPrimaryClip(clipData); + m_usePrimaryClip = true; + } + } + + private static void setClipboardHtml(String text, String html) + { + if (m_clipboardManager != null) { + ClipData clipData = ClipData.newHtmlText("text/html", text, html); + updatePrimaryClip(clipData); + } + } + + public static boolean hasClipboardHtml() + { + if (m_clipboardManager != null && m_clipboardManager.hasPrimaryClip()) { + ClipData primaryClip = m_clipboardManager.getPrimaryClip(); + for (int i = 0; i < primaryClip.getItemCount(); ++i) + if (primaryClip.getItemAt(i).getHtmlText() != null) + return true; + } + return false; + } + + private static String getClipboardHtml() + { + if (m_clipboardManager != null && m_clipboardManager.hasPrimaryClip()) { + ClipData primaryClip = m_clipboardManager.getPrimaryClip(); + for (int i = 0; i < primaryClip.getItemCount(); ++i) + if (primaryClip.getItemAt(i).getHtmlText() != null) + return primaryClip.getItemAt(i).getHtmlText().toString(); + } + return ""; + } + + private static void setClipboardUri(String uriString) + { + if (m_clipboardManager != null) { + ClipData clipData = ClipData.newUri(m_activity.getContentResolver(), "text/uri-list", + Uri.parse(uriString)); + updatePrimaryClip(clipData); + } + } + + public static boolean hasClipboardUri() + { + if (m_clipboardManager != null && m_clipboardManager.hasPrimaryClip()) { + ClipData primaryClip = m_clipboardManager.getPrimaryClip(); + for (int i = 0; i < primaryClip.getItemCount(); ++i) + if (primaryClip.getItemAt(i).getUri() != null) + return true; + } + return false; + } + + private static String[] getClipboardUris() + { + ArrayList uris = new ArrayList(); + if (m_clipboardManager != null && m_clipboardManager.hasPrimaryClip()) { + ClipData primaryClip = m_clipboardManager.getPrimaryClip(); + for (int i = 0; i < primaryClip.getItemCount(); ++i) + if (primaryClip.getItemAt(i).getUri() != null) + uris.add(primaryClip.getItemAt(i).getUri().toString()); + } + String[] strings = new String[uris.size()]; + strings = uris.toArray(strings); + return strings; } private static void openContextMenu(final int x, final int y, final int w, final int h) diff --git a/src/plugins/platforms/android/androidjniclipboard.cpp b/src/plugins/platforms/android/androidjniclipboard.cpp index d169035339..671d0b56d0 100644 --- a/src/plugins/platforms/android/androidjniclipboard.cpp +++ b/src/plugins/platforms/android/androidjniclipboard.cpp @@ -38,6 +38,7 @@ ****************************************************************************/ #include "androidjniclipboard.h" +#include #include QT_BEGIN_NAMESPACE @@ -62,27 +63,60 @@ namespace QtAndroidClipboard return; } } - - void setClipboardText(const QString &text) + void setClipboardMimeData(QMimeData *data) { - QJNIObjectPrivate::callStaticMethod(applicationClass(), - "setClipboardText", - "(Ljava/lang/String;)V", - QJNIObjectPrivate::fromString(text).object()); - } - - bool hasClipboardText() - { - return QJNIObjectPrivate::callStaticMethod(applicationClass(), - "hasClipboardText"); + QJNIObjectPrivate::callStaticMethod(applicationClass(), "clearClipData"); + if (data->hasText()) { + QJNIObjectPrivate::callStaticMethod(applicationClass(), + "setClipboardText", "(Ljava/lang/String;)V", + QJNIObjectPrivate::fromString(data->text()).object()); + } + if (data->hasHtml()) { + QJNIObjectPrivate::callStaticMethod(applicationClass(), + "setClipboardHtml", + "(Ljava/lang/String;Ljava/lang/String;)V", + QJNIObjectPrivate::fromString(data->text()).object(), + QJNIObjectPrivate::fromString(data->html()).object()); + } + if (data->hasUrls()) { + QList urls = data->urls(); + for (const auto &u : qAsConst(urls)) { + QJNIObjectPrivate::callStaticMethod(applicationClass(), "setClipboardUri", + "(Ljava/lang/String;)V", + QJNIObjectPrivate::fromString(u.toEncoded()).object()); + } + } } - QString clipboardText() + QMimeData *getClipboardMimeData() { - QJNIObjectPrivate text = QJNIObjectPrivate::callStaticObjectMethod(applicationClass(), - "getClipboardText", - "()Ljava/lang/String;"); - return text.toString(); + QMimeData *data = new QMimeData; + if (QJNIObjectPrivate::callStaticMethod(applicationClass(), "hasClipboardText")) { + data->setText(QJNIObjectPrivate::callStaticObjectMethod(applicationClass(), + "getClipboardText", + "()Ljava/lang/String;").toString()); + } + if (QJNIObjectPrivate::callStaticMethod(applicationClass(), "hasClipboardHtml")) { + data->setHtml(QJNIObjectPrivate::callStaticObjectMethod(applicationClass(), + "getClipboardHtml", + "()Ljava/lang/String;").toString()); + } + if (QJNIObjectPrivate::callStaticMethod(applicationClass(), "hasClipboardUri")) { + QJNIObjectPrivate uris = QJNIObjectPrivate::callStaticObjectMethod(applicationClass(), + "getClipboardUris", + "()[Ljava/lang/String;"); + if (uris.isValid()) { + QList urls; + QJNIEnvironmentPrivate env; + jobjectArray juris = static_cast(uris.object()); + const jint nUris = env->GetArrayLength(juris); + urls.reserve(static_cast(nUris)); + for (int i = 0; i < nUris; ++i) + urls << QUrl(QJNIObjectPrivate(env->GetObjectArrayElement(juris, i)).toString()); + data->setUrls(urls); + } + } + return data; } void onClipboardDataChanged(JNIEnv */*env*/, jobject /*thiz*/) diff --git a/src/plugins/platforms/android/androidjniclipboard.h b/src/plugins/platforms/android/androidjniclipboard.h index 2ec566e729..e83e6b555c 100644 --- a/src/plugins/platforms/android/androidjniclipboard.h +++ b/src/plugins/platforms/android/androidjniclipboard.h @@ -51,9 +51,8 @@ namespace QtAndroidClipboard { // Clipboard support void setClipboardManager(QAndroidPlatformClipboard *manager); - void setClipboardText(const QString &text); - bool hasClipboardText(); - QString clipboardText(); + void setClipboardMimeData(QMimeData *data); + QMimeData *getClipboardMimeData(); void onClipboardDataChanged(JNIEnv */*env*/, jobject /*thiz*/); // Clipboard support } diff --git a/src/plugins/platforms/android/qandroidplatformclipboard.cpp b/src/plugins/platforms/android/qandroidplatformclipboard.cpp index dc5147b259..17dfe27d12 100644 --- a/src/plugins/platforms/android/qandroidplatformclipboard.cpp +++ b/src/plugins/platforms/android/qandroidplatformclipboard.cpp @@ -52,16 +52,15 @@ QMimeData *QAndroidPlatformClipboard::mimeData(QClipboard::Mode mode) { Q_UNUSED(mode); Q_ASSERT(supportsMode(mode)); - m_mimeData.setText(QtAndroidClipboard::hasClipboardText() - ? QtAndroidClipboard::clipboardText() - : QString()); - return &m_mimeData; + QMimeData *data = QtAndroidClipboard::getClipboardMimeData(); + data->setParent(this); + return data; } void QAndroidPlatformClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode) { - if (supportsMode(mode)) - QtAndroidClipboard::setClipboardText(data != 0 && data->hasText() ? data->text() : QString()); + if (data && supportsMode(mode)) + QtAndroidClipboard::setClipboardMimeData(data); if (data != 0) data->deleteLater(); } diff --git a/src/plugins/platforms/android/qandroidplatformclipboard.h b/src/plugins/platforms/android/qandroidplatformclipboard.h index dfc3629c10..3ed9d323f8 100644 --- a/src/plugins/platforms/android/qandroidplatformclipboard.h +++ b/src/plugins/platforms/android/qandroidplatformclipboard.h @@ -46,7 +46,7 @@ #ifndef QT_NO_CLIPBOARD QT_BEGIN_NAMESPACE -class QAndroidPlatformClipboard: public QPlatformClipboard +class QAndroidPlatformClipboard : public QObject, public QPlatformClipboard { public: QAndroidPlatformClipboard(); @@ -54,9 +54,6 @@ public: QMimeData *mimeData(QClipboard::Mode mode = QClipboard::Clipboard) override; void setMimeData(QMimeData *data, QClipboard::Mode mode = QClipboard::Clipboard) override; bool supportsMode(QClipboard::Mode mode) const override; - -private: - QMimeData m_mimeData; }; QT_END_NAMESPACE -- cgit v1.2.3 From c879fc2ab7c5278f1a1f7727b011479a5baafc0c Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 14 Dec 2018 07:46:12 +0100 Subject: Pass the alignment to QFontMetrics::elidedText() When the text is elided, it needs to account for the mnenomic if there is one so it does not end up eliding the text unnecessarily. Change-Id: I77c15067f3e8d57d8deca83090bcb80554c3733f Reviewed-by: Christian Ehrlicher Reviewed-by: Richard Moe Gustavsen --- src/widgets/styles/qcommonstyle.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 10dfad2754..9fbbe1893a 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -1675,7 +1675,8 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt, alignment |= Qt::AlignLeft | Qt::AlignVCenter; } tr.translate(shiftX, shiftY); - const QString text = toolbutton->fontMetrics.elidedText(toolbutton->text, Qt::ElideMiddle, tr.width()); + const QString text = toolbutton->fontMetrics.elidedText(toolbutton->text, Qt::ElideMiddle, + tr.width(), alignment); proxy()->drawItemText(p, QStyle::visualRect(opt->direction, rect, tr), alignment, toolbutton->palette, toolbutton->state & State_Enabled, text, QPalette::ButtonText); -- cgit v1.2.3 From 9ab04795e2eb8ae3fdb6ab6ef75f26db9d25e876 Mon Sep 17 00:00:00 2001 From: Antonio Larrosa Date: Fri, 21 Dec 2018 15:22:35 +0100 Subject: Fix qfloat16 methods definition without declaration when using Q_QDOC This fixes qtdoc failing to build on i586 because of an assertion in libclang since Q_QDOC is defined and thus the declaration of the qfloat16(float) constructor and operator float() are removed, thus their definitions should be removed too, which is what this patch does. Fixes: QTBUG-72725 Done-with: Michal Srb Change-Id: I6424873425d46345e09f411f9ce88f2520825da4 Reviewed-by: Thiago Macieira Reviewed-by: Jesus Fernandez --- src/corelib/global/qfloat16.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/corelib/global/qfloat16.h b/src/corelib/global/qfloat16.h index a8befd7adb..3e50ad8467 100644 --- a/src/corelib/global/qfloat16.h +++ b/src/corelib/global/qfloat16.h @@ -123,6 +123,7 @@ Q_REQUIRED_RESULT inline bool qIsNull(qfloat16 f) Q_DECL_NOTHROW inline int qIntCast(qfloat16 f) Q_DECL_NOTHROW { return int(static_cast(f)); } +#ifndef Q_QDOC QT_WARNING_PUSH QT_WARNING_DISABLE_CLANG("-Wc99-extensions") QT_WARNING_DISABLE_GCC("-Wold-style-cast") @@ -162,6 +163,7 @@ inline qfloat16::operator float() const Q_DECL_NOTHROW return f; #endif } +#endif inline qfloat16 operator-(qfloat16 a) Q_DECL_NOTHROW { -- cgit v1.2.3 From a7cea16005ea657d5de82d99a1f716a267eaf9bb Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Fri, 14 Dec 2018 12:34:55 -0800 Subject: MSVC x86: implement add_overflow for quint64 There's no 64-bit ADD instruction, so we make do with ADD+ADC. This is what Clang generates. ICC uses the two as well, but then performs some subtractions to find out if it overflowed. GCC for some inexplicable reason attempts to use SSE2 if that's enabled, otherwise it performs the subtractions like ICC. Alternative implementation which generates better code, but violates strict aliasing: uint *low = reinterpret_cast(r); uint *high = low + 1; return _addcarry_u32(_addcarry_u32(0, unsigned(v1), unsigned(v2), low), v1 >> 32, v2 >> 32, high); Manual testing shows this works. tst_qnumeric passes in debug mode. MSVC 2017 15.9 still miscompiles in release mode (reported to MS as [1]). [1] https://developercommunity.visualstudio.com/content/problem/409039/-addcarry-u32-wrong-results-with-constant-inputs.html Change-Id: I61ce366d57bc46c89db5fffd15704d53ebd4af3c Reviewed-by: Thomas Miller Reviewed-by: Allan Sandfeld Jensen --- src/corelib/global/qnumeric_p.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/corelib/global/qnumeric_p.h b/src/corelib/global/qnumeric_p.h index 0a6db9afcd..c762da80d3 100644 --- a/src/corelib/global/qnumeric_p.h +++ b/src/corelib/global/qnumeric_p.h @@ -373,10 +373,18 @@ template <> inline bool add_overflow(unsigned v1, unsigned v2, unsigned *r) // 32-bit mul_overflow is fine with the generic code above -# if defined(Q_PROCESSOR_X86_64) template <> inline bool add_overflow(quint64 v1, quint64 v2, quint64 *r) -{ return _addcarry_u64(0, v1, v2, reinterpret_cast(r)); } -# endif // x86-64 +{ +# if defined(Q_PROCESSOR_X86_64) + return _addcarry_u64(0, v1, v2, reinterpret_cast(r)); +# else + uint low, high; + uchar carry = _addcarry_u32(0, unsigned(v1), unsigned(v2), &low); + carry = _addcarry_u32(carry, v1 >> 32, v2 >> 32, &high); + *r = (quint64(high) << 32) | low; + return carry; +# endif // !x86-64 +} # endif // MSVC X86 #endif // !GCC } -- cgit v1.2.3 From f372714e96c91619179574b05d97cea07ffc3b5d Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 17 Dec 2018 10:51:33 +0100 Subject: Doc: Fix typo in QStyle Change-Id: Ic979cb66acb3f8824aefb6ad858c0f746ce3e02b Reviewed-by: Leena Miettinen --- src/widgets/styles/qstyle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/widgets/styles/qstyle.cpp b/src/widgets/styles/qstyle.cpp index 8006be8c27..ac4fb7fbd1 100644 --- a/src/widgets/styles/qstyle.cpp +++ b/src/widgets/styles/qstyle.cpp @@ -1998,7 +1998,7 @@ void QStyle::drawItemPixmap(QPainter *painter, const QRect &rect, int alignment, This enum value has been introduced in Qt 5.10. \value SH_SpinBox_ButtonsInsideFrame - Determnines if the spin box buttons are inside the line edit frame. + Determines if the spin box buttons are inside the line edit frame. This enum value has been introduced in Qt 5.11. \value SH_SpinBox_StepModifier -- cgit v1.2.3 From 28a28af182c7fb9b0cf6d0b9ccc948843c6992a1 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 20 Dec 2018 15:48:06 +0100 Subject: QtCore: Unify license headers Change-Id: Iff4f6da9f0bbf7a0627101f455dd8467681b2783 Reviewed-by: Thiago Macieira --- ...c_corelib_animation_qparallelanimationgroup.cpp | 51 +++++++++------ .../src_corelib_animation_qpropertyanimation.cpp | 51 +++++++++------ ...corelib_animation_qsequentialanimationgroup.cpp | 51 +++++++++------ .../src_corelib_animation_qvariantanimation.cpp | 51 +++++++++------ .../snippets/code/src_corelib_global_qlogging.cpp | 51 +++++++++------ .../snippets/code/src_corelib_global_qnumeric.cpp | 51 +++++++++------ .../src_corelib_global_qoperatingsystemversion.cpp | 51 +++++++++------ .../snippets/code/src_corelib_global_qrandom.cpp | 49 ++++++++------ .../doc/snippets/code/src_corelib_io_qdebug.cpp | 49 ++++++++------ .../snippets/code/src_corelib_io_qfileselector.cpp | 49 ++++++++------ .../code/src_corelib_io_qloggingcategory.cpp | 51 +++++++++------ .../snippets/code/src_corelib_io_qstorageinfo.cpp | 49 ++++++++------ .../doc/snippets/code/src_corelib_io_qurlquery.cpp | 51 +++++++++------ .../code/src_corelib_kernel_qdeadlinetimer.cpp | 49 ++++++++------ .../code/src_corelib_kernel_qtestsupport_core.cpp | 51 +++++++++------ .../code/src_corelib_serialization_qcborstream.cpp | 49 ++++++++------ .../code/src_corelib_serialization_qcborvalue.cpp | 49 ++++++++------ .../code/src_corelib_serialization_qdatastream.cpp | 51 +++++++++------ .../src_corelib_serialization_qjsondocument.cpp | 51 +++++++++------ .../code/src_corelib_tools_qbytearraymatcher.cpp | 51 +++++++++------ .../code/src_corelib_tools_qcontiguouscache.cpp | 51 +++++++++------ .../code/src_corelib_tools_qshareddata.cpp | 51 +++++++++------ .../code/src_corelib_tools_qsharedpointer.cpp | 49 ++++++++------ .../code/src_corelib_tools_qstringview.cpp | 51 +++++++++------ .../code/src_gui_itemviews_qidentityproxymodel.cpp | 2 +- src/corelib/doc/snippets/hellotrmain.cpp | 2 +- src/corelib/doc/snippets/qbytearraylist/main.cpp | 51 +++++++++------ src/corelib/doc/snippets/qelapsedtimer/main.cpp | 2 +- src/corelib/doc/snippets/qloggingcategory/main.cpp | 2 +- .../doc/snippets/resource-system/mainwindow.cpp | 2 +- src/corelib/doc/snippets/timers/analogclock.cpp | 2 +- src/corelib/global/archdetect.cpp | 2 +- src/corelib/itemmodels/qabstractproxymodel.cpp | 2 +- src/corelib/itemmodels/qabstractproxymodel.h | 2 +- src/corelib/itemmodels/qabstractproxymodel_p.h | 2 +- src/corelib/itemmodels/qidentityproxymodel.cpp | 2 +- src/corelib/itemmodels/qidentityproxymodel.h | 2 +- src/corelib/itemmodels/qitemselectionmodel.cpp | 2 +- src/corelib/itemmodels/qitemselectionmodel.h | 2 +- src/corelib/itemmodels/qitemselectionmodel_p.h | 2 +- src/corelib/itemmodels/qsortfilterproxymodel.cpp | 2 +- src/corelib/itemmodels/qsortfilterproxymodel.h | 2 +- src/corelib/itemmodels/qstringlistmodel.cpp | 2 +- src/corelib/itemmodels/qstringlistmodel.h | 2 +- src/corelib/kernel/qcore_mac_objc.mm | 76 +++++++++++----------- src/corelib/kernel/qppsattribute.cpp | 74 ++++++++++----------- src/corelib/kernel/qppsattribute_p.h | 75 ++++++++++----------- src/corelib/kernel/qppsattributeprivate_p.h | 74 ++++++++++----------- src/corelib/kernel/qppsobject.cpp | 74 ++++++++++----------- src/corelib/kernel/qppsobject_p.h | 74 ++++++++++----------- src/corelib/kernel/qppsobjectprivate_p.h | 74 ++++++++++----------- src/corelib/kernel/qtestsupport_core.cpp | 2 +- src/corelib/kernel/qtestsupport_core.h | 2 +- src/corelib/tools/qstring_mips_dsp_asm.S | 2 +- 54 files changed, 1050 insertions(+), 774 deletions(-) (limited to 'src') diff --git a/src/corelib/doc/snippets/code/src_corelib_animation_qparallelanimationgroup.cpp b/src/corelib/doc/snippets/code/src_corelib_animation_qparallelanimationgroup.cpp index 3fc53bc58b..472c5d41c4 100644 --- a/src/corelib/doc/snippets/code/src_corelib_animation_qparallelanimationgroup.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_animation_qparallelanimationgroup.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_animation_qpropertyanimation.cpp b/src/corelib/doc/snippets/code/src_corelib_animation_qpropertyanimation.cpp index a6dbd909d7..7bd8121b90 100644 --- a/src/corelib/doc/snippets/code/src_corelib_animation_qpropertyanimation.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_animation_qpropertyanimation.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_animation_qsequentialanimationgroup.cpp b/src/corelib/doc/snippets/code/src_corelib_animation_qsequentialanimationgroup.cpp index 1f1363f127..0eff184926 100644 --- a/src/corelib/doc/snippets/code/src_corelib_animation_qsequentialanimationgroup.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_animation_qsequentialanimationgroup.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_animation_qvariantanimation.cpp b/src/corelib/doc/snippets/code/src_corelib_animation_qvariantanimation.cpp index b462ff2d6a..0808dcc145 100644 --- a/src/corelib/doc/snippets/code/src_corelib_animation_qvariantanimation.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_animation_qvariantanimation.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qlogging.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qlogging.cpp index 7b0b357cff..7589050bc2 100644 --- a/src/corelib/doc/snippets/code/src_corelib_global_qlogging.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_global_qlogging.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qnumeric.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qnumeric.cpp index 5d64070b1b..d281089041 100644 --- a/src/corelib/doc/snippets/code/src_corelib_global_qnumeric.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_global_qnumeric.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qoperatingsystemversion.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qoperatingsystemversion.cpp index d9e927c55a..c712dfa432 100644 --- a/src/corelib/doc/snippets/code/src_corelib_global_qoperatingsystemversion.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_global_qoperatingsystemversion.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_global_qrandom.cpp b/src/corelib/doc/snippets/code/src_corelib_global_qrandom.cpp index b03e656b64..6e47a7a3d9 100644 --- a/src/corelib/doc/snippets/code/src_corelib_global_qrandom.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_global_qrandom.cpp @@ -4,9 +4,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -15,24 +15,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qdebug.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qdebug.cpp index 4bbdc509ca..14e72e99dd 100644 --- a/src/corelib/doc/snippets/code/src_corelib_io_qdebug.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_io_qdebug.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qfileselector.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qfileselector.cpp index 91c94eb762..0d1aa691cf 100644 --- a/src/corelib/doc/snippets/code/src_corelib_io_qfileselector.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_io_qfileselector.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtWidgets module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qloggingcategory.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qloggingcategory.cpp index 20ae52a251..cab48f1e27 100644 --- a/src/corelib/doc/snippets/code/src_corelib_io_qloggingcategory.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_io_qloggingcategory.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qstorageinfo.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qstorageinfo.cpp index e0594433ff..c7a1b34f7a 100644 --- a/src/corelib/doc/snippets/code/src_corelib_io_qstorageinfo.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_io_qstorageinfo.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2014 Ivan Komissarov ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_io_qurlquery.cpp b/src/corelib/doc/snippets/code/src_corelib_io_qurlquery.cpp index da87bfd143..22f1d3260f 100644 --- a/src/corelib/doc/snippets/code/src_corelib_io_qurlquery.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_io_qurlquery.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtWidgets module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_kernel_qdeadlinetimer.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qdeadlinetimer.cpp index eb291d7b18..35c06f842e 100644 --- a/src/corelib/doc/snippets/code/src_corelib_kernel_qdeadlinetimer.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_kernel_qdeadlinetimer.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtWidgets module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp b/src/corelib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp index ed3e9bd0c0..e793cb1f55 100644 --- a/src/corelib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_kernel_qtestsupport_core.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtTest module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_serialization_qcborstream.cpp b/src/corelib/doc/snippets/code/src_corelib_serialization_qcborstream.cpp index dbe38aa4b5..6ddb5a9365 100644 --- a/src/corelib/doc/snippets/code/src_corelib_serialization_qcborstream.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_serialization_qcborstream.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtWidgets module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_serialization_qcborvalue.cpp b/src/corelib/doc/snippets/code/src_corelib_serialization_qcborvalue.cpp index 63f813cf69..5406536cfe 100644 --- a/src/corelib/doc/snippets/code/src_corelib_serialization_qcborvalue.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_serialization_qcborvalue.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtWidgets module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_serialization_qdatastream.cpp b/src/corelib/doc/snippets/code/src_corelib_serialization_qdatastream.cpp index 5caaa16727..cfcc2f8f94 100644 --- a/src/corelib/doc/snippets/code/src_corelib_serialization_qdatastream.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_serialization_qdatastream.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_serialization_qjsondocument.cpp b/src/corelib/doc/snippets/code/src_corelib_serialization_qjsondocument.cpp index c4913b1740..1fe328c0a0 100644 --- a/src/corelib/doc/snippets/code/src_corelib_serialization_qjsondocument.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_serialization_qjsondocument.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearraymatcher.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearraymatcher.cpp index 63fc1f91e7..9cf94f0494 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qbytearraymatcher.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qbytearraymatcher.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qcontiguouscache.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qcontiguouscache.cpp index 6bc9604243..84780374e9 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qcontiguouscache.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qcontiguouscache.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qshareddata.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qshareddata.cpp index 45e8b0a965..88c8ae4151 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qshareddata.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qshareddata.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qsharedpointer.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qsharedpointer.cpp index 69061ce298..e2979fa7b4 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qsharedpointer.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qsharedpointer.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: ** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_corelib_tools_qstringview.cpp b/src/corelib/doc/snippets/code/src_corelib_tools_qstringview.cpp index 5dc153372c..fc426e1977 100644 --- a/src/corelib/doc/snippets/code/src_corelib_tools_qstringview.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_tools_qstringview.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtWidgets module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp b/src/corelib/doc/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp index d89e28836f..c1af521c03 100644 --- a/src/corelib/doc/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp +++ b/src/corelib/doc/snippets/code/src_gui_itemviews_qidentityproxymodel.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2016 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage diff --git a/src/corelib/doc/snippets/hellotrmain.cpp b/src/corelib/doc/snippets/hellotrmain.cpp index 7e09c58f4f..2fab919a47 100644 --- a/src/corelib/doc/snippets/hellotrmain.cpp +++ b/src/corelib/doc/snippets/hellotrmain.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the examples of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage diff --git a/src/corelib/doc/snippets/qbytearraylist/main.cpp b/src/corelib/doc/snippets/qbytearraylist/main.cpp index 8a861eca4a..fd52ef945b 100644 --- a/src/corelib/doc/snippets/qbytearraylist/main.cpp +++ b/src/corelib/doc/snippets/qbytearraylist/main.cpp @@ -3,9 +3,9 @@ ** Copyright (C) 2014 by Southwest Research Institute (R) ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtCore module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** -** $QT_BEGIN_LICENSE:LGPL$ +** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the @@ -14,24 +14,35 @@ ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 3 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL3 included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 3 requirements -** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 2.0 or (at your option) the GNU General -** Public license version 3 or any later version approved by the KDE Free -** Qt Foundation. The licenses are as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-2.0.html and -** https://www.gnu.org/licenses/gpl-3.0.html. +** BSD License Usage +** Alternatively, you may use this file under the terms of the BSD license +** as follows: +** +** "Redistribution and use in source and binary forms, with or without +** modification, are permitted provided that the following conditions are +** met: +** * Redistributions of source code must retain the above copyright +** notice, this list of conditions and the following disclaimer. +** * Redistributions in binary form must reproduce the above copyright +** notice, this list of conditions and the following disclaimer in +** the documentation and/or other materials provided with the +** distribution. +** * Neither the name of The Qt Company Ltd nor the names of its +** contributors may be used to endorse or promote products derived +** from this software without specific prior written permission. +** +** +** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." ** ** $QT_END_LICENSE$ ** diff --git a/src/corelib/doc/snippets/qelapsedtimer/main.cpp b/src/corelib/doc/snippets/qelapsedtimer/main.cpp index add6ad0169..408c4eab07 100644 --- a/src/corelib/doc/snippets/qelapsedtimer/main.cpp +++ b/src/corelib/doc/snippets/qelapsedtimer/main.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtNetwork module of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage diff --git a/src/corelib/doc/snippets/qloggingcategory/main.cpp b/src/corelib/doc/snippets/qloggingcategory/main.cpp index 73df3c2d2f..f5c47b2ae8 100644 --- a/src/corelib/doc/snippets/qloggingcategory/main.cpp +++ b/src/corelib/doc/snippets/qloggingcategory/main.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the examples of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage diff --git a/src/corelib/doc/snippets/resource-system/mainwindow.cpp b/src/corelib/doc/snippets/resource-system/mainwindow.cpp index 6fcf52e588..bbeeec64ac 100644 --- a/src/corelib/doc/snippets/resource-system/mainwindow.cpp +++ b/src/corelib/doc/snippets/resource-system/mainwindow.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the examples of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage diff --git a/src/corelib/doc/snippets/timers/analogclock.cpp b/src/corelib/doc/snippets/timers/analogclock.cpp index 0dc2fbc708..4e1957a450 100644 --- a/src/corelib/doc/snippets/timers/analogclock.cpp +++ b/src/corelib/doc/snippets/timers/analogclock.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the examples of the Qt Toolkit. +** This file is part of the documentation of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:BSD$ ** Commercial License Usage diff --git a/src/corelib/global/archdetect.cpp b/src/corelib/global/archdetect.cpp index 422df3ff90..66a5e074f6 100644 --- a/src/corelib/global/archdetect.cpp +++ b/src/corelib/global/archdetect.cpp @@ -4,7 +4,7 @@ ** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the FOO module of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/corelib/itemmodels/qabstractproxymodel.cpp b/src/corelib/itemmodels/qabstractproxymodel.cpp index b7c49a53e4..62b3ee85b9 100644 --- a/src/corelib/itemmodels/qabstractproxymodel.cpp +++ b/src/corelib/itemmodels/qabstractproxymodel.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/corelib/itemmodels/qabstractproxymodel.h b/src/corelib/itemmodels/qabstractproxymodel.h index c4e5d67908..08ecf9d15f 100644 --- a/src/corelib/itemmodels/qabstractproxymodel.h +++ b/src/corelib/itemmodels/qabstractproxymodel.h @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/corelib/itemmodels/qabstractproxymodel_p.h b/src/corelib/itemmodels/qabstractproxymodel_p.h index 3a9f33baba..f7bd5cc691 100644 --- a/src/corelib/itemmodels/qabstractproxymodel_p.h +++ b/src/corelib/itemmodels/qabstractproxymodel_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/corelib/itemmodels/qidentityproxymodel.cpp b/src/corelib/itemmodels/qidentityproxymodel.cpp index c1e23dbd0c..f869601d3f 100644 --- a/src/corelib/itemmodels/qidentityproxymodel.cpp +++ b/src/corelib/itemmodels/qidentityproxymodel.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/corelib/itemmodels/qidentityproxymodel.h b/src/corelib/itemmodels/qidentityproxymodel.h index 3e6f5e4c48..89ac89cdba 100644 --- a/src/corelib/itemmodels/qidentityproxymodel.h +++ b/src/corelib/itemmodels/qidentityproxymodel.h @@ -3,7 +3,7 @@ ** Copyright (C) 2011 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com, author Stephen Kelly ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/corelib/itemmodels/qitemselectionmodel.cpp b/src/corelib/itemmodels/qitemselectionmodel.cpp index edb9bb9098..1bacb63b17 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.cpp +++ b/src/corelib/itemmodels/qitemselectionmodel.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/corelib/itemmodels/qitemselectionmodel.h b/src/corelib/itemmodels/qitemselectionmodel.h index 63e5f0ca9c..1c924053a5 100644 --- a/src/corelib/itemmodels/qitemselectionmodel.h +++ b/src/corelib/itemmodels/qitemselectionmodel.h @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/corelib/itemmodels/qitemselectionmodel_p.h b/src/corelib/itemmodels/qitemselectionmodel_p.h index 187d4a2c1d..e12a0c2928 100644 --- a/src/corelib/itemmodels/qitemselectionmodel_p.h +++ b/src/corelib/itemmodels/qitemselectionmodel_p.h @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.cpp b/src/corelib/itemmodels/qsortfilterproxymodel.cpp index 21fbf83382..87960b0863 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.cpp +++ b/src/corelib/itemmodels/qsortfilterproxymodel.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/corelib/itemmodels/qsortfilterproxymodel.h b/src/corelib/itemmodels/qsortfilterproxymodel.h index 0be8b88672..303226668f 100644 --- a/src/corelib/itemmodels/qsortfilterproxymodel.h +++ b/src/corelib/itemmodels/qsortfilterproxymodel.h @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/corelib/itemmodels/qstringlistmodel.cpp b/src/corelib/itemmodels/qstringlistmodel.cpp index 567e6fa35e..0adaba9b9a 100644 --- a/src/corelib/itemmodels/qstringlistmodel.cpp +++ b/src/corelib/itemmodels/qstringlistmodel.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/corelib/itemmodels/qstringlistmodel.h b/src/corelib/itemmodels/qstringlistmodel.h index a40c13ae40..53376285c6 100644 --- a/src/corelib/itemmodels/qstringlistmodel.h +++ b/src/corelib/itemmodels/qstringlistmodel.h @@ -3,7 +3,7 @@ ** Copyright (C) 2016 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/corelib/kernel/qcore_mac_objc.mm b/src/corelib/kernel/qcore_mac_objc.mm index 4ca9c2e996..cb3539f3ec 100644 --- a/src/corelib/kernel/qcore_mac_objc.mm +++ b/src/corelib/kernel/qcore_mac_objc.mm @@ -1,42 +1,42 @@ /**************************************************************************** - ** - ** Copyright (C) 2016 The Qt Company Ltd. - ** Copyright (C) 2014 Petroules Corporation. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtCore module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ +** +** Copyright (C) 2016 The Qt Company Ltd. +** Copyright (C) 2014 Petroules Corporation. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ #include diff --git a/src/corelib/kernel/qppsattribute.cpp b/src/corelib/kernel/qppsattribute.cpp index ffd5c53a6d..6be462edb5 100644 --- a/src/corelib/kernel/qppsattribute.cpp +++ b/src/corelib/kernel/qppsattribute.cpp @@ -1,41 +1,41 @@ /**************************************************************************** - ** - ** Copyright (C) 2013 BlackBerry Limited. All rights reserved. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtCore module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ +** +** Copyright (C) 2013 BlackBerry Limited. All rights reserved. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ #include "qppsattribute_p.h" #include "qppsattributeprivate_p.h" diff --git a/src/corelib/kernel/qppsattribute_p.h b/src/corelib/kernel/qppsattribute_p.h index 035756e002..b59dcd5851 100644 --- a/src/corelib/kernel/qppsattribute_p.h +++ b/src/corelib/kernel/qppsattribute_p.h @@ -1,41 +1,42 @@ /**************************************************************************** - ** - ** Copyright (C) 2013 BlackBerry Limited. All rights reserved. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtCore module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ +** +** Copyright (C) 2013 BlackBerry Limited. All rights reserved. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + #ifndef QPPSATTRIBUTE_P_H #define QPPSATTRIBUTE_P_H diff --git a/src/corelib/kernel/qppsattributeprivate_p.h b/src/corelib/kernel/qppsattributeprivate_p.h index 6166447ef2..78b7b3c4c2 100644 --- a/src/corelib/kernel/qppsattributeprivate_p.h +++ b/src/corelib/kernel/qppsattributeprivate_p.h @@ -1,41 +1,41 @@ /**************************************************************************** - ** - ** Copyright (C) 2013 BlackBerry Limited. All rights reserved. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtCore module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ +** +** Copyright (C) 2013 BlackBerry Limited. All rights reserved. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ #ifndef QPPSATTRIBUTEPRIVATE_P_H #define QPPSATTRIBUTEPRIVATE_P_H diff --git a/src/corelib/kernel/qppsobject.cpp b/src/corelib/kernel/qppsobject.cpp index d58715d12b..f4001d3833 100644 --- a/src/corelib/kernel/qppsobject.cpp +++ b/src/corelib/kernel/qppsobject.cpp @@ -1,41 +1,41 @@ /**************************************************************************** - ** - ** Copyright (C) 2013 BlackBerry Limited. All rights reserved. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtCore module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ +** +** Copyright (C) 2013 BlackBerry Limited. All rights reserved. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ #include "qppsobject_p.h" diff --git a/src/corelib/kernel/qppsobject_p.h b/src/corelib/kernel/qppsobject_p.h index c7b99c8e42..abcf00fa05 100644 --- a/src/corelib/kernel/qppsobject_p.h +++ b/src/corelib/kernel/qppsobject_p.h @@ -1,41 +1,41 @@ /**************************************************************************** - ** - ** Copyright (C) 2013 BlackBerry Limited. All rights reserved. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtCore module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ +** +** Copyright (C) 2013 BlackBerry Limited. All rights reserved. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ #ifndef QPPSOBJECT_P_H #define QPPSOBJECT_P_H diff --git a/src/corelib/kernel/qppsobjectprivate_p.h b/src/corelib/kernel/qppsobjectprivate_p.h index dae44e3609..d6b4640832 100644 --- a/src/corelib/kernel/qppsobjectprivate_p.h +++ b/src/corelib/kernel/qppsobjectprivate_p.h @@ -1,41 +1,41 @@ /**************************************************************************** - ** - ** Copyright (C) 2013 BlackBerry Limited. All rights reserved. - ** Contact: https://www.qt.io/licensing/ - ** - ** This file is part of the QtCore module of the Qt Toolkit. - ** - ** $QT_BEGIN_LICENSE:LGPL$ - ** Commercial License Usage - ** Licensees holding valid commercial Qt licenses may use this file in - ** accordance with the commercial license agreement provided with the - ** Software or, alternatively, in accordance with the terms contained in - ** a written agreement between you and The Qt Company. For licensing terms - ** and conditions see https://www.qt.io/terms-conditions. For further - ** information use the contact form at https://www.qt.io/contact-us. - ** - ** GNU Lesser General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU Lesser - ** General Public License version 3 as published by the Free Software - ** Foundation and appearing in the file LICENSE.LGPL3 included in the - ** packaging of this file. Please review the following information to - ** ensure the GNU Lesser General Public License version 3 requirements - ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. - ** - ** GNU General Public License Usage - ** Alternatively, this file may be used under the terms of the GNU - ** General Public License version 2.0 or (at your option) the GNU General - ** Public license version 3 or any later version approved by the KDE Free - ** Qt Foundation. The licenses are as published by the Free Software - ** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 - ** included in the packaging of this file. Please review the following - ** information to ensure the GNU General Public License requirements will - ** be met: https://www.gnu.org/licenses/gpl-2.0.html and - ** https://www.gnu.org/licenses/gpl-3.0.html. - ** - ** $QT_END_LICENSE$ - ** - ****************************************************************************/ +** +** Copyright (C) 2013 BlackBerry Limited. All rights reserved. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the QtCore module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** Commercial License Usage +** Licensees holding valid commercial Qt licenses may use this file in +** accordance with the commercial license agreement provided with the +** Software or, alternatively, in accordance with the terms contained in +** a written agreement between you and The Qt Company. For licensing terms +** and conditions see https://www.qt.io/terms-conditions. For further +** information use the contact form at https://www.qt.io/contact-us. +** +** GNU Lesser General Public License Usage +** Alternatively, this file may be used under the terms of the GNU Lesser +** General Public License version 3 as published by the Free Software +** Foundation and appearing in the file LICENSE.LGPL3 included in the +** packaging of this file. Please review the following information to +** ensure the GNU Lesser General Public License version 3 requirements +** will be met: https://www.gnu.org/licenses/lgpl-3.0.html. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 2.0 or (at your option) the GNU General +** Public license version 3 or any later version approved by the KDE Free +** Qt Foundation. The licenses are as published by the Free Software +** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3 +** included in the packaging of this file. Please review the following +** information to ensure the GNU General Public License requirements will +** be met: https://www.gnu.org/licenses/gpl-2.0.html and +** https://www.gnu.org/licenses/gpl-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ #ifndef QPPSOBJECTPRIVATE_P_H_ #define QPPSOBJECTPRIVATE_P_H_ diff --git a/src/corelib/kernel/qtestsupport_core.cpp b/src/corelib/kernel/qtestsupport_core.cpp index d69551a227..e00ad75fef 100644 --- a/src/corelib/kernel/qtestsupport_core.cpp +++ b/src/corelib/kernel/qtestsupport_core.cpp @@ -3,7 +3,7 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtTest module of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/corelib/kernel/qtestsupport_core.h b/src/corelib/kernel/qtestsupport_core.h index 7fc0054580..c8b664b6d3 100644 --- a/src/corelib/kernel/qtestsupport_core.h +++ b/src/corelib/kernel/qtestsupport_core.h @@ -3,7 +3,7 @@ ** Copyright (C) 2018 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtTest module of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage diff --git a/src/corelib/tools/qstring_mips_dsp_asm.S b/src/corelib/tools/qstring_mips_dsp_asm.S index faf90e14be..202f322310 100644 --- a/src/corelib/tools/qstring_mips_dsp_asm.S +++ b/src/corelib/tools/qstring_mips_dsp_asm.S @@ -3,7 +3,7 @@ ** Copyright (C) 2013 Imagination Technologies Limited, www.imgtec.com ** Contact: https://www.qt.io/licensing/ ** -** This file is part of the QtGui module of the Qt Toolkit. +** This file is part of the QtCore module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage -- cgit v1.2.3 From 07e5edf99123de2d0a8620eb89b14bc2eb99b675 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 5 Dec 2018 10:48:55 +0100 Subject: Doc: Consistently mark QT_XYZ_CAST_FROM_ASCII with \c Otherwise it gets linkified, which looks inconsistent. Instead, use \sa for functions where QT_NO_CAST_FROM_ASCII or QT_RESTRICTED_CAST_FROM_ASCII is referenced. Change-Id: Ic3933d8c4c81c963215de7f3aac4d0a11e61cbc2 Reviewed-by: Paul Wicking Reviewed-by: Oswald Buddenhagen Reviewed-by: Martin Smith --- src/corelib/tools/qchar.cpp | 2 +- src/corelib/tools/qstring.cpp | 96 +++++++++++++++++++++++++++++++++--- src/corelib/tools/qstringbuilder.cpp | 2 +- 3 files changed, 91 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/qchar.cpp b/src/corelib/tools/qchar.cpp index 94de69f075..47c853084b 100644 --- a/src/corelib/tools/qchar.cpp +++ b/src/corelib/tools/qchar.cpp @@ -652,7 +652,7 @@ QT_BEGIN_NAMESPACE Constructs a QChar corresponding to ASCII/Latin-1 character \a ch. \note This constructor is not available when \c QT_NO_CAST_FROM_ASCII - or QT_RESTRICTED_CAST_FROM_ASCII is defined. + or \c QT_RESTRICTED_CAST_FROM_ASCII is defined. \sa QT_NO_CAST_FROM_ASCII, QT_RESTRICTED_CAST_FROM_ASCII */ diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index d50a28abc5..63d44eb39c 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -1350,7 +1350,7 @@ const QString::Null QString::null = { }; literals and 8-bit data to unicode QStrings, but allows the use of the \c{QChar(char)} and \c{QString(const char (&ch)[N]} constructors, and the \c{QString::operator=(const char (&ch)[N])} assignment operator - giving most of the type-safety benefits of QT_NO_CAST_FROM_ASCII + giving most of the type-safety benefits of \c QT_NO_CAST_FROM_ASCII but does not require user code to wrap character and string literals with QLatin1Char, QLatin1String or similar. @@ -2005,13 +2005,13 @@ const QString::Null QString::null = { }; can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. - \note Defining QT_RESTRICTED_CAST_FROM_ASCII also disables + \note Defining \c QT_RESTRICTED_CAST_FROM_ASCII also disables this constructor, but enables a \c{QString(const char (&ch)[N])} constructor instead. Using non-literal input, or input with embedded NUL characters, or non-7-bit characters is undefined in this case. - \sa fromLatin1(), fromLocal8Bit(), fromUtf8() + \sa fromLatin1(), fromLocal8Bit(), fromUtf8(), QT_NO_CAST_FROM_ASCII, QT_RESTRICTED_CAST_FROM_ASCII */ /*! \fn QString QString::fromStdString(const std::string &str) @@ -2204,7 +2204,7 @@ QString::QString(QChar ch) can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. - \sa fromLatin1(), fromLocal8Bit(), fromUtf8() + \sa fromLatin1(), fromLocal8Bit(), fromUtf8(), QT_NO_CAST_FROM_ASCII */ /*! \fn QString::QString(const Null &) @@ -2452,6 +2452,8 @@ QString &QString::operator=(QLatin1String other) QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \fn QString &QString::operator=(const char *str) @@ -2466,6 +2468,7 @@ QString &QString::operator=(QLatin1String other) This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + \sa QT_NO_CAST_FROM_ASCII, QT_RESTRICTED_CAST_FROM_ASCII */ /*! \fn QString &QString::operator=(char ch) @@ -2480,6 +2483,8 @@ QString &QString::operator=(QLatin1String other) QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! @@ -2542,8 +2547,10 @@ QString &QString::operator=(QChar ch) If the given \a position is greater than size(), the array is first extended using resize(). - This function is not available when QT_NO_CAST_FROM_ASCII is + This function is not available when \c QT_NO_CAST_FROM_ASCII is defined. + + \sa QT_NO_CAST_FROM_ASCII */ @@ -2558,8 +2565,10 @@ QString &QString::operator=(QChar ch) If the given \a position is greater than size(), the array is first extended using resize(). - This function is not available when QT_NO_CAST_FROM_ASCII is + This function is not available when \c QT_NO_CAST_FROM_ASCII is defined. + + \sa QT_NO_CAST_FROM_ASCII */ @@ -2724,6 +2733,8 @@ QString &QString::append(QLatin1String str) when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \fn QString &QString::append(const char *str) @@ -2737,6 +2748,8 @@ QString &QString::append(QLatin1String str) when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! @@ -2799,6 +2812,8 @@ QString &QString::append(QChar ch) QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \fn QString &QString::prepend(const char *str) @@ -2812,6 +2827,8 @@ QString &QString::append(QChar ch) QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \fn QString &QString::prepend(QChar ch) @@ -3410,6 +3427,8 @@ bool QString::operator==(QLatin1String other) const Q_DECL_NOTHROW Returns \c true if this string is lexically equal to the parameter string \a other. Otherwise returns \c false. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \fn bool QString::operator==(const char *other) const @@ -3423,6 +3442,8 @@ bool QString::operator==(QLatin1String other) const Q_DECL_NOTHROW QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! @@ -3463,6 +3484,8 @@ bool QString::operator<(QLatin1String other) const Q_DECL_NOTHROW QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \fn bool QString::operator<(const char *other) const @@ -3479,6 +3502,8 @@ bool QString::operator<(QLatin1String other) const Q_DECL_NOTHROW QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \fn bool operator<=(const QString &s1, const QString &s2) @@ -3514,6 +3539,8 @@ bool QString::operator<(QLatin1String other) const Q_DECL_NOTHROW QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \fn bool QString::operator<=(const char *other) const @@ -3527,6 +3554,8 @@ bool QString::operator<(QLatin1String other) const Q_DECL_NOTHROW QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \fn bool operator>(const QString &s1, const QString &s2) @@ -3564,6 +3593,8 @@ bool QString::operator>(QLatin1String other) const Q_DECL_NOTHROW QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \fn bool QString::operator>(const char *other) const @@ -3577,6 +3608,8 @@ bool QString::operator>(QLatin1String other) const Q_DECL_NOTHROW when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \fn bool operator>=(const QString &s1, const QString &s2) @@ -3611,6 +3644,8 @@ bool QString::operator>(QLatin1String other) const Q_DECL_NOTHROW when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \fn bool QString::operator>=(const char *other) const @@ -3624,6 +3659,8 @@ bool QString::operator>(QLatin1String other) const Q_DECL_NOTHROW when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \fn bool operator!=(const QString &s1, const QString &s2) @@ -3658,6 +3695,8 @@ bool QString::operator>(QLatin1String other) const Q_DECL_NOTHROW when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \fn bool QString::operator!=(const char *other) const @@ -3671,6 +3710,8 @@ bool QString::operator>(QLatin1String other) const Q_DECL_NOTHROW QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! @@ -6064,6 +6105,8 @@ QString& QString::fill(QChar ch, int size) QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \fn QString &QString::operator+=(const char *str) @@ -6077,6 +6120,8 @@ QString& QString::fill(QChar ch, int size) when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \fn QString &QString::operator+=(const QStringRef &str) @@ -6098,6 +6143,8 @@ QString& QString::fill(QChar ch, int size) when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \fn QString &QString::operator+=(QChar ch) @@ -9275,7 +9322,7 @@ QString &QString::setRawData(const QChar *unicode, int size) in the first place. In those cases, using QStringLiteral may be the better option. - \sa QString, QLatin1Char, {QStringLiteral()}{QStringLiteral} + \sa QString, QLatin1Char, {QStringLiteral()}{QStringLiteral}, QT_NO_CAST_FROM_ASCII */ /*! @@ -9752,6 +9799,8 @@ QString &QString::setRawData(const QChar *unicode, int size) QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! @@ -9766,6 +9815,8 @@ QString &QString::setRawData(const QChar *unicode, int size) QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \fn bool QLatin1String::operator!=(const QString &other) const @@ -9791,6 +9842,8 @@ QString &QString::setRawData(const QChar *unicode, int size) QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! @@ -9805,6 +9858,8 @@ QString &QString::setRawData(const QChar *unicode, int size) QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! @@ -9831,6 +9886,8 @@ QString &QString::setRawData(const QChar *unicode, int size) when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! @@ -9845,6 +9902,8 @@ QString &QString::setRawData(const QChar *unicode, int size) when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! @@ -9871,6 +9930,8 @@ QString &QString::setRawData(const QChar *unicode, int size) QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! @@ -9885,6 +9946,8 @@ QString &QString::setRawData(const QChar *unicode, int size) QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! @@ -9911,6 +9974,8 @@ QString &QString::setRawData(const QChar *unicode, int size) QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! @@ -9925,6 +9990,8 @@ QString &QString::setRawData(const QChar *unicode, int size) QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \fn bool QLatin1String::operator<=(const QString &other) const @@ -9950,6 +10017,8 @@ QString &QString::setRawData(const QChar *unicode, int size) QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ /*! @@ -9964,6 +10033,8 @@ QString &QString::setRawData(const QChar *unicode, int size) QT_NO_CAST_FROM_ASCII when you compile your applications. This can be useful if you want to ensure that all user-visible strings go through QObject::tr(), for example. + + \sa QT_NO_CAST_FROM_ASCII */ @@ -10592,6 +10663,7 @@ bool operator<(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW Returns \c true if this string is lexically equal to the parameter string \a s. Otherwise returns \c false. + \sa QT_NO_CAST_FROM_ASCII */ /*! @@ -10609,6 +10681,8 @@ bool operator<(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW Returns \c true if this string is not lexically equal to the parameter string \a s. Otherwise returns \c false. + + \sa QT_NO_CAST_FROM_ASCII */ /*! @@ -10626,6 +10700,8 @@ bool operator<(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW Returns \c true if this string is lexically smaller than the parameter string \a s. Otherwise returns \c false. + + \sa QT_NO_CAST_FROM_ASCII */ /*! @@ -10643,6 +10719,8 @@ bool operator<(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW Returns \c true if this string is lexically smaller than or equal to the parameter string \a s. Otherwise returns \c false. + + \sa QT_NO_CAST_FROM_ASCII */ /*! @@ -10661,6 +10739,8 @@ bool operator<(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW Returns \c true if this string is lexically greater than the parameter string \a s. Otherwise returns \c false. + + \sa QT_NO_CAST_FROM_ASCII */ /*! @@ -10678,6 +10758,8 @@ bool operator<(const QStringRef &s1,const QStringRef &s2) Q_DECL_NOTHROW Returns \c true if this string is lexically greater than or equal to the parameter string \a s. Otherwise returns \c false. + + \sa QT_NO_CAST_FROM_ASCII */ /*! \typedef QString::Data diff --git a/src/corelib/tools/qstringbuilder.cpp b/src/corelib/tools/qstringbuilder.cpp index 081d7136a7..8afc83819b 100644 --- a/src/corelib/tools/qstringbuilder.cpp +++ b/src/corelib/tools/qstringbuilder.cpp @@ -80,7 +80,7 @@ QT_BEGIN_NAMESPACE \endlist The types in the last list point are only available when - QT_NO_CAST_FROM_ASCII is not defined. + \c QT_NO_CAST_FROM_ASCII is not defined. For building QByteArrays: -- cgit v1.2.3 From 8915c9715a183e30f725d7cf4a5571f12c74650e Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Mon, 3 Dec 2018 11:08:28 +0100 Subject: Doc: Remove pre-Windows 7 from QCollator documentation The code path that this refers to was removed already for Qt 5.11 in commit 53fb2c48ef472ee74a2. Change-Id: I4a7ae1b89b24c0ab7ceaa43f763c7ef422ca4900 Reviewed-by: Friedemann Kleint --- src/corelib/tools/qcollator.cpp | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src') diff --git a/src/corelib/tools/qcollator.cpp b/src/corelib/tools/qcollator.cpp index 4315d35a52..76dcf35833 100644 --- a/src/corelib/tools/qcollator.cpp +++ b/src/corelib/tools/qcollator.cpp @@ -222,11 +222,6 @@ Qt::CaseSensitivity QCollator::caseSensitivity() 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() */ void QCollator::setNumericMode(bool on) -- cgit v1.2.3 From 69f7115c43ef17c2d8ff3f7842e64b539da94dcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 18 Dec 2018 13:17:45 +0100 Subject: macOS: Merge qt_mac_createRoleFonts into only caller MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Id6e61a70e4ebe47896dcbc8680d1d6b06c747871 Reviewed-by: Timur Pocheptsov Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qcocoatheme.mm | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm index 240deeddbd..c46df25b66 100644 --- a/src/plugins/platforms/cocoa/qcocoatheme.mm +++ b/src/plugins/platforms/cocoa/qcocoatheme.mm @@ -228,16 +228,12 @@ const QPalette *QCocoaTheme::palette(Palette type) const return nullptr; } -QHash qt_mac_createRoleFonts() -{ - QCoreTextFontDatabase *ctfd = static_cast(QGuiApplicationPrivate::platformIntegration()->fontDatabase()); - return ctfd->themeFonts(); -} - const QFont *QCocoaTheme::font(Font type) const { if (m_fonts.isEmpty()) { - m_fonts = qt_mac_createRoleFonts(); + const auto *platformIntegration = QGuiApplicationPrivate::platformIntegration(); + const auto *coreTextFontDb = static_cast(platformIntegration->fontDatabase()); + m_fonts = coreTextFontDb->themeFonts(); } return m_fonts.value(type, nullptr); } -- cgit v1.2.3 From fb67ac6368aeb9547cc78551708e4ed0d9e4bbfd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 12 Dec 2018 13:52:52 +0100 Subject: Modernize QNSImageView implementation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use Objc properties instead of instance variables. Change-Id: I4bddf2c9c824467d7c42dd5bb0c3b4aacd6b27be Reviewed-by: Tor Arne Vestbø --- .../platforms/cocoa/qcocoasystemtrayicon.mm | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm index 0158895441..3a7ac60424 100644 --- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm +++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm @@ -105,6 +105,8 @@ QT_USE_NAMESPACE @end @interface QT_MANGLE_NAMESPACE(QNSImageView) : NSImageView +@property (nonatomic, assign) BOOL down; +@property (nonatomic, assign) QT_MANGLE_NAMESPACE(QNSStatusItem) *parent; @end QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSStatusItem); @@ -277,36 +279,32 @@ QT_END_NAMESPACE @implementation NSStatusItem (Qt) @end -@implementation QNSImageView { - BOOL down; - QT_MANGLE_NAMESPACE(QNSStatusItem) *parent; -} - +@implementation QNSImageView - (instancetype)initWithParent:(QNSStatusItem *)myParent { self = [super init]; - parent = myParent; - down = NO; + self.parent = myParent; + self.down = NO; return self; } - (void)menuTrackingDone:(NSNotification *)__unused notification { - down = NO; + self.down = NO; [self setNeedsDisplay:YES]; } - (void)mousePressed:(NSEvent *)mouseEvent { - down = YES; + self.down = YES; int clickCount = [mouseEvent clickCount]; [self setNeedsDisplay:YES]; if (clickCount == 2) { [self menuTrackingDone:nil]; - [parent doubleClickSelector:self]; + [self.parent doubleClickSelector:self]; } else { - [parent triggerSelector:self button:cocoaButton2QtButton(mouseEvent)]; + [self.parent triggerSelector:self button:cocoaButton2QtButton(mouseEvent)]; } } @@ -344,7 +342,7 @@ QT_END_NAMESPACE } - (void)drawRect:(NSRect)rect { - [[parent item] drawStatusBarBackgroundInRect:rect withHighlight:down]; + [[self.parent item] drawStatusBarBackgroundInRect:rect withHighlight:self.down]; [super drawRect:rect]; } @end -- cgit v1.2.3 From f0dd6655e1df27dbb10bc43e0787d9328800c93a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Wed, 12 Dec 2018 14:59:48 +0100 Subject: Fix QSystemTrayIcon stale pointer access MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The child imageCell is a NSView and may be retained by Cocoa, which means it may outlive the parent QNSStatusItem. Clear its parent pointer to avoid referencing a stale pointer. Task-number: QTBUG-47929 Change-Id: I6078070b8c9f512ecd034fee4e54b1d8282dabdf Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm index 3a7ac60424..4982f5ee05 100644 --- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm +++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm @@ -372,6 +372,7 @@ QT_END_NAMESPACE - (void)dealloc { [[NSStatusBar systemStatusBar] removeStatusItem:item]; [[NSNotificationCenter defaultCenter] removeObserver:imageCell]; + imageCell.parent = nil; [imageCell release]; [item release]; [super dealloc]; -- cgit v1.2.3 From 3306b162392cb4afe268e8dfecd3a0e7ba7eaca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 18 Dec 2018 22:20:57 +0100 Subject: macOS: Only do gamma-corrected blending for subpixel-antialiased text MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The grayscale font-smoothing doesn't expect to be linearly blended, as first assumed. Amended nativetext manual test to better diagnose the native Core Text behavior. Non-linear blending will result in the magenta text having a dark outline against the green background. Change-Id: I24a5f04eb1bd66fb98d621078d80ee9b80800827 Reviewed-by: Simon Hausmann Reviewed-by: Tor Arne Vestbø --- src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm index 19b450b643..7957cd130a 100644 --- a/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm +++ b/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm @@ -736,7 +736,7 @@ bool QCoreTextFontEngine::shouldSmoothFont() const bool QCoreTextFontEngine::expectsGammaCorrectedBlending() const { - return shouldSmoothFont(); + return shouldSmoothFont() && fontSmoothing() == Subpixel; } qreal QCoreTextFontEngine::fontSmoothingGamma() -- cgit v1.2.3 From ff835a5030f3ec0aaa91ad0332739ca3259804e8 Mon Sep 17 00:00:00 2001 From: Luca Beldi Date: Thu, 6 Dec 2018 08:48:35 +0000 Subject: Fix QStringListModel::setData to check for actual changes QStringListModel::setData documentation states that "The dataChanged() signal is emitted if the item is changed." This patch actually respects the doc. setData will check that the data actually changed before sending the dataChanged signal. [ChangeLog][QtCore][QStringListModel] setData will now emit the dataChanged() signal only if the string set is different from the one already contained in the model Change-Id: I4308a6f3b4851203fb899c5e29a36076e0c32f2f Reviewed-by: David Faure --- src/corelib/itemmodels/qstringlistmodel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/corelib/itemmodels/qstringlistmodel.cpp b/src/corelib/itemmodels/qstringlistmodel.cpp index 0adaba9b9a..f92a0d6676 100644 --- a/src/corelib/itemmodels/qstringlistmodel.cpp +++ b/src/corelib/itemmodels/qstringlistmodel.cpp @@ -184,7 +184,10 @@ bool QStringListModel::setData(const QModelIndex &index, const QVariant &value, { if (index.row() >= 0 && index.row() < lst.size() && (role == Qt::EditRole || role == Qt::DisplayRole)) { - lst.replace(index.row(), value.toString()); + const QString valueString = value.toString(); + if (lst.at(index.row()) == valueString) + return true; + lst.replace(index.row(), valueString); QVector roles; roles.reserve(2); roles.append(Qt::DisplayRole); -- cgit v1.2.3 From f05cc4144e06fd06eed12a3e427eb49e7ad1cf85 Mon Sep 17 00:00:00 2001 From: Alexander Volkov Date: Tue, 18 Dec 2018 16:49:20 +0300 Subject: QDialog: Pass transient parent as a parent to native dialogs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sometimes it's needed to show a native dialog for another process, for example in xdg-desktop-portal-kde. In this case we have WId of a parent window which can be used for calling QWindow::setTransientParent(QWindow::fromWinId(...)). Pass this transient parent to a native dialog so it could use it as a transient parent for itself. Rename QDialogPrivate::parentWindow() for clarity. Change-Id: I68974ddea35f9366a0ddffe602d9d028f45e26fa Reviewed-by: Tor Arne Vestbø --- src/widgets/dialogs/qdialog.cpp | 9 ++++++--- src/widgets/dialogs/qdialog_p.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index 06f0393b4c..6f96018f3e 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -145,10 +145,13 @@ bool QDialogPrivate::canBeNativeDialog() const return false; } -QWindow *QDialogPrivate::parentWindow() const +QWindow *QDialogPrivate::transientParentWindow() const { - if (const QWidget *parent = q_func()->nativeParentWidget()) + Q_Q(const QDialog); + if (const QWidget *parent = q->nativeParentWidget()) return parent->windowHandle(); + else if (q->windowHandle()) + return q->windowHandle()->transientParent(); return 0; } @@ -158,7 +161,7 @@ bool QDialogPrivate::setNativeDialogVisible(bool visible) if (visible) { Q_Q(QDialog); helperPrepareShow(helper); - nativeDialogInUse = helper->show(q->windowFlags(), q->windowModality(), parentWindow()); + nativeDialogInUse = helper->show(q->windowFlags(), q->windowModality(), transientParentWindow()); } else if (nativeDialogInUse) { helper->hide(); } diff --git a/src/widgets/dialogs/qdialog_p.h b/src/widgets/dialogs/qdialog_p.h index 99fff08e65..b1de56188c 100644 --- a/src/widgets/dialogs/qdialog_p.h +++ b/src/widgets/dialogs/qdialog_p.h @@ -87,7 +87,7 @@ public: {} ~QDialogPrivate(); - QWindow *parentWindow() const; + QWindow *transientParentWindow() const; bool setNativeDialogVisible(bool visible); QVariant styleHint(QPlatformDialogHelper::StyleHint hint) const; void deletePlatformHelper(); -- cgit v1.2.3 From 9636a43abcf98dede8b267f557b728e99f0d56cd Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Thu, 1 Nov 2018 11:52:28 +0100 Subject: Doc: Update page Tamil Script Code for Information Interchange Task-number: QTBUG-56668 Change-Id: I173d73ef5e9b08e865cb75fa03849665fcda652e Reviewed-by: Venugopal Shivashankar --- src/corelib/codecs/codecs.qdoc | 6 ++---- src/corelib/doc/src/external-resources.qdoc | 8 ++++---- 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/corelib/codecs/codecs.qdoc b/src/corelib/codecs/codecs.qdoc index 9364b7a989..ec9b8185e2 100644 --- a/src/corelib/codecs/codecs.qdoc +++ b/src/corelib/codecs/codecs.qdoc @@ -276,13 +276,11 @@ TSCII, formally the Tamil Standard Code Information Interchange specification, is a commonly used charset for Tamils. The - official page for the standard is at - \l{http://www.tamil.net/tscii/} + official page for the standard is \l{Information Technology in Tamil} - This codec uses the mapping table found at - \l{http://www.geocities.com/Athens/5180/tsciiset.html}. Tamil uses composed Unicode which might cause some problems if you are using Unicode fonts instead of TSCII fonts. + A Tamil codepage layout can be found on \l {Tamil Script Code}. Most of the code was written by Hans Petter Bieker and is included in Qt with the author's permission and the grateful diff --git a/src/corelib/doc/src/external-resources.qdoc b/src/corelib/doc/src/external-resources.qdoc index f7c9dbb365..f16a21d521 100644 --- a/src/corelib/doc/src/external-resources.qdoc +++ b/src/corelib/doc/src/external-resources.qdoc @@ -32,13 +32,13 @@ */ /*! - \externalpage http://www.geocities.com/Athens/5180/tsciiset.html - \title http://www.geocities.com/Athens/5180/tsciiset.html + \externalpage https://en.wikipedia.org/wiki/Tamil_Script_Code_for_Information_Interchange + \title Tamil Script Code */ /*! - \externalpage http://www.tamil.net/tscii/ - \title http://www.tamil.net/tscii/ + \externalpage http://home.infitt.org + \title Information Technology in Tamil */ /*! -- cgit v1.2.3 From 7ba16f4c1ea172026da834887de1b8da797de79a Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Mon, 31 Dec 2018 16:20:48 +0100 Subject: QComboBox/WindowVistaStyle: restore focus rect The focus rect for the QComboBox was removed during the refactoring done in 5c60e4b8f9cc88e48f5e7652eefe90e1366ae23d. Readd the functionality in a similar to QWindowsStyle::drawComplexControl(). Fixes: QTBUG-69239 Change-Id: I74e4060fbe52432318e3c986fc838cf353d99843 Reviewed-by: Andre de la Rocha Reviewed-by: Friedemann Kleint --- src/plugins/styles/windowsvista/qwindowsvistastyle.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp index 7b35d1b58c..771552a121 100644 --- a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp +++ b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp @@ -1664,9 +1664,15 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle theme.stateId = CBXS_NORMAL; d->drawBackground(theme); } + if ((sub & SC_ComboBoxEditField) && (flags & State_HasFocus)) { + QStyleOptionFocusRect fropt; + fropt.QStyleOption::operator=(*cmb); + fropt.rect = proxy()->subControlRect(CC_ComboBox, option, SC_ComboBoxEditField, widget); + proxy()->drawPrimitive(PE_FrameFocusRect, &fropt, painter, widget); + } } - } - break; + } + break; case CC_ScrollBar: if (const QStyleOptionSlider *scrollbar = qstyleoption_cast(option)) { -- cgit v1.2.3 From f9d8762d37d83e3f3f21adfece0dbbb15886d722 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Fri, 21 Dec 2018 09:38:30 +0100 Subject: winrt: Remove yet another Windows Phone leftover Hardware and camera button handling are phone specific APIs we no longer support in Qt. Change-Id: Ib11f894a426b8e4b71acf24876437ddab2cea548 Reviewed-by: Oliver Wolff Reviewed-by: Andre de la Rocha Reviewed-by: Oswald Buddenhagen --- src/plugins/platforms/winrt/qwinrtintegration.cpp | 132 ---------------------- src/plugins/platforms/winrt/qwinrtintegration.h | 16 --- 2 files changed, 148 deletions(-) (limited to 'src') diff --git a/src/plugins/platforms/winrt/qwinrtintegration.cpp b/src/plugins/platforms/winrt/qwinrtintegration.cpp index 4f37583bed..78cbc3aec3 100644 --- a/src/plugins/platforms/winrt/qwinrtintegration.cpp +++ b/src/plugins/platforms/winrt/qwinrtintegration.cpp @@ -75,13 +75,6 @@ #include #include -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) -# include -# include - using namespace ABI::Windows::Foundation::Metadata; -#endif - - using namespace Microsoft::WRL; using namespace Microsoft::WRL::Wrappers; using namespace ABI::Windows::Foundation; @@ -92,27 +85,14 @@ using namespace ABI::Windows::UI::Core; using namespace ABI::Windows::UI::ViewManagement; using namespace ABI::Windows::Graphics::Display; using namespace ABI::Windows::ApplicationModel::Core; -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) -using namespace ABI::Windows::Phone::UI::Input; -#endif typedef IEventHandler ResumeHandler; typedef IEventHandler SuspendHandler; -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) -typedef IEventHandler BackPressedHandler; -typedef IEventHandler CameraButtonHandler; -#endif QT_BEGIN_NAMESPACE typedef HRESULT (__stdcall ICoreApplication::*CoreApplicationCallbackRemover)(EventRegistrationToken); uint qHash(CoreApplicationCallbackRemover key) { void *ptr = *(void **)(&key); return qHash(ptr); } -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) -typedef HRESULT (__stdcall IHardwareButtonsStatics::*HardwareButtonsCallbackRemover)(EventRegistrationToken); -uint qHash(HardwareButtonsCallbackRemover key) { void *ptr = *(void **)(&key); return qHash(ptr); } -typedef HRESULT (__stdcall IHardwareButtonsStatics2::*HardwareButtons2CallbackRemover)(EventRegistrationToken); -uint qHash(HardwareButtons2CallbackRemover key) { void *ptr = *(void **)(&key); return qHash(ptr); } -#endif class QWinRTIntegrationPrivate { @@ -128,15 +108,6 @@ public: ComPtr application; QHash applicationTokens; -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) - ComPtr hardwareButtons; - QHash buttonsTokens; - ComPtr cameraButtons; - QHash cameraTokens; - boolean hasHardwareButtons; - bool cameraHalfPressed : 1; - bool cameraPressed : 1; -#endif }; QWinRTIntegration::QWinRTIntegration() : d_ptr(new QWinRTIntegrationPrivate) @@ -156,45 +127,6 @@ QWinRTIntegration::QWinRTIntegration() : d_ptr(new QWinRTIntegrationPrivate) &d->applicationTokens[&ICoreApplication::remove_Resuming]); Q_ASSERT_SUCCEEDED(hr); -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) - d->hasHardwareButtons = false; - ComPtr apiInformationStatics; - hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Foundation_Metadata_ApiInformation).Get(), - IID_PPV_ARGS(&apiInformationStatics)); - - if (SUCCEEDED(hr)) { - const HStringReference valueRef(L"Windows.Phone.UI.Input.HardwareButtons"); - hr = apiInformationStatics->IsTypePresent(valueRef.Get(), &d->hasHardwareButtons); - } - - if (d->hasHardwareButtons) { - hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Phone_UI_Input_HardwareButtons).Get(), - IID_PPV_ARGS(&d->hardwareButtons)); - Q_ASSERT_SUCCEEDED(hr); - hr = d->hardwareButtons->add_BackPressed(Callback(this, &QWinRTIntegration::onBackButtonPressed).Get(), - &d->buttonsTokens[&IHardwareButtonsStatics::remove_BackPressed]); - Q_ASSERT_SUCCEEDED(hr); - - hr = RoGetActivationFactory(HString::MakeReference(RuntimeClass_Windows_Phone_UI_Input_HardwareButtons).Get(), - IID_PPV_ARGS(&d->cameraButtons)); - Q_ASSERT_SUCCEEDED(hr); - if (qEnvironmentVariableIntValue("QT_QPA_ENABLE_CAMERA_KEYS")) { - hr = d->cameraButtons->add_CameraPressed(Callback(this, &QWinRTIntegration::onCameraPressed).Get(), - &d->cameraTokens[&IHardwareButtonsStatics2::remove_CameraPressed]); - Q_ASSERT_SUCCEEDED(hr); - hr = d->cameraButtons->add_CameraHalfPressed(Callback(this, &QWinRTIntegration::onCameraHalfPressed).Get(), - &d->cameraTokens[&IHardwareButtonsStatics2::remove_CameraHalfPressed]); - Q_ASSERT_SUCCEEDED(hr); - hr = d->cameraButtons->add_CameraReleased(Callback(this, &QWinRTIntegration::onCameraReleased).Get(), - &d->cameraTokens[&IHardwareButtonsStatics2::remove_CameraReleased]); - Q_ASSERT_SUCCEEDED(hr); - } - d->cameraPressed = false; - d->cameraHalfPressed = false; - } -#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) - - QEventDispatcherWinRT::runOnXamlThread([d]() { d->mainScreen = new QWinRTScreen; return S_OK; @@ -214,18 +146,6 @@ QWinRTIntegration::~QWinRTIntegration() Q_D(QWinRTIntegration); HRESULT hr; -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) - if (d->hasHardwareButtons) { - for (QHash::const_iterator i = d->buttonsTokens.begin(); i != d->buttonsTokens.end(); ++i) { - hr = (d->hardwareButtons.Get()->*i.key())(i.value()); - Q_ASSERT_SUCCEEDED(hr); - } - for (QHash::const_iterator i = d->cameraTokens.begin(); i != d->cameraTokens.end(); ++i) { - hr = (d->cameraButtons.Get()->*i.key())(i.value()); - Q_ASSERT_SUCCEEDED(hr); - } - } -#endif // Do not execute this on Windows Phone as the application is already // shutting down and trying to unregister suspending/resume handler will // cause exceptions and assert in debug mode @@ -353,58 +273,6 @@ QPlatformTheme *QWinRTIntegration::createPlatformTheme(const QString &name) cons // System-level integration points -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) -HRESULT QWinRTIntegration::onBackButtonPressed(IInspectable *, IBackPressedEventArgs *args) -{ - Q_D(QWinRTIntegration); - QWindow *window = d->mainScreen->topWindow(); - QWindowSystemInterface::setSynchronousWindowSystemEvents(true); - const bool pressed = QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyPress, Qt::Key_Back, Qt::NoModifier, - 0, 0, 0, QString(), false, 1, false); - const bool released = QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyRelease, Qt::Key_Back, Qt::NoModifier, - 0, 0, 0, QString(), false, 1, false); - QWindowSystemInterface::setSynchronousWindowSystemEvents(false); - args->put_Handled(pressed || released); - return S_OK; -} - -HRESULT QWinRTIntegration::onCameraPressed(IInspectable *, ICameraEventArgs *) -{ - Q_D(QWinRTIntegration); - QWindow *window = d->mainScreen->topWindow(); - QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyPress, Qt::Key_Camera, Qt::NoModifier, - 0, 0, 0, QString(), false, 1, false); - d->cameraPressed = true; - return S_OK; -} - -HRESULT QWinRTIntegration::onCameraHalfPressed(IInspectable *, ICameraEventArgs *) -{ - Q_D(QWinRTIntegration); - QWindow *window = d->mainScreen->topWindow(); - QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyPress, Qt::Key_CameraFocus, Qt::NoModifier, - 0, 0, 0, QString(), false, 1, false); - d->cameraHalfPressed = true; - return S_OK; -} - -HRESULT QWinRTIntegration::onCameraReleased(IInspectable *, ICameraEventArgs *) -{ - Q_D(QWinRTIntegration); - QWindow *window = d->mainScreen->topWindow(); - if (d->cameraHalfPressed) - QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyRelease, Qt::Key_CameraFocus, Qt::NoModifier, - 0, 0, 0, QString(), false, 1, false); - - if (d->cameraPressed) - QWindowSystemInterface::handleExtendedKeyEvent(window, QEvent::KeyRelease, Qt::Key_Camera, Qt::NoModifier, - 0, 0, 0, QString(), false, 1, false); - d->cameraHalfPressed = false; - d->cameraPressed = false; - return S_OK; -} -#endif // WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) - HRESULT QWinRTIntegration::onSuspended(IInspectable *, ISuspendingEventArgs *) { QWindowSystemInterface::handleApplicationStateChanged(Qt::ApplicationSuspended); diff --git a/src/plugins/platforms/winrt/qwinrtintegration.h b/src/plugins/platforms/winrt/qwinrtintegration.h index 636e594b4b..e944ed5d79 100644 --- a/src/plugins/platforms/winrt/qwinrtintegration.h +++ b/src/plugins/platforms/winrt/qwinrtintegration.h @@ -50,16 +50,6 @@ namespace ABI { namespace Foundation { struct IAsyncAction; } -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) - namespace Phone { - namespace UI { - namespace Input { - struct IBackPressedEventArgs; - struct ICameraEventArgs; - } - } - } -#endif } } struct IAsyncInfo; @@ -111,12 +101,6 @@ public: QPlatformOffscreenSurface *createPlatformOffscreenSurface(QOffscreenSurface *surface) const override; private: -#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_PHONE_APP) - HRESULT onBackButtonPressed(IInspectable *, ABI::Windows::Phone::UI::Input::IBackPressedEventArgs *args); - HRESULT onCameraPressed(IInspectable *, ABI::Windows::Phone::UI::Input::ICameraEventArgs *); - HRESULT onCameraHalfPressed(IInspectable *, ABI::Windows::Phone::UI::Input::ICameraEventArgs *); - HRESULT onCameraReleased(IInspectable *, ABI::Windows::Phone::UI::Input::ICameraEventArgs *); -#endif HRESULT onSuspended(IInspectable *, ABI::Windows::ApplicationModel::ISuspendingEventArgs *); HRESULT onResume(IInspectable *, IInspectable *); -- cgit v1.2.3 From ceddc14af17df166d05d98cfa76256bfc0b34183 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Fri, 21 Dec 2018 11:31:24 +0100 Subject: Draw ShowTabsAndSpaces symbols with the correct font We would draw the tab and space symbols without setting the correct font on the painter first. [ChangeLog][QtGui][Text] Fixed so ShowTabsAndSpaces will use the correct font. Fixes: QTBUG-62540 Change-Id: I3b7d6d317473e7aab722dafe1a128c57a830f634 Reviewed-by: Andy Shaw Reviewed-by: Konstantin Ritt --- src/gui/text/qtextlayout.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/gui/text/qtextlayout.cpp b/src/gui/text/qtextlayout.cpp index be306ed224..f3f0caa379 100644 --- a/src/gui/text/qtextlayout.cpp +++ b/src/gui/text/qtextlayout.cpp @@ -2598,6 +2598,7 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR Qt::IntersectClip); else x /= 2; // Centered + p->setFont(f); p->drawText(QPointF(iterator.x.toReal() + x, y.toReal()), visualTab); } @@ -2671,8 +2672,11 @@ void QTextLine::draw(QPainter *p, const QPointF &pos, const QTextLayout::FormatR if (c.style() != Qt::NoBrush) p->setPen(c.color()); QChar visualSpace(si.analysis.flags == QScriptAnalysis::Space ? (ushort)0xb7 : (ushort)0xb0); + QFont oldFont = p->font(); + p->setFont(eng->font(si)); p->drawText(QPointF(iterator.x.toReal(), itemBaseLine.toReal()), visualSpace); p->setPen(pen); + p->setFont(oldFont); } } eng->drawDecorations(p); -- cgit v1.2.3 From 6899117a59256082f37492d81ecaf56a0844690e Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Thu, 27 Dec 2018 01:10:29 +0100 Subject: configure: properly atomize render vs. renderutil xcb-render is a C interface for X11 extension. xcb-render-util is a utility library that complements xcb-render by providing convenience functions and interfaces which make the raw X protocol more usable. Bumped xcb-render-util version to avoid having include hacks. We were bundling 8 years old release 0.3.8 (Apr, 2011). 0.3.9 is the latest release and it was relesed 4,5 years ago (Jun, 2014). All CI machines have 0.3.9. The only thing that have changed in xcb-render-util sources since 2011 is that we don't need to have various hacks to include xcb_renderutil.h in C++ files. Upgrading bundled XCB libs was also requested in QTBUG-71109. Task-number: QTBUG-71109 Change-Id: Ib261f7584ad81be95660123b007e2200a3042f4c Reviewed-by: Oswald Buddenhagen --- src/3rdparty/xcb/README | 2 +- src/3rdparty/xcb/include/xcb/xcb_renderutil.h | 10 +++++++- src/3rdparty/xcb/xcb-util-renderutil/util.c | 30 ++++++++++++---------- src/gui/configure.json | 35 +++++++++++++------------- src/plugins/platforms/xcb/qxcbbackingstore.cpp | 6 ----- src/plugins/platforms/xcb/qxcbimage.cpp | 6 ----- src/plugins/platforms/xcb/xcb_qpa_lib.pro | 2 +- 7 files changed, 46 insertions(+), 45 deletions(-) (limited to 'src') diff --git a/src/3rdparty/xcb/README b/src/3rdparty/xcb/README index 9e8ea30b51..2f1ee24079 100644 --- a/src/3rdparty/xcb/README +++ b/src/3rdparty/xcb/README @@ -8,7 +8,7 @@ Contains the header and sources files from selected xcb libraries: Pointer Barriers API and SendExtensionEvent API) libxcb-util-image-0.3.9 libxcb-util-keysyms-0.3.9 - libxcb-util-renderutil-0.3.8 + libxcb-util-renderutil-0.3.9 libxcb-util-wm-0.3.9 The 'include' directory was obtained by compiling and installing all of the modules. diff --git a/src/3rdparty/xcb/include/xcb/xcb_renderutil.h b/src/3rdparty/xcb/include/xcb/xcb_renderutil.h index 6eb5923236..77c5b7f054 100644 --- a/src/3rdparty/xcb/include/xcb/xcb_renderutil.h +++ b/src/3rdparty/xcb/include/xcb/xcb_renderutil.h @@ -27,6 +27,10 @@ #define XCB_RENDERUTIL #include +#ifdef __cplusplus +extern "C" { +#endif + typedef enum xcb_pict_format_t { XCB_PICT_FORMAT_ID = (1 << 0), XCB_PICT_FORMAT_TYPE = (1 << 1), @@ -58,7 +62,7 @@ xcb_render_util_find_visual_format (const xcb_render_query_pict_formats_reply_t xcb_render_pictforminfo_t * xcb_render_util_find_format (const xcb_render_query_pict_formats_reply_t *formats, unsigned long mask, - const xcb_render_pictforminfo_t *template, + const xcb_render_pictforminfo_t *ptemplate, int count); xcb_render_pictforminfo_t * @@ -139,4 +143,8 @@ void xcb_render_util_composite_text_free ( xcb_render_util_composite_text_stream_t *stream ); +#ifdef __cplusplus +} +#endif + #endif /* XCB_RENDERUTIL */ diff --git a/src/3rdparty/xcb/xcb-util-renderutil/util.c b/src/3rdparty/xcb/xcb-util-renderutil/util.c index 2d8840d204..7666c433dd 100644 --- a/src/3rdparty/xcb/xcb-util-renderutil/util.c +++ b/src/3rdparty/xcb/xcb-util-renderutil/util.c @@ -19,6 +19,10 @@ * PERFORMANCE OF THIS SOFTWARE. */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include "xcb_renderutil.h" xcb_render_pictvisual_t * @@ -41,7 +45,7 @@ xcb_render_util_find_visual_format (const xcb_render_query_pict_formats_reply_t xcb_render_pictforminfo_t * xcb_render_util_find_format (const xcb_render_query_pict_formats_reply_t *formats, unsigned long mask, - const xcb_render_pictforminfo_t *template, + const xcb_render_pictforminfo_t *ptemplate, int count) { xcb_render_pictforminfo_iterator_t i; @@ -50,40 +54,40 @@ xcb_render_util_find_format (const xcb_render_query_pict_formats_reply_t *format for (i = xcb_render_query_pict_formats_formats_iterator(formats); i.rem; xcb_render_pictforminfo_next(&i)) { if (mask & XCB_PICT_FORMAT_ID) - if (template->id != i.data->id) + if (ptemplate->id != i.data->id) continue; if (mask & XCB_PICT_FORMAT_TYPE) - if (template->type != i.data->type) + if (ptemplate->type != i.data->type) continue; if (mask & XCB_PICT_FORMAT_DEPTH) - if (template->depth != i.data->depth) + if (ptemplate->depth != i.data->depth) continue; if (mask & XCB_PICT_FORMAT_RED) - if (template->direct.red_shift != i.data->direct.red_shift) + if (ptemplate->direct.red_shift != i.data->direct.red_shift) continue; if (mask & XCB_PICT_FORMAT_RED_MASK) - if (template->direct.red_mask != i.data->direct.red_mask) + if (ptemplate->direct.red_mask != i.data->direct.red_mask) continue; if (mask & XCB_PICT_FORMAT_GREEN) - if (template->direct.green_shift != i.data->direct.green_shift) + if (ptemplate->direct.green_shift != i.data->direct.green_shift) continue; if (mask & XCB_PICT_FORMAT_GREEN_MASK) - if (template->direct.green_mask != i.data->direct.green_mask) + if (ptemplate->direct.green_mask != i.data->direct.green_mask) continue; if (mask & XCB_PICT_FORMAT_BLUE) - if (template->direct.blue_shift != i.data->direct.blue_shift) + if (ptemplate->direct.blue_shift != i.data->direct.blue_shift) continue; if (mask & XCB_PICT_FORMAT_BLUE_MASK) - if (template->direct.blue_mask != i.data->direct.blue_mask) + if (ptemplate->direct.blue_mask != i.data->direct.blue_mask) continue; if (mask & XCB_PICT_FORMAT_ALPHA) - if (template->direct.alpha_shift != i.data->direct.alpha_shift) + if (ptemplate->direct.alpha_shift != i.data->direct.alpha_shift) continue; if (mask & XCB_PICT_FORMAT_ALPHA_MASK) - if (template->direct.alpha_mask != i.data->direct.alpha_mask) + if (ptemplate->direct.alpha_mask != i.data->direct.alpha_mask) continue; if (mask & XCB_PICT_FORMAT_COLORMAP) - if (template->colormap != i.data->colormap) + if (ptemplate->colormap != i.data->colormap) continue; if (count-- == 0) return i.data; diff --git a/src/gui/configure.json b/src/gui/configure.json index caa6f065f0..7b861c80fe 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -615,6 +615,20 @@ ], "use": "xcb" }, + "xcb_renderutil": { + "label": "XCB Renderutil >= 0.3.9", + "test": { + "main": [ + "xcb_render_util_find_standard_format(nullptr, XCB_PICT_STANDARD_ARGB_32);" + ] + }, + "headers": "xcb/xcb_renderutil.h", + "sources": [ + { "type": "pkgConfig", "args": "xcb-renderutil >= 0.3.9" }, + "-lxcb-render-util" + ], + "use": "xcb xcb_render" + }, "xcb_randr": { "label": "XCB RandR", "headers": "xcb/randr.h", @@ -704,32 +718,20 @@ "xcb_render": { "label": "XCB XRender", "test": { - "tail": [ - "// 'template' is used as a function argument name in xcb_renderutil.h", - "#define template template_param", - "// extern \"C\" is missing, too", - "extern \"C\" {", - "#include ", - "}", - "#undef template" - ], "main": [ - "int primaryScreen = 0;", "xcb_generic_error_t *error = 0;", "xcb_connection_t *connection = 0;", "xcb_render_query_pict_formats_cookie_t formatsCookie =", " xcb_render_query_pict_formats(connection);", "xcb_render_query_pict_formats_reply_t *formatsReply =", " xcb_render_query_pict_formats_reply(", - " connection, formatsCookie, &error);", - "xcb_render_util_find_standard_format(", - " formatsReply, XCB_PICT_STANDARD_ARGB_32);" + " connection, formatsCookie, &error);" ] }, "headers": "xcb/render.h", "sources": [ - { "type": "pkgConfig", "args": "xcb-renderutil xcb-render" }, - "-lxcb-render-util -lxcb-render" + { "type": "pkgConfig", "args": "xcb-render" }, + "-lxcb-render" ], "use": "xcb" }, @@ -737,7 +739,6 @@ "label": "XCB GLX", "test": { "main": [ - "int primaryScreen = 0;", "xcb_connection_t *connection = 0;", "xcb_generic_error_t *error = 0;", "xcb_glx_query_version_cookie_t xglx_query_cookie = xcb_glx_query_version(", @@ -1555,7 +1556,7 @@ "xcb-render": { "label": "XCB render", "emitIf": "features.xcb", - "condition": "!features.system-xcb || libs.xcb_render", + "condition": "!features.system-xcb || (libs.xcb_render && libs.xcb_renderutil)", "output": [ "privateFeature" ] }, "xkb": { diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp index ba9a3e68ee..e446933dac 100644 --- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp +++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp @@ -47,13 +47,7 @@ #include #if QT_CONFIG(xcb_render) #include -// 'template' is used as a function argument name in xcb_renderutil.h -#define template template_param -// extern "C" is missing too -extern "C" { #include -} -#undef template #endif #include diff --git a/src/plugins/platforms/xcb/qxcbimage.cpp b/src/plugins/platforms/xcb/qxcbimage.cpp index 44c7d22344..31c24f40b4 100644 --- a/src/plugins/platforms/xcb/qxcbimage.cpp +++ b/src/plugins/platforms/xcb/qxcbimage.cpp @@ -44,13 +44,7 @@ #include #if QT_CONFIG(xcb_render) #include -// 'template' is used as a function argument name in xcb_renderutil.h -#define template template_param -// extern "C" is missing too -extern "C" { #include -} -#undef template #endif #include "qxcbconnection.h" diff --git a/src/plugins/platforms/xcb/xcb_qpa_lib.pro b/src/plugins/platforms/xcb/xcb_qpa_lib.pro index f4ca9cc81d..1369d3496e 100644 --- a/src/plugins/platforms/xcb/xcb_qpa_lib.pro +++ b/src/plugins/platforms/xcb/xcb_qpa_lib.pro @@ -97,7 +97,7 @@ qtConfig(vulkan) { !qtConfig(system-xcb) { QMAKE_USE += xcb-static } else { - qtConfig(xcb-render): QMAKE_USE += xcb_render + qtConfig(xcb-render): QMAKE_USE += xcb_render xcb_renderutil qtConfig(xcb-xinput): QMAKE_USE += xcb_xinput QMAKE_USE += xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama } -- cgit v1.2.3 From 7d8fe4d98fc5e05f60a91649f208b92d622a4eac Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Thu, 27 Dec 2018 01:10:29 +0100 Subject: configure: make xcb-render a hard dependency for xcb plugin Its been available by default since at least libxcb 1.5, and in Qt 5.12 we have even increased the minimal required libxcb version to 1.9. Having configure switches for extensions is a legacy from Qt 4. There are still few exceptions in Qt5, where the reason is that we have to support Linux distributions that don't ship recent enough libxcb. Task-number: QTBUG-30939 Change-Id: I0a02d93b6411119ec018b0cb8fe5c63beeab62ee Reviewed-by: Oswald Buddenhagen Reviewed-by: Allan Sandfeld Jensen --- src/gui/configure.json | 42 +++++++++------------- src/plugins/platforms/xcb/qxcbbackingstore.cpp | 12 ------- src/plugins/platforms/xcb/qxcbbackingstore.h | 3 +- src/plugins/platforms/xcb/qxcbconnection_basic.cpp | 10 ++---- src/plugins/platforms/xcb/qxcbcursor.cpp | 4 --- src/plugins/platforms/xcb/qxcbimage.cpp | 11 +----- src/plugins/platforms/xcb/xcb_qpa_lib.pro | 5 +-- 7 files changed, 23 insertions(+), 64 deletions(-) (limited to 'src') diff --git a/src/gui/configure.json b/src/gui/configure.json index 7b861c80fe..3af7d2d49d 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -617,11 +617,6 @@ }, "xcb_renderutil": { "label": "XCB Renderutil >= 0.3.9", - "test": { - "main": [ - "xcb_render_util_find_standard_format(nullptr, XCB_PICT_STANDARD_ARGB_32);" - ] - }, "headers": "xcb/xcb_renderutil.h", "sources": [ { "type": "pkgConfig", "args": "xcb-renderutil >= 0.3.9" }, @@ -717,17 +712,6 @@ }, "xcb_render": { "label": "XCB XRender", - "test": { - "main": [ - "xcb_generic_error_t *error = 0;", - "xcb_connection_t *connection = 0;", - "xcb_render_query_pict_formats_cookie_t formatsCookie =", - " xcb_render_query_pict_formats(connection);", - "xcb_render_query_pict_formats_reply_t *formatsReply =", - " xcb_render_query_pict_formats_reply(", - " connection, formatsCookie, &error);" - ] - }, "headers": "xcb/render.h", "sources": [ { "type": "pkgConfig", "args": "xcb-render" }, @@ -1075,19 +1059,31 @@ "xcb/xcb_image.h", "xcb/xcb_keysyms.h", "xcb/randr.h", + "xcb/render.h", "xcb/shape.h", "xcb/shm.h", "xcb/sync.h", "xcb/xfixes.h", "xcb/xinerama.h", - "xcb/xcb_icccm.h" + "xcb/xcb_icccm.h", + "xcb/xcb_renderutil.h" ], "main": [ "int primaryScreen = 0;", - "(void) xcb_connect(\"\", &primaryScreen);" + "xcb_connection_t *c = xcb_connect(\"\", &primaryScreen);", + + "/* RENDER */", + "xcb_generic_error_t *error = nullptr;", + "xcb_render_query_pict_formats_cookie_t formatsCookie =", + " xcb_render_query_pict_formats(c);", + "xcb_render_query_pict_formats_reply_t *formatsReply =", + " xcb_render_query_pict_formats_reply(c, formatsCookie, &error);", + + "/* RENDERUTIL: xcb_renderutil.h include won't compile unless version >= 0.3.9 */", + "xcb_render_util_find_standard_format(nullptr, XCB_PICT_STANDARD_ARGB_32);" ] }, - "use": "xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama xcb" + "use": "xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_render xcb_renderutil xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama xcb" }, "x11prefix": { "label": "X11 prefix", @@ -1553,12 +1549,6 @@ "condition": "features.xcb-native-painting", "output": [ "privateFeature" ] }, - "xcb-render": { - "label": "XCB render", - "emitIf": "features.xcb", - "condition": "!features.system-xcb || (libs.xcb_render && libs.xcb_renderutil)", - "output": [ "privateFeature" ] - }, "xkb": { "label": "XCB XKB", "emitIf": "features.xcb", @@ -1943,7 +1933,7 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla "section": "X11", "condition": "features.xcb", "entries": [ - "system-xcb", "egl_x11", "xkb", "xlib", "xcb-render", "xcb-glx", "xcb-xinput", "xcb-xlib", "xcb-native-painting" + "system-xcb", "egl_x11", "xkb", "xlib", "xcb-glx", "xcb-xinput", "xcb-xlib", "xcb-native-painting" ] }, { diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.cpp b/src/plugins/platforms/xcb/qxcbbackingstore.cpp index e446933dac..f9240a45cc 100644 --- a/src/plugins/platforms/xcb/qxcbbackingstore.cpp +++ b/src/plugins/platforms/xcb/qxcbbackingstore.cpp @@ -45,10 +45,8 @@ #include #include -#if QT_CONFIG(xcb_render) #include #include -#endif #include #include @@ -956,16 +954,13 @@ QXcbSystemTrayBackingStore::QXcbSystemTrayBackingStore(QWindow *window) if (depth != 32) { platformWindow->setParentRelativeBackPixmap(); -#if QT_CONFIG(xcb_render) initXRenderMode(); -#endif m_useGrabbedBackgound = !m_usingXRenderMode; } } QXcbSystemTrayBackingStore::~QXcbSystemTrayBackingStore() { -#if QT_CONFIG(xcb_render) if (m_xrenderPicture) { xcb_render_free_picture(xcb_connection(), m_xrenderPicture); m_xrenderPicture = XCB_NONE; @@ -978,7 +973,6 @@ QXcbSystemTrayBackingStore::~QXcbSystemTrayBackingStore() xcb_render_free_picture(xcb_connection(), m_windowPicture); m_windowPicture = XCB_NONE; } -#endif // QT_CONFIG(xcb_render) } void QXcbSystemTrayBackingStore::beginPaint(const QRegion ®ion) @@ -1000,7 +994,6 @@ void QXcbSystemTrayBackingStore::render(xcb_window_t window, const QRegion ®i return; } -#if QT_CONFIG(xcb_render) m_image->put(m_xrenderPixmap, region, offset); const QRect bounds = region.boundingRect(); const QPoint target = bounds.topLeft(); @@ -1011,7 +1004,6 @@ void QXcbSystemTrayBackingStore::render(xcb_window_t window, const QRegion ®i m_xrenderPicture, 0, m_windowPicture, target.x(), target.y(), 0, 0, target.x(), target.y(), source.width(), source.height()); -#endif // QT_CONFIG(xcb_render) } void QXcbSystemTrayBackingStore::recreateImage(QXcbWindow *win, const QSize &size) @@ -1028,7 +1020,6 @@ void QXcbSystemTrayBackingStore::recreateImage(QXcbWindow *win, const QSize &siz return; } -#if QT_CONFIG(xcb_render) if (m_xrenderPicture) { xcb_render_free_picture(xcb_connection(), m_xrenderPicture); m_xrenderPicture = XCB_NONE; @@ -1051,10 +1042,8 @@ void QXcbSystemTrayBackingStore::recreateImage(QXcbWindow *win, const QSize &siz m_image->resize(size); else m_image = new QXcbBackingStoreImage(this, size, 32, QImage::Format_ARGB32_Premultiplied); -#endif // QT_CONFIG(xcb_render) } -#if QT_CONFIG(xcb_render) void QXcbSystemTrayBackingStore::initXRenderMode() { if (!connection()->hasXRender()) @@ -1098,6 +1087,5 @@ void QXcbSystemTrayBackingStore::initXRenderMode() m_usingXRenderMode = true; } -#endif // QT_CONFIG(xcb_render) QT_END_NAMESPACE diff --git a/src/plugins/platforms/xcb/qxcbbackingstore.h b/src/plugins/platforms/xcb/qxcbbackingstore.h index b91e5c7dc2..0c30929d4e 100644 --- a/src/plugins/platforms/xcb/qxcbbackingstore.h +++ b/src/plugins/platforms/xcb/qxcbbackingstore.h @@ -99,14 +99,13 @@ protected: void recreateImage(QXcbWindow *win, const QSize &size) override; private: -#if QT_CONFIG(xcb_render) void initXRenderMode(); xcb_pixmap_t m_xrenderPixmap = XCB_NONE; xcb_render_picture_t m_xrenderPicture = XCB_NONE; xcb_render_pictformat_t m_xrenderPictFormat = XCB_NONE; xcb_render_picture_t m_windowPicture = XCB_NONE; -#endif + bool m_usingXRenderMode = false; bool m_useGrabbedBackgound = false; QPixmap m_grabbedBackground; diff --git a/src/plugins/platforms/xcb/qxcbconnection_basic.cpp b/src/plugins/platforms/xcb/qxcbconnection_basic.cpp index b8335d1240..c69912c361 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_basic.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_basic.cpp @@ -44,12 +44,10 @@ #include #include #include +#include #if QT_CONFIG(xcb_xinput) #include #endif -#if QT_CONFIG(xcb_render) -#include -#endif #if QT_CONFIG(xkb) #define explicit dont_use_cxx_explicit #include @@ -139,12 +137,10 @@ QXcbBasicConnection::QXcbBasicConnection(const char *displayName) xcb_extension_t *extensions[] = { &xcb_shm_id, &xcb_xfixes_id, &xcb_randr_id, &xcb_shape_id, &xcb_sync_id, + &xcb_render_id, #if QT_CONFIG(xkb) &xcb_xkb_id, #endif -#if QT_CONFIG(xcb_render) - &xcb_render_id, -#endif #if QT_CONFIG(xcb_xinput) &xcb_input_id, #endif @@ -293,7 +289,6 @@ void QXcbBasicConnection::initializeShm() void QXcbBasicConnection::initializeXRandr() { -#if QT_CONFIG(xcb_render) const xcb_query_extension_reply_t *reply = xcb_get_extension_data(m_xcbConnection, &xcb_render_id); if (!reply || !reply->present) { qCDebug(lcQpaXcb, "XRender extension not present on the X server"); @@ -311,7 +306,6 @@ void QXcbBasicConnection::initializeXRandr() m_hasXRandr = true; m_xrenderVersion.first = xrenderQuery->major_version; m_xrenderVersion.second = xrenderQuery->minor_version; -#endif } void QXcbBasicConnection::initializeXinerama() diff --git a/src/plugins/platforms/xcb/qxcbcursor.cpp b/src/plugins/platforms/xcb/qxcbcursor.cpp index 7831671d42..fbadab4d50 100644 --- a/src/plugins/platforms/xcb/qxcbcursor.cpp +++ b/src/plugins/platforms/xcb/qxcbcursor.cpp @@ -607,14 +607,10 @@ xcb_cursor_t QXcbCursor::createBitmapCursor(QCursor *cursor) QPoint spot = cursor->hotSpot(); xcb_cursor_t c = XCB_NONE; if (cursor->pixmap().depth() > 1) { -#if QT_CONFIG(xcb_render) if (connection()->hasXRender(0, 5)) c = qt_xcb_createCursorXRender(m_screen, cursor->pixmap().toImage(), spot); else qCWarning(lcQpaXcb, "xrender >= 0.5 required to create pixmap cursors"); -#else - qCWarning(lcQpaXcb, "This build of Qt does not support pixmap cursors"); -#endif } else { xcb_connection_t *conn = xcb_connection(); xcb_pixmap_t cp = qt_xcb_XPixmapFromBitmap(m_screen, cursor->bitmap()->toImage()); diff --git a/src/plugins/platforms/xcb/qxcbimage.cpp b/src/plugins/platforms/xcb/qxcbimage.cpp index 31c24f40b4..8f33e6ed31 100644 --- a/src/plugins/platforms/xcb/qxcbimage.cpp +++ b/src/plugins/platforms/xcb/qxcbimage.cpp @@ -42,10 +42,9 @@ #include #include #include -#if QT_CONFIG(xcb_render) + #include #include -#endif #include "qxcbconnection.h" #include "qxcbintegration.h" @@ -230,7 +229,6 @@ xcb_pixmap_t qt_xcb_XPixmapFromBitmap(QXcbScreen *screen, const QImage &image) xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, const QPoint &spot) { -#if QT_CONFIG(xcb_render) xcb_connection_t *conn = screen->xcb_connection(); const int w = image.width(); const int h = image.height(); @@ -283,13 +281,6 @@ xcb_cursor_t qt_xcb_createCursorXRender(QXcbScreen *screen, const QImage &image, xcb_render_free_picture(conn, pic); xcb_free_pixmap(conn, pix); return cursor; - -#else - Q_UNUSED(screen); - Q_UNUSED(image); - Q_UNUSED(spot); - return XCB_NONE; -#endif } QT_END_NAMESPACE diff --git a/src/plugins/platforms/xcb/xcb_qpa_lib.pro b/src/plugins/platforms/xcb/xcb_qpa_lib.pro index 1369d3496e..647058167b 100644 --- a/src/plugins/platforms/xcb/xcb_qpa_lib.pro +++ b/src/plugins/platforms/xcb/xcb_qpa_lib.pro @@ -97,9 +97,10 @@ qtConfig(vulkan) { !qtConfig(system-xcb) { QMAKE_USE += xcb-static } else { - qtConfig(xcb-render): QMAKE_USE += xcb_render xcb_renderutil qtConfig(xcb-xinput): QMAKE_USE += xcb_xinput - QMAKE_USE += xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama + QMAKE_USE += \ + xcb_icccm xcb_image xcb_keysyms xcb_randr xcb_render xcb_renderutil \ + xcb_shape xcb_shm xcb_sync xcb_xfixes xcb_xinerama } QMAKE_USE += xcb -- cgit v1.2.3 From 0decdcb754dbbd42769ede69eb32c17ea05f4d8c Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Fri, 28 Dec 2018 23:43:18 +0100 Subject: configure: add X11 subsection in "Features used by QPA backends" xcb-xlib is used by XCB and EGLFS_X11. xlib is used by XCB, EGLFS_X11 and offscreen plugin (not listed currently under "QPA backends"). egl_x11 is used by XCB GL integration plugin and EGLFS_X11. Renamed X11 -> XCB under "QPA backends", because that is the correct QPA name. Change-Id: I455ac3a41da3ab84453d8de0edc657c3a5e064c9 Reviewed-by: Oswald Buddenhagen --- src/gui/configure.json | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/gui/configure.json b/src/gui/configure.json index 3af7d2d49d..f33f34ec60 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -1902,7 +1902,15 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla "integrityhid", "mtdev", "tslib", - "xkbcommon" + "xkbcommon", + { + "section": "X11 specific", + "entries": [ + "xlib", + "xcb-xlib", + "egl_x11" + ] + } ] }, { @@ -1930,10 +1938,10 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla ] }, { - "section": "X11", + "section": "XCB", "condition": "features.xcb", "entries": [ - "system-xcb", "egl_x11", "xkb", "xlib", "xcb-glx", "xcb-xinput", "xcb-xlib", "xcb-native-painting" + "system-xcb", "xkb", "xcb-xinput", "xcb-glx", "xcb-native-painting" ] }, { -- cgit v1.2.3 From dd988e2074fa8d7d230b14ab997bcfc86dc6e1a4 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Thu, 27 Dec 2018 01:10:29 +0100 Subject: configure: add XCB GL integration features This way Qt builders can see if everything has been configured properly for XCB GL integrations at configure time, instead of at the end of the build process. Change-Id: I00740cc2edd7f6ecfcda0ddfb22649d1b4db4aa2 Reviewed-by: Oswald Buddenhagen --- src/gui/configure.json | 26 +++++++++++++++++++--- .../xcb/gl_integrations/gl_integrations.pro | 4 ++-- 2 files changed, 25 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/gui/configure.json b/src/gui/configure.json index f33f34ec60..582705f402 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -1531,12 +1531,24 @@ "emitIf": "features.xcb", "output": [ { "type": "varAssign", "name": "QMAKE_X11_PREFIX", "value": "tests.x11prefix.value" } ] }, - "xcb-glx": { - "label": "XCB GLX", + "xcb-glx-plugin": { + "label": "GLX Plugin", "emitIf": "features.xcb", + "condition": "features.xcb-xlib && features.opengl && !features.opengles2", + "output": [ "privateFeature" ] + }, + "xcb-glx": { + "label": " XCB GLX", + "emitIf": "features.xcb && features.xcb-glx-plugin", "condition": "libs.xcb_glx", "output": [ "privateFeature" ] }, + "xcb-egl-plugin": { + "label": "EGL-X11 Plugin", + "emitIf": "features.xcb", + "condition": "features.egl_x11 && features.opengl", + "output": [ "privateFeature" ] + }, "xcb-native-painting": { "label": "Native painting (experimental)", "emitIf": "features.xcb", @@ -1941,7 +1953,15 @@ QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your pla "section": "XCB", "condition": "features.xcb", "entries": [ - "system-xcb", "xkb", "xcb-xinput", "xcb-glx", "xcb-native-painting" + "system-xcb", "xkb", "xcb-xinput", "xcb-native-painting", + { + "section": "GL integrations", + "entries": [ + "xcb-glx-plugin", + "xcb-glx", + "xcb-egl-plugin" + ] + } ] }, { diff --git a/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro b/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro index b8f878ffe8..dde176433c 100644 --- a/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro +++ b/src/plugins/platforms/xcb/gl_integrations/gl_integrations.pro @@ -1,10 +1,10 @@ TEMPLATE = subdirs QT_FOR_CONFIG += gui-private -qtConfig(egl):qtConfig(egl_x11):qtConfig(opengl) { +qtConfig(xcb-egl-plugin) { SUBDIRS += xcb_egl } -qtConfig(xcb-xlib):qtConfig(opengl):!qtConfig(opengles2) { +qtConfig(xcb-glx-plugin) { SUBDIRS += xcb_glx } -- cgit v1.2.3 From 1606a8aa1c8ab2bce4009ba34a854cd83ddf39e0 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Wed, 2 Jan 2019 13:44:13 +0100 Subject: Doc: fix typo in QAbstractSocket::bind documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: QTBUG-72780 Change-Id: I16d89d29f573dba37ed8e1986ed9677117ca6aad Reviewed-by: André Hartmann Reviewed-by: Paul Wicking Reviewed-by: Topi Reiniö --- src/network/socket/qabstractsocket.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/network/socket/qabstractsocket.cpp b/src/network/socket/qabstractsocket.cpp index 2f93c5fa2b..e86793cb21 100644 --- a/src/network/socket/qabstractsocket.cpp +++ b/src/network/socket/qabstractsocket.cpp @@ -1549,7 +1549,7 @@ void QAbstractSocket::setPauseMode(PauseModes pauseMode) By default, the socket is bound using the DefaultForPlatform BindMode. If a port is not specified, a random port is chosen. - On success, the functions returns \c true and the socket enters + On success, the function returns \c true and the socket enters BoundState; otherwise it returns \c false. */ -- cgit v1.2.3 From d8bbb5ee0e60d44a70d29306e607a59caf7fe5bc Mon Sep 17 00:00:00 2001 From: Vitaly Fanaskov Date: Fri, 7 Dec 2018 16:04:33 +0100 Subject: Respect roles of buttons added to QMessageBox MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a button added to QMessageBox has AcceptRole or YesRole, the signal accepted() will be emitted upon click on the button. If the button has RejectRole or NoRole, the signal rejected() will be emitted upon click on the button. If a button has a different role, neither accepted() nor rejected() will be emitted. This works for both standard and custom buttons. The signal finished() with result code will be sent regardless of a clicked button role. Also added documentation strings for some methods of private classes in order to have better tooltips in IDE(s). Task-number: QTBUG-44131 Change-Id: I521a4e5112eb4cf168f6fbb4c002dbe119aeeb09 Reviewed-by: Tor Arne Vestbø --- src/widgets/dialogs/qdialog.cpp | 48 ++++++++++++++++++++++++++++--------- src/widgets/dialogs/qdialog_p.h | 3 +++ src/widgets/dialogs/qmessagebox.cpp | 42 ++++++++++++++++++++++++++++---- 3 files changed, 78 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp index 6f96018f3e..1fb5e61301 100644 --- a/src/widgets/dialogs/qdialog.cpp +++ b/src/widgets/dialogs/qdialog.cpp @@ -145,6 +145,41 @@ bool QDialogPrivate::canBeNativeDialog() const return false; } +/*! + \internal + + Properly hides dialog and sets the \p resultCode + */ +void QDialogPrivate::hide(int resultCode) +{ + Q_Q(QDialog); + + q->setResult(resultCode); + q->hide(); + + close_helper(QWidgetPrivate::CloseNoEvent); + resetModalitySetByOpen(); +} + +/*! + \internal + + Emits finished() signal with \p resultCode. If the \p dialogCode + is equal to 0 emits rejected(), if the \p dialogCode is equal to + 1 emits accepted(). + */ +void QDialogPrivate::finalize(int resultCode, int dialogCode) +{ + Q_Q(QDialog); + + if (dialogCode == QDialog::Accepted) + emit q->accepted(); + else if (dialogCode == QDialog::Rejected) + emit q->rejected(); + + emit q->finished(resultCode); +} + QWindow *QDialogPrivate::transientParentWindow() const { Q_Q(const QDialog); @@ -593,17 +628,8 @@ int QDialog::exec() void QDialog::done(int r) { Q_D(QDialog); - setResult(r); - hide(); - - d->close_helper(QWidgetPrivate::CloseNoEvent); - d->resetModalitySetByOpen(); - - emit finished(r); - if (r == Accepted) - emit accepted(); - else if (r == Rejected) - emit rejected(); + d->hide(r); + d->finalize(r, r); } /*! diff --git a/src/widgets/dialogs/qdialog_p.h b/src/widgets/dialogs/qdialog_p.h index b1de56188c..92634f6793 100644 --- a/src/widgets/dialogs/qdialog_p.h +++ b/src/widgets/dialogs/qdialog_p.h @@ -122,6 +122,9 @@ public: QPlatformDialogHelper *platformHelper() const; virtual bool canBeNativeDialog() const; + void hide(int resultCode); + void finalize(int resultCode, int dialogCode); + private: virtual void initHelper(QPlatformDialogHelper *) {} virtual void helperPrepareShow(QPlatformDialogHelper *) {} diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp index ffbbe82856..ce918b8a74 100644 --- a/src/widgets/dialogs/qmessagebox.cpp +++ b/src/widgets/dialogs/qmessagebox.cpp @@ -209,6 +209,7 @@ public: void setupLayout(); void _q_buttonClicked(QAbstractButton *); void _q_clicked(QPlatformDialogHelper::StandardButton button, QPlatformDialogHelper::ButtonRole role); + void setClickedButton(QAbstractButton *button); QAbstractButton *findButton(int button0, int button1, int button2, int flags); void addOldButtons(int button0, int button1, int button2); @@ -216,6 +217,8 @@ public: QAbstractButton *abstractButtonForId(int id) const; int execReturnCode(QAbstractButton *button); + int dialogCodeForButton(QAbstractButton *button) const; + void detectEscapeButton(); void updateSize(); int layoutMinimumWidth(); @@ -466,6 +469,27 @@ int QMessageBoxPrivate::execReturnCode(QAbstractButton *button) return ret; } +/*! + \internal + + Returns 0 for RejectedRole and NoRole, 1 for AcceptedRole and YesRole, -1 otherwise + */ +int QMessageBoxPrivate::dialogCodeForButton(QAbstractButton *button) const +{ + Q_Q(const QMessageBox); + + switch (q->buttonRole(button)) { + case QMessageBox::AcceptRole: + case QMessageBox::YesRole: + return QDialog::Accepted; + case QMessageBox::RejectRole: + case QMessageBox::NoRole: + return QDialog::Rejected; + default: + return -1; + } +} + void QMessageBoxPrivate::_q_buttonClicked(QAbstractButton *button) { Q_Q(QMessageBox); @@ -477,20 +501,30 @@ void QMessageBoxPrivate::_q_buttonClicked(QAbstractButton *button) } else #endif { - clickedButton = button; - q->done(execReturnCode(button)); // does not trigger closeEvent - emit q->buttonClicked(button); + setClickedButton(button); if (receiverToDisconnectOnClose) { QObject::disconnect(q, signalToDisconnectOnClose, receiverToDisconnectOnClose, memberToDisconnectOnClose); - receiverToDisconnectOnClose = 0; + receiverToDisconnectOnClose = nullptr; } signalToDisconnectOnClose.clear(); memberToDisconnectOnClose.clear(); } } +void QMessageBoxPrivate::setClickedButton(QAbstractButton *button) +{ + Q_Q(QMessageBox); + + clickedButton = button; + emit q->buttonClicked(clickedButton); + + auto resultCode = execReturnCode(button); + hide(resultCode); + finalize(resultCode, dialogCodeForButton(button)); +} + void QMessageBoxPrivate::_q_clicked(QPlatformDialogHelper::StandardButton button, QPlatformDialogHelper::ButtonRole role) { Q_Q(QMessageBox); -- cgit v1.2.3 From 88e34b0a4636de234cc37410c25f0c1032d99a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 19 Dec 2018 22:52:23 +0100 Subject: CoreText: Fix inaccurate use of pixelSize when dealing with pointSize Change-Id: If46fa157bc921efd8145823c806b6b04f49233cf Reviewed-by: Timur Pocheptsov --- .../fontdatabases/mac/qcoretextfontdatabase.mm | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm index ba23271e55..047773d8e3 100644 --- a/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm +++ b/src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm @@ -194,7 +194,7 @@ struct FontDescription { QFont::Weight weight; QFont::Style style; QFont::Stretch stretch; - int pixelSize; + qreal pointSize; bool fixedPitch; QSupportedWritingSystems writingSystems; }; @@ -210,7 +210,7 @@ Q_DECL_UNUSED static inline QDebug operator<<(QDebug debug, const FontDescriptio << ", weight=" << fd.weight << ", style=" << fd.style << ", stretch=" << fd.stretch - << ", pixelSize=" << fd.pixelSize + << ", pointSize=" << fd.pointSize << ", fixedPitch=" << fd.fixedPitch << ", writingSystems=" << fd.writingSystems << ")"; @@ -286,9 +286,11 @@ static void getFontDescription(CTFontDescriptorRef font, FontDescription *fd) if (CFNumberIsFloatType(size)) { double d; CFNumberGetValue(size, kCFNumberDoubleType, &d); - fd->pixelSize = d; + fd->pointSize = d; } else { - CFNumberGetValue(size, kCFNumberIntType, &fd->pixelSize); + int i; + CFNumberGetValue(size, kCFNumberIntType, &i); + fd->pointSize = i; } } @@ -316,8 +318,8 @@ void QCoreTextFontDatabase::populateFromDescriptor(CTFontDescriptorRef font, con CFRetain(font); QPlatformFontDatabase::registerFont(family, fd.styleName, fd.foundryName, fd.weight, fd.style, fd.stretch, - true /* antialiased */, true /* scalable */, - fd.pixelSize, fd.fixedPitch, fd.writingSystems, (void *) font); + true /* antialiased */, true /* scalable */, 0 /* pixelSize, ignored as font is scalable */, + fd.fixedPitch, fd.writingSystems, (void *)font); } static NSString * const kQtFontDataAttribute = @"QtFontDataAttribute"; @@ -727,7 +729,7 @@ QFont *QCoreTextFontDatabase::themeFont(QPlatformTheme::Font f) const else CFRelease(fontDesc); - QFont *font = new QFont(fd.familyName, fd.pixelSize, fd.weight, fd.style == QFont::StyleItalic); + QFont *font = new QFont(fd.familyName, fd.pointSize, fd.weight, fd.style == QFont::StyleItalic); return font; } -- cgit v1.2.3 From 4dc2bc323c985bdceb27f096dd6c8e7af657bb6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 2 Jan 2019 19:35:07 +0100 Subject: macOS: Remove Mojave forward-declarations now that we build with Xcode 10 Change-Id: I8528932f3744fbf3473219b6eeda7c26ac039b67 Reviewed-by: Timur Pocheptsov --- src/corelib/kernel/qcore_mac_objc.mm | 12 ++++-------- src/plugins/platforms/cocoa/qcocoatheme.mm | 10 ++++------ 2 files changed, 8 insertions(+), 14 deletions(-) (limited to 'src') diff --git a/src/corelib/kernel/qcore_mac_objc.mm b/src/corelib/kernel/qcore_mac_objc.mm index cb3539f3ec..7b78ef11be 100644 --- a/src/corelib/kernel/qcore_mac_objc.mm +++ b/src/corelib/kernel/qcore_mac_objc.mm @@ -41,12 +41,7 @@ #include #ifdef Q_OS_MACOS -# include -# if !QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14) -@interface NSApplication (MojaveForwardDeclarations) -@property (strong) NSAppearance *effectiveAppearance NS_AVAILABLE_MAC(10_14); -@end -# endif +#include #endif #if defined(QT_PLATFORM_UIKIT) @@ -174,10 +169,11 @@ QDebug operator<<(QDebug debug, const QMacAutoReleasePool *pool) #ifdef Q_OS_MACOS bool qt_mac_applicationIsInDarkMode() { +#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14) if (__builtin_available(macOS 10.14, *)) return [NSApp.effectiveAppearance.name hasSuffix:@"DarkAqua"]; - else - return false; +#endif + return false; } #endif diff --git a/src/plugins/platforms/cocoa/qcocoatheme.mm b/src/plugins/platforms/cocoa/qcocoatheme.mm index c46df25b66..efe670abed 100644 --- a/src/plugins/platforms/cocoa/qcocoatheme.mm +++ b/src/plugins/platforms/cocoa/qcocoatheme.mm @@ -80,12 +80,7 @@ #include -#if !QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14) -@interface NSApplication (MojaveForwardDeclarations) -@property (readonly, strong) NSAppearance *effectiveAppearance NS_AVAILABLE_MAC(10_14); -@end -#endif - +#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14) @interface QT_MANGLE_NAMESPACE(QCocoaThemeAppAppearanceObserver) : NSObject @property (readonly, nonatomic) QCocoaTheme *theme; - (instancetype)initWithTheme:(QCocoaTheme *)theme; @@ -124,6 +119,7 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QCocoaThemeAppAppearanceObserver); self.theme->handleSystemThemeChange(); } @end +#endif // QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14) QT_BEGIN_NAMESPACE @@ -132,8 +128,10 @@ const char *QCocoaTheme::name = "cocoa"; QCocoaTheme::QCocoaTheme() : m_systemPalette(nullptr), m_appearanceObserver(nil) { +#if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14) if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSMojave) m_appearanceObserver = [[QCocoaThemeAppAppearanceObserver alloc] initWithTheme:this]; +#endif [[NSNotificationCenter defaultCenter] addObserverForName:NSSystemColorsDidChangeNotification object:nil queue:nil usingBlock:^(NSNotification *) { -- cgit v1.2.3 From 1075f10184e52ecb08e9b91ae8da25d12f17a9ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Sat, 22 Dec 2018 20:08:27 +0100 Subject: macOS: Optimize detection of dark mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I579527c54f8453c1e4f57bab7eebfc576b6ad365 Reviewed-by: Morten Johan Sørvig --- src/corelib/kernel/qcore_mac_objc.mm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/kernel/qcore_mac_objc.mm b/src/corelib/kernel/qcore_mac_objc.mm index 7b78ef11be..bc23e821fd 100644 --- a/src/corelib/kernel/qcore_mac_objc.mm +++ b/src/corelib/kernel/qcore_mac_objc.mm @@ -170,8 +170,11 @@ QDebug operator<<(QDebug debug, const QMacAutoReleasePool *pool) bool qt_mac_applicationIsInDarkMode() { #if QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14) - if (__builtin_available(macOS 10.14, *)) - return [NSApp.effectiveAppearance.name hasSuffix:@"DarkAqua"]; + if (__builtin_available(macOS 10.14, *)) { + auto appearance = [NSApp.effectiveAppearance bestMatchFromAppearancesWithNames: + @[ NSAppearanceNameAqua, NSAppearanceNameDarkAqua ]]; + return [appearance isEqualToString:NSAppearanceNameDarkAqua]; + } #endif return false; } -- cgit v1.2.3 From 1fb41a38692a4f675a9a336d92d806e12eeb0de9 Mon Sep 17 00:00:00 2001 From: Ville Voutilainen Date: Fri, 4 Jan 2019 09:35:40 +0200 Subject: Fix qbswap calls for Big Endian targets Task-number: QTBUG-71945 Change-Id: I5356f8e32d00ea591b1f65cdd4111276fcf876ac Reviewed-by: Simon Hausmann Reviewed-by: Khem Raj --- src/corelib/global/qendian.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/corelib/global/qendian.h b/src/corelib/global/qendian.h index f2e5833468..615f523888 100644 --- a/src/corelib/global/qendian.h +++ b/src/corelib/global/qendian.h @@ -204,9 +204,9 @@ template inline Q_DECL_CONSTEXPR T qToBigEndian(T source) template inline Q_DECL_CONSTEXPR T qFromBigEndian(T source) { return source; } template inline Q_DECL_CONSTEXPR T qToLittleEndian(T source) -{ return qbswap(source); } +{ return qbswap(source); } template inline Q_DECL_CONSTEXPR T qFromLittleEndian(T source) -{ return qbswap(source); } +{ return qbswap(source); } template inline void qToBigEndian(T src, void *dest) { qToUnaligned(src, dest); } template inline void qToLittleEndian(T src, void *dest) -- cgit v1.2.3 From 012f7bb622add41ffc79c0d1eb62043c840be7db Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Fri, 4 Jan 2019 10:45:59 +0100 Subject: Copy backend configuration while setting dtls config When setting dtls configuration, we should also copy backendConfig, otherwise this setting will be ignored. Change-Id: I4df53e8e6d8c2bd0eb7dddb9928b7883c401d60a Reviewed-by: Timur Pocheptsov --- src/network/ssl/qdtls.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/network/ssl/qdtls.cpp b/src/network/ssl/qdtls.cpp index bbb22aa527..3185bfa124 100644 --- a/src/network/ssl/qdtls.cpp +++ b/src/network/ssl/qdtls.cpp @@ -370,6 +370,7 @@ void QDtlsBasePrivate::setConfiguration(const QSslConfiguration &configuration) dtlsConfiguration.nextProtocolNegotiationStatus = configuration.nextProtocolNegotiationStatus(); dtlsConfiguration.dtlsCookieEnabled = configuration.dtlsCookieVerificationEnabled(); dtlsConfiguration.allowRootCertOnDemandLoading = configuration.d->allowRootCertOnDemandLoading; + dtlsConfiguration.backendConfig = configuration.backendConfiguration(); clearDtlsError(); } -- cgit v1.2.3 From 2f4eea5b9cce7b438eeb9016c52a67937d536793 Mon Sep 17 00:00:00 2001 From: Volker Krause Date: Sat, 5 Jan 2019 12:50:18 +0100 Subject: Also integrate Android AAR libraries This works in the same way as JARs are currently provided by dependencies, and becomes necessary when needing e.g. the Android support/compat libs for implementing the Java side of a library. While this is not relevant (yet?) for Qt itself, we hit this with KDE's notification framework. Change-Id: Ia87d1a048a493f7bc311abf5761f33d1943cfbe9 Reviewed-by: BogDan Vatra --- src/android/templates/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/android/templates/build.gradle b/src/android/templates/build.gradle index fcd8ae345d..989d0792cf 100644 --- a/src/android/templates/build.gradle +++ b/src/android/templates/build.gradle @@ -17,7 +17,7 @@ repositories { apply plugin: 'com.android.application' dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) + implementation fileTree(dir: 'libs', include: ['*.jar', '*.aar']) } android { -- cgit v1.2.3 From ecdccce8e468784e050b65052da193bb40e2d9b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Nowacki?= Date: Fri, 4 Jan 2019 13:48:56 +0100 Subject: Fix warnings about uninitialized variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qtbase/src/corelib/kernel/qmetatype.cpp: In static member function ‘static void QMetaType::destroy(int, void*)’: qtbase/src/corelib/kernel/qmetatype.cpp:2599:27: error: ‘info.QMetaType::m_destructor’ may be used uninitialized in this function [-Werror=maybe-uninitialized] if (m_typedDestructor && !m_destructor) ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ qtbase/src/corelib/kernel/qmetatype.cpp:1868:15: note: ‘info.QMetaType::m_destructor’ was declared here QMetaType info(type); ^~~~ qtbase/src/corelib/kernel/qmetatype.cpp:2600:26: error: ‘info.QMetaType::m_typedDestructor’ may be used uninitialized in this function [-Werror=maybe-uninitialized] m_typedDestructor(m_typeId, data); ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~ qtbase/src/corelib/kernel/qmetatype.cpp:1868:15: note: ‘info.QMetaType::m_typedDestructor’ was declared here QMetaType info(type); ^~~~ The extended (not inlined) function may be called on a half initialized invalid instance. Change-Id: I26d677a8ad2bd0c5846233f06393e774d377936d Reviewed-by: Liang Qi Reviewed-by: Thiago Macieira --- src/corelib/kernel/qmetatype.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/corelib/kernel/qmetatype.cpp b/src/corelib/kernel/qmetatype.cpp index eb67544f21..632b86959d 100644 --- a/src/corelib/kernel/qmetatype.cpp +++ b/src/corelib/kernel/qmetatype.cpp @@ -2566,6 +2566,8 @@ void *QMetaType::createExtended(const void *copy) const */ void QMetaType::destroyExtended(void *data) const { + if (m_typeId == QMetaType::UnknownType) + return; if (Q_UNLIKELY(m_typedDestructor && !m_destructor)) m_typedDestructor(m_typeId, data); else @@ -2582,6 +2584,8 @@ void QMetaType::destroyExtended(void *data) const */ void *QMetaType::constructExtended(void *where, const void *copy) const { + if (m_typeId == QMetaType::UnknownType) + return nullptr; if (m_typedConstructor && !m_constructor) return m_typedConstructor(m_typeId, where, copy); return nullptr; @@ -2596,6 +2600,8 @@ void *QMetaType::constructExtended(void *where, const void *copy) const */ void QMetaType::destructExtended(void *data) const { + if (m_typeId == QMetaType::UnknownType) + return; if (m_typedDestructor && !m_destructor) m_typedDestructor(m_typeId, data); } -- cgit v1.2.3 From abcf7a103eb1e00f2487b2346129112778f8c112 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Wed, 2 Jan 2019 12:18:15 +0100 Subject: configure: improve warning when all qpa plugins disabled with features.gui The mentioned README file has never been very trustworthy and after 863c6887495c0bd9ee3a85aa7cd2d997cdc5c93c it has become very minimal - it doesn't contain anything that is not already present in "configure --help" and enforced by the configure process. Furthermore, the warning was XCB specific, but Qt supports also other QPA plugins on linux. Change-Id: I3211dda3f294cbcd5f3d15fe8c21a1af7627f048 Reviewed-by: Joerg Bornemann --- src/gui/configure.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/configure.json b/src/gui/configure.json index 582705f402..89934c8f1d 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -1830,8 +1830,7 @@ or may depend on your system and XQuartz setup." "condition": "features.gui && config.linux && !config.android && !features.xcb && !features.eglfs && !features.directfb && !features.linuxfb && !features.mirclient", "message": "No QPA platform plugin enabled! This will produce a Qt that cannot run GUI applications. -The dependencies needed for xcb to build are listed in -src/plugins/platforms/xcb/README" +See \"Platform backends\" in the output of --help." }, { "type": "warning", -- cgit v1.2.3 From 772f56c3cf54dc34dbaa3ae50570a006f9e7721a Mon Sep 17 00:00:00 2001 From: Liang Qi Date: Mon, 7 Jan 2019 13:58:30 +0100 Subject: Fix warnings about uninitialized variables - qrgba64_p.h In function 'QRgba64 rgbBlend(QRgba64, QRgba64, uint)': error: 'blend.QRgba64::rgba' is used uninitialized in this function [-Werror=uninitialized] qrgba64_p.h:246:13: note: 'blend' was declared here QRgba64 blend; Change-Id: I7b263f863281c51c7d8099704f2cffcc7e1a07df Reviewed-by: Allan Sandfeld Jensen --- src/gui/painting/qrgba64_p.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/gui/painting/qrgba64_p.h b/src/gui/painting/qrgba64_p.h index b7e4d4d905..ca879de27c 100644 --- a/src/gui/painting/qrgba64_p.h +++ b/src/gui/painting/qrgba64_p.h @@ -266,10 +266,10 @@ inline QRgba64 rgbBlend(QRgba64 d, QRgba64 s, uint rgbAlpha) const int mr = qRed(rgbAlpha); const int mg = qGreen(rgbAlpha); const int mb = qBlue(rgbAlpha); - blend.setRed (qt_div_255(s.red() * mr + d.red() * (255 - mr))); - blend.setGreen(qt_div_255(s.green() * mg + d.green() * (255 - mg))); - blend.setBlue (qt_div_255(s.blue() * mb + d.blue() * (255 - mb))); - blend.setAlpha(s.alpha()); + blend = qRgba64(qt_div_255(s.red() * mr + d.red() * (255 - mr)), + qt_div_255(s.green() * mg + d.green() * (255 - mg)), + qt_div_255(s.blue() * mb + d.blue() * (255 - mb)), + s.alpha()); #endif return blend; } -- cgit v1.2.3 From 2cd633e7eef6f67ee7ed5f23afea7e0f23c7eb03 Mon Sep 17 00:00:00 2001 From: Max Mazurov Date: Wed, 2 Jan 2019 16:55:24 +0000 Subject: XCB: Use application name for X11 selection owner name This makes it possible for clipboard managers (or other scripts) to distinguish different Qt applications and act differently. Change-Id: I5bc5a1914b51127b24a81142ca9dbdb196ffd0d8 Fixes: QTBUG-72806 Reviewed-by: Gatis Paeglis --- src/plugins/platforms/xcb/qxcbconnection.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/plugins/platforms/xcb/qxcbconnection.cpp b/src/plugins/platforms/xcb/qxcbconnection.cpp index 37ee980924..29acf0e86d 100644 --- a/src/plugins/platforms/xcb/qxcbconnection.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection.cpp @@ -39,6 +39,7 @@ #include #include +#include #include "qxcbconnection.h" #include "qxcbkeyboard.h" @@ -817,7 +818,7 @@ xcb_window_t QXcbConnection::getQtSelectionOwner() 0); // value list QXcbWindow::setWindowTitle(connection(), m_qtSelectionOwner, - QStringLiteral("Qt Selection Window")); + QLatin1String("Qt Selection Owner for ") + QCoreApplication::applicationName()); } return m_qtSelectionOwner; } -- cgit v1.2.3 From 5733dfbd90fd059e7310786faefb022b00289592 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 20 Dec 2018 16:30:51 +0100 Subject: qmake: make CONFIG+=egl work again while it's legacy and should not be used (use QMAKE_USE+=egl instead), it shouldn't be broken nonetheless. amends 310bf3f57c. Fixes: QTBUG-72564 Change-Id: Id6a070a4653dc1182a6b4d75af027a6ee6cbacae Reviewed-by: Joerg Bornemann Reviewed-by: Laszlo Agocs Reviewed-by: Rolf Eike Beer --- src/platformsupport/eglconvenience/qt_egl_p.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/platformsupport/eglconvenience/qt_egl_p.h b/src/platformsupport/eglconvenience/qt_egl_p.h index e2c6b0ceb6..ea554927de 100644 --- a/src/platformsupport/eglconvenience/qt_egl_p.h +++ b/src/platformsupport/eglconvenience/qt_egl_p.h @@ -52,7 +52,9 @@ // #ifdef QT_EGL_NO_X11 -# define MESA_EGL_NO_X11_HEADERS // MESA +# ifndef MESA_EGL_NO_X11_HEADERS +# define MESA_EGL_NO_X11_HEADERS // MESA +# endif # if !defined(Q_OS_INTEGRITY) # define WIN_INTERFACE_CUSTOM // NV # endif // Q_OS_INTEGRITY -- cgit v1.2.3