From 45c358b0da4e8f629d9c70a32fe06a3fb1cb6ca8 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Wed, 21 Nov 2018 17:08:49 +1000 Subject: threads: disable threads examples for nothread builds Change-Id: I2c253de973f5399c5ed68194b969ccebe457c689 Reviewed-by: Eskil Abrahamsen Blomfeldt --- examples/corelib/corelib.pro | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/corelib/corelib.pro b/examples/corelib/corelib.pro index 014e8af608..8caf2c16df 100644 --- a/examples/corelib/corelib.pro +++ b/examples/corelib/corelib.pro @@ -5,5 +5,6 @@ SUBDIRS = \ ipc \ mimetypes \ serialization \ - threads \ tools + +qtConfig(thread): SUBDIRS += threads -- cgit v1.2.3 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(-) 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(-) 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 6a221f3d05b6d0e902d86d75428364747268c6c9 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 7 Dec 2018 10:36:08 +0100 Subject: Fix qmake's detection for conflicting source files for nmake Consider the following source tree: foo/narf.cpp bar/narf.c bar/gnampf.cpp The .pro file has SOURCES += foo/narf.cpp bar/gnampf.cpp The file bar/narf.c is not supposed to be built for whatever reason. QMake's nmake Makefile generator generates inference rules of the form {.\foo}.cpp{debug\}.obj:: ... for every source subdirectory and every source file extension. Thus, we have {.\foo}.cpp{debug\}.obj:: {.\bar}.cpp{debug\}.obj:: {.\bar}.c{debug\}.obj:: Depending on the exact execution order of the inference rules (which depends on the names of the files) the latter rule might get picked, and we're erronously compiling bar/narf.c even though it's not referenced in the .pro file. Conclusion: QMake's detection of conflicting source files must consider the base names of source files, and not the exact file names. Fixes: QTBUG-72059 Change-Id: I50c2725ae2a7421053369a10680230f571af00ea Reviewed-by: Oliver Wolff Reviewed-by: Oswald Buddenhagen --- qmake/generators/win32/msvc_nmake.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index 306ae57871..780f6bd4d8 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -553,12 +553,13 @@ void NmakeMakefileGenerator::writeImplicitRulesPart(QTextStream &t) QDirIterator dit(sourceDir, sourceFilesFilter, QDir::Files | QDir::NoDotAndDotDot); while (dit.hasNext()) { dit.next(); - QString &duplicate = fileNames[dit.fileName()]; + const QFileInfo fi = dit.fileInfo(); + QString &duplicate = fileNames[fi.completeBaseName()]; if (duplicate.isNull()) { - duplicate = dit.filePath(); + duplicate = fi.filePath(); } else { warn_msg(WarnLogic, "%s conflicts with %s", qPrintable(duplicate), - qPrintable(dit.filePath())); + qPrintable(fi.filePath())); duplicatesFound = true; } } -- cgit v1.2.3 From 826b09f0c507fe5321a8534054a4f0b7bdd2699b Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Tue, 4 Dec 2018 12:00:37 +0100 Subject: Fix build of static plugins with resources This patch reverts 388c4ef9f78c8e. The reason is that it generates a symbol (resource_init_function) based on the name of the pro-file. But if different plugins are built from a pro-file with the same name, you end up linking in many symbols with the same name as well. Which one that ends up being used at runtime will typically depend on the linking order of the plugins. This problem will happen if you build an app for iOS that uses both controls 1 and controls 2. In that case, both QML plugins are built from a "controls.pro" file. At runtime, only one of the plugins will be imported correctly. This patch therefore reverts 388c4ef9f78c8e, but at the same time, to not re-introduce the problem it fixed, we instead genereate both a debug and release version of the plugin_resources.cpp file. That way we can still depend on the TARGET variable for generating both the resource_init_function symbol and the cpp file. Fixes: QTBUG-62647 Fixes: QTBUG-71386 Fixes: QTBUG-72108 Change-Id: I3d8c53132458b30ed9f47a259f1f8e4fa4d44130 Reviewed-by: Oswald Buddenhagen --- mkspecs/features/resources.prf | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/mkspecs/features/resources.prf b/mkspecs/features/resources.prf index a25846bd77..48e9f83885 100644 --- a/mkspecs/features/resources.prf +++ b/mkspecs/features/resources.prf @@ -73,17 +73,14 @@ for(resource, RESOURCES) { } !isEmpty(RESOURCES):contains(TEMPLATE, .*lib):plugin:static { - pluginName = $$lower($$replace(_PRO_FILE_, .*/([^/.]+)\\.[^/.]+, \\1)) - - resource_init_function = $${pluginName}_plugin_resource_init + resource_init_function = $$lower($$basename(TARGET))_plugin_resource_init DEFINES += "QT_PLUGIN_RESOURCE_INIT_FUNCTION=$$resource_init_function" - - RESOURCE_INIT_CPP = $$OUT_PWD/$${pluginName}_plugin_resources.cpp + RESOURCE_INIT_CPP = $$OUT_PWD/$$lower($$basename(TARGET))_plugin_resources.cpp GENERATED_SOURCES += $$RESOURCE_INIT_CPP QMAKE_DISTCLEAN += $$RESOURCE_INIT_CPP - !build_pass { + isEmpty(BUILDS)|build_pass { RESOURCE_INIT_CONT = \ "// This file is autogenerated by qmake. It contains a function that" \ "// references all resources the plugin includes and the function is" \ -- 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(-) 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 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(-) 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 76f11b0eda50f05fb0912738be41b4333a82f748 Mon Sep 17 00:00:00 2001 From: Ville Voutilainen Date: Mon, 10 Dec 2018 16:21:07 +0200 Subject: Silence GCC 9 warnings Change-Id: I5654881a3adac6f67a38837321c8e1c3ce1e2d8f Reviewed-by: Thiago Macieira --- mkspecs/features/qt_common.prf | 17 ++++++++++++++++- mkspecs/features/qt_module_headers.prf | 8 ++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf index 4ad9946ae0..e67b79acc3 100644 --- a/mkspecs/features/qt_common.prf +++ b/mkspecs/features/qt_common.prf @@ -89,6 +89,14 @@ clang { greaterThan(QT_GCC_MAJOR_VERSION, 5): QMAKE_CXXFLAGS_WARN_ON += -Wshift-overflow=2 -Wduplicated-cond # GCC 7 has a lot of false positives relating to this, so disable completely greaterThan(QT_GCC_MAJOR_VERSION, 6): QMAKE_CXXFLAGS_WARN_ON += -Wno-stringop-overflow + # GCC 9 has a lot of false positives relating to this, so disable completely + greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-deprecated-copy + # GCC 9 introduced this + greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-redundant-move + # GCC 9 introduced this + greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-format-overflow + # GCC 9 introduced this + greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-init-list-lifetime } warnings_are_errors:warning_clean { @@ -127,7 +135,14 @@ warnings_are_errors:warning_clean { # GCC 7 includes -Wimplicit-fallthrough in -Wextra, but Qt is not yet free of implicit fallthroughs. greaterThan(QT_GCC_MAJOR_VERSION, 6): QMAKE_CXXFLAGS_WARN_ON += -Wno-error=implicit-fallthrough - + # GCC 9 has a lot of false positives relating to this, so disable completely + greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-deprecated-copy + # GCC 9 introduced this + greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-redundant-move + # GCC 9 introduced this + greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-format-overflow + # GCC 9 introduced this + greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-init-list-lifetime # Work-around for bug https://code.google.com/p/android/issues/detail?id=58135 android: QMAKE_CXXFLAGS_WARN_ON += -Wno-error=literal-suffix } diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf index 70d3520e5c..6b4b9143fa 100644 --- a/mkspecs/features/qt_module_headers.prf +++ b/mkspecs/features/qt_module_headers.prf @@ -239,6 +239,14 @@ headersclean:!internal_module { gcc_ver = $${QT_GCC_MAJOR_VERSION}.$${QT_GCC_MINOR_VERSION} versionAtLeast(gcc_ver, 4.5): hcleanFLAGS += -Wdouble-promotion versionAtLeast(gcc_ver, 4.9): hcleanFLAGS += -Wfloat-conversion + # GCC 9 has a lot of false positives relating to this, so disable completely + greaterThan(QT_GCC_MAJOR_VERSION, 8): hcleanFLAGS += -Wno-deprecated-copy + # GCC 9 introduced this + greaterThan(QT_GCC_MAJOR_VERSION, 8): hcleanFLAGS += -Wno-redundant-move + # GCC 9 introduced this + greaterThan(QT_GCC_MAJOR_VERSION, 8): hcleanFLAGS += -Wno-format-overflow + # GCC 9 introduced this + greaterThan(QT_GCC_MAJOR_VERSION, 8): hcleanFLAGS += -Wno-init-list-lifetime c++11 { # only enabled for actual c++11 builds due to -- 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 ++++++++ tests/auto/gui/painting/qpainter/tst_qpainter.cpp | 16 ++++++++++++++++ 2 files changed, 24 insertions(+) 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); diff --git a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp index 9bf9e99bf9..bc0baed15c 100644 --- a/tests/auto/gui/painting/qpainter/tst_qpainter.cpp +++ b/tests/auto/gui/painting/qpainter/tst_qpainter.cpp @@ -299,6 +299,8 @@ private slots: void fillPolygon(); + void drawImageAtPointF(); + private: void fillData(); void setPenColor(QPainter& p); @@ -5292,6 +5294,20 @@ void tst_QPainter::fillPolygon() } } +void tst_QPainter::drawImageAtPointF() +{ + // Just test we do not crash + QImage image1(10, 10, QImage::Format_RGB32); + QImage image2(200, 200, QImage::Format_RGB32); + + QPainter paint(&image2); + paint.setClipRect(97, 46, 14, 14); + paint.setCompositionMode(QPainter::CompositionMode_Source); + paint.drawImage(QPointF(96, std::numeric_limits::max()), image1); + paint.drawImage(QPointF(std::numeric_limits::min(), 48), image1); + paint.end(); +} + QTEST_MAIN(tst_QPainter) #include "tst_qpainter.moc" -- 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(-) 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 63b0eb3a89049f3a9166a29e8c8275d77323ec52 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Mon, 3 Dec 2018 13:18:35 +0100 Subject: Include CLDR 34 update in change log Change-Id: I88ab9d48eaa0486cbd930166de601973be2e8e0f Reviewed-by: Thiago Macieira --- dist/changes-5.12.0 | 1 + 1 file changed, 1 insertion(+) diff --git a/dist/changes-5.12.0 b/dist/changes-5.12.0 index b5e664fc5a..15b12b60ab 100644 --- a/dist/changes-5.12.0 +++ b/dist/changes-5.12.0 @@ -48,6 +48,7 @@ information about a particular change. - The minimal required version of libxcb is now 1.9. Bundled xcb sources were updated to libxcb 1.9.1 built with xcb-proto 1.8. - [QTBUG-67654] Updated CLDR to version 33.1 + - [QTBUG-71144] Updated CLDR to version 34 - [QTBUG-66561][QTBUG-70008] double-conversion got updated to upstream version 3.1.1. - libjpeg-turbo was updated to version 2.0.0 -- 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 ++++ .../auto/corelib/tools/qcollator/tst_qcollator.cpp | 18 +++++++--- 7 files changed, 70 insertions(+), 24 deletions(-) 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, diff --git a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp index 2d65d3433f..72f88a235d 100644 --- a/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp +++ b/tests/auto/corelib/tools/qcollator/tst_qcollator.cpp @@ -93,7 +93,7 @@ void tst_QCollator::compare_data() QTest::addColumn("caseInsensitiveResult"); QTest::addColumn("numericMode"); QTest::addColumn("ignorePunctuation"); - QTest::addColumn("punctuationResult"); + QTest::addColumn("punctuationResult"); // Test ignores punctuation *and case* /* It's hard to test English, because it's treated differently @@ -169,8 +169,12 @@ void tst_QCollator::compare_data() QTest::newRow("french6") << QString("fr_FR") << QString("Test 9") << QString("Test_19") << -1 << -1 << true << true << -1; QTest::newRow("french7") << QString("fr_FR") << QString("test_19") << QString("test 19") << 1 << 1 << true << false << 1; QTest::newRow("french8") << QString("fr_FR") << QString("test.19") << QString("test,19") << 1 << 1 << true << true << 0; -} + // C locale: case sensitive [A-Z] < [a-z] but case insensitive [Aa] < [Bb] <...< [Zz] + const QString C = QStringLiteral("C"); + QTest::newRow("C:ABBA:AaaA") << C << QStringLiteral("ABBA") << QStringLiteral("AaaA") << -1 << 1 << false << false << 1; + QTest::newRow("C:AZa:aAZ") << C << QStringLiteral("AZa") << QStringLiteral("aAZ") << -1 << 1 << false << false << 1; +} void tst_QCollator::compare() { @@ -184,6 +188,10 @@ void tst_QCollator::compare() QFETCH(int, punctuationResult); QCollator collator(locale); + // Need to canonicalize sign to -1, 0 or 1, as .compare() can produce any -ve for <, any +ve for >. + auto asSign = [](int compared) { + return compared < 0 ? -1 : compared > 0 ? 1 : 0; + }; #if defined(Q_OS_ANDROID) && !defined(Q_OS_ANDROID_EMBEDDED) if (collator.locale() != QLocale()) @@ -193,12 +201,12 @@ void tst_QCollator::compare() if (numericMode) collator.setNumericMode(true); - QCOMPARE(collator.compare(s1, s2), result); + QCOMPARE(asSign(collator.compare(s1, s2)), result); collator.setCaseSensitivity(Qt::CaseInsensitive); - QCOMPARE(collator.compare(s1, s2), caseInsensitiveResult); + QCOMPARE(asSign(collator.compare(s1, s2)), caseInsensitiveResult); #if !QT_CONFIG(iconv) collator.setIgnorePunctuation(ignorePunctuation); - QCOMPARE(collator.compare(s1, s2), punctuationResult); + QCOMPARE(asSign(collator.compare(s1, s2)), punctuationResult); #endif } -- cgit v1.2.3 From f10b98084064f5d53717c8364048562d373a7f88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 10 Dec 2018 17:57:26 +0100 Subject: nativetext: Fix baseline positioning for CoreText The Qt and CoreText positioning is now in sync. Change-Id: I0cbb5b150d1bef732674b8d42c64a040773a62ab Reviewed-by: Eskil Abrahamsen Blomfeldt --- tests/manual/textrendering/nativetext/main.cpp | 27 ++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/tests/manual/textrendering/nativetext/main.cpp b/tests/manual/textrendering/nativetext/main.cpp index 5c7621e61f..3fb78858f0 100644 --- a/tests/manual/textrendering/nativetext/main.cpp +++ b/tests/manual/textrendering/nativetext/main.cpp @@ -101,7 +101,9 @@ public: const int ascent = fontMetrics().ascent(); - p.setPen(Qt::magenta); + QPen metricsPen(Qt::magenta, 1.0); + metricsPen.setCosmetic(true); + p.setPen(metricsPen); p.drawLine(QPoint(0, ascent), QPoint(width(), ascent)); p.end(); @@ -152,13 +154,22 @@ public: if (font().styleStrategy() & QFont::NoAntialias) CGContextSetShouldAntialias(ctx, false); - // Retain count already tracked by QMacCGContext above - NSGraphicsContext.currentContext = [NSGraphicsContext graphicsContextWithCGContext:ctx flipped:YES]; - [text().toNSString() drawAtPoint:CGPointZero withAttributes:@{ - NSFontAttributeName : (NSFont *)fontEngine->handle(), - NSForegroundColorAttributeName : nsColor - }]; - NSGraphicsContext.currentContext = nil; + // Flip to what CT expects + CGContextScaleCTM(ctx, 1, -1); + CGContextTranslateCTM(ctx, 0, -height()); + + // Set up baseline + CGContextSetTextPosition(ctx, 0, height() - fontMetrics().ascent()); + + auto *attributedString = [[NSAttributedString alloc] initWithString:text().toNSString() + attributes:@{ + NSFontAttributeName : (NSFont *)fontEngine->handle(), + NSForegroundColorAttributeName : nsColor + } + ]; + + QCFType line = CTLineCreateWithAttributedString(CFAttributedStringRef([attributedString autorelease])); + CTLineDraw(line, ctx); #endif } -- 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(+) 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(-) 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 ceebad9bd2c5ca35c09a17b0adc5e8ee140bdad2 Mon Sep 17 00:00:00 2001 From: Vitaly Fanaskov Date: Fri, 7 Dec 2018 17:21:50 +0100 Subject: tst_QMessageBox: Modernize and simplify code Changed 0 to nullptr, used more C++-style casts, simplified some code for searching a button, and changed foreach to range-based for loop. Task-number: QTBUG-44131 Change-Id: I211b12751b0e2591d1d14294c31b51d52bb4e3f6 Reviewed-by: Christian Ehrlicher --- .../dialogs/qmessagebox/tst_qmessagebox.cpp | 73 +++++++++++----------- 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp index 049468fd7c..3b31a74adf 100644 --- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp +++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp @@ -210,9 +210,9 @@ void tst_QMessageBox::button() { QMessageBox msgBox; msgBox.addButton("retry", QMessageBox::DestructiveRole); - QVERIFY(msgBox.button(QMessageBox::Ok) == 0); // not added yet + QVERIFY(msgBox.button(QMessageBox::Ok) == nullptr); // not added yet QPushButton *b1 = msgBox.addButton(QMessageBox::Ok); - QCOMPARE(msgBox.button(QMessageBox::Ok), (QAbstractButton *)b1); // just added + QCOMPARE(msgBox.button(QMessageBox::Ok), static_cast(b1)); // just added QCOMPARE(msgBox.standardButton(b1), QMessageBox::Ok); msgBox.addButton(QMessageBox::Cancel); QCOMPARE(msgBox.standardButtons(), QMessageBox::Ok | QMessageBox::Cancel); @@ -220,12 +220,12 @@ void tst_QMessageBox::button() // remove the cancel, should not exist anymore msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); QVERIFY(!msgBox.button(QMessageBox::Cancel)); - QVERIFY(msgBox.button(QMessageBox::Yes) != 0); + QVERIFY(msgBox.button(QMessageBox::Yes) != nullptr); // should not crash QPushButton *b4 = new QPushButton; msgBox.addButton(b4, QMessageBox::DestructiveRole); - msgBox.addButton(0, QMessageBox::ActionRole); + msgBox.addButton(nullptr, QMessageBox::ActionRole); } void tst_QMessageBox::defaultButton() @@ -237,7 +237,7 @@ void tst_QMessageBox::defaultButton() QVERIFY(!msgBox.defaultButton()); QPushButton pushButton; msgBox.setDefaultButton(&pushButton); - QVERIFY(msgBox.defaultButton() == 0); // we have not added it yet + QVERIFY(msgBox.defaultButton() == nullptr); // we have not added it yet QPushButton *retryButton = msgBox.addButton(QMessageBox::Retry); msgBox.setDefaultButton(retryButton); QCOMPARE(msgBox.defaultButton(), retryButton); @@ -248,11 +248,11 @@ void tst_QMessageBox::defaultButton() closeHelper.start(Qt::Key_Enter, &msgBox); msgBox.exec(); - QCOMPARE(msgBox.clickedButton(), (QAbstractButton *)retryButton); + QCOMPARE(msgBox.clickedButton(), static_cast(retryButton)); QAbstractButton *okButton = msgBox.button(QMessageBox::Ok); msgBox.setDefaultButton(QMessageBox::Ok); - QCOMPARE(msgBox.defaultButton(), (QPushButton *)okButton); + QCOMPARE(msgBox.defaultButton(), static_cast(okButton)); closeHelper.start(Qt::Key_Enter, &msgBox); msgBox.exec(); QCOMPARE(msgBox.clickedButton(), okButton); @@ -260,7 +260,7 @@ void tst_QMessageBox::defaultButton() QCOMPARE(msgBox.defaultButton(), okButton); msgBox.removeButton(okButton); delete okButton; - okButton = 0; + okButton = nullptr; QVERIFY(!msgBox.defaultButton()); msgBox.setDefaultButton(QMessageBox::Ok); QVERIFY(!msgBox.defaultButton()); @@ -287,7 +287,7 @@ void tst_QMessageBox::escapeButton() QVERIFY(msgBox.clickedButton() == msgBox.button(QMessageBox::Cancel)); // auto detected (cancel) msgBox.setEscapeButton(retryButton); - QCOMPARE(msgBox.escapeButton(), (QAbstractButton *)retryButton); + QCOMPARE(msgBox.escapeButton(), static_cast(retryButton)); // with escape closeHelper.start(Qt::Key_Escape, &msgBox); @@ -297,7 +297,7 @@ void tst_QMessageBox::escapeButton() // with close closeHelper.start(ExecCloseHelper::CloseWindow, &msgBox); msgBox.exec(); - QCOMPARE(msgBox.clickedButton(), (QAbstractButton *)retryButton); + QCOMPARE(msgBox.clickedButton(), static_cast(retryButton)); QAbstractButton *okButton = msgBox.button(QMessageBox::Ok); msgBox.setEscapeButton(QMessageBox::Ok); @@ -309,7 +309,7 @@ void tst_QMessageBox::escapeButton() QCOMPARE(msgBox.escapeButton(), okButton); msgBox.removeButton(okButton); delete okButton; - okButton = 0; + okButton = nullptr; QVERIFY(!msgBox.escapeButton()); msgBox.setEscapeButton(QMessageBox::Ok); QVERIFY(!msgBox.escapeButton()); @@ -353,28 +353,28 @@ void tst_QMessageBox::statics() ExecCloseHelper closeHelper; for (int i = 0; i < 4; i++) { closeHelper.start(Qt::Key_Escape); - QMessageBox::StandardButton sb = (*statics[i])(0, "caption", + QMessageBox::StandardButton sb = (*statics[i])(nullptr, "caption", "text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help | QMessageBox::Cancel, QMessageBox::NoButton); QCOMPARE(sb, QMessageBox::Cancel); QVERIFY(closeHelper.done()); closeHelper.start(ExecCloseHelper::CloseWindow); - sb = (*statics[i])(0, "caption", + sb = (*statics[i])(nullptr, "caption", "text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help | QMessageBox::Cancel, QMessageBox::NoButton); QCOMPARE(sb, QMessageBox::Cancel); QVERIFY(closeHelper.done()); closeHelper.start(Qt::Key_Enter); - sb = (*statics[i])(0, "caption", + sb = (*statics[i])(nullptr, "caption", "text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help, QMessageBox::Yes); QCOMPARE(sb, QMessageBox::Yes); QVERIFY(closeHelper.done()); closeHelper.start(Qt::Key_Enter); - sb = (*statics[i])(0, "caption", + sb = (*statics[i])(nullptr, "caption", "text", QMessageBox::Yes | QMessageBox::No | QMessageBox::Help, QMessageBox::No); QCOMPARE(sb, QMessageBox::No); @@ -400,7 +400,7 @@ void tst_QMessageBox::about() { ExecCloseHelper closeHelper; closeHelper.start(Qt::Key_Escape); - QMessageBox::about(0, "Caption", "This is an auto test"); + QMessageBox::about(nullptr, "Caption", "This is an auto test"); // On Mac, about and aboutQt are not modal, so we need to // explicitly run the event loop #ifdef Q_OS_MAC @@ -412,7 +412,7 @@ void tst_QMessageBox::about() const int keyToSend = Qt::Key_Enter; closeHelper.start(keyToSend); - QMessageBox::aboutQt(0, "Caption"); + QMessageBox::aboutQt(nullptr, "Caption"); #ifdef Q_OS_MAC QTRY_VERIFY(closeHelper.done()); #else @@ -427,7 +427,7 @@ void tst_QMessageBox::staticSourceCompat() // source compat tests for < 4.2 ExecCloseHelper closeHelper; closeHelper.start(Qt::Key_Enter); - ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes, QMessageBox::No); + ret = QMessageBox::information(nullptr, "title", "text", QMessageBox::Yes, QMessageBox::No); int expectedButton = int(QMessageBox::Yes); if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) { const int dialogButtonBoxLayout = theme->themeHint(QPlatformTheme::DialogButtonBoxLayout).toInt(); @@ -439,39 +439,39 @@ void tst_QMessageBox::staticSourceCompat() QVERIFY(closeHelper.done()); closeHelper.start(Qt::Key_Enter); - ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No); + ret = QMessageBox::information(nullptr, "title", "text", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No); QCOMPARE(ret, int(QMessageBox::Yes)); QVERIFY(closeHelper.done()); closeHelper.start(Qt::Key_Enter); - ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes, QMessageBox::No | QMessageBox::Default); + ret = QMessageBox::information(nullptr, "title", "text", QMessageBox::Yes, QMessageBox::No | QMessageBox::Default); QCOMPARE(ret, int(QMessageBox::No)); QVERIFY(closeHelper.done()); closeHelper.start(Qt::Key_Enter); - ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape); + ret = QMessageBox::information(nullptr, "title", "text", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape); QCOMPARE(ret, int(QMessageBox::Yes)); QVERIFY(closeHelper.done()); closeHelper.start(Qt::Key_Enter); - ret = QMessageBox::information(0, "title", "text", QMessageBox::Yes | QMessageBox::Escape, QMessageBox::No | QMessageBox::Default); + ret = QMessageBox::information(nullptr, "title", "text", QMessageBox::Yes | QMessageBox::Escape, QMessageBox::No | QMessageBox::Default); QCOMPARE(ret, int(QMessageBox::No)); QVERIFY(closeHelper.done()); // the button text versions closeHelper.start(Qt::Key_Enter); - ret = QMessageBox::information(0, "title", "text", "Yes", "No", QString(), 1); + ret = QMessageBox::information(nullptr, "title", "text", "Yes", "No", QString(), 1); QCOMPARE(ret, 1); QVERIFY(closeHelper.done()); if (0) { // don't run these tests since the dialog won't close! closeHelper.start(Qt::Key_Escape); - ret = QMessageBox::information(0, "title", "text", "Yes", "No", QString(), 1); + ret = QMessageBox::information(nullptr, "title", "text", "Yes", "No", QString(), 1); QCOMPARE(ret, -1); QVERIFY(closeHelper.done()); closeHelper.start(Qt::Key_Escape); - ret = QMessageBox::information(0, "title", "text", "Yes", "No", QString(), 0, 1); + ret = QMessageBox::information(nullptr, "title", "text", "Yes", "No", QString(), 0, 1); QCOMPARE(ret, 1); QVERIFY(closeHelper.done()); } @@ -618,9 +618,8 @@ void tst_QMessageBox::detailsButtonText() QDialogButtonBox* bb = box.findChild("qt_msgbox_buttonbox"); QVERIFY(bb); //get the detail button - QList list = bb->buttons(); - QAbstractButton* btn = NULL; - foreach(btn, list) { + auto list = bb->buttons(); + for (auto btn : list) { if (btn && (btn->inherits("QPushButton"))) { if (btn->text().remove(QLatin1Char('&')) != QMessageBox::tr("OK") && btn->text() != QMessageBox::tr("Show Details...")) { @@ -640,12 +639,12 @@ void tst_QMessageBox::expandDetails_QTBUG_32473() QDialogButtonBox* bb = box.findChild("qt_msgbox_buttonbox"); QVERIFY(bb); - QList list = bb->buttons(); - QAbstractButton* moreButton = NULL; - foreach (QAbstractButton* btn, list) - if (btn && bb->buttonRole(btn) == QDialogButtonBox::ActionRole) - moreButton = btn; - QVERIFY(moreButton); + auto list = bb->buttons(); + auto it = std::find_if(list.rbegin(), list.rend(), [&](QAbstractButton *btn) { + return btn && bb->buttonRole(btn) == QDialogButtonBox::ActionRole; }); + QVERIFY(it != list.rend()); + auto moreButton = *it; + QVERIFY(QTest::qWaitForWindowExposed(&box)); QRect geom = box.geometry(); box.resized = false; @@ -667,19 +666,19 @@ void tst_QMessageBox::incorrectDefaultButton() closeHelper.start(Qt::Key_Escape); //Do not crash here QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added"); - QMessageBox::question( 0, "", "I've been hit!",QMessageBox::Ok | QMessageBox::Cancel,QMessageBox::Save ); + QMessageBox::question(nullptr, "", "I've been hit!",QMessageBox::Ok | QMessageBox::Cancel,QMessageBox::Save); QVERIFY(closeHelper.done()); closeHelper.start(Qt::Key_Escape); QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added"); - QMessageBox::question( 0, "", "I've been hit!",QFlag(QMessageBox::Ok | QMessageBox::Cancel),QMessageBox::Save ); + QMessageBox::question(nullptr, "", "I've been hit!",QFlag(QMessageBox::Ok | QMessageBox::Cancel),QMessageBox::Save); QVERIFY(closeHelper.done()); closeHelper.start(Qt::Key_Escape); QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added"); QTest::ignoreMessage(QtWarningMsg, "QDialogButtonBox::createButton: Invalid ButtonRole, button not added"); //do not crash here -> call old function of QMessageBox in this case - QMessageBox::question( 0, "", "I've been hit!",QMessageBox::Ok | QMessageBox::Cancel,QMessageBox::Save | QMessageBox::Cancel,QMessageBox::Ok); + QMessageBox::question(nullptr, "", "I've been hit!",QMessageBox::Ok | QMessageBox::Cancel,QMessageBox::Save | QMessageBox::Cancel,QMessageBox::Ok); QVERIFY(closeHelper.done()); } -- 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 +++++-- tests/auto/gui/image/qimage/tst_qimage.cpp | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) 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(); diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp index 5ffd75f931..eded206d37 100644 --- a/tests/auto/gui/image/qimage/tst_qimage.cpp +++ b/tests/auto/gui/image/qimage/tst_qimage.cpp @@ -233,6 +233,7 @@ private slots: #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) void toWinHBITMAP_data(); void toWinHBITMAP(); + void fromMonoHBITMAP(); #endif // Q_OS_WIN && !Q_OS_WINRT private: @@ -3635,6 +3636,19 @@ void tst_QImage::toWinHBITMAP() DeleteDC(bitmapDc); ReleaseDC(0, displayDc); } + +void tst_QImage::fromMonoHBITMAP() // QTBUG-72343, corruption for mono bitmaps +{ + enum : int { width = 32, height = 32, size = width * height / 8 }; // 32x32 mono bitmap + char bitmapData[size]; + memset(bitmapData, 0, size); + const HBITMAP hbitmap = CreateBitmap(width, height, /* planes */ 1, /* bitcount */ 1, bitmapData); + const QImage image = qt_imageFromWinHBITMAP(hbitmap); + QCOMPARE(image.size(), QSize(width, height)); + QCOMPARE(image.scanLine(0)[0], 0u); + DeleteObject(hbitmap); +} + #endif // Q_OS_WIN && !Q_OS_WINRT QTEST_GUILESS_MAIN(tst_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(-) 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 bccb964b9a201a87080d524a0d3c11551f794901 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 19 Oct 2018 19:01:37 +0200 Subject: escape literal backslashes in qmake files Task-number: QTBUG-70765 Change-Id: I56abbf19be88d01b2964980fb741567f28e4f0fa Reviewed-by: Joerg Bornemann --- mkspecs/features/mac/asset_catalogs.prf | 2 +- mkspecs/features/mac/default_post.prf | 2 +- mkspecs/features/moc.prf | 2 +- mkspecs/features/qt_configure.prf | 38 ++++++++++++++++----------------- mkspecs/features/qt_docs.prf | 2 +- mkspecs/features/static_runtime.prf | 4 ++-- 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/mkspecs/features/mac/asset_catalogs.prf b/mkspecs/features/mac/asset_catalogs.prf index 123a0e0fcd..58211c13a2 100644 --- a/mkspecs/features/mac/asset_catalogs.prf +++ b/mkspecs/features/mac/asset_catalogs.prf @@ -110,7 +110,7 @@ # Backwards compatibility for (bundle_data, QMAKE_BUNDLE_DATA) { for (bundle_file, $${bundle_data}.files) { - !contains(bundle_file, .*\.xcassets$): next() + !contains(bundle_file, .*\\.xcassets$): next() warning("*.xcassets in QMAKE_BUNDLE_DATA is deprecated. Use QMAKE_ASSET_CATALOGS instead.") !exists($$absolute_path($$bundle_file/AppIcon.appiconset, $$_PRO_FILE_PWD_)): next() diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf index c01e99fe8e..3881b432ef 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -21,7 +21,7 @@ contains(TEMPLATE, .*app) { !isEmpty($$list($$(QT_MAC_SDK_NO_VERSION_CHECK))): \ CONFIG += sdk_no_version_check - QMAKE_MAC_SDK_MAJOR_MINOR_VERSION = $$replace(QMAKE_MAC_SDK_VERSION, "(\d+)(\.\d+)(\.\d+)?", \1\2) + QMAKE_MAC_SDK_MAJOR_MINOR_VERSION = $$replace(QMAKE_MAC_SDK_VERSION, "(\\d+)(\\.\\d+)(\\.\\d+)?", \\1\\2) !sdk_no_version_check:!versionAtMost(QMAKE_MAC_SDK_MAJOR_MINOR_VERSION, $$QT_MAC_SDK_VERSION_MAX) { warning("Qt has only been tested with version $$QT_MAC_SDK_VERSION_MAX"\ diff --git a/mkspecs/features/moc.prf b/mkspecs/features/moc.prf index 5c7745e5bb..d075183028 100644 --- a/mkspecs/features/moc.prf +++ b/mkspecs/features/moc.prf @@ -38,7 +38,7 @@ if(gcc|intel_icl|msvc):!rim_qcc:!uikit:!no_moc_predefs:if(!macos|count(QMAKE_APP } else: error("Oops, I messed up") moc_predefs.output = $$MOC_DIR/moc_predefs.h moc_predefs.input = MOC_PREDEF_FILE - silent: moc_predefs.commands = @echo generating $$moc_predefs.output$$escape_expand(\n\t)@$$moc_predefs.commands + silent: moc_predefs.commands = @echo generating $$moc_predefs.output$$escape_expand(\\n\\t)@$$moc_predefs.commands QMAKE_EXTRA_COMPILERS += moc_predefs MOC_PREDEF_FILE = $$[QT_HOST_DATA/src]/mkspecs/features/data/dummy.cpp } diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index d8f5af5404..d071e51769 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1196,9 +1196,9 @@ defineTest(qtConfTest_files) { for(i, $${1}.files._KEYS_) { f = $$eval($${1}.files.$${i}) qtLog("Searching for file $${f}.") - contains(f, ".*\.h") { + contains(f, ".*\\.h") { file = $$qtConfFindInPathList($$f, $$EXTRA_INCLUDEPATH $$QMAKE_DEFAULT_INCDIRS) - } else: contains(f, ".*\.(lib|so|a)") { + } else: contains(f, ".*\\.(lib|so|a)") { file = $$qtConfFindInPathList($$f, $$EXTRA_LIBDIR $$QMAKE_DEFAULT_LIBDIRS) } else { # assume we're looking for an executable @@ -1399,7 +1399,7 @@ defineReplace(qtConfEvaluate) { 1 ~= s/$$escape_expand(\\n) */ /g expr = $${1} expr ~= s/&&/ && /g - expr ~= s/\|\|/ || /g + expr ~= s/\\|\\|/ || /g expr ~= s/!/ ! /g expr ~= s/\\(/ ( /g expr ~= s/\\)/ ) /g @@ -1422,7 +1422,7 @@ defineReplace(qtConfEvaluateSingleExpression) { } else: contains(e, "^'.*'$") { # quoted literals result = $$replace(e, "^'(.*)'$", "\\1") - } else: contains(e, "^tests\..*") { + } else: contains(e, "^tests\\..*") { !qt_conf_tests_allowed: \ error("Expression '$${1}' refers to a test, which is not allowed at this stage of configuring.") test = $$section(e, ".", 1, 1) @@ -1433,7 +1433,7 @@ defineReplace(qtConfEvaluateSingleExpression) { error("Unknown test object $${test} in expression '$${1}'.") qtRunSingleTest($$test) result = $$eval($${currentConfig}.tests.$${test}.$${var}) - } else: contains(e, "^libs\..*") { + } else: contains(e, "^libs\\..*") { !qt_conf_tests_allowed: \ error("Expression '$${1}' refers to a library, which is not allowed at this stage of configuring.") lib = $$section(e, ".", 1, 1) @@ -1446,7 +1446,7 @@ defineReplace(qtConfEvaluateSingleExpression) { !defined($${currentConfig}.libraries.$${lib}.$${var}, var): \ var = sources.$$eval($${currentConfig}.libraries.$${lib}.source).$$var result = $$eval($${currentConfig}.libraries.$${lib}.$${var}) - } else: contains(e, "^features\..*") { + } else: contains(e, "^features\\..*") { feature = $$section(e, ".", 1, 1) var = $$section(e, ".", 2, -1) isEmpty(var): \ @@ -1470,33 +1470,33 @@ defineReplace(qtConfEvaluateSingleExpression) { !qtConfCheckFeature($$feature): \ error("Expression '$$1' is accessing non-emitted feature $${feature}.") result = $$eval($${currentConfig}.features.$${feature}.$${var}) - } else: contains(e, "^config\..*") { - var = $$replace(e, "^config\.", "") + } else: contains(e, "^config\\..*") { + var = $$replace(e, "^config\\.", "") result = false contains(CONFIG, $$var): result = true - } else: contains(e, "^module\..*") { - var = $$replace(e, "^module\.", "") + } else: contains(e, "^module\\..*") { + var = $$replace(e, "^module\\.", "") result = false qtConfHaveModule($$var): result = true - } else: contains(e, "^arch\..*") { - var = $$replace(e, "^arch\.", "") + } else: contains(e, "^arch\\..*") { + var = $$replace(e, "^arch\\.", "") result = false isEmpty(QT_ARCH): \ qtConfCheckFeature(architecture) contains(QT_ARCH, $$var): result = true - } else: contains(e, "^subarch\..*") { - var = $$replace(e, "^subarch\.", "") + } else: contains(e, "^subarch\\..*") { + var = $$replace(e, "^subarch\\.", "") result = false isEmpty(QT_ARCH): \ qtConfCheckFeature(architecture) contains(QT_CPU_FEATURES.$$QT_ARCH, $$var): result = true - } else: contains(e, "^input\..*") { + } else: contains(e, "^input\\..*") { result = $$eval(config.$$e) - } else: contains(e, "^var\..*") { - var = $$replace(e, "^var\.", "") + } else: contains(e, "^var\\..*") { + var = $$replace(e, "^var\\.", "") result = $$eval($$var) - } else: contains(e, "^call\..*") { - call = $$replace(e, "^call\.", "qtConfFunc_") + } else: contains(e, "^call\\..*") { + call = $$replace(e, "^call\\.", "qtConfFunc_") !defined($$call, replace): \ error("Call $$call referenced in expression '$${1}' does not exist") eval(result = \$\$"$$call"()) diff --git a/mkspecs/features/qt_docs.prf b/mkspecs/features/qt_docs.prf index 3139c443c6..3b74cd4dd5 100644 --- a/mkspecs/features/qt_docs.prf +++ b/mkspecs/features/qt_docs.prf @@ -18,7 +18,7 @@ isEmpty(qtver.value): error("No version for documentation specified.") qtmver.name = QT_VER qtmver.value = $$replace(qtver.value, ^(\\d+\\.\\d+).*$, \\1) qtvertag.name = QT_VERSION_TAG -qtvertag.value = $$replace(qtver.value, \.,) +qtvertag.value = $$replace(qtver.value, \\.,) qtdocs.name = QT_INSTALL_DOCS qtdocs.value = $$[QT_INSTALL_DOCS/src] builddir.name = BUILDDIR diff --git a/mkspecs/features/static_runtime.prf b/mkspecs/features/static_runtime.prf index 1af3236189..e20bfc4281 100644 --- a/mkspecs/features/static_runtime.prf +++ b/mkspecs/features/static_runtime.prf @@ -1,7 +1,7 @@ msvc { # -MD becomes -MT, -MDd becomes -MTd - QMAKE_CFLAGS ~= s,^-MD(d?)$,-MT\1,g - QMAKE_CXXFLAGS ~= s,^-MD(d?)$,-MT\1,g + QMAKE_CFLAGS ~= s,^-MD(d?)$,-MT\\1,g + QMAKE_CXXFLAGS ~= s,^-MD(d?)$,-MT\\1,g } else: mingw { QMAKE_LFLAGS += -static } -- cgit v1.2.3 From 4e54ac7c8951c87846dccd12b0801eb31fa9dd84 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Wed, 5 Dec 2018 13:32:19 +0100 Subject: Doc: correct syntax error in qmake manual Change-Id: I600f8c9ea8e55dad19345bd4d726cf8d5438e9ce Reviewed-by: Oswald Buddenhagen Reviewed-by: Paul Wicking --- qmake/doc/src/qmake-manual.qdoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc index 1a779a94b4..97744e7460 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -3406,7 +3406,7 @@ \snippet code/doc_src_qmake-manual.pro 72 Like \l {qmake-cat}{$$cat()}, the \a mode argument takes \c blob, \c lines, - \c true, and \false as value. However, the legacy word splitting rules + \c true, and \c false as value. However, the legacy word splitting rules (i.e. empty or \c true, and \c false) differ subtly. If you pass \c stsvar, the command's exit status will be stored in that -- cgit v1.2.3 From 69f6d3bd44e4e2d36ef741a1914227f804504141 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 27 Nov 2018 13:53:44 +0100 Subject: configure: fix $$qtConfFindInPath() on windows uses of this function (or the "files" stanza in configure.json) which don't explicitly target windows don't specify the .exe extension, so we need to add it automatically if it's missing. Task-number: QTBUG-57436 Change-Id: I1994378399bc3466c32ee065e752516f42652975 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_configure.prf | 1 + 1 file changed, 1 insertion(+) diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index d071e51769..e2e341770e 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -378,6 +378,7 @@ defineReplace(qtConfFindInPathList) { defineReplace(qtConfFindInPath) { ensurePathEnv() + equals(QMAKE_HOST.os, Windows):!contains(1, .*\\.exe): 1 = $${1}.exe return($$qtConfFindInPathList($$1, $$2 $$QMAKE_PATH_ENV)) } -- cgit v1.2.3 From 35602d75d37af5ffee41d78f8876506ce2c188bf Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Fri, 30 Nov 2018 15:41:43 +0100 Subject: Refactor tst_QAbstractSlider::keyPressed() Don't do several tests at once in the test function. Instead, move the extra tests to the data function. This makes it possible to easily add a self-contained test (i.e row) for an upcoming fix. Task-number: QTBUG-25988 Change-Id: I65c8d7620f01107f8f59c96896b1a641d97f5fdc Reviewed-by: Richard Moe Gustavsen --- .../qabstractslider/tst_qabstractslider.cpp | 645 +++++++++++++++------ 1 file changed, 482 insertions(+), 163 deletions(-) diff --git a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp index 70ae453896..089469f8dc 100644 --- a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp +++ b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp @@ -467,160 +467,517 @@ void tst_QAbstractSlider::keyPressed_data() QTest::addColumn("maximum"); QTest::addColumn("stepSize"); QTest::addColumn("pageSize"); + QTest::addColumn("invertedAppearance"); + QTest::addColumn("invertedControls"); QTest::addColumn >("keySequence"); - QTest::addColumn("expectedSliderPositionHorizontal"); - QTest::addColumn("expectedSliderPositionVertical"); - QTest::addColumn("expectedSliderPositionHorizontalInverted"); // :) - QTest::addColumn("expectedSliderPositionVerticalInverted"); - + QTest::addColumn("expectedSliderPosition"); QList list; - list << Qt::Key_Down; - QTest::newRow("Step down once 1") << 10 // initial position - << 0 // minimum - << 100 // maximum - << 3 // single step size - << 0 // page step size - << list // key sequence - << 7 // result in case of horizontal slider - << 7 // result in case of vertical slider - << 13 // result in case of inverted horiz. slider - << 13; // result in case of inverted vertical slider + QTest::newRow("Step down once 1, horizontal") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 7; // expected position + + QTest::newRow("Step down once 1, horizontal, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 13; // expected position + + QTest::newRow("Step down once 1, vertical") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 7; // expected position + + QTest::newRow("Step down once 1, vertical, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 13; // expected position list = QList(); list << Qt::Key_Up; - QTest::newRow("Step down once 2") << 10 // initial position - << 0 // minimum - << 100 // maximum - << 3 // single step size - << 0 // page step size - << list // key sequence - << 13 // result in case of horizontal slider - << 13 // result in case of vertical slider - << 7 // result in case of inverted horiz. slider - << 7; // result in case of inverted vertical slider - + QTest::newRow("Step up once 2, horizontal") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 13; // expected position + + QTest::newRow("Step up once 2, horizontal, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 7; // expected position + + QTest::newRow("Step up once 2, vertical") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 13; // expected position + + QTest::newRow("Step up once 2, vertical, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 7; // expected position list = QList(); list << Qt::Key_Left; - QTest::newRow("Step left once") << 10 // initial position - << 0 // minimum - << 100 // maximum - << 3 // single step size - << 0 // page step size - << list // key sequence - << 7 // result in case of horizontal slider - << 7 // result in case of vertical slider - << 13 // result in case of inverted horiz. slider - << 13; // result in case of inverted vertical slider + QTest::newRow("Step left once 2, horizontal") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 7; // expected position + + QTest::newRow("Step left once 2, horizontal, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 13; // expected position + + QTest::newRow("Step left once 2, vertical") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 7; // expected position + + QTest::newRow("Step left once 2, vertical, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 13; // expected position list = QList(); list << Qt::Key_Right; - QTest::newRow("Step right once") << 10 // initial position - << 0 // minimum - << 100 // maximum - << 3 // single step size - << 0 // page step size - << list // key sequence - << 13 // result in case of horizontal slider - << 13 // result in case of vertical slider - << 7 // result in case of inverted horiz. slider - << 7; // result in case of inverted vertical slider + QTest::newRow("Step right once 2, horizontal") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 13; // expected position + + QTest::newRow("Step right once 2, horizontal, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 7; // expected position + + QTest::newRow("Step right once 2, vertical") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 13; // expected position + + QTest::newRow("Step right once 2, vertical, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 7; // expected position list = QList(); list << Qt::Key_PageDown; - QTest::newRow("Page down once") << 10 // initial position - << 0 // minimum - << 100 // maximum - << 0 // single step size - << 3 // page step size - << list // key sequence - << 7 // result in case of horizontal slider - << 7 // result in case of vertical slider - << 13 // result in case of inverted horiz. slider - << 13; // result in case of inverted vertical slider + QTest::newRow("Page down once, horizontal") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 7; // expected position + + QTest::newRow("Page down once, horizontal, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 13; // expected position + + QTest::newRow("Page down once, vertical") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 7; // expected position + + QTest::newRow("Page down once, vertical, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 13; // expected position list = QList(); list << Qt::Key_PageUp; - QTest::newRow("Page up once") << 10 // initial position - << 0 // minimum - << 100 // maximum - << 0 // single step size - << 3 // page step size - << list // key sequence - << 13 // result in case of horizontal slider - << 13 // result in case of vertical slider - << 7 // result in case of inverted horiz. slider - << 7; // result in case of inverted vertical slider + QTest::newRow("Page up once, horizontal") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 13; // expected position + + QTest::newRow("Page up once, horizontal, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 7; // expected position + + QTest::newRow("Page up once, vertical") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 13; // expected position + + QTest::newRow("Page up once, vertical, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 7; // expected position list = QList(); list << Qt::Key_Up << Qt::Key_Up << Qt::Key_PageDown << Qt::Key_PageDown << Qt::Key_Left << Qt::Key_Left << Qt::Key_Right << Qt::Key_Down << Qt::Key_PageUp << Qt::Key_PageUp << Qt::Key_Down << Qt::Key_Right; - QTest::newRow("Symmetric seq") << 50 // initial position - << 0 // minimum - << 100 // maximum - << 3 // single step size - << 3 // page step size - << list // key sequence - << 50 // result in case of horizontal slider - << 50 // result in case of vertical slider - << 50 // result in case of inverted horiz. slider - << 50; // result in case of inverted vertical slider - + QTest::newRow("Symmetric seq, horizontal") + << 50 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 50; // expected position + + QTest::newRow("Symmetric seq, horizontal, both inverted") + << 50 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 50; // expected position + + QTest::newRow("Symmetric seq, vertical") + << 50 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 50; // expected position + + QTest::newRow("Symmetric seq, vertical, both inverted") + << 50 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 50; // expected position list = QList(); list << Qt::Key_Home; - QTest::newRow("Home") << 10 // initial position - << 0 // minimum - << 100 // maximum - << 0 // single step size - << 3 // page step size - << list // key sequence - << 0 // result in case of horizontal slider - << 0 // result in case of vertical slider - << 0 // result in case of inverted horiz. slider - << 0; // result in case of inverted vertical slider + QTest::newRow("Home, horizontal") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 0; // expected position + + QTest::newRow("Home, horizontal, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 0; // expected position + + QTest::newRow("Home, vertical") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 0; // expected position + + QTest::newRow("Home, vertical, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 0; // expected position list = QList(); list << Qt::Key_End; - QTest::newRow("End") << 10 // initial position - << 0 // minimum - << 100 // maximum - << 0 // single step size - << 3 // page step size - << list // key sequence - << 100 // result in case of horizontal slider - << 100 // result in case of vertical slider - << 100 // result in case of inverted horiz. slider - << 100; // result in case of inverted vertical slider + QTest::newRow("End, horizontal") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 100; // expected position + + QTest::newRow("End, horizontal, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 100; // expected position + + QTest::newRow("End, vertical") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 100; // expected position + + QTest::newRow("End, vertical, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 100; // expected position list = QList(); list << Qt::Key_End << Qt::Key_Up; - QTest::newRow("Past end")<< 10 // initial position - << 0 // minimum - << 100 // maximum - << 3 // single step size - << 3 // page step size - << list // key sequence - << 100 // result in case of horizontal slider - << 100 // result in case of vertical slider - << 97 // result in case of inverted horiz. slider - << 97; // result in case of inverted vertical slider + QTest::newRow("Past end, horizontal") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 100; // expected position + + QTest::newRow("Past end, horizontal, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 97; // expected position + + QTest::newRow("Past end, vertical") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 100; // expected position + + QTest::newRow("Past end, vertical, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 97; // expected position list = QList(); list << Qt::Key_Home << Qt::Key_Down; - QTest::newRow("Past home")<< 10 // initial position - << 0 // minimum - << 100 // maximum - << 3 // single step size - << 3 // page step size - << list // key sequence - << 0 // result in case of horizontal slider - << 0 // result in case of vertical slider - << 3 // result in case of inverted horiz. slider - << 3; // result in case of inverted vertical slider - + QTest::newRow("Past home, horizontal") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 0; // expected position + + QTest::newRow("Past home, horizontal, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 3; // expected position + + QTest::newRow("Past home, vertical") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 0; // expected position + + QTest::newRow("Past home, vertical, both inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << true // inverted appearance + << true // inverted controls + << list // key sequence + << 3; // expected position } void tst_QAbstractSlider::keyPressed() @@ -630,60 +987,22 @@ void tst_QAbstractSlider::keyPressed() QFETCH(int, maximum); QFETCH(int, stepSize); QFETCH(int, pageSize); + QFETCH(bool, invertedAppearance); + QFETCH(bool, invertedControls); QFETCH(QList, keySequence); - QFETCH(int, expectedSliderPositionHorizontal); - QFETCH(int, expectedSliderPositionVertical); - QFETCH(int, expectedSliderPositionHorizontalInverted); - QFETCH(int, expectedSliderPositionVerticalInverted); + QFETCH(int, expectedSliderPosition); - // Horizontal non-inverted slider->setRange(minimum,maximum); slider->setSliderPosition(initialSliderPosition); slider->setSingleStep(stepSize); slider->setPageStep(pageSize); slider->setOrientation(Qt::Horizontal); - slider->setInvertedAppearance(false); - slider->setInvertedControls(false); + slider->setInvertedAppearance(invertedAppearance); + slider->setInvertedControls(invertedControls); for (int i=0;isliderPosition(), expectedSliderPositionHorizontal); - - // Horizontal inverted - slider->setRange(minimum,maximum); - slider->setSliderPosition(initialSliderPosition); - slider->setSingleStep(stepSize); - slider->setPageStep(pageSize); - slider->setOrientation(Qt::Horizontal); - slider->setInvertedAppearance(true); - slider->setInvertedControls(true); - for (int i=0;isliderPosition(), expectedSliderPositionHorizontalInverted); - - // Vertical non-inverted - slider->setRange(minimum,maximum); - slider->setSliderPosition(initialSliderPosition); - slider->setSingleStep(stepSize); - slider->setPageStep(pageSize); - slider->setOrientation(Qt::Vertical); - slider->setInvertedAppearance(false); - slider->setInvertedControls(false); - for (int i=0;isliderPosition(), expectedSliderPositionVertical); - - // Vertical inverted - slider->setRange(minimum,maximum); - slider->setSliderPosition(initialSliderPosition); - slider->setSingleStep(stepSize); - slider->setPageStep(pageSize); - slider->setOrientation(Qt::Vertical); - slider->setInvertedAppearance(true); - slider->setInvertedControls(true); - for (int i=0;isliderPosition(), expectedSliderPositionVerticalInverted); + QCOMPARE(slider->sliderPosition(), expectedSliderPosition); } #if QT_CONFIG(wheelevent) -- 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 +- .../qabstractslider/tst_qabstractslider.cpp | 490 ++++++++++++++++++++- 2 files changed, 491 insertions(+), 8 deletions(-) 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 diff --git a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp index 089469f8dc..1a0d7a9289 100644 --- a/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp +++ b/tests/auto/widgets/widgets/qabstractslider/tst_qabstractslider.cpp @@ -485,6 +485,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 7; // expected position + QTest::newRow("Step down once 1, horizontal, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 7; // expected position + + QTest::newRow("Step down once 1, horizontal, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 13; // expected position + QTest::newRow("Step down once 1, horizontal, both inverted") << 10 // initial position << 0 // minimum @@ -507,6 +529,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 7; // expected position + QTest::newRow("Step down once 1, vertical, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 7; // expected position + + QTest::newRow("Step down once 1, vertical, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 13; // expected position + QTest::newRow("Step down once 1, vertical, both inverted") << 10 // initial position << 0 // minimum @@ -531,6 +575,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 13; // expected position + QTest::newRow("Step up once 2, horizontal, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 13; // expected position + + QTest::newRow("Step up once 2, horizontal, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 7; // expected position + QTest::newRow("Step up once 2, horizontal, both inverted") << 10 // initial position << 0 // minimum @@ -553,6 +619,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 13; // expected position + QTest::newRow("Step up once 2, vertical, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 13; // expected position + + QTest::newRow("Step up once 2, vertical, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 7; // expected position + QTest::newRow("Step up once 2, vertical, both inverted") << 10 // initial position << 0 // minimum @@ -577,6 +665,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 7; // expected position + QTest::newRow("Step left once 2, horizontal, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 7; // expected position + + QTest::newRow("Step left once 2, horizontal, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 13; // expected position + QTest::newRow("Step left once 2, horizontal, both inverted") << 10 // initial position << 0 // minimum @@ -599,6 +709,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 7; // expected position + QTest::newRow("Step left once 2, vertical, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 7; // expected position + + QTest::newRow("Step left once 2, vertical, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 13; // expected position + QTest::newRow("Step left once 2, vertical, both inverted") << 10 // initial position << 0 // minimum @@ -623,6 +755,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 13; // expected position + QTest::newRow("Step right once 2, horizontal, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 13; // expected position + + QTest::newRow("Step right once 2, horizontal, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 7; // expected position + QTest::newRow("Step right once 2, horizontal, both inverted") << 10 // initial position << 0 // minimum @@ -645,6 +799,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 13; // expected position + QTest::newRow("Step right once 2, vertical, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 13; // expected position + + QTest::newRow("Step right once 2, vertical, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 0 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 7; // expected position + QTest::newRow("Step right once 2, vertical, both inverted") << 10 // initial position << 0 // minimum @@ -654,7 +830,7 @@ void tst_QAbstractSlider::keyPressed_data() << true // inverted appearance << true // inverted controls << list // key sequence - << 7; // expected position + << 7; // expected position list = QList(); list << Qt::Key_PageDown; @@ -667,7 +843,29 @@ void tst_QAbstractSlider::keyPressed_data() << false// inverted appearance << false// inverted controls << list // key sequence - << 7; // expected position + << 7; // expected position + + QTest::newRow("Page down once, horizontal, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 7; // expected position + + QTest::newRow("Page down once, horizontal, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 13; // expected position QTest::newRow("Page down once, horizontal, both inverted") << 10 // initial position @@ -689,7 +887,29 @@ void tst_QAbstractSlider::keyPressed_data() << false// inverted appearance << false// inverted controls << list // key sequence - << 7; // expected position + << 7; // expected position + + QTest::newRow("Page down once, vertical, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 7; // expected position + + QTest::newRow("Page down once, vertical, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 13; // expected position QTest::newRow("Page down once, vertical, both inverted") << 10 // initial position @@ -715,6 +935,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 13; // expected position + QTest::newRow("Page up once, horizontal, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 13; // expected position + + QTest::newRow("Page up once, horizontal, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 7; // expected position + QTest::newRow("Page up once, horizontal, both inverted") << 10 // initial position << 0 // minimum @@ -737,6 +979,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 13; // expected position + QTest::newRow("Page up once, vertical, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 13; // expected position + + QTest::newRow("Page up once, vertical, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 7; // expected position + QTest::newRow("Page up once, vertical, both inverted") << 10 // initial position << 0 // minimum @@ -762,6 +1026,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 50; // expected position + QTest::newRow("Symmetric seq, horizontal, appearance inverted") + << 50 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 50; // expected position + + QTest::newRow("Symmetric seq, horizontal, controls inverted") + << 50 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 50; // expected position + QTest::newRow("Symmetric seq, horizontal, both inverted") << 50 // initial position << 0 // minimum @@ -784,6 +1070,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 50; // expected position + QTest::newRow("Symmetric seq, vertical, appearance inverted") + << 50 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 50; // expected position + + QTest::newRow("Symmetric seq, vertical, controls inverted") + << 50 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 50; // expected position + QTest::newRow("Symmetric seq, vertical, both inverted") << 50 // initial position << 0 // minimum @@ -808,6 +1116,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 0; // expected position + QTest::newRow("Home, horizontal, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 0; // expected position + + QTest::newRow("Home, horizontal, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 0; // expected position + QTest::newRow("Home, horizontal, both inverted") << 10 // initial position << 0 // minimum @@ -830,6 +1160,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 0; // expected position + QTest::newRow("Home, vertical, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 0; // expected position + + QTest::newRow("Home, vertical, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 0; // expected position + QTest::newRow("Home, vertical, both inverted") << 10 // initial position << 0 // minimum @@ -854,6 +1206,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 100; // expected position + QTest::newRow("End, horizontal, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 100; // expected position + + QTest::newRow("End, horizontal, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 100; // expected position + QTest::newRow("End, horizontal, both inverted") << 10 // initial position << 0 // minimum @@ -876,6 +1250,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 100; // expected position + QTest::newRow("End, vertical, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 100; // expected position + + QTest::newRow("End, vertical, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 0 // single step size + << 3 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 100; // expected position + QTest::newRow("End, vertical, both inverted") << 10 // initial position << 0 // minimum @@ -900,6 +1296,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 100; // expected position + QTest::newRow("Past end, horizontal, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 100; // expected position + + QTest::newRow("Past end, horizontal, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 97; // expected position + QTest::newRow("Past end, horizontal, both inverted") << 10 // initial position << 0 // minimum @@ -922,6 +1340,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 100; // expected position + QTest::newRow("Past end, vertical, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 100; // expected position + + QTest::newRow("Past end, vertical, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 97; // expected position + QTest::newRow("Past end, vertical, both inverted") << 10 // initial position << 0 // minimum @@ -946,6 +1386,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 0; // expected position + QTest::newRow("Past home, horizontal, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << true // inverted appearance + << false// inverted controls + << list // key sequence + << 0; // expected position + + QTest::newRow("Past home, horizontal, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 3; // expected position + QTest::newRow("Past home, horizontal, both inverted") << 10 // initial position << 0 // minimum @@ -968,6 +1430,28 @@ void tst_QAbstractSlider::keyPressed_data() << list // key sequence << 0; // expected position + QTest::newRow("Past home, vertical, appearance inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << false// inverted appearance + << false// inverted controls + << list // key sequence + << 0; // expected position + + QTest::newRow("Past home, vertical, controls inverted") + << 10 // initial position + << 0 // minimum + << 100 // maximum + << 3 // single step size + << 3 // page step size + << false// inverted appearance + << true // inverted controls + << list // key sequence + << 3; // expected position + QTest::newRow("Past home, vertical, both inverted") << 10 // initial position << 0 // minimum -- cgit v1.2.3 From 9d76beee5be0812fdc8bd53c3145de95b45ab6a6 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 14 Dec 2018 14:18:39 +0100 Subject: qmake: don't mess up linking order of libraries ... which are specified by full filepath, by making the de-duplication consistent with that applied to libs specified with -l, that is, last one wins. the problem existed "forever", but it became more visible after the recent configure changes. fwiw, Win32MakefileGenerator is not affected, because it has the opposite problem: it de-duplicates everything (including object files) in "last one wins mode". it might make sense to change that as well. Change-Id: Id7ef1d394fcc9d444450672c06a6f11af2b19eab Reviewed-by: Robert Griebl --- qmake/generators/unix/unixmake.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/qmake/generators/unix/unixmake.cpp b/qmake/generators/unix/unixmake.cpp index 50ec8db79e..4cbe06d9dc 100644 --- a/qmake/generators/unix/unixmake.cpp +++ b/qmake/generators/unix/unixmake.cpp @@ -399,6 +399,8 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) libdirs.append(QMakeLocalFileName(dlib.toQString())); frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks")); frameworkdirs.append(QMakeLocalFileName("/Library/Frameworks")); + ProStringList extens; + extens << project->first("QMAKE_EXTENSION_SHLIB") << "a"; static const char * const lflags[] = { "LIBS", "LIBS_PRIVATE", "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", nullptr }; for (int i = 0; lflags[i]; i++) { @@ -417,8 +419,6 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) libdirs.insert(libidx++, f); } else if(opt.startsWith("-l")) { QString lib = opt.mid(2); - ProStringList extens; - extens << project->first("QMAKE_EXTENSION_SHLIB") << "a"; for (QList::Iterator dep_it = libdirs.begin(); dep_it != libdirs.end(); ++dep_it) { QString libBase = (*dep_it).local() + '/' @@ -521,8 +521,18 @@ UnixMakefileGenerator::findLibraries(bool linkPrl, bool mergeLflags) lflags[arch].append(opt); } } else if(!opt.isNull()) { + for (const ProString &ext : extens) { + if (opt.size() > ext.size() && opt.endsWith(ext) + && opt.at(opt.size() - ext.size() - 1) == '.') { + // Make sure we keep the dependency order of libraries + lflags[arch].removeAll(opt); + lflags[arch].append(opt); + goto found2; + } + } if(!lflags[arch].contains(opt)) lflags[arch].append(opt); + found2: ; } } -- cgit v1.2.3 From 74cdd89e0fd437ef4c4041f04c9aa522f2371615 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 13 Dec 2018 16:20:40 +0100 Subject: qmake: don't assign fallbacks for QMAKE_DEFAULT_{INC,LIB}DIRS in x-builds these cannot be possibly correct, and might mislead. Change-Id: Ie10531807978def04768e2429304949415cafb2a Reviewed-by: Joerg Bornemann --- mkspecs/features/toolchain.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf index 55295f271f..e8c3f81c8b 100644 --- a/mkspecs/features/toolchain.prf +++ b/mkspecs/features/toolchain.prf @@ -178,7 +178,7 @@ isEmpty($${target_prefix}.INCDIRS) { QMAKE_DEFAULT_INCDIRS = $$split(INCLUDE, $$QMAKE_DIRLIST_SEP) } - unix { + unix:if(!cross_compile|host_build) { isEmpty(QMAKE_DEFAULT_INCDIRS): QMAKE_DEFAULT_INCDIRS = /usr/include /usr/local/include isEmpty(QMAKE_DEFAULT_LIBDIRS): QMAKE_DEFAULT_LIBDIRS = /lib /usr/lib } -- cgit v1.2.3 From 852b1afa5658d410a270a09ee7b94572df52ccbe Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 13 Dec 2018 17:53:38 +0100 Subject: qmake: don't misuse cache() ... when QMAKE_DEFAULT_{INC,LIB}DIRS cannot be determined. it would have been nicer to actually persist empty results, but cache() won't do that, and fixing it doesn't seem worth the effort now. Change-Id: I95d5645e40a0da572f0def16462703373eaeb804 Reviewed-by: Joerg Bornemann --- mkspecs/features/toolchain.prf | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf index e8c3f81c8b..63f2f12e21 100644 --- a/mkspecs/features/toolchain.prf +++ b/mkspecs/features/toolchain.prf @@ -183,8 +183,11 @@ isEmpty($${target_prefix}.INCDIRS) { isEmpty(QMAKE_DEFAULT_LIBDIRS): QMAKE_DEFAULT_LIBDIRS = /lib /usr/lib } - cache($${target_prefix}.INCDIRS, set stash, QMAKE_DEFAULT_INCDIRS) - cache($${target_prefix}.LIBDIRS, set stash, QMAKE_DEFAULT_LIBDIRS) + # cache() complains about undefined variables and doesn't persist empty ones. + !isEmpty(QMAKE_DEFAULT_INCDIRS): \ + cache($${target_prefix}.INCDIRS, set stash, QMAKE_DEFAULT_INCDIRS) + !isEmpty(QMAKE_DEFAULT_LIBDIRS): \ + cache($${target_prefix}.LIBDIRS, set stash, QMAKE_DEFAULT_LIBDIRS) } else { QMAKE_DEFAULT_INCDIRS = $$eval($${target_prefix}.INCDIRS) QMAKE_DEFAULT_LIBDIRS = $$eval($${target_prefix}.LIBDIRS) -- cgit v1.2.3 From a8cb177d31d45a8cfee16b2c82131d1474d1d2e5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 11 Dec 2018 15:02:16 +0100 Subject: Fix build with win32-clang-msvc and win32-icc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fbbe8aba9d70a3c13d1cd7797eb4dbbd1f05ade5 introduced a check for MSVC_VER to qmake, which is not set in win32-clang-msvc, causing the build to fail: Mkspec does not specify MSVC_VER. Cannot continue. Unable to generate output for: .../config.tests/verifyspec/Makefile Extract a minimal msvc-based-version.conf which determines MSVC_VER from QMAKE_MSC_VER for win32-clang-msvc and win32-icc. Task-number: QTBUG-63512 Change-Id: Ia6de8c4b1aae2ae1962cf4e60e3e6d51fdbbbabe Reviewed-by: Mårten Nordheim Reviewed-by: Thiago Macieira Reviewed-by: Oswald Buddenhagen --- mkspecs/common/msvc-based-version.conf | 32 ++++++++++++++++++++++++++++++++ mkspecs/common/msvc-version.conf | 10 +++------- mkspecs/features/toolchain.prf | 6 +++++- 3 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 mkspecs/common/msvc-based-version.conf diff --git a/mkspecs/common/msvc-based-version.conf b/mkspecs/common/msvc-based-version.conf new file mode 100644 index 0000000000..38aecbaf59 --- /dev/null +++ b/mkspecs/common/msvc-based-version.conf @@ -0,0 +1,32 @@ +# +# qmake configuration for Compilers based on the Microsoft Visual Studio +# C/C++ Compilers like win32-clang-msvc + +# +# Version-specific changes +# + +isEmpty(QMAKE_MSC_VER): error("msvc-based-version.conf loaded but QMAKE_MSC_VER isn't set") + +MSVC_VER = 14.0 +COMPAT_MKSPEC = win32-msvc2015 + +# -utf-8 compiler option for Visual Studio 2015 Update 2 +greaterThan(QMAKE_MSC_FULL_VER, 190023918):!intel_icl { + isEmpty(QT_CLANG_MAJOR_VERSION)|!lessThan(QT_CLANG_MAJOR_VERSION, 4) { + QMAKE_CFLAGS_UTF8_SOURCE = -utf-8 + } +} + +greaterThan(QMAKE_MSC_VER, 1909) { + # Visual Studio 2017 (15.0) / Visual C++ 19.10 and up + MSVC_VER = 15.0 + COMPAT_MKSPEC = win32-msvc2017 +} + +greaterThan(QMAKE_MSC_VER, 1910) { + # No compat spec past MSVC 2017 + COMPAT_MKSPEC = +} + +!isEmpty(COMPAT_MKSPEC):!$$COMPAT_MKSPEC: CONFIG += $$COMPAT_MKSPEC diff --git a/mkspecs/common/msvc-version.conf b/mkspecs/common/msvc-version.conf index 3fb55c9d81..de8ba56b7b 100644 --- a/mkspecs/common/msvc-version.conf +++ b/mkspecs/common/msvc-version.conf @@ -1,7 +1,6 @@ # # qmake configuration for Microsoft Visual Studio C/C++ Compiler -# This file is used by win32-msvc, win32-clang-msvc, and all -# winrt-XXX-msvcXXX specs +# This file is used by win32-msvc and all winrt-XXX-msvcXXX specs # # @@ -70,11 +69,8 @@ greaterThan(QMAKE_MSC_VER, 1899) { QMAKE_CXXFLAGS += -Zc:strictStrings -Zc:throwingNew QMAKE_CXXFLAGS_WARN_ON += -w44456 -w44457 -w44458 -wd4577 -wd4467 - greaterThan(QMAKE_MSC_FULL_VER, 190023918):!intel_icl { - isEmpty(QT_CLANG_MAJOR_VERSION)|!lessThan(QT_CLANG_MAJOR_VERSION, 4) { - QMAKE_CFLAGS_UTF8_SOURCE = -utf-8 - } - } + # -utf-8 compiler option for Visual Studio 2015 Update 2 + greaterThan(QMAKE_MSC_FULL_VER, 190023918): QMAKE_CFLAGS_UTF8_SOURCE = -utf-8 } greaterThan(QMAKE_MSC_VER, 1909) { diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf index 63f2f12e21..c7ea20e180 100644 --- a/mkspecs/features/toolchain.prf +++ b/mkspecs/features/toolchain.prf @@ -281,4 +281,8 @@ QMAKE_COMPILER_DEFINES += __cplusplus=$$QT_COMPILER_STDCXX QMAKE_CFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT -msvc:!intel_icl:!clang_cl: include(../common/msvc-version.conf) +clang_cl|intel_icl { + include(../common/msvc-based-version.conf) +} else: msvc { + include(../common/msvc-version.conf) +} -- 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(-) 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(-) 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 e9c08f8287556742fbb927653b4c2d071923e5a7 Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 22 May 2018 21:17:11 -0300 Subject: Mark ICC 18 & 19 as warning-free MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I052407b777ec43f78378fffd15311de83f978817 Reviewed-by: Sérgio Martins --- mkspecs/features/qt_common.prf | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf index e67b79acc3..6cb2e78c1c 100644 --- a/mkspecs/features/qt_common.prf +++ b/mkspecs/features/qt_common.prf @@ -112,16 +112,17 @@ warnings_are_errors:warning_clean { QMAKE_CXXFLAGS_WARN_ON += -Werror -Wno-error=\\$${LITERAL_HASH}warnings -Wno-error=deprecated-declarations $$WERROR } } else:intel_icc:linux { - # Intel CC 13.0 - 17.0, on Linux only + # Intel CC 13.0 - 18.0, on Linux only ver = $${QT_ICC_MAJOR_VERSION}.$${QT_ICC_MINOR_VERSION} - linux:contains(ver, "(1[3456]\\.|17\\.0)") { + linux:contains(ver, "(1[345678]\\.|19\\.0)") { # 177: function "entity" was declared but never referenced # (too aggressive; ICC reports even for functions created due to template instantiation) # 1224: #warning directive # 1478: function "entity" (declared at line N) was declared deprecated + # 1786: function "entity" (declared at line N of "file") was declared deprecated ("message") # 1881: argument must be a constant null pointer value # (NULL in C++ is usually a literal 0) - QMAKE_CXXFLAGS_WARN_ON += -Werror -ww177,1224,1478,1881 $$WERROR + QMAKE_CXXFLAGS_WARN_ON += -Werror -ww177,1224,1478,1786,1881 $$WERROR } } else:gcc:!clang:!intel_icc:!rim_qcc { # GCC 4.6-4.9, 5.x, ... -- 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(-) 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 --- configure.json | 6 +-- mkspecs/features/qt_configure.prf | 58 ++++++++++++++++++++++--- 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 +- 8 files changed, 125 insertions(+), 82 deletions(-) diff --git a/configure.json b/configure.json index 69e058e0c2..2a717daf9a 100644 --- a/configure.json +++ b/configure.json @@ -152,13 +152,13 @@ "zlib": { "label": "zlib", "test": { - "include": "zlib.h", "main": [ "z_streamp stream = 0;", "(void) zlibVersion();", "(void) compress2(0, 0, 0, 0, 1); // compress2 was added in zlib version 1.0.8" ] }, + "headers": "zlib.h", "sources": [ { "libs": "-lzdll", "condition": "config.msvc" }, { "libs": "-lzlib", "condition": "config.msvc" }, @@ -169,9 +169,9 @@ "dbus": { "label": "D-Bus >= 1.2", "test": { - "include": "dbus/dbus.h", "main": "(void) dbus_bus_get_private(DBUS_BUS_SYSTEM, (DBusError *)NULL);" }, + "headers": "dbus/dbus.h", "sources": [ { "type": "pkgConfig", "args": "dbus-1 >= 1.2" }, { @@ -196,9 +196,9 @@ "libudev": { "label": "udev", "test": { - "include": "libudev.h", "main": "udev_unref(udev_new());" }, + "headers": "libudev.h", "sources": [ { "type": "pkgConfig", "args": "libudev" }, "-ludev" diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index e2e341770e..3483ddc5dc 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -582,7 +582,33 @@ defineTest(qtConfResolvePathLibs) { return($$ret) } -# includes-var, includes +defineReplace(qtConfGetTestIncludes) { + defined($${1}._KEYS_, var) { + 1st = $$first($${1}._KEYS_) + equals(1st, 0) { + # array; recurse for every element + ret = + for (k, $${1}._KEYS_): \ + ret += $$qtConfGetTestIncludes($${1}.$$k) + return($$ret) + } + # object; try condition and recurse + !defined($${1}.headers, var):!defined($${1}.headers._KEYS_, var): \ # just plain broken without it + error("headers object '$$1' has no nested headers entry") + cond = $$eval($${1}.condition) + isEmpty(cond): \ # would be pointless otherwise + error("headers object '$$1' has no condition") + !$$qtConfEvaluate($$cond) { + qtLog("header entry '$$1' failed condition '$$cond'.") + return() + } + qtLog("header entry '$$1' passed condition.") + return($$qtConfGetTestIncludes($${1}.headers)) + } + return($$eval($$1)) # plain string - or nothing (can happen for top-level call only) +} + +# includes-var, in-paths, test-object-var defineTest(qtConfResolvePathIncs) { ret = true for (incdir, 2) { @@ -594,6 +620,21 @@ defineTest(qtConfResolvePathIncs) { 2 -= $$QMAKE_DEFAULT_INCDIRS $$1 = $$2 export($$1) + wasm { + # FIXME: emcc downloads pre-built libraries and adds their include + # path to the clang call dynamically. it would be possible to parse + # the emcc -s USE_xyz=1 --cflags output to populate xzy_INCDIR and + # thus make the code below work. + return($$ret) + } + hdrs = $$qtConfGetTestIncludes($${3}.headers) + for (hdr, hdrs) { + h = $$qtConfFindInPathList($$hdr, $$2 $$EXTRA_INCLUDEPATH $$QMAKE_DEFAULT_INCDIRS) + isEmpty(h) { + qtLog("$$hdr not found in [$$val_escape(2)] and global paths.") + ret = false + } + } return($$ret) } @@ -662,7 +703,7 @@ defineTest(qtConfLibrary_inline) { !qtConfResolveAllLibs($$1): \ return(false) - !qtConfResolvePathIncs($${1}.includedir, $$includes): \ + !qtConfResolvePathIncs($${1}.includedir, $$includes, $$2): \ return(false) return(true) @@ -678,7 +719,7 @@ defineTest(qtConfLibrary_makeSpec) { !qtConfResolvePathLibs($${1}.libs, $$eval(QMAKE_LIBDIR_$$spec), $$eval(QMAKE_LIBS_$$spec)): \ return(false) - !qtConfResolvePathIncs($${1}.includedir, $$eval(QMAKE_INCDIR_$$spec)): \ + !qtConfResolvePathIncs($${1}.includedir, $$eval(QMAKE_INCDIR_$$spec), $$2): \ return(false) # note that the object is re-exported, because we resolve the libraries. @@ -741,7 +782,7 @@ defineTest(qtConfLibrary_pkgConfig) { } !isEmpty(ignored): \ qtLog("Note: Dropped compiler flags '$$ignored'.") - !qtConfResolvePathIncs($${1}.includedir, $$includes): \ + !qtConfResolvePathIncs($${1}.includedir, $$includes, $$2): \ return(false) $${1}.defines = $$defines @@ -1054,7 +1095,7 @@ defineTest(qtConfTestPrepare_compile) { } defineTest(qtConfPrepareCompileTestSource) { - test_dir = $$2 + test_dir = $$3 test_lang = $$eval($${1}.lang) isEmpty(test_lang): test_lang = "c++" @@ -1071,7 +1112,10 @@ defineTest(qtConfPrepareCompileTestSource) { for (ent, $$qtConfScalarOrList($${1}.head)): \ contents += $$ent # Includes - for (ent, $$qtConfScalarOrList($${1}.include)): \ + hdrs = $$qtConfGetTestIncludes($${1}.include) + isEmpty(hdrs): \ + hdrs = $$qtConfGetTestIncludes($$2) + for (ent, hdrs): \ contents += "$${LITERAL_HASH}include <$$ent>" # Custom code after includes for (ent, $$qtConfScalarOrList($${1}.tail)): \ @@ -1107,7 +1151,7 @@ defineTest(qtConfTest_compile) { isEmpty(test) { test_dir = $$test_base_out_dir/$$section(1, ".", -1) test_out_dir = $$test_dir - qtConfPrepareCompileTestSource($${1}.test, $$test_dir) + qtConfPrepareCompileTestSource($${1}.test, $${1}.headers, $$test_dir) } else { test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$test test_out_dir = $$test_base_out_dir/$$test 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 +- .../qregularexpression/tst_qregularexpression.cpp | 76 +++++++++++----------- 4 files changed, 41 insertions(+), 43 deletions(-) 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; diff --git a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp index c23ee3b0ba..c02756d76a 100644 --- a/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp +++ b/tests/auto/corelib/tools/qregularexpression/tst_qregularexpression.cpp @@ -2169,47 +2169,47 @@ void tst_QRegularExpression::wildcard_data() addRow("*.html", "test.html", 0); addRow("*.html", "test.htm", -1); - addRow("bar*", "foobarbaz", 3); + addRow("*bar*", "foobarbaz", 0); addRow("*", "Qt Rocks!", 0); - addRow(".html", "test.html", 4); - addRow(".h", "test.cpp", -1); - addRow(".???l", "test.html", 4); - addRow("?", "test.html", 0); - addRow("?m", "test.html", 6); - addRow("[*]", "test.html", -1); - addRow("[?]","test.html", -1); - addRow("[?]","test.h?ml", 6); - addRow("[[]","test.h[ml", 6); - addRow("[]]","test.h]ml", 6); - addRow(".h[a-z]ml", "test.html", 4); - addRow(".h[A-Z]ml", "test.html", -1); - addRow(".h[A-Z]ml", "test.hTml", 4); - addRow(".h[!A-Z]ml", "test.hTml", -1); - addRow(".h[!A-Z]ml", "test.html", 4); - addRow(".h[!T]ml", "test.hTml", -1); - addRow(".h[!T]ml", "test.html", 4); - addRow(".h[!T]m[!L]", "test.htmL", -1); - addRow(".h[!T]m[!L]", "test.html", 4); - addRow(".h[][!]", "test.h]ml", 4); - addRow(".h[][!]", "test.h[ml", 4); - addRow(".h[][!]", "test.h!ml", 4); - - addRow("foo/*/bar", "Qt/foo/baz/bar", 3); - addRow("foo/(*)/bar", "Qt/foo/baz/bar", -1); - addRow("foo/(*)/bar", "Qt/foo/(baz)/bar", 3); - addRow("foo/?/bar", "Qt/foo/Q/bar", 3); - addRow("foo/?/bar", "Qt/foo/Qt/bar", -1); - addRow("foo/(?)/bar", "Qt/foo/Q/bar", -1); - addRow("foo/(?)/bar", "Qt/foo/(Q)/bar", 3); + addRow("*.html", "test.html", 0); + addRow("*.h", "test.cpp", -1); + addRow("*.???l", "test.html", 0); + addRow("*?", "test.html", 0); + addRow("*?ml", "test.html", 0); + addRow("*[*]", "test.html", -1); + addRow("*[?]","test.html", -1); + addRow("*[?]ml","test.h?ml", 0); + addRow("*[[]ml","test.h[ml", 0); + addRow("*[]]ml","test.h]ml", 0); + addRow("*.h[a-z]ml", "test.html", 0); + addRow("*.h[A-Z]ml", "test.html", -1); + addRow("*.h[A-Z]ml", "test.hTml", 0); + addRow("*.h[!A-Z]ml", "test.hTml", -1); + addRow("*.h[!A-Z]ml", "test.html", 0); + addRow("*.h[!T]ml", "test.hTml", -1); + addRow("*.h[!T]ml", "test.html", 0); + addRow("*.h[!T]m[!L]", "test.htmL", -1); + addRow("*.h[!T]m[!L]", "test.html", 0); + addRow("*.h[][!]ml", "test.h]ml", 0); + addRow("*.h[][!]ml", "test.h[ml", 0); + addRow("*.h[][!]ml", "test.h!ml", 0); + + addRow("foo/*/bar", "foo/baz/bar", 0); + addRow("foo/(*)/bar", "foo/baz/bar", -1); + addRow("foo/(*)/bar", "foo/(baz)/bar", 0); + addRow("foo/?/bar", "foo/Q/bar", 0); + addRow("foo/?/bar", "foo/Qt/bar", -1); + addRow("foo/(?)/bar", "foo/Q/bar", -1); + addRow("foo/(?)/bar", "foo/(Q)/bar", 0); #ifdef Q_OS_WIN - addRow("foo\\*\\bar", "Qt\\foo\\baz\\bar", 3); - addRow("foo\\(*)\\bar", "Qt\\foo\\baz\\bar", -1); - addRow("foo\\(*)\\bar", "Qt\\foo\\(baz)\\bar", 3); - addRow("foo\\?\\bar", "Qt\\foo\\Q\\bar", 3); - addRow("foo\\?\\bar", "Qt\\foo\\Qt\\bar", -1); - addRow("foo\\(?)\\bar", "Qt\\foo\\Q\\bar", -1); - addRow("foo\\(?)\\bar", "Qt\\foo\\(Q)\\bar", 3); + addRow("foo\\*\\bar", "foo\\baz\\bar", 0); + addRow("foo\\(*)\\bar", "foo\\baz\\bar", -1); + addRow("foo\\(*)\\bar", "foo\\(baz)\\bar", 0); + addRow("foo\\?\\bar", "foo\\Q\\bar", 0); + addRow("foo\\?\\bar", "foo\\Qt\\bar", -1); + addRow("foo\\(?)\\bar", "foo\\Q\\bar", -1); + addRow("foo\\(?)\\bar", "foo\\(Q)\\bar", 0); #endif } -- 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(-) 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 +- tests/auto/tools/moc/cxx11-enums.h | 9 +++++++++ tests/auto/tools/moc/tst_moc.cpp | 3 +++ 3 files changed, 13 insertions(+), 1 deletion(-) 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)) { diff --git a/tests/auto/tools/moc/cxx11-enums.h b/tests/auto/tools/moc/cxx11-enums.h index 93ab16c157..cc14c0acda 100644 --- a/tests/auto/tools/moc/cxx11-enums.h +++ b/tests/auto/tools/moc/cxx11-enums.h @@ -40,13 +40,22 @@ public: enum class TypedEnumClass : char { C0, C1, C2, C3 }; enum NormalEnum { D2 = 2, D3, D0 =0 , D1 }; enum class ClassFlag { F0 = 1, F1 = 2, F2 = 4, F3 = 8}; + + enum struct EnumStruct { G0, G1, G2, G3 }; + enum struct TypedEnumStruct : char { H0, H1, H2, H3 }; + enum struct StructFlag { I0 = 1, I1 = 2, I2 = 4, I3 = 8}; + Q_DECLARE_FLAGS(ClassFlags, ClassFlag) + Q_DECLARE_FLAGS(StructFlags, StructFlag) Q_ENUM(EnumClass) Q_ENUM(TypedEnum) Q_ENUM(TypedEnumClass) Q_ENUM(NormalEnum) + Q_ENUM(EnumStruct) + Q_ENUM(TypedEnumStruct) Q_FLAG(ClassFlags) + Q_FLAG(StructFlags) }; // Also test the Q_ENUMS macro diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp index 92a94055a4..293cbd8323 100644 --- a/tests/auto/tools/moc/tst_moc.cpp +++ b/tests/auto/tools/moc/tst_moc.cpp @@ -2266,6 +2266,9 @@ void tst_Moc::cxx11Enums_data() QTest::newRow("NormalEnum 2") << meta2 << QByteArray("NormalEnum") << QByteArray("NormalEnum") << 'D' << false; QTest::newRow("ClassFlags") << meta1 << QByteArray("ClassFlags") << QByteArray("ClassFlag") << 'F' << true; QTest::newRow("ClassFlags 2") << meta2 << QByteArray("ClassFlags") << QByteArray("ClassFlag") << 'F' << true; + QTest::newRow("EnumStruct") << meta1 << QByteArray("EnumStruct") << QByteArray("EnumStruct") << 'G' << true; + QTest::newRow("TypedEnumStruct") << meta1 << QByteArray("TypedEnumStruct") << QByteArray("TypedEnumStruct") << 'H' << true; + QTest::newRow("StructFlags") << meta1 << QByteArray("StructFlags") << QByteArray("StructFlag") << 'I' << true; } void tst_Moc::cxx11Enums() -- 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(-) 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 b34143f8a19040a457d399a22f0bde53ac327ff1 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Tue, 11 Dec 2018 00:52:36 +0800 Subject: Fix clang LTCG config on Windows To enable LTCG, clang-cl.exe need "-flto" instead of "-GL". But if you enabled LTO, the lib tool will have to change to "llvm-lib.exe" and the link tool also need to change to "lld-link.exe", because msvc linker will see these lib files as corrupted files. Leave QMAKE_LFLAGS_LTCG empty because lld-link doesn't need any additional parameters. Fixes: QTBUG-72402 Change-Id: Ia34d98bd1ad919d542ea3eac83944bf8c40ce0cd Reviewed-by: Thiago Macieira Reviewed-by: Friedemann Kleint Reviewed-by: Oswald Buddenhagen --- mkspecs/win32-clang-msvc/qmake.conf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mkspecs/win32-clang-msvc/qmake.conf b/mkspecs/win32-clang-msvc/qmake.conf index ba9704e069..027f93ca6e 100644 --- a/mkspecs/win32-clang-msvc/qmake.conf +++ b/mkspecs/win32-clang-msvc/qmake.conf @@ -15,6 +15,14 @@ QMAKE_CFLAGS += -Wno-microsoft-enum-value QMAKE_CXXFLAGS += -Wno-microsoft-enum-value +QMAKE_LINK = lld-link +QMAKE_LIB = llvm-lib /NOLOGO + +QMAKE_CFLAGS_LTCG = -flto +QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG +# Leave QMAKE_LFLAGS_LTCG empty because lld-link doesn't need any additional parameters +QMAKE_LFLAGS_LTCG = + # Precompiled headers are not supported yet by clang CONFIG -= precompile_header -- cgit v1.2.3 From 1f30434356603109ca8aa5edb720522cb6fceac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Thu, 13 Dec 2018 16:02:50 +0100 Subject: nativewindow: Add additional test for 8pt font size Change-Id: I5012eb6ffee8f81da61a6fe611352ee5900a5eee Reviewed-by: Friedemann Kleint Reviewed-by: Simon Hausmann --- tests/manual/textrendering/nativetext/main.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/manual/textrendering/nativetext/main.cpp b/tests/manual/textrendering/nativetext/main.cpp index 3fb78858f0..7e98dd44d0 100644 --- a/tests/manual/textrendering/nativetext/main.cpp +++ b/tests/manual/textrendering/nativetext/main.cpp @@ -208,10 +208,9 @@ public: } }(); - layout->addWidget(new TextRenderer(12, text, color.first, color.second)); - layout->addWidget(new TextRenderer(24, text, color.first, color.second)); - layout->addWidget(new TextRenderer(36, text, color.first, color.second)); - layout->addWidget(new TextRenderer(48, text, color.first, color.second)); + for (int pointSize : {8, 12, 24, 36, 48}) + layout->addWidget(new TextRenderer(pointSize, text, color.first, color.second)); + static_cast(m_previews->layout())->addLayout(layout); } -- 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(+) 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(-) 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(-) 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(-) 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 bd05a009f0f9119dccf912550a6b44f825a9400b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 14 Dec 2018 16:11:01 +0100 Subject: configure: add "we mean it" blurb like all qt_*.prf files (exceptions prove the rule), the configure system counts as private api. Change-Id: Iea3057445e430029ecd8449e604e2d5c499ae10a Reviewed-by: Lars Knoll --- mkspecs/features/qt_configure.prf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 3483ddc5dc..c854a31f55 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1,3 +1,13 @@ +# +# W A R N I N G +# ------------- +# +# This file is not part of the Qt API. It exists purely as an +# implementation detail. It may change from version to version +# without notice, or even be removed. +# +# We mean it. +# QT_CONFIGURE_REPORT = QT_CONFIGURE_NOTES = -- 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(-) 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(-) 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(-) 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 cf51bcba10af20b6c603c34f0be99b7c34f6a8f7 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 3 May 2018 17:37:10 +0200 Subject: configure: allow libraries to create explicitly empty tests this allows compile-testing the specified headers with no further tests. Change-Id: I268ff328deee221d9b92386fe2bd133b19a6f8e2 Reviewed-by: Joerg Bornemann Reviewed-by: Oswald Buddenhagen --- mkspecs/features/qt_configure.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index c854a31f55..fe14ea1f40 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -982,7 +982,7 @@ defineTest(qtConfHandleLibrary) { export($${lpfx}.source) # if the library defines a test, use it to verify the source. - !isEmpty($${lpfx}.test)|!isEmpty($${lpfx}.test._KEYS_) { + defined($${lpfx}.test, var)|defined($${lpfx}.test._KEYS_, var) { $${lpfx}.resolved_uses = $$currentConfig:$$1 $${lpfx}.host = $$eval($${spfx}.host) !qtConfTest_compile($$lpfx) { -- 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(-) 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(-) 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(-) 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 --- config.tests/corewlan/corewlan.pro | 1 - config.tests/corewlan/corewlantest.mm | 47 ----------------------------------- src/network/configure.json | 6 ++++- 3 files changed, 5 insertions(+), 49 deletions(-) delete mode 100644 config.tests/corewlan/corewlan.pro delete mode 100644 config.tests/corewlan/corewlantest.mm diff --git a/config.tests/corewlan/corewlan.pro b/config.tests/corewlan/corewlan.pro deleted file mode 100644 index c19f0be4fd..0000000000 --- a/config.tests/corewlan/corewlan.pro +++ /dev/null @@ -1 +0,0 @@ -OBJECTIVE_SOURCES = corewlantest.mm diff --git a/config.tests/corewlan/corewlantest.mm b/config.tests/corewlan/corewlantest.mm deleted file mode 100644 index 73b4d0d145..0000000000 --- a/config.tests/corewlan/corewlantest.mm +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include - -int main() -{ - [CWInterface interfaceWithName:@"en2"]; - return 0; -} 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 --- config.tests/qpa/vulkan/vulkan.cpp | 58 ------------------------- config.tests/qpa/vulkan/vulkan.pro | 1 - config.tests/unix/cxx11_random/cxx11_random.cpp | 35 --------------- config.tests/unix/cxx11_random/cxx11_random.pro | 1 - config.tests/unix/futimens/futimens.cpp | 47 -------------------- config.tests/unix/futimens/futimens.pro | 6 --- config.tests/unix/futimes/futimes.cpp | 47 -------------------- config.tests/unix/futimes/futimes.pro | 1 - config.tests/unix/getauxval/getauxval.cpp | 34 --------------- config.tests/unix/getauxval/getauxval.pro | 1 - config.tests/unix/getentropy/getentropy.cpp | 35 --------------- config.tests/unix/getentropy/getentropy.pro | 1 - config.tests/unix/opengles32/opengles32.cpp | 47 -------------------- config.tests/unix/opengles32/opengles32.pro | 7 --- config.tests/x11/xrender/xrender.cpp | 52 ---------------------- config.tests/x11/xrender/xrender.pro | 2 - src/corelib/configure.json | 34 ++++++++++++--- src/gui/configure.json | 33 ++++++++++++-- 18 files changed, 59 insertions(+), 383 deletions(-) delete mode 100644 config.tests/qpa/vulkan/vulkan.cpp delete mode 100644 config.tests/qpa/vulkan/vulkan.pro delete mode 100644 config.tests/unix/cxx11_random/cxx11_random.cpp delete mode 100644 config.tests/unix/cxx11_random/cxx11_random.pro delete mode 100644 config.tests/unix/futimens/futimens.cpp delete mode 100644 config.tests/unix/futimens/futimens.pro delete mode 100644 config.tests/unix/futimes/futimes.cpp delete mode 100644 config.tests/unix/futimes/futimes.pro delete mode 100644 config.tests/unix/getauxval/getauxval.cpp delete mode 100644 config.tests/unix/getauxval/getauxval.pro delete mode 100644 config.tests/unix/getentropy/getentropy.cpp delete mode 100644 config.tests/unix/getentropy/getentropy.pro delete mode 100644 config.tests/unix/opengles32/opengles32.cpp delete mode 100644 config.tests/unix/opengles32/opengles32.pro delete mode 100644 config.tests/x11/xrender/xrender.cpp delete mode 100644 config.tests/x11/xrender/xrender.pro diff --git a/config.tests/qpa/vulkan/vulkan.cpp b/config.tests/qpa/vulkan/vulkan.cpp deleted file mode 100644 index 22f5edf9f2..0000000000 --- a/config.tests/qpa/vulkan/vulkan.cpp +++ /dev/null @@ -1,58 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -// This is a header-only test. Qt does not rely on linking to a Vulkan library directly. - -#include - -// 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); -} - -int main(int, char **) -{ - VkInstanceCreateInfo info; - testUpdateBuffer(0, 0, 0, 0, 0); - - return 0; -} diff --git a/config.tests/qpa/vulkan/vulkan.pro b/config.tests/qpa/vulkan/vulkan.pro deleted file mode 100644 index 5f05bc49aa..0000000000 --- a/config.tests/qpa/vulkan/vulkan.pro +++ /dev/null @@ -1 +0,0 @@ -SOURCES = vulkan.cpp diff --git a/config.tests/unix/cxx11_random/cxx11_random.cpp b/config.tests/unix/cxx11_random/cxx11_random.cpp deleted file mode 100644 index d6872667fd..0000000000 --- a/config.tests/unix/cxx11_random/cxx11_random.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** 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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -int main() -{ - std::mt19937 mt(0); - return 0; -} diff --git a/config.tests/unix/cxx11_random/cxx11_random.pro b/config.tests/unix/cxx11_random/cxx11_random.pro deleted file mode 100644 index 0cd5fff9d9..0000000000 --- a/config.tests/unix/cxx11_random/cxx11_random.pro +++ /dev/null @@ -1 +0,0 @@ -SOURCES = cxx11_random.cpp diff --git a/config.tests/unix/futimens/futimens.cpp b/config.tests/unix/futimens/futimens.cpp deleted file mode 100644 index 1b66386ca1..0000000000 --- a/config.tests/unix/futimens/futimens.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 Raphael Gozzo -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - futimens(-1,0); - return 0; -} - diff --git a/config.tests/unix/futimens/futimens.pro b/config.tests/unix/futimens/futimens.pro deleted file mode 100644 index 83a122252a..0000000000 --- a/config.tests/unix/futimens/futimens.pro +++ /dev/null @@ -1,6 +0,0 @@ -SOURCES += futimens.cpp - -# 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 diff --git a/config.tests/unix/futimes/futimes.cpp b/config.tests/unix/futimes/futimes.cpp deleted file mode 100644 index 553b39068e..0000000000 --- a/config.tests/unix/futimes/futimes.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2015 Raphael Gozzo -** Contact: http://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - futimes(-1,0); - return 0; -} - diff --git a/config.tests/unix/futimes/futimes.pro b/config.tests/unix/futimes/futimes.pro deleted file mode 100644 index 8e7f2c0f62..0000000000 --- a/config.tests/unix/futimes/futimes.pro +++ /dev/null @@ -1 +0,0 @@ -SOURCES += futimes.cpp diff --git a/config.tests/unix/getauxval/getauxval.cpp b/config.tests/unix/getauxval/getauxval.cpp deleted file mode 100644 index 62f71e95d2..0000000000 --- a/config.tests/unix/getauxval/getauxval.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** 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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -int main() -{ - return getauxval(AT_NULL); -} diff --git a/config.tests/unix/getauxval/getauxval.pro b/config.tests/unix/getauxval/getauxval.pro deleted file mode 100644 index ea46cb0bae..0000000000 --- a/config.tests/unix/getauxval/getauxval.pro +++ /dev/null @@ -1 +0,0 @@ -SOURCES = getauxval.cpp diff --git a/config.tests/unix/getentropy/getentropy.cpp b/config.tests/unix/getentropy/getentropy.cpp deleted file mode 100644 index 6cb4dc3a95..0000000000 --- a/config.tests/unix/getentropy/getentropy.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 Intel Corporation. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the test suite of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** 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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -int main() -{ - char buf[32]; - return getentropy(buf, sizeof(buf)); -} diff --git a/config.tests/unix/getentropy/getentropy.pro b/config.tests/unix/getentropy/getentropy.pro deleted file mode 100644 index bdd626b513..0000000000 --- a/config.tests/unix/getentropy/getentropy.pro +++ /dev/null @@ -1 +0,0 @@ -SOURCES = getentropy.cpp diff --git a/config.tests/unix/opengles32/opengles32.cpp b/config.tests/unix/opengles32/opengles32.cpp deleted file mode 100644 index 0505510464..0000000000 --- a/config.tests/unix/opengles32/opengles32.cpp +++ /dev/null @@ -1,47 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - glFramebufferTexture(GL_TEXTURE_2D, GL_DEPTH_STENCIL_ATTACHMENT, 1, 0); - - return 0; -} diff --git a/config.tests/unix/opengles32/opengles32.pro b/config.tests/unix/opengles32/opengles32.pro deleted file mode 100644 index c95ba83364..0000000000 --- a/config.tests/unix/opengles32/opengles32.pro +++ /dev/null @@ -1,7 +0,0 @@ -# The library is expected to be the same as in ES 2.0 (libGLESv2). -# The difference is the header and the presence of the functions in -# the library. - -SOURCES = opengles32.cpp - -CONFIG -= qt diff --git a/config.tests/x11/xrender/xrender.cpp b/config.tests/x11/xrender/xrender.cpp deleted file mode 100644 index 35203cc02c..0000000000 --- a/config.tests/x11/xrender/xrender.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 -#include - -#if RENDER_MAJOR == 0 && RENDER_MINOR < 5 -# error "Required Xrender version 0.6 not found." -#else -int main(int, char **) -{ - XRenderPictFormat *format; - format = 0; - return 0; -} -#endif diff --git a/config.tests/x11/xrender/xrender.pro b/config.tests/x11/xrender/xrender.pro deleted file mode 100644 index 6244ae6b47..0000000000 --- a/config.tests/x11/xrender/xrender.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = xrender.cpp -CONFIG -= qt 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 ++-- .../itemviews/qtableview/tst_qtableview.cpp | 40 ++++++-- 3 files changed, 125 insertions(+), 38 deletions(-) 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; diff --git a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp index ab746dfee8..1b95b5a3ca 100644 --- a/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp +++ b/tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp @@ -1264,19 +1264,47 @@ void tst_QTableView::moveCursorStrikesBack_data() for (int i = 0; i < 7; ++i) fullList << i; - QTest::newRow("All disabled, wrap forward. Timeout => FAIL") << -1 << -1 + QTest::newRow("All disabled, wrap forward. => invalid index") << -1 << -1 << fullList << fullList << QRect() << 1 << 0 << (IntList() << int(QtTestTableView::MoveNext)) - << 1 << 0; + << -1 << -1; - QTest::newRow("All disabled, wrap backwards. Timeout => FAIL") << -1 << -1 + QTest::newRow("All disabled, wrap backwards. => invalid index") << -1 << -1 << fullList << fullList << QRect() << 1 << 0 << (IntList() << int(QtTestTableView::MovePrevious)) + << -1 << -1; + + QTest::newRow("Last column disabled, MoveEnd. QTBUG-72400") << -1 << -1 + << IntList() + << (IntList() << 6) + << QRect() + << 0 << 0 << (IntList() << int(QtTestTableView::MoveEnd)) + << 0 << 5; + + QTest::newRow("First column disabled, MoveHome. QTBUG-72400") << -1 << -1 + << IntList() + << (IntList() << 0) + << QRect() + << 0 << 6 << (IntList() << int(QtTestTableView::MoveHome)) + << 0 << 1; + + QTest::newRow("First row disabled, MovePageUp. QTBUG-72400") << -1 << -1 + << (IntList() << 0) + << IntList() + << QRect() + << 2 << 0 << (IntList() << int(QtTestTableView::MovePageUp)) << 1 << 0; + + QTest::newRow("Last row disabled, MovePageDown. QTBUG-72400") << -1 << -1 + << (IntList() << 6) + << IntList() + << QRect() + << 4 << 0 << (IntList() << int(QtTestTableView::MovePageDown)) + << 5 << 0; } void tst_QTableView::moveCursorStrikesBack() @@ -1302,6 +1330,9 @@ void tst_QTableView::moveCursorStrikesBack() if (span.height() && span.width()) view.setSpan(span.top(), span.left(), span.height(), span.width()); view.show(); + QVERIFY(QTest::qWaitForWindowActive(&view)); + // resize to make sure there are scrollbars + view.resize(view.columnWidth(0) * 7, view.rowHeight(0) * 7); QModelIndex index = model.index(startRow, startColumn); view.setCurrentIndex(index); @@ -1320,9 +1351,6 @@ void tst_QTableView::moveCursorStrikesBack() newColumn = newIndex.column(); } - // expected fails, task 119433 - if(newRow == -1) - return; QCOMPARE(newRow, expectedRow); QCOMPARE(newColumn, expectedColumn); } -- 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(-) 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(+) 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(-) 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(+) 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(+) 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(-) 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 91d98321d361b4304265e09dba227df9fdc78393 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 14 Dec 2018 20:20:56 +0100 Subject: qmake: move QT_BEGIN_NAMESPACE to correct place this makes no difference whatsoever, because qmake isn't actually built in a namespace, but it makes the new qtc code model happy. Change-Id: I70ad8e16cceff73276a821219fc80bab365954b5 Reviewed-by: Joerg Bornemann --- qmake/generators/win32/registry_p.h | 4 ++-- qmake/qmake_pch.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/qmake/generators/win32/registry_p.h b/qmake/generators/win32/registry_p.h index 3526dffd45..f9e8bba016 100644 --- a/qmake/generators/win32/registry_p.h +++ b/qmake/generators/win32/registry_p.h @@ -40,8 +40,6 @@ // We mean it. // -QT_BEGIN_NAMESPACE - #include #ifdef Q_OS_WIN32 @@ -52,6 +50,8 @@ QT_BEGIN_NAMESPACE #include +QT_BEGIN_NAMESPACE + /** * Read a value from the Windows registry. * diff --git a/qmake/qmake_pch.h b/qmake/qmake_pch.h index c0f62b263d..c97c872311 100644 --- a/qmake/qmake_pch.h +++ b/qmake/qmake_pch.h @@ -54,10 +54,10 @@ #include #include -QT_BEGIN_NAMESPACE //#include //#include "option.h" +QT_BEGIN_NAMESPACE QT_END_NAMESPACE #endif -- cgit v1.2.3 From 32aa6734d445e1eed38e55ee03af4267ab6cd2c7 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 14 Dec 2018 17:49:43 +0100 Subject: configure: add support for multiple libdirs in inline library sources while the command line doesn't actually permit it (that can be re-evaluated separately), derivatives of the inline source type may want to inject additional paths, as is the case with opcua. the incdir field supports multiple entries without additional action. Change-Id: I3860ca1fc8fab25c04eb63bdb2f855b77ff3b9a4 Reviewed-by: Rainer Keller Reviewed-by: Oswald Buddenhagen Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_configure.prf | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index fe14ea1f40..5798a8a27b 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -707,8 +707,12 @@ defineTest(qtConfLibrary_inline) { } libdir = $$eval(config.input.$${input}.libdir) - !isEmpty(libdir): \ - $${1}.libs = -L$$libdir $$eval($${1}.libs) + !isEmpty(libdir) { + libs = + for (ld, libdir): \ + libs += -L$$ld + $${1}.libs = $$libs $$eval($${1}.libs) + } !qtConfResolveAllLibs($$1): \ return(false) -- cgit v1.2.3 From a8207699ce282cdcaa9423374fdad20a63897d25 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 24 Nov 2017 19:48:33 +0100 Subject: configure: normalize dashes to underscores in exported libraries it works without it, but technically speaking it's undefined behavior. Change-Id: Icdcdd5b923ce4cecd9dc9e75f9d5d66d0fa8a032 Reviewed-by: Joerg Bornemann --- mkspecs/features/qmake_use.prf | 6 +++--- mkspecs/features/qt_configure.prf | 16 ++++++++-------- mkspecs/features/qt_helper_lib.prf | 3 ++- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/mkspecs/features/qmake_use.prf b/mkspecs/features/qmake_use.prf index 8159e471a2..64faa4f215 100644 --- a/mkspecs/features/qmake_use.prf +++ b/mkspecs/features/qmake_use.prf @@ -5,14 +5,14 @@ for(ever) { for (use, QMAKE_USE$${suffix}) { use = $$split(use, /) name = $$take_first(use) - nu = $$upper($$name) + nu = $$upper($$replace(name, -, _)) !contains(use, linkonly): CC_USES += $$nu !contains(use, nolink): LD_USES += $$nu } CC_USES = $$resolve_depends(CC_USES, QMAKE_DEPENDS_, _CC) for (nu, CC_USES) { !defined(QMAKE_LIBS_$$nu, var): \ - error("Library '$$lower($$nu)' is not defined.") + error("Library '$$lower($$replace(nu, _, -))' is not defined.") DEFINES += $$eval(QMAKE_DEFINES_$${nu}) INCLUDEPATH += $$eval(QMAKE_INCDIR_$${nu}) @@ -20,7 +20,7 @@ for(ever) { LD_USES = $$resolve_depends(LD_USES, QMAKE_DEPENDS_, _LD) for (nu, LD_USES) { !defined(QMAKE_LIBS_$$nu, var): \ - error("Library '$$lower($$nu)' is not defined.") + error("Library '$$lower($$replace(nu, _, -))' is not defined.") debug: \ LIBS$${suffix} += $$eval(QMAKE_LIBS_$${nu}_DEBUG) $$eval(QMAKE_LIBS_$$nu) diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 5798a8a27b..83802cffca 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -439,12 +439,12 @@ defineTest(qtConfSetupLibraries) { lpfx = $${currentConfig}.libraries.$${l} # 'export' may be omitted, in which case it falls back to the library's name !defined($${lpfx}.export, var) { - $${lpfx}.export = $$l + $${lpfx}.export = $$replace(l, -, _) export($${lpfx}.export) } # 'export' may also be empty, but we need a derived identifier alias = $$eval($${lpfx}.export) - isEmpty(alias): alias = $$l + isEmpty(alias): alias = $$replace(l, -, _) $${lpfx}.alias = $$alias export($${lpfx}.alias) # make it easy to refer to the library by its export name. @@ -804,7 +804,7 @@ defineTest(qtConfLibrary_pkgConfig) { largs = $$qtConfAllLibraryArgs($$eval($${2}.dependencies)) for (la, largs): \ eval("$$la") - USES = $$eval($$list($$upper($$QMAKE_USE))) + USES = $$eval($$list($$upper($$replace(QMAKE_USE, -, _)))) # _CC == _LD for configure's library sources, so pick first arbitrarily. DEPS = $$resolve_depends(USES, QMAKE_DEPENDS_, _CC) for (DEP, DEPS) { @@ -837,7 +837,7 @@ defineTest(qtConfTest_getPkgConfigVariable) { } defineReplace(qtConfLibraryArgs) { - NAME = $$upper($$eval($${1}.library)) + NAME = $$upper($$replace($${1}.library, -, _)) qmake_args = "QMAKE_LIBS_$${NAME} = $$val_escape($${1}.libs)" for (b, $${1}.builds._KEYS_): \ qmake_args += "QMAKE_LIBS_$${NAME}_$$upper($$b) = $$val_escape($${1}.builds.$${b})" @@ -853,8 +853,8 @@ defineReplace(qtConfLibraryArgs) { for (use, depends): \ dep_uses += $$section(use, :, 1, 1) qmake_args += \ - "QMAKE_DEPENDS_$${NAME}_CC = $$upper($$dep_uses)" \ - "QMAKE_DEPENDS_$${NAME}_LD = $$upper($$dep_uses)" + "QMAKE_DEPENDS_$${NAME}_CC = $$upper($$replace(dep_uses, -, _))" \ + "QMAKE_DEPENDS_$${NAME}_LD = $$upper($$replace(dep_uses, -, _))" } return($$qmake_args) } @@ -917,7 +917,7 @@ defineTest(qtConfExportLibrary) { !isEmpty(use_cfg): \ depends += $$upper($$eval($${use_cfg}.libraries.$${use_lib}.export)) else: \ - depends += $$upper($$use_lib) + depends += $$upper($$replace(use_lib, -, _)) } # we use suffixes instead of infixes, because $$resolve_depends() demands it. qtConfOutputVar(assign, $$output, QMAKE_DEPENDS_$${NAME}_CC, $$depends) @@ -1092,7 +1092,7 @@ defineTest(qtConfTestPrepare_compile) { } } isEmpty(libConfig) { - nu = $$upper($$u) + nu = $$upper($$replace(u, -, _)) !defined(QMAKE_LIBS_$$nu, var): \ error("Test $$1 tries to use undeclared library '$$u'") # using an external library by exported name. diff --git a/mkspecs/features/qt_helper_lib.prf b/mkspecs/features/qt_helper_lib.prf index 05d3b941bd..2cb54fc547 100644 --- a/mkspecs/features/qt_helper_lib.prf +++ b/mkspecs/features/qt_helper_lib.prf @@ -31,6 +31,7 @@ THE_TARGET = $$qt5LibraryTarget($$TARGET) !build_pass { MODULE = $$replace(TARGET, ^qt, ) + MODULE ~= s,-,_, MODULE_PRI = $$MODULE_QMAKE_OUTDIR/mkspecs/modules/qt_ext_$${MODULE}.pri ucmodule = $$upper($$MODULE) @@ -46,7 +47,7 @@ THE_TARGET = $$qt5LibraryTarget($$TARGET) for (use, QMAKE_USE) { use = $$split(use, /) name = $$take_first(use) - nu = $$upper($$name) + nu = $$upper($$replace(name, -, _)) !contains(use, linkonly): CC_USES += $$nu !contains(use, nolink): LD_USES += $$nu } -- cgit v1.2.3 From 6b39d51a2c39569f984ef90e905bdf43958f5431 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 13 Jul 2018 18:33:17 +0200 Subject: configure: enable sharing of inlined source code between tests this is implemented by means of (multiple) inheritance, which applies specifically only to the inlined source and header list, but not to library sources or dependencies. Change-Id: I8f1d5b34d1d2d12e39225dc50357ad6ec648c6b6 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_configure.prf | 59 +++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 18 deletions(-) diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 83802cffca..72bbd42fa5 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -592,6 +592,16 @@ defineTest(qtConfResolvePathLibs) { return($$ret) } +defineReplace(qtConfGetTestSourceList) { + result = + !isEmpty($${1}.test.inherit) { + base = $$section(1, ., 0, -2) + for (i, $${1}.test.inherit): \ + result += $$qtConfGetTestSourceList($${base}.$$i) + } + return($$result $$1) +} + defineReplace(qtConfGetTestIncludes) { defined($${1}._KEYS_, var) { 1st = $$first($${1}._KEYS_) @@ -637,7 +647,10 @@ defineTest(qtConfResolvePathIncs) { # thus make the code below work. return($$ret) } - hdrs = $$qtConfGetTestIncludes($${3}.headers) + tests = $$qtConfGetTestSourceList($$3) + hdrs = + for (test, tests): \ + hdrs += $$qtConfGetTestIncludes($${test}.headers) for (hdr, hdrs) { h = $$qtConfFindInPathList($$hdr, $$2 $$EXTRA_INCLUDEPATH $$QMAKE_DEFAULT_INCDIRS) isEmpty(h) { @@ -1109,10 +1122,14 @@ defineTest(qtConfTestPrepare_compile) { } defineTest(qtConfPrepareCompileTestSource) { - test_dir = $$3 + test_dir = $$2 - test_lang = $$eval($${1}.lang) - isEmpty(test_lang): test_lang = "c++" + tests = $$qtConfGetTestSourceList($$1) + + test_lang = "c++" + for (test, tests): \ + test_lang += $$eval($${test}.test.lang) + test_lang = $$last(test_lang) # Last non-empty, that is. equals(test_lang, "c++"): suffix = "cpp" else: equals(test_lang, "c"): suffix = "c" @@ -1123,25 +1140,30 @@ defineTest(qtConfPrepareCompileTestSource) { # Create source code contents = "/* Generated by configure */" # Custom code before includes - for (ent, $$qtConfScalarOrList($${1}.head)): \ - contents += $$ent + for (test, tests): \ + for (ent, $$qtConfScalarOrList($${test}.test.head)): \ + contents += $$ent # Includes - hdrs = $$qtConfGetTestIncludes($${1}.include) - isEmpty(hdrs): \ - hdrs = $$qtConfGetTestIncludes($$2) - for (ent, hdrs): \ - contents += "$${LITERAL_HASH}include <$$ent>" + for (test, tests) { + hdrs = $$qtConfGetTestIncludes($${test}.test.include) + isEmpty(hdrs): \ + hdrs = $$qtConfGetTestIncludes($${test}.headers) + for (ent, hdrs): \ + contents += "$${LITERAL_HASH}include <$$ent>" + } # Custom code after includes - for (ent, $$qtConfScalarOrList($${1}.tail)): \ - contents += $$ent + for (test, tests): \ + for (ent, $$qtConfScalarOrList($${test}.test.tail)): \ + contents += $$ent # And finally the custom code inside main() contents += \ "int main(int argc, char **argv)" \ "{" \ " (void)argc; (void)argv;" \ " /* BEGIN TEST: */" - for (ent, $$qtConfScalarOrList($${1}.main)): \ - contents += " $$ent" + for (test, tests): \ + for (ent, $$qtConfScalarOrList($${test}.test.main)): \ + contents += " $$ent" contents += \ " /* END TEST */" \ " return 0;" \ @@ -1151,8 +1173,9 @@ defineTest(qtConfPrepareCompileTestSource) { # Create stub .pro file contents = "SOURCES = main.$$suffix" # Custom project code - for (ent, $$qtConfScalarOrList($${1}.qmake)): \ - contents += $$ent + for (test, tests): \ + for (ent, $$qtConfScalarOrList($${test}.test.qmake)): \ + contents += $$ent write_file($$test_dir/$$basename(test_dir).pro, contents)|error() } @@ -1165,7 +1188,7 @@ defineTest(qtConfTest_compile) { isEmpty(test) { test_dir = $$test_base_out_dir/$$section(1, ".", -1) test_out_dir = $$test_dir - qtConfPrepareCompileTestSource($${1}.test, $${1}.headers, $$test_dir) + qtConfPrepareCompileTestSource($$1, $$test_dir) } else { test_dir = $$QMAKE_CONFIG_TESTS_DIR/$$test test_out_dir = $$test_base_out_dir/$$test -- 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 --- config.tests/openssl/openssl.cpp | 54 --------------------------------- config.tests/openssl/openssl.pro | 1 - config.tests/unix/openssl11/openssl.cpp | 48 ----------------------------- config.tests/unix/openssl11/openssl.pro | 2 -- src/network/configure.json | 26 ++++++++++++++-- 5 files changed, 23 insertions(+), 108 deletions(-) delete mode 100644 config.tests/openssl/openssl.cpp delete mode 100644 config.tests/openssl/openssl.pro delete mode 100644 config.tests/unix/openssl11/openssl.cpp delete mode 100644 config.tests/unix/openssl11/openssl.pro diff --git a/config.tests/openssl/openssl.cpp b/config.tests/openssl/openssl.cpp deleted file mode 100644 index 9188fb008f..0000000000 --- a/config.tests/openssl/openssl.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x10000000L -# error "OpenSSL >= 1.0.0 is required" -#endif - -#include - -#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 - -int main() -{ -} diff --git a/config.tests/openssl/openssl.pro b/config.tests/openssl/openssl.pro deleted file mode 100644 index f0ee5e2b0c..0000000000 --- a/config.tests/openssl/openssl.pro +++ /dev/null @@ -1 +0,0 @@ -SOURCES = openssl.cpp diff --git a/config.tests/unix/openssl11/openssl.cpp b/config.tests/unix/openssl11/openssl.cpp deleted file mode 100644 index c20cc59deb..0000000000 --- a/config.tests/unix/openssl11/openssl.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -#if !defined(OPENSSL_VERSION_NUMBER) || OPENSSL_VERSION_NUMBER-0 < 0x10100000L -# error "OpenSSL >= 1.1 is required" -#endif - -int main() -{ -} diff --git a/config.tests/unix/openssl11/openssl.pro b/config.tests/unix/openssl11/openssl.pro deleted file mode 100644 index a023aee4aa..0000000000 --- a/config.tests/unix/openssl11/openssl.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = openssl.cpp -CONFIG -= x11 qt 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 73b8769730701736cd0d05f904b69f2e7e35de1d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 13 Jul 2018 21:25:12 +0200 Subject: configure: enable inline tests to contain auxiliary files ... and use that to migrate the pch test. Change-Id: I2ce884442cab6124c37142f571cf6f82191ee4f5 Reviewed-by: Joerg Bornemann --- config.tests/common/pch/header.h | 1 - config.tests/common/pch/pch.pro | 4 ---- config.tests/common/pch/source.cpp | 44 -------------------------------------- configure.json | 16 +++++++++++++- mkspecs/features/qt_configure.prf | 5 +++++ 5 files changed, 20 insertions(+), 50 deletions(-) delete mode 100644 config.tests/common/pch/header.h delete mode 100644 config.tests/common/pch/pch.pro delete mode 100644 config.tests/common/pch/source.cpp diff --git a/config.tests/common/pch/header.h b/config.tests/common/pch/header.h deleted file mode 100644 index ebc22c4fb0..0000000000 --- a/config.tests/common/pch/header.h +++ /dev/null @@ -1 +0,0 @@ -#define HEADER_H diff --git a/config.tests/common/pch/pch.pro b/config.tests/common/pch/pch.pro deleted file mode 100644 index f6384b71e1..0000000000 --- a/config.tests/common/pch/pch.pro +++ /dev/null @@ -1,4 +0,0 @@ -CONFIG += precompile_header -PRECOMPILED_DIR = .pch -PRECOMPILED_HEADER = header.h -SOURCES = source.cpp diff --git a/config.tests/common/pch/source.cpp b/config.tests/common/pch/source.cpp deleted file mode 100644 index 855672ffa8..0000000000 --- a/config.tests/common/pch/source.cpp +++ /dev/null @@ -1,44 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the configuration 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 HEADER_H -#error no go -#endif - -int main() { return 0; } diff --git a/configure.json b/configure.json index 2a717daf9a..9fce6d039e 100644 --- a/configure.json +++ b/configure.json @@ -324,7 +324,21 @@ "precompile_header": { "label": "precompiled header support", "type": "compile", - "test": "common/pch" + "test": { + "files": { + "header.h": "#define HEADER_H" + }, + "tail": [ + "#ifndef HEADER_H", + "#error no go", + "#endif" + ], + "qmake": [ + "CONFIG += precompile_header", + "PRECOMPILED_DIR = .pch", + "PRECOMPILED_HEADER = header.h" + ] + } }, "use_gold_linker": { "label": "gold linker", diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 72bbd42fa5..f5aa444ade 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1170,6 +1170,11 @@ defineTest(qtConfPrepareCompileTestSource) { "}" write_file($$test_dir/main.$$suffix, contents)|error() + for (test, tests) { + for (file, $$qtConfScalarOrList($${test}.test.files._KEYS_)): \ + write_file($$test_dir/$$file, $$qtConfScalarOrList($${test}.test.files.$${file}))|error() + } + # Create stub .pro file contents = "SOURCES = main.$$suffix" # Custom project code -- 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 --- config.tests/xlocalescanprint/qglobal.h | 43 --------------- config.tests/xlocalescanprint/xlocalescanprint.cpp | 62 ---------------------- config.tests/xlocalescanprint/xlocalescanprint.pro | 1 - mkspecs/features/qt_configure.prf | 3 +- src/corelib/configure.json | 33 +++++++++++- 5 files changed, 34 insertions(+), 108 deletions(-) delete mode 100644 config.tests/xlocalescanprint/qglobal.h delete mode 100644 config.tests/xlocalescanprint/xlocalescanprint.cpp delete mode 100644 config.tests/xlocalescanprint/xlocalescanprint.pro diff --git a/config.tests/xlocalescanprint/qglobal.h b/config.tests/xlocalescanprint/qglobal.h deleted file mode 100644 index 98de822847..0000000000 --- a/config.tests/xlocalescanprint/qglobal.h +++ /dev/null @@ -1,43 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 QGLOBAL_H -#define QGLOBAL_H - -#endif diff --git a/config.tests/xlocalescanprint/xlocalescanprint.cpp b/config.tests/xlocalescanprint/xlocalescanprint.cpp deleted file mode 100644 index 2f1f28f74e..0000000000 --- a/config.tests/xlocalescanprint/xlocalescanprint.cpp +++ /dev/null @@ -1,62 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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$ -** -****************************************************************************/ - -#define QT_BEGIN_NAMESPACE -#define QT_END_NAMESPACE - -#ifdef _MSVC_VER -#define Q_CC_MSVC _MSVC_VER -#endif - -#define QT_NO_DOUBLECONVERSION - -#include "../../../src/corelib/tools/qdoublescanprint_p.h" - -int main(int argc, char **argv) -{ -#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); - return 0; -} diff --git a/config.tests/xlocalescanprint/xlocalescanprint.pro b/config.tests/xlocalescanprint/xlocalescanprint.pro deleted file mode 100644 index 3748d2a728..0000000000 --- a/config.tests/xlocalescanprint/xlocalescanprint.pro +++ /dev/null @@ -1 +0,0 @@ -SOURCES = xlocalescanprint.cpp diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index f5aa444ade..87190bc52a 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -1178,9 +1178,10 @@ defineTest(qtConfPrepareCompileTestSource) { # Create stub .pro file contents = "SOURCES = main.$$suffix" # Custom project code + pwd = $$val_escape($${currentConfig}.dir) for (test, tests): \ for (ent, $$qtConfScalarOrList($${test}.test.qmake)): \ - contents += $$ent + contents += $$replace(ent, "@PWD@", $$pwd) write_file($$test_dir/$$basename(test_dir).pro, contents)|error() } 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 --- config.tests/gnu-libiconv/gnu-libiconv.cpp | 54 ------------------------------ config.tests/gnu-libiconv/gnu-libiconv.pro | 1 - config.tests/iconv/iconv.cpp | 54 ------------------------------ config.tests/iconv/iconv.pro | 2 -- config.tests/sun-libiconv/sun-libiconv.pro | 1 - src/corelib/codecs/codecs.pri | 3 +- src/corelib/configure.json | 54 +++++++++++++++++++++++------- 7 files changed, 42 insertions(+), 127 deletions(-) delete mode 100644 config.tests/gnu-libiconv/gnu-libiconv.cpp delete mode 100644 config.tests/gnu-libiconv/gnu-libiconv.pro delete mode 100644 config.tests/iconv/iconv.cpp delete mode 100644 config.tests/iconv/iconv.pro delete mode 100644 config.tests/sun-libiconv/sun-libiconv.pro diff --git a/config.tests/gnu-libiconv/gnu-libiconv.cpp b/config.tests/gnu-libiconv/gnu-libiconv.cpp deleted file mode 100644 index fe4b87b923..0000000000 --- a/config.tests/gnu-libiconv/gnu-libiconv.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - iconv_t x = iconv_open("", ""); - - const char *inp; - char *outp; - size_t inbytes, outbytes; - iconv(x, &inp, &inbytes, &outp, &outbytes); - - iconv_close(x); - - return 0; -} diff --git a/config.tests/gnu-libiconv/gnu-libiconv.pro b/config.tests/gnu-libiconv/gnu-libiconv.pro deleted file mode 100644 index e4e020cffb..0000000000 --- a/config.tests/gnu-libiconv/gnu-libiconv.pro +++ /dev/null @@ -1 +0,0 @@ -SOURCES = gnu-libiconv.cpp diff --git a/config.tests/iconv/iconv.cpp b/config.tests/iconv/iconv.cpp deleted file mode 100644 index be4236436f..0000000000 --- a/config.tests/iconv/iconv.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the config.tests 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 - -int main(int, char **) -{ - iconv_t x = iconv_open("", ""); - - char *inp; - char *outp; - size_t inbytes, outbytes; - iconv(x, &inp, &inbytes, &outp, &outbytes); - - iconv_close(x); - - return 0; -} diff --git a/config.tests/iconv/iconv.pro b/config.tests/iconv/iconv.pro deleted file mode 100644 index 70af0d2eb2..0000000000 --- a/config.tests/iconv/iconv.pro +++ /dev/null @@ -1,2 +0,0 @@ -SOURCES = iconv.cpp -mac|mingw|openbsd|qnx|haiku:LIBS += -liconv diff --git a/config.tests/sun-libiconv/sun-libiconv.pro b/config.tests/sun-libiconv/sun-libiconv.pro deleted file mode 100644 index d0881b732a..0000000000 --- a/config.tests/sun-libiconv/sun-libiconv.pro +++ /dev/null @@ -1 +0,0 @@ -SOURCES = ../gnu-libiconv/gnu-libiconv.cpp 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(+) 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 f377b1ddfb01f654975d8fee1dba3dbed78822e8 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 3 Dec 2018 08:35:28 +0100 Subject: qmake: Add support for installing executable files without calling strip Since some files are still executable (such as bash scripts) then they should not get strip called on them when installing in those cases. So by adding .CONFIG = nostrip, it indicates that strip should not be called on this. Fixes: QTBUG-60751 Change-Id: I19d502c07644daf9d487a8817c8e57d96eedab60 Reviewed-by: Oswald Buddenhagen --- qmake/generators/makefile.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 7247d1f8df..765aea4d83 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1289,6 +1289,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild) } } bool is_target = (wild == fileFixify(var("TARGET"), FileFixifyAbsolute)); + const bool noStrip = installConfigValues.contains("nostrip"); if(is_target || exists(wild)) { //real file or target QFileInfo fi(fileInfo(wild)); QString dst_file = filePrefixRoot(root, dst_dir); @@ -1302,7 +1303,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild) cmd = QLatin1String("-$(QINSTALL)"); cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file); inst << cmd; - if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") && + if (!noStrip && !project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") && !fi.isDir() && fi.isExecutable() && !project->isEmpty("QMAKE_STRIP")) inst << QString("-") + var("QMAKE_STRIP") + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst_dir + filestr, FileFixifyAbsolute, false))); @@ -1337,7 +1338,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, bool noBuild) QString cmd = QLatin1String("-$(QINSTALL) ") + escapeFilePath(dirstr + file) + " " + escapeFilePath(dst_file); inst << cmd; - if (!project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") && + if (!noStrip && !project->isActiveConfig("debug_info") && !project->isActiveConfig("nostrip") && !fi.isDir() && fi.isExecutable() && !project->isEmpty("QMAKE_STRIP")) inst << QString("-") + var("QMAKE_STRIP") + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst_dir + file, FileFixifyAbsolute, false))); -- cgit v1.2.3 From 3f2786e3226ac8b25188fe1b1e6de802996f6720 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 12 Apr 2018 16:48:27 +0200 Subject: qmake: fixify target paths of extra compilers more consistently ... so we don't get into situations where a target has a relative path, while another target depends on it with an absolute path. Task-number: QTBUG-36768 Change-Id: Icc5b249914bb3f095f4a6542c30bacf5ea6f9ec9 Reviewed-by: Joerg Bornemann Reviewed-by: Oswald Buddenhagen --- qmake/generators/makefile.cpp | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 765aea4d83..8b36b64d1d 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1876,12 +1876,14 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) if (config.indexOf("combine") != -1) { // compilers with a combined input only have one output QString input = project->first(ProKey(*it + ".output")).toQString(); - t << ' ' << escapeDependencyPath(Option::fixPathToTargetOS( - replaceExtraCompilerVariables(tmp_out, input, QString(), NoShell))); + t << ' ' << escapeDependencyPath(fileFixify( + replaceExtraCompilerVariables(tmp_out, input, QString(), NoShell), + FileFixifyFromOutdir)); } else { for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { - t << ' ' << escapeDependencyPath(Option::fixPathToTargetOS( - replaceExtraCompilerVariables(tmp_out, (*input).toQString(), QString(), NoShell))); + t << ' ' << escapeDependencyPath(fileFixify( + replaceExtraCompilerVariables(tmp_out, (*input).toQString(), QString(), NoShell), + FileFixifyFromOutdir)); } } t << endl; @@ -1917,8 +1919,9 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) QString tinp = (*input).toQString(); QString out = replaceExtraCompilerVariables(tmp_out, tinp, QString(), NoShell); for (const QString &rc : qAsConst(raw_clean)) { - dels << ' ' + escapeFilePath(Option::fixPathToTargetOS( - replaceExtraCompilerVariables(rc, tinp, out, NoShell), false)); + dels << ' ' + escapeFilePath(fileFixify( + replaceExtraCompilerVariables(rc, tinp, out, NoShell), + FileFixifyFromOutdir)); } } if(project->isActiveConfig("no_delete_multiple_files")) { @@ -2034,7 +2037,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) QString out = replaceExtraCompilerVariables(tmp_out, QString(), QString(), NoShell); QString cmd = replaceExtraCompilerVariables(tmp_cmd, inputs, QStringList() << out, TargetShell); - t << escapeDependencyPath(Option::fixPathToTargetOS(out)) << ":"; + t << escapeDependencyPath(fileFixify(out, FileFixifyFromOutdir)) << ":"; // compiler.CONFIG+=explicit_dependencies means that ONLY compiler.depends gets to cause Makefile dependencies if (config.indexOf("explicit_dependencies") != -1) { t << " " << valList(escapeDependencyPaths(fileFixify(tmp_dep, FileFixifyFromOutdir))); @@ -2046,14 +2049,16 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) } for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) { QString inpf = (*input).toQString(); - QString in = Option::fixPathToTargetOS(inpf, false); - QStringList deps = findDependencies(inpf); - deps << in; - QString out = Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_out, inpf, QString(), NoShell)); + QStringList deps; + deps << fileFixify(inpf, FileFixifyFromOutdir); + deps += findDependencies(inpf); + QString out = fileFixify(replaceExtraCompilerVariables(tmp_out, inpf, QString(), NoShell), + FileFixifyFromOutdir); if(!tmp_dep.isEmpty()) { QStringList pre_deps = fileFixify(tmp_dep, FileFixifyFromOutdir); for(int i = 0; i < pre_deps.size(); ++i) - deps << replaceExtraCompilerVariables(pre_deps.at(i), inpf, out, NoShell); + deps << fileFixify(replaceExtraCompilerVariables(pre_deps.at(i), inpf, out, NoShell), + FileFixifyFromOutdir); } QString cmd = replaceExtraCompilerVariables(tmp_cmd, inpf, out, TargetShell); // NOTE: The var -> QMAKE_COMP_var replace feature is unsupported, do not use! @@ -2113,7 +2118,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) //use the depend system to find includes of these included files QStringList inc_deps; for(int i = 0; i < deps.size(); ++i) { - const QString dep = deps.at(i); + const QString dep = fileFixify(deps.at(i), FileFixifyFromOutdir | FileFixifyAbsolute); if(QFile::exists(dep)) { SourceFileType type = TYPE_UNKNOWN; if(type == TYPE_UNKNOWN) { @@ -2150,11 +2155,10 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t) } } } - deps += inc_deps; + deps += fileFixify(inc_deps, FileFixifyFromOutdir); } for(int i = 0; i < deps.size(); ) { QString &dep = deps[i]; - dep = Option::fixPathToTargetOS(dep, false); if(out == dep) deps.removeAt(i); else -- cgit v1.2.3 From 49c8595bf8f4563656498be9f99448526338acb3 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 17 Dec 2018 21:18:18 +0100 Subject: qmake: fix typo in function name Change-Id: Ie88ae0f13be83d6e63078eeb359d9ddf012c94fb Reviewed-by: Joerg Bornemann --- mkspecs/features/toolchain.prf | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf index c7ea20e180..1a76e50b49 100644 --- a/mkspecs/features/toolchain.prf +++ b/mkspecs/features/toolchain.prf @@ -9,7 +9,7 @@ defineReplace(qtMakeExpand) { } } -defineTest(qtCompilerErrror) { +defineTest(qtCompilerError) { !cross_compile: \ what = else: host_build: \ @@ -69,7 +69,7 @@ isEmpty($${target_prefix}.INCDIRS) { cxx_flags += -E -v output = $$system("$$cmd_prefix $$QMAKE_CXX $$qtMakeExpand($$cxx_flags) -xc++ - 2>&1 $$cmd_suffix", lines, ec) - !equals(ec, 0): qtCompilerErrror($$QMAKE_CXX, $$output) + !equals(ec, 0): qtCompilerError($$QMAKE_CXX, $$output) rim_qcc { for (line, output) { @@ -129,7 +129,7 @@ isEmpty($${target_prefix}.INCDIRS) { # What's more, -print-search-dirs can't be used on clang on Apple because it # won't print all the library paths (only the clang-internal ones). output = $$system("$$cmd_prefix $$QMAKE_LINK $$QMAKE_LFLAGS -print-search-dirs", lines, ec) - !equals(ec, 0): qtCompilerErrror($$QMAKE_LINK, $$output) + !equals(ec, 0): qtCompilerError($$QMAKE_LINK, $$output) for (line, output) { contains(line, "^libraries: .*") { @@ -149,7 +149,7 @@ isEmpty($${target_prefix}.INCDIRS) { } else: ghs { cmd = $$QMAKE_CXX $$QMAKE_CXXFLAGS -$${LITERAL_HASH} -o /tmp/fake_output /tmp/fake_input.cpp output = $$system("$$cmd", blob, ec) - !equals(ec, 0): qtCompilerErrror($$QMAKE_CXX, $$output) + !equals(ec, 0): qtCompilerError($$QMAKE_CXX, $$output) output ~= s/\\\\\\n {8}//g output = $$split(output, $$escape_expand(\\n)) for (line, output) { @@ -199,14 +199,14 @@ isEmpty($${target_prefix}.INCDIRS) { defineReplace(qtVariablesFromMSVC) { ret = $$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) 2>NUL", lines, ec) - !equals(ec, 0): qtCompilerErrror($$1, $$ret) + !equals(ec, 0): qtCompilerError($$1, $$ret) return($$ret) } defineReplace(qtVariablesFromGCC) { ret = $$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) \ 2>$$QMAKE_SYSTEM_NULL_DEVICE", lines, ec) - !equals(ec, 0): qtCompilerErrror($$1, $$ret) + !equals(ec, 0): qtCompilerError($$1, $$ret) return($$ret) } -- cgit v1.2.3 From e0926ca4260953a70cdb2a6f84da35517ead1349 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 19 Dec 2018 17:54:46 +0100 Subject: qmake: remove support for pre-5.6 qt module pris MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit it seems rather obsolete by now. Change-Id: I43a84367fbe9f82c3adc0e3825d14198e69eaa1f Reviewed-by: Tor Arne Vestbø --- mkspecs/features/qt.prf | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf index d16b3cf1be..5da82fdb5b 100644 --- a/mkspecs/features/qt.prf +++ b/mkspecs/features/qt.prf @@ -198,28 +198,6 @@ for(ever) { MODULE_LIBS_ADD = $$MODULE_LIBS MODULE_LIBS_ADD -= $$QMAKE_DEFAULT_LIBDIRS - !contains(MODULE_CONFIG, v2) { - # Backwards compatibility with pre-5.6 module .pri files - - contains(MODULE_CONFIG, lib_bundle) { - MODULE_FRAMEWORKS = $$MODULE_LIBS - inc = $$MODULE_LIBS/$${MODULE_NAME}.framework/Headers - MODULE_INCLUDES = $$inc - contains(MODULE_CONFIG, internal_module): \ - MODULE_INCLUDES += \ - $$inc/$$eval(QT.$${QTLIB}.VERSION) \ - $$inc/$$eval(QT.$${QTLIB}.VERSION)/$$MODULE_NAME - } else { - # Re-insert the major version in the library name (cf qt5LibraryTarget above) - MODULE_NAME ~= s,^Qt,Qt$$QT_MAJOR_VERSION, - } - - # Only link to this module if a libs directory is set, else this is just a module - # to give access to sources or include files, and not for linking. - !isEmpty(MODULE_LIBS):!contains(MODULE_CONFIG, no_link): \ - MODULE_MODULE = $${MODULE_NAME}$${QT_LIBINFIX} - } - # Frameworks shouldn't need include paths, but much code does not use # module-qualified #includes, so by default we add paths which point # directly into the frameworks. Private modules have somewhat convoluted -- 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(-) 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(-) 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 ++++++++ tests/auto/gui/text/qfontmetrics/testfont.qrc | 1 + .../gui/text/qfontmetrics/tst_qfontmetrics.cpp | 27 ++++++++++++++++++++++ 3 files changed, 38 insertions(+) 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; diff --git a/tests/auto/gui/text/qfontmetrics/testfont.qrc b/tests/auto/gui/text/qfontmetrics/testfont.qrc index bc0c0b0959..30b4a3f82e 100644 --- a/tests/auto/gui/text/qfontmetrics/testfont.qrc +++ b/tests/auto/gui/text/qfontmetrics/testfont.qrc @@ -1,5 +1,6 @@ ucs4font.ttf + ../../../shared/resources/testfont.ttf diff --git a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp index 9e705b4a00..a0e8525268 100644 --- a/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp +++ b/tests/auto/gui/text/qfontmetrics/tst_qfontmetrics.cpp @@ -58,6 +58,7 @@ private slots: void lineWidth(); void mnemonicTextWidth(); void leadingBelowLine(); + void elidedMetrics(); }; void tst_QFontMetrics::same() @@ -331,5 +332,31 @@ void tst_QFontMetrics::leadingBelowLine() QCOMPARE(line.base(), line.ascent); } +void tst_QFontMetrics::elidedMetrics() +{ + QString testFont = QFINDTESTDATA("fonts/testfont.ttf"); + QVERIFY(!testFont.isEmpty()); + + int id = QFontDatabase::addApplicationFont(testFont); + QVERIFY(id >= 0); + + QFont font(QFontDatabase::applicationFontFamilies(id).at(0)); + font.setPixelSize(12.0); + + QFontMetricsF metrics(font); + QString s = QStringLiteral("VeryLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongLongText"); + + QRectF boundingRect = metrics.boundingRect(s); + + QString elided = metrics.elidedText(s, Qt::ElideRight, boundingRect.width() / 2.0); + + QRectF elidedBoundingRect = metrics.boundingRect(elided); + + QCOMPARE(boundingRect.height(), elidedBoundingRect.height()); + QCOMPARE(boundingRect.y(), elidedBoundingRect.y()); + + QFontDatabase::removeApplicationFont(id); +} + QTEST_MAIN(tst_QFontMetrics) #include "tst_qfontmetrics.moc" -- 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(-) 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(-) 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(-) 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(+) 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(-) 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(-) 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(-) 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(-) 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 b978cdcb268cbeb233c5e06fa4bb193cd34348aa Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 11 Dec 2018 14:17:05 +0100 Subject: Make sure -prefix documentation is also valid for top-level build Fixes: QTBUG-71540 Change-Id: I1c8c66706beaa130f9eb7a6f2ee02a21f98d8afc Reviewed-by: Oswald Buddenhagen --- config_help.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config_help.txt b/config_help.txt index 5369163055..7b5da3fbeb 100644 --- a/config_help.txt +++ b/config_help.txt @@ -17,7 +17,8 @@ quoting and double quotes for the outer quoting. Top-level installation directories: -prefix ...... The deployment directory, as seen on the target device. - [/usr/local/Qt-$QT_VERSION, $PWD if -developer-build] + [/usr/local/Qt-$QT_VERSION; qtbase build directory if + -developer-build] -extprefix ... The installation directory, as seen on the host machine. [SYSROOT/PREFIX] -hostprefix [dir] .. The installation directory for build tools running on -- 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(-) 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(-) 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(-) 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(+) 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 5af60d3b371360285af442d1ee194b44d681f297 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 10 Dec 2018 23:37:54 +0100 Subject: macOS: Prevent checking for stale SDK without the required SDK name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There's no need to check the SDK at the root exclusive-build Makefile, we can leave it to the individual build passes where the SDK variable is available. Fixes: QTBUG-72449 Change-Id: Ic829babf4c76e6d20812de0b94120199ebfb300c Reviewed-by: Morten Johan Sørvig Reviewed-by: Tor Arne Vestbø --- mkspecs/features/mac/default_post.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf index 3881b432ef..8e2c5e603a 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -1,7 +1,7 @@ load(default_post) contains(TEMPLATE, .*app) { - !macx-xcode { + !macx-xcode:if(isEmpty(BUILDS)|build_pass) { # Detect changes to the platform SDK QMAKE_EXTRA_VARIABLES += QMAKE_MAC_SDK QMAKE_MAC_SDK_VERSION QMAKE_XCODE_DEVELOPER_PATH QMAKE_EXTRA_INCLUDES += $$shell_quote($$PWD/sdk.mk) -- 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 +- tests/manual/textrendering/nativetext/main.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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() diff --git a/tests/manual/textrendering/nativetext/main.cpp b/tests/manual/textrendering/nativetext/main.cpp index 7e98dd44d0..b481e44bae 100644 --- a/tests/manual/textrendering/nativetext/main.cpp +++ b/tests/manual/textrendering/nativetext/main.cpp @@ -101,7 +101,7 @@ public: const int ascent = fontMetrics().ascent(); - QPen metricsPen(Qt::magenta, 1.0); + QPen metricsPen(QColor(112, 216, 255), 1.0); metricsPen.setCosmetic(true); p.setPen(metricsPen); p.drawLine(QPoint(0, ascent), QPoint(width(), ascent)); @@ -201,7 +201,7 @@ public: case 0: return qMakePair(QColor(), QColor()); case 1: return qMakePair(QColor(Qt::black), QColor(Qt::white)); case 2: return qMakePair(QColor(Qt::white), QColor(Qt::black)); - case 3: return qMakePair(QColor(Qt::green), QColor(Qt::red)); + case 3: return qMakePair(QColor(Qt::magenta), QColor(Qt::green)); case 4: return qMakePair(QColor(0, 0, 0, 128), QColor(Qt::white)); case 5: return qMakePair(QColor(255, 255, 255, 128), QColor(Qt::black)); default: return qMakePair(QColor(), QColor()); -- 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 ++++- .../qstringlistmodel/tst_qstringlistmodel.cpp | 20 ++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) 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); diff --git a/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp b/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp index 9a54c0a70d..1b40e77648 100644 --- a/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp +++ b/tests/auto/corelib/itemmodels/qstringlistmodel/tst_qstringlistmodel.cpp @@ -81,6 +81,8 @@ private slots: void setData_emits_both_roles_data(); void setData_emits_both_roles(); + void setData_emits_on_change_only(); + void supportedDragDropActions(); }; @@ -246,6 +248,24 @@ void tst_QStringListModel::setData_emits_both_roles() expected); } +void tst_QStringListModel::setData_emits_on_change_only() +{ + QStringListModel model(QStringList{QStringLiteral("one"), QStringLiteral("two")}); + QSignalSpy dataChangedSpy(&model, &QAbstractItemModel::dataChanged); + QVERIFY(dataChangedSpy.isValid()); + const QModelIndex modelIdx = model.index(0, 0); + const QString newStringData = QStringLiteral("test"); + QVERIFY(model.setData(modelIdx, newStringData)); + QCOMPARE(dataChangedSpy.count(), 1); + const QList spyList = dataChangedSpy.takeFirst(); + QCOMPARE(spyList.at(0).value(), modelIdx); + QCOMPARE(spyList.at(1).value(), modelIdx); + const QVector expectedRoles{Qt::DisplayRole, Qt::EditRole}; + QCOMPARE(spyList.at(2).value >(), expectedRoles); + QVERIFY(model.setData(modelIdx, newStringData)); + QVERIFY(dataChangedSpy.isEmpty()); +} + void tst_QStringListModel::supportedDragDropActions() { QStringListModel model; -- 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(-) 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(-) 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(-) 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 --- qmake/generators/win32/msvc_nmake.cpp | 8 -- src/plugins/platforms/winrt/qwinrtintegration.cpp | 132 ---------------------- src/plugins/platforms/winrt/qwinrtintegration.h | 16 --- 3 files changed, 156 deletions(-) diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index 780f6bd4d8..548d2e8575 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -195,11 +195,6 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t) incDirs << crtInclude + QStringLiteral("/winrt"); if (winrtBuild) { - // Only use mobile-specific headers and link against store-specific libs for - // winrt builds. - incDirs << kitDir + QStringLiteral("Extension SDKs/WindowsMobile/") - + crtVersion + QStringLiteral("/Include/WinRT"); - libDirs << toolsInstallDir + QStringLiteral("lib/") + arch + QStringLiteral("/store"); } else { // Desktop projects may require the atl headers and libs. @@ -236,9 +231,6 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t) incDirs << crtInclude + QStringLiteral("/shared"); incDirs << crtInclude + QStringLiteral("/winrt"); - incDirs << kitDir + QStringLiteral("Extension SDKs/WindowsMobile/") - + crtVersion + QStringLiteral("/Include/WinRT"); - libDirs << vcInstallDir + QStringLiteral("lib/store/") + compilerArch; libDirs << vcInstallDir + QStringLiteral("atlmfc/lib") + compilerArch; 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(+) 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(-) 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(-) 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(-) 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(-) 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 7ca39bf7bcfaca46463d41b25441127909bbdd82 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Wed, 12 Dec 2018 12:18:10 +0100 Subject: Doc: cleanup semaphore example This patch removes unused signal and variable. Change-Id: Ia4eaf083493d3d37e3ff22e0380d5a5ee69f91cf Reviewed-by: Paul Wicking Reviewed-by: Sze Howe Koh --- examples/corelib/threads/semaphores/semaphores.cpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/examples/corelib/threads/semaphores/semaphores.cpp b/examples/corelib/threads/semaphores/semaphores.cpp index 145624bb0b..a245b9906b 100644 --- a/examples/corelib/threads/semaphores/semaphores.cpp +++ b/examples/corelib/threads/semaphores/semaphores.cpp @@ -94,12 +94,6 @@ public: } fprintf(stderr, "\n"); } - -signals: - void stringConsumed(const QString &text); - -protected: - bool finish; }; //! [4] -- 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(-) 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 +++++++++- .../dialogs/qmessagebox/tst_qmessagebox.cpp | 95 ++++++++++++++++++++++ 4 files changed, 173 insertions(+), 15 deletions(-) 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); diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp index 3b31a74adf..eeda17074b 100644 --- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp +++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp @@ -110,6 +110,10 @@ private slots: void setInformativeText(); void iconPixmap(); + // QTBUG-44131 + void acceptedRejectedSignals(); + void acceptedRejectedSignals_data(); + void cleanup(); }; @@ -717,5 +721,96 @@ void tst_QMessageBox::iconPixmap() QCOMPARE(messageBox.iconPixmap(), QPixmap()); } +using SignalSignature = void(QDialog::*)(); +Q_DECLARE_METATYPE(SignalSignature); +Q_DECLARE_METATYPE(QMessageBox::ButtonRole) + +using ButtonsCreator = std::function(QMessageBox &)>; +Q_DECLARE_METATYPE(ButtonsCreator); + +using RoleSet = QSet; +Q_DECLARE_METATYPE(RoleSet); + +void tst_QMessageBox::acceptedRejectedSignals() +{ + QMessageBox messageBox(QMessageBox::Information, "Test window", "Test text"); + + QFETCH(ButtonsCreator, buttonsCreator); + QVERIFY(buttonsCreator); + + const auto buttons = buttonsCreator(messageBox); + QVERIFY(!buttons.isEmpty()); + + QFETCH(RoleSet, roles); + QFETCH(SignalSignature, signalSignature); + for (auto button: buttons) { + QVERIFY(button); + + messageBox.show(); + QVERIFY(QTest::qWaitForWindowExposed(&messageBox)); + + QSignalSpy spy(&messageBox, signalSignature); + QVERIFY(spy.isValid()); + button->click(); + + if (roles.contains(messageBox.buttonRole(button))) + QCOMPARE(spy.count(), 1); + else + QVERIFY(spy.isEmpty()); + } +} + +static void addAcceptedRow(const char *title, ButtonsCreator bc) +{ + QTest::newRow(title) << (RoleSet() << QMessageBox::AcceptRole << QMessageBox::YesRole) + << &QDialog::accepted << bc; +} + +static void addRejectedRow(const char *title, ButtonsCreator bc) +{ + QTest::newRow(title) << (RoleSet() << QMessageBox::RejectRole << QMessageBox::NoRole) + << &QDialog::rejected << bc; +} + +static void addCustomButtonsData() +{ + ButtonsCreator buttonsCreator = [](QMessageBox &messageBox) { + QVector buttons(QMessageBox::NRoles); + for (int i = QMessageBox::AcceptRole; i < QMessageBox::NRoles; ++i) { + buttons[i] = messageBox.addButton( + QString("Button role: %1").arg(i), QMessageBox::ButtonRole(i)); + } + + return buttons; + }; + + addAcceptedRow("Accepted_CustomButtons", buttonsCreator); + addRejectedRow("Rejected_CustomButtons", buttonsCreator); +} + +static void addStandardButtonsData() +{ + ButtonsCreator buttonsCreator = [](QMessageBox &messageBox) { + QVector buttons; + for (int i = QMessageBox::FirstButton; i <= QMessageBox::LastButton; i <<= 1) + buttons << messageBox.addButton(QMessageBox::StandardButton(i)); + + return buttons; + }; + + addAcceptedRow("Accepted_StandardButtons", buttonsCreator); + addRejectedRow("Rejected_StandardButtons", buttonsCreator); +} + +void tst_QMessageBox::acceptedRejectedSignals_data() +{ + QTest::addColumn("roles"); + QTest::addColumn("signalSignature"); + QTest::addColumn("buttonsCreator"); + + addStandardButtonsData(); + addCustomButtonsData(); +} + QTEST_MAIN(tst_QMessageBox) #include "tst_qmessagebox.moc" -- 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(-) 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(-) 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 f7dc6042cbff1b9638bc916872c1aaff86de0c0d Mon Sep 17 00:00:00 2001 From: Vitaly Fanaskov Date: Fri, 7 Dec 2018 16:59:30 +0100 Subject: Remove dead code Task-number: QTBUG-44131 Change-Id: Ic092f2be5855840d6467560159c12f3c5aa36344 Reviewed-by: Christian Ehrlicher Reviewed-by: Lars Knoll --- .../dialogs/qmessagebox/tst_qmessagebox.cpp | 134 --------------------- 1 file changed, 134 deletions(-) diff --git a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp index eeda17074b..76314564f1 100644 --- a/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp +++ b/tests/auto/widgets/dialogs/qmessagebox/tst_qmessagebox.cpp @@ -38,49 +38,6 @@ #include #include -#define CONVENIENCE_FUNC_SYMS(func) \ - { \ - int x1 = QMessageBox::func(0, "Foo", "Bar"); \ - int x3 = QMessageBox::func(0, "Foo", "Bar", "Save"); \ - int x6 = QMessageBox::func(0, "Foo", "Bar", "Save", "Save As"); \ - int x7 = QMessageBox::func(0, "Foo", "Bar", "Save", "Save As", "Dont Save"); \ - int x8 = QMessageBox::func(0, "Foo", "Bar", "Save", "Save As", "Dont Save", 1); \ - int x9 = QMessageBox::func(0, "Foo", "Bar", "Save", "Save As", "Dont Save", 1, 2); \ - int x10 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::YesAll, QMessageBox::Yes); \ - int x11 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::YesAll, QMessageBox::Yes, \ - QMessageBox::No); \ - qDebug("%d %d %d %d %d %d %d %d", x1, x3, x6, x7, x8, x9, x10, x11); \ - { \ - int x4 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes, (int)QMessageBox::No); \ - int x5 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes, (int)QMessageBox::No); \ - int x6 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default, (int)QMessageBox::No); \ - int x7 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes, QMessageBox::No); \ - int x8 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes, QMessageBox::No); \ - int x9 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No); \ - int x10 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes, (int)QMessageBox::No, (int)QMessageBox::Ok); \ - int x11 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes, (int)QMessageBox::No, (int)QMessageBox::Ok); \ - int x12 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default, (int)QMessageBox::No, (int)QMessageBox::Ok); \ - int x13 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes, QMessageBox::No, (int)QMessageBox::Ok); \ - int x14 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes, QMessageBox::No, (int)QMessageBox::Ok); \ - int x15 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, (int)QMessageBox::Ok); \ - int x16 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes, (int)QMessageBox::No, QMessageBox::Ok); \ - int x17 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes, (int)QMessageBox::No, QMessageBox::Ok); \ - int x18 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default, (int)QMessageBox::No, QMessageBox::Ok); \ - int x19 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes, QMessageBox::No, QMessageBox::Ok); \ - int x20 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes, QMessageBox::No, QMessageBox::Ok); \ - int x21 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default, QMessageBox::No, QMessageBox::Ok); \ - qDebug("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d", x4, x5, x6, x7, x8, x9, x10, x11, x12, x13, x14, x15, x16, x17, x18, x19, x20, x21); \ - } \ - } - -#define CONVENIENCE_FUNC_SYMS_EXTRA(func) \ - { \ - int x1 = QMessageBox::func(0, "Foo", "Bar", (int)QMessageBox::Yes); \ - int x2 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes); \ - int x3 = QMessageBox::func(0, "Foo", "Bar", QMessageBox::Yes | QMessageBox::Default); \ - qDebug("%d %d %d", x1, x2, x3); \ - } - class tst_QMessageBox : public QObject { Q_OBJECT @@ -103,7 +60,6 @@ private slots: void staticSourceCompat(); void instanceSourceCompat(); - void testSymbols(); void incorrectDefaultButton(); void updateSize(); @@ -509,96 +465,6 @@ void tst_QMessageBox::instanceSourceCompat() #endif } -void tst_QMessageBox::testSymbols() -{ - return; - - QMessageBox::Icon icon; - icon = QMessageBox::NoIcon; - icon = QMessageBox::Information; - icon = QMessageBox::Warning; - icon = QMessageBox::Critical; - icon = QMessageBox::Question; - - QMessageBox mb1; - QMessageBox mb2(0); - QMessageBox mb3(&mb1); - QMessageBox mb3b("title", "text", QMessageBox::Critical, int(QMessageBox::Yes), - int(QMessageBox::No), int(QMessageBox::Cancel), &mb1, Qt::Dialog); - - QMessageBox::Button button = QMessageBox::NoButton; - button = QMessageBox::Ok; - button = QMessageBox::Cancel; - button = QMessageBox::Yes; - button = QMessageBox::No; - button = QMessageBox::Abort; - button = QMessageBox::Retry; - button = QMessageBox::Ignore; - button = QMessageBox::YesAll; - button = QMessageBox::NoAll; - button = QMessageBox::ButtonMask; - button = QMessageBox::Default; - button = QMessageBox::Escape; - button = QMessageBox::FlagMask; - QVERIFY(button); - - const QString text = QStringLiteral("Foo"); - mb1.setText(text); - QCOMPARE(mb1.text(), text); - - icon = mb1.icon(); - QCOMPARE(icon, QMessageBox::NoIcon); - mb1.setIcon(QMessageBox::Question); - QCOMPARE(mb1.icon(), QMessageBox::Question); - - QPixmap iconPixmap = mb1.iconPixmap(); - mb1.setIconPixmap(iconPixmap); - QCOMPARE(mb1.icon(), QMessageBox::NoIcon); - - QCOMPARE(mb1.buttonText(QMessageBox::Ok), QLatin1String("OK")); - QCOMPARE(mb1.buttonText(QMessageBox::Cancel), QString()); - QCOMPARE(mb1.buttonText(QMessageBox::Ok | QMessageBox::Default), QString()); - - const QString button1 = QStringLiteral("Bar"); - mb2.setButtonText(QMessageBox::Cancel, QStringLiteral("Foo")); - mb2.setButtonText(QMessageBox::Ok, button1); - mb2.setButtonText(QMessageBox::Ok | QMessageBox::Default, QStringLiteral("Baz")); - - QCOMPARE(mb2.buttonText(QMessageBox::Cancel), QString()); - QCOMPARE(mb2.buttonText(QMessageBox::Ok), button1); - - QVERIFY(mb3b.buttonText(QMessageBox::Yes).endsWith("Yes")); - QCOMPARE(mb3b.buttonText(QMessageBox::YesAll), QString()); - QCOMPARE(mb3b.buttonText(QMessageBox::Ok), QString()); - - const QString button2 = QStringLiteral("Blah"); - mb3b.setButtonText(QMessageBox::Yes, button2); - mb3b.setButtonText(QMessageBox::YesAll, QStringLiteral("Zoo")); - mb3b.setButtonText(QMessageBox::Ok, QStringLiteral("Zoo")); - - QCOMPARE(mb3b.buttonText(QMessageBox::Yes), button2); - QCOMPARE(mb3b.buttonText(QMessageBox::YesAll), QString()); - QCOMPARE(mb3b.buttonText(QMessageBox::Ok), QString()); - - QCOMPARE(mb1.textFormat(), Qt::AutoText); - mb1.setTextFormat(Qt::PlainText); - QCOMPARE(mb1.textFormat(), Qt::PlainText); - - CONVENIENCE_FUNC_SYMS(information); - CONVENIENCE_FUNC_SYMS_EXTRA(information); - CONVENIENCE_FUNC_SYMS(question); - CONVENIENCE_FUNC_SYMS_EXTRA(question); - CONVENIENCE_FUNC_SYMS(warning); - CONVENIENCE_FUNC_SYMS(critical); - - QSize sizeHint = mb1.sizeHint(); - QVERIFY(sizeHint.width() > 20 && sizeHint.height() > 20); - - QMessageBox::about(&mb1, "title", "text"); - QMessageBox::aboutQt(&mb1); - QMessageBox::aboutQt(&mb1, "title"); -} - void tst_QMessageBox::detailsText() { QMessageBox box; -- cgit v1.2.3 From 8c2ca29045498be5fd74b8a4df633e7edae211c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Thu, 15 Nov 2018 09:51:25 +0200 Subject: Revert "Blacklist tst_QTimer::basic_chrono on macOS" Incorrectly blacklisted. This reverts commit 40a7c57ba990dfd58814a4a9dc69948991458cd4. Task-number: QTBUG-61013 Change-Id: I7d9dc4a4b1c8d7ff77ab75c61027b908ffb74552 Reviewed-by: Liang Qi --- tests/auto/corelib/kernel/qtimer/BLACKLIST | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/auto/corelib/kernel/qtimer/BLACKLIST b/tests/auto/corelib/kernel/qtimer/BLACKLIST index b355bc22c2..e5136624d8 100644 --- a/tests/auto/corelib/kernel/qtimer/BLACKLIST +++ b/tests/auto/corelib/kernel/qtimer/BLACKLIST @@ -1,5 +1,3 @@ [remainingTime] windows osx -[basic_chrono] -osx ci -- 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(-) 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(-) 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(+) 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(-) 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 fff59911a353b3fcf74369d8459ac79ce350a54d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 14 Dec 2018 20:13:44 +0100 Subject: qmake: add QMAKE_EXPORTED_VARIABLES because QMAKE_EXTRA_VARIABLES sometimes just ain't enough. Change-Id: I739e5b6510e4701ca0a86834e4f9a978d7ef1cf4 Reviewed-by: Joerg Bornemann --- qmake/generators/makefile.cpp | 19 +++++++++++++++++++ qmake/generators/makefile.h | 1 + qmake/generators/unix/unixmake2.cpp | 2 ++ qmake/generators/win32/winmakefile.cpp | 2 ++ 4 files changed, 24 insertions(+) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 8b36b64d1d..99455e7cb5 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -2212,6 +2212,25 @@ MakefileGenerator::writeExtraVariables(QTextStream &t) } } +// This is a more powerful alternative to the above function. +// It's meant to be internal, as one can make quite a mess with it. +void +MakefileGenerator::writeExportedVariables(QTextStream &t) +{ + const auto &vars = project->values("QMAKE_EXPORTED_VARIABLES"); + if (vars.isEmpty()) + return; + for (const auto &exp : vars) { + const ProString &name = project->first(ProKey(exp + ".name")); + const ProString &value = project->first(ProKey(exp + ".value")); + if (!value.isEmpty()) + t << name << " = " << value << endl; + else + t << name << " =\n"; + } + t << endl; +} + bool MakefileGenerator::writeDummyMakefile(QTextStream &t) { diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h index b5c150e1cb..0c30e74a1d 100644 --- a/qmake/generators/makefile.h +++ b/qmake/generators/makefile.h @@ -79,6 +79,7 @@ protected: void writeHeader(QTextStream &t); void writeSubDirs(QTextStream &t); void writeMakeQmake(QTextStream &t, bool noDummyQmakeAll = false); + void writeExportedVariables(QTextStream &t); void writeExtraVariables(QTextStream &t); void writeExtraTargets(QTextStream &t); void writeExtraCompilerTargets(QTextStream &t); diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index d3abedb50b..4b33713a75 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp @@ -180,6 +180,8 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) ProStringList &bundledFiles = project->values("QMAKE_BUNDLED_FILES"); + writeExportedVariables(t); + t << "####### Compiler, tools and options\n\n"; t << "CC = " << var("QMAKE_CC") << endl; t << "CXX = " << var("QMAKE_CXX") << endl; diff --git a/qmake/generators/win32/winmakefile.cpp b/qmake/generators/win32/winmakefile.cpp index e0d03ccc1c..91215c94b1 100644 --- a/qmake/generators/win32/winmakefile.cpp +++ b/qmake/generators/win32/winmakefile.cpp @@ -520,6 +520,8 @@ void Win32MakefileGenerator::writeIncPart(QTextStream &t) void Win32MakefileGenerator::writeStandardParts(QTextStream &t) { + writeExportedVariables(t); + t << "####### Compiler, tools and options\n\n"; t << "CC = " << var("QMAKE_CC") << endl; t << "CXX = " << var("QMAKE_CXX") << endl; -- cgit v1.2.3 From f89ac0101ad4a6cb5339a3bfe132aad897eafc9d Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Fri, 14 Dec 2018 21:12:11 +0100 Subject: qmake: add $$read_registry() function Change-Id: I7f9f17e0f44c273e4754d1decc92a8594cad8658 Reviewed-by: Simon Hausmann --- qmake/Makefile.unix | 6 +- qmake/Makefile.unix.win32 | 2 +- qmake/doc/src/qmake-manual.qdoc | 11 +++ qmake/generators/win32/registry.cpp | 158 --------------------------------- qmake/generators/win32/registry_p.h | 73 --------------- qmake/library/qmakebuiltins.cpp | 40 ++++++++- qmake/library/registry.cpp | 158 +++++++++++++++++++++++++++++++++ qmake/library/registry_p.h | 73 +++++++++++++++ tests/auto/tools/qmakelib/qmakelib.pro | 2 + 9 files changed, 287 insertions(+), 236 deletions(-) delete mode 100644 qmake/generators/win32/registry.cpp delete mode 100644 qmake/generators/win32/registry_p.h create mode 100644 qmake/library/registry.cpp create mode 100644 qmake/library/registry_p.h diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix index 9e0b51ba55..0f69b6b487 100644 --- a/qmake/Makefile.unix +++ b/qmake/Makefile.unix @@ -192,6 +192,9 @@ qmakeevaluator.o: $(QMKLIBSRC)/qmakeevaluator.cpp qmakebuiltins.o: $(QMKLIBSRC)/qmakebuiltins.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< +registry.o: $(QMKLIBSRC)/registry.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + project.o: $(QMKSRC)/project.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< @@ -225,9 +228,6 @@ unixmake.o: $(QMKSRC)/generators/unix/unixmake.cpp unixmake2.o: $(QMKSRC)/generators/unix/unixmake2.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< -registry.o: $(QMKSRC)/generators/win32/registry.cpp - $(CXX) -c -o $@ $(CXXFLAGS) $< - winmakefile.o: $(QMKSRC)/generators/win32/winmakefile.cpp $(CXX) -c -o $@ $(CXXFLAGS) $< diff --git a/qmake/Makefile.unix.win32 b/qmake/Makefile.unix.win32 index 48efd6f030..faf09ac11e 100644 --- a/qmake/Makefile.unix.win32 +++ b/qmake/Makefile.unix.win32 @@ -18,4 +18,4 @@ QTSRCS = \ $(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp \ $(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp \ $(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp \ - $(SOURCE_PATH)/qmake/generators/win32/registry.cpp + $(SOURCE_PATH)/qmake/library/registry.cpp diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc index 97744e7460..fb8bad32a2 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -3258,6 +3258,17 @@ Returns the \c string with every special regular expression character escaped with a backslash. This function is a wrapper around QRegExp::escape. + \section2 read_registry(tree, key[, flag]) + + Returns the value of registry key \c key inside the tree \c tree. + + Only the trees \c HKEY_CURRENT_USER (\c HKCU) and \c HKEY_LOCAL_MACHINE + (\c HKLM) are supported. + + The \c flag may be \c WOW64_32KEY (\c 32) or \c WOW64_64KEY (\c 64). + + \note This function is available only on Windows hosts. + \section2 relative_path(filePath[, base]) Returns the path to \c filePath relative to \c base. diff --git a/qmake/generators/win32/registry.cpp b/qmake/generators/win32/registry.cpp deleted file mode 100644 index 3391ab9512..0000000000 --- a/qmake/generators/win32/registry.cpp +++ /dev/null @@ -1,158 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the qmake application of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** 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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include "registry_p.h" - -QT_BEGIN_NAMESPACE - -#ifdef Q_OS_WIN32 -/* - Returns the path part of a registry key. - e.g. - For a key - "Software\\Microsoft\\VisualStudio\\8.0\\Setup\\VC\\ProductDir" - it returns - "Software\\Microsoft\\VisualStudio\\8.0\\Setup\\VC\\" -*/ -static QString keyPath(const QString &rKey) -{ - int idx = rKey.lastIndexOf(QLatin1Char('\\')); - if (idx == -1) - return QString(); - return rKey.left(idx + 1); -} - -/* - Returns the name part of a registry key. - e.g. - For a key - "Software\\Microsoft\\VisualStudio\\8.0\\Setup\\VC\\ProductDir" - it returns - "ProductDir" -*/ -static QString keyName(const QString &rKey) -{ - int idx = rKey.lastIndexOf(QLatin1Char('\\')); - if (idx == -1) - return rKey; - - QString res(rKey.mid(idx + 1)); - if (res == QLatin1String("Default") || res == QLatin1String(".")) - res = QString(); - return res; -} -#endif - -QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey, unsigned long options) -{ - QString result; - -#ifdef Q_OS_WIN32 - QString rSubkeyName = keyName(rSubkey); - QString rSubkeyPath = keyPath(rSubkey); - - HKEY handle = nullptr; - LONG res = RegOpenKeyEx(parentHandle, (wchar_t*)rSubkeyPath.utf16(), 0, - KEY_READ | options, &handle); - - if (res != ERROR_SUCCESS) - return QString(); - - // get the size and type of the value - DWORD dataType; - DWORD dataSize; - res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), nullptr, &dataType, nullptr, &dataSize); - if (res != ERROR_SUCCESS) { - RegCloseKey(handle); - return QString(); - } - - // get the value - QByteArray data(dataSize, 0); - res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), nullptr, nullptr, - reinterpret_cast(data.data()), &dataSize); - if (res != ERROR_SUCCESS) { - RegCloseKey(handle); - return QString(); - } - - switch (dataType) { - case REG_EXPAND_SZ: - case REG_SZ: { - result = QString::fromWCharArray(((const wchar_t *)data.constData())); - break; - } - - case REG_MULTI_SZ: { - QStringList l; - int i = 0; - for (;;) { - QString s = QString::fromWCharArray((const wchar_t *)data.constData() + i); - i += s.length() + 1; - - if (s.isEmpty()) - break; - l.append(s); - } - result = l.join(QLatin1String(", ")); - break; - } - - case REG_NONE: - case REG_BINARY: { - result = QString::fromWCharArray((const wchar_t *)data.constData(), data.size() / 2); - break; - } - - case REG_DWORD_BIG_ENDIAN: - case REG_DWORD: { - Q_ASSERT(data.size() == sizeof(int)); - int i; - memcpy((char*)&i, data.constData(), sizeof(int)); - result = QString::number(i); - break; - } - - default: - qWarning("QSettings: unknown data %u type in windows registry", quint32(dataType)); - break; - } - - RegCloseKey(handle); -#else - Q_UNUSED(parentHandle); - Q_UNUSED(rSubkey) - Q_UNUSED(options); -#endif - - return result; -} - -QT_END_NAMESPACE - diff --git a/qmake/generators/win32/registry_p.h b/qmake/generators/win32/registry_p.h deleted file mode 100644 index f9e8bba016..0000000000 --- a/qmake/generators/win32/registry_p.h +++ /dev/null @@ -1,73 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the qmake application of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** 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 General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** 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-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef QT_WINDOWS_REGISTRY_H -#define QT_WINDOWS_REGISTRY_H - -// -// W A R N I N G -// ------------- -// -// This file is not part of the Qt API. It exists purely as an -// implementation detail. This header file may change from version to -// version without notice, or even be removed. -// -// We mean it. -// - -#include - -#ifdef Q_OS_WIN32 - #include -#else - typedef void* HKEY; -#endif - -#include - -QT_BEGIN_NAMESPACE - -/** - * Read a value from the Windows registry. - * - * If the key is not found, or the registry cannot be accessed (for example - * if this code is compiled for a platform other than Windows), a null - * string is returned. - * - * 32-bit code reads from the registry's 32 bit view (Wow6432Node), - * 64 bit code reads from the 64 bit view. - * Pass KEY_WOW64_32KEY to access the 32 bit view regardless of the - * application's architecture, KEY_WOW64_64KEY respectively. - */ -QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey, - unsigned long options = 0); - -QT_END_NAMESPACE - -#endif // QT_WINDOWS_REGISTRY_H - diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp index f81bec158b..dd7766c8e0 100644 --- a/qmake/library/qmakebuiltins.cpp +++ b/qmake/library/qmakebuiltins.cpp @@ -52,6 +52,9 @@ # include #endif #include +#ifdef Q_OS_WIN +# include +#endif #include @@ -93,7 +96,7 @@ enum ExpandFunc { E_UPPER, E_LOWER, E_TITLE, E_FILES, E_PROMPT, E_RE_ESCAPE, E_VAL_ESCAPE, E_REPLACE, E_SORT_DEPENDS, E_RESOLVE_DEPENDS, E_ENUMERATE_VARS, E_SHADOWED, E_ABSOLUTE_PATH, E_RELATIVE_PATH, E_CLEAN_PATH, - E_SYSTEM_PATH, E_SHELL_PATH, E_SYSTEM_QUOTE, E_SHELL_QUOTE, E_GETENV + E_SYSTEM_PATH, E_SHELL_PATH, E_SYSTEM_QUOTE, E_SHELL_QUOTE, E_GETENV, E_READ_REGISTRY }; enum TestFunc { @@ -190,6 +193,7 @@ void QMakeEvaluator::initFunctionStatics() { "system_quote", E_SYSTEM_QUOTE, -1, 1, "arg" }, { "shell_quote", E_SHELL_QUOTE, -1, 1, "arg" }, { "getenv", E_GETENV, 1, 1, "arg" }, + { "read_registry", E_READ_REGISTRY, 2, 3, "tree, key, [wow64]" }, }; statics.expands.reserve((int)(sizeof(expandInits)/sizeof(expandInits[0]))); for (unsigned i = 0; i < sizeof(expandInits)/sizeof(expandInits[0]); ++i) @@ -1214,6 +1218,40 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand( ret << ProString(m_option->getEnv(u1.str())); break; } +#ifdef Q_OS_WIN + case E_READ_REGISTRY: { + HKEY tree; + const auto par = args.at(0); + if (!par.compare(QLatin1String("HKCU"), Qt::CaseInsensitive) + || !par.compare(QLatin1String("HKEY_CURRENT_USER"), Qt::CaseInsensitive)) { + tree = HKEY_CURRENT_USER; + } else if (!par.compare(QLatin1String("HKLM"), Qt::CaseInsensitive) + || !par.compare(QLatin1String("HKEY_LOCAL_MACHINE"), Qt::CaseInsensitive)) { + tree = HKEY_LOCAL_MACHINE; + } else { + evalError(fL1S("read_registry(): invalid or unsupported registry tree %1.") + .arg(par.toQStringView())); + goto allfail; + } + int flags = 0; + if (args.count() > 2) { + const auto opt = args.at(2); + if (opt == "32" + || !opt.compare(QLatin1String("wow64_32key"), Qt::CaseInsensitive)) { + flags = KEY_WOW64_32KEY; + } else if (opt == "64" + || !opt.compare(QLatin1String("wow64_64key"), Qt::CaseInsensitive)) { + flags = KEY_WOW64_64KEY; + } else { + evalError(fL1S("read_registry(): invalid option %1.") + .arg(opt.toQStringView())); + goto allfail; + } + } + ret << ProString(qt_readRegistryKey(tree, args.at(1).toQString(m_tmp1), flags)); + break; + } +#endif default: evalError(fL1S("Function '%1' is not implemented.").arg(func.toQStringView())); break; diff --git a/qmake/library/registry.cpp b/qmake/library/registry.cpp new file mode 100644 index 0000000000..3391ab9512 --- /dev/null +++ b/qmake/library/registry.cpp @@ -0,0 +1,158 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the qmake application of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** 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 General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** 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-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#include +#include "registry_p.h" + +QT_BEGIN_NAMESPACE + +#ifdef Q_OS_WIN32 +/* + Returns the path part of a registry key. + e.g. + For a key + "Software\\Microsoft\\VisualStudio\\8.0\\Setup\\VC\\ProductDir" + it returns + "Software\\Microsoft\\VisualStudio\\8.0\\Setup\\VC\\" +*/ +static QString keyPath(const QString &rKey) +{ + int idx = rKey.lastIndexOf(QLatin1Char('\\')); + if (idx == -1) + return QString(); + return rKey.left(idx + 1); +} + +/* + Returns the name part of a registry key. + e.g. + For a key + "Software\\Microsoft\\VisualStudio\\8.0\\Setup\\VC\\ProductDir" + it returns + "ProductDir" +*/ +static QString keyName(const QString &rKey) +{ + int idx = rKey.lastIndexOf(QLatin1Char('\\')); + if (idx == -1) + return rKey; + + QString res(rKey.mid(idx + 1)); + if (res == QLatin1String("Default") || res == QLatin1String(".")) + res = QString(); + return res; +} +#endif + +QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey, unsigned long options) +{ + QString result; + +#ifdef Q_OS_WIN32 + QString rSubkeyName = keyName(rSubkey); + QString rSubkeyPath = keyPath(rSubkey); + + HKEY handle = nullptr; + LONG res = RegOpenKeyEx(parentHandle, (wchar_t*)rSubkeyPath.utf16(), 0, + KEY_READ | options, &handle); + + if (res != ERROR_SUCCESS) + return QString(); + + // get the size and type of the value + DWORD dataType; + DWORD dataSize; + res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), nullptr, &dataType, nullptr, &dataSize); + if (res != ERROR_SUCCESS) { + RegCloseKey(handle); + return QString(); + } + + // get the value + QByteArray data(dataSize, 0); + res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), nullptr, nullptr, + reinterpret_cast(data.data()), &dataSize); + if (res != ERROR_SUCCESS) { + RegCloseKey(handle); + return QString(); + } + + switch (dataType) { + case REG_EXPAND_SZ: + case REG_SZ: { + result = QString::fromWCharArray(((const wchar_t *)data.constData())); + break; + } + + case REG_MULTI_SZ: { + QStringList l; + int i = 0; + for (;;) { + QString s = QString::fromWCharArray((const wchar_t *)data.constData() + i); + i += s.length() + 1; + + if (s.isEmpty()) + break; + l.append(s); + } + result = l.join(QLatin1String(", ")); + break; + } + + case REG_NONE: + case REG_BINARY: { + result = QString::fromWCharArray((const wchar_t *)data.constData(), data.size() / 2); + break; + } + + case REG_DWORD_BIG_ENDIAN: + case REG_DWORD: { + Q_ASSERT(data.size() == sizeof(int)); + int i; + memcpy((char*)&i, data.constData(), sizeof(int)); + result = QString::number(i); + break; + } + + default: + qWarning("QSettings: unknown data %u type in windows registry", quint32(dataType)); + break; + } + + RegCloseKey(handle); +#else + Q_UNUSED(parentHandle); + Q_UNUSED(rSubkey) + Q_UNUSED(options); +#endif + + return result; +} + +QT_END_NAMESPACE + diff --git a/qmake/library/registry_p.h b/qmake/library/registry_p.h new file mode 100644 index 0000000000..f9e8bba016 --- /dev/null +++ b/qmake/library/registry_p.h @@ -0,0 +1,73 @@ +/**************************************************************************** +** +** Copyright (C) 2016 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the qmake application of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:GPL-EXCEPT$ +** 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 General Public License Usage +** Alternatively, this file may be used under the terms of the GNU +** General Public License version 3 as published by the Free Software +** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +** 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-3.0.html. +** +** $QT_END_LICENSE$ +** +****************************************************************************/ + +#ifndef QT_WINDOWS_REGISTRY_H +#define QT_WINDOWS_REGISTRY_H + +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists purely as an +// implementation detail. This header file may change from version to +// version without notice, or even be removed. +// +// We mean it. +// + +#include + +#ifdef Q_OS_WIN32 + #include +#else + typedef void* HKEY; +#endif + +#include + +QT_BEGIN_NAMESPACE + +/** + * Read a value from the Windows registry. + * + * If the key is not found, or the registry cannot be accessed (for example + * if this code is compiled for a platform other than Windows), a null + * string is returned. + * + * 32-bit code reads from the registry's 32 bit view (Wow6432Node), + * 64 bit code reads from the 64 bit view. + * Pass KEY_WOW64_32KEY to access the 32 bit view regardless of the + * application's architecture, KEY_WOW64_64KEY respectively. + */ +QString qt_readRegistryKey(HKEY parentHandle, const QString &rSubkey, + unsigned long options = 0); + +QT_END_NAMESPACE + +#endif // QT_WINDOWS_REGISTRY_H + diff --git a/tests/auto/tools/qmakelib/qmakelib.pro b/tests/auto/tools/qmakelib/qmakelib.pro index 140bece708..29f17f6a14 100644 --- a/tests/auto/tools/qmakelib/qmakelib.pro +++ b/tests/auto/tools/qmakelib/qmakelib.pro @@ -1,6 +1,7 @@ CONFIG += testcase TARGET = tst_qmakelib QT = core testlib +win32: LIBS += -ladvapi32 INCLUDEPATH += ../../../../qmake/library VPATH += ../../../../qmake/library @@ -13,6 +14,7 @@ SOURCES += \ parsertest.cpp \ evaltest.cpp \ ioutils.cpp \ + registry.cpp \ proitems.cpp \ qmakevfs.cpp \ qmakeparser.cpp \ -- cgit v1.2.3 From ef14c3dc1a6106673969bc55967c434761d33629 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 17 Dec 2018 21:16:27 +0100 Subject: qmake: reshuffle toolchain.prf swap the order of compiler version detection and default path detection. this keeps a subsequent commit smaller, which introduces a dependency between the two. Change-Id: I2d4cbee1fd3555411c18833bbee0201c994a9942 Reviewed-by: Joerg Bornemann --- mkspecs/features/toolchain.prf | 209 +++++++++++++++++++++-------------------- 1 file changed, 106 insertions(+), 103 deletions(-) diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf index 1a76e50b49..734a7fbf86 100644 --- a/mkspecs/features/toolchain.prf +++ b/mkspecs/features/toolchain.prf @@ -1,14 +1,3 @@ - -defineReplace(qtMakeExpand) { - out = "$$1" - for(ever) { - m = $$replace(out, ".*\\$\\(EXPORT_([^)]+)\\).*", \\1) - equals(m, $$out): \ - return($$out) - out = $$replace(out, "\\$\\(EXPORT_$$m\\)", $$eval($$m)) - } -} - defineTest(qtCompilerError) { !cross_compile: \ what = @@ -30,6 +19,112 @@ cross_compile:host_build: \ else: \ target_prefix = QMAKE_CXX +# +# Determine and cache the compiler version +# + +defineReplace(qtVariablesFromMSVC) { + ret = $$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) 2>NUL", lines, ec) + !equals(ec, 0): qtCompilerError($$1, $$ret) + return($$ret) +} + +defineReplace(qtVariablesFromGCC) { + ret = $$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) \ + 2>$$QMAKE_SYSTEM_NULL_DEVICE", lines, ec) + !equals(ec, 0): qtCompilerError($$1, $$ret) + return($$ret) +} + +isEmpty($${target_prefix}.COMPILER_MACROS) { + msvc { + clang_cl { + # We need to obtain the cl.exe version first + vars = $$qtVariablesFromMSVC(cl) + for (v, vars) { + isEmpty(v)|contains(v, $${LITERAL_HASH}.*): next() + eval($$v) + } + isEmpty(QMAKE_MSC_FULL_VER): error("Could not determine the Visual Studio version") + + QMAKE_CFLAGS_MSVC_COMPAT = $$replace(QMAKE_MSC_FULL_VER, "(..)(..)(.*)", \ + "-fms-compatibility-version=\\1.\\2.\\3") + cache($${target_prefix}.QMAKE_CFLAGS_MSVC_COMPAT, set stash, QMAKE_CFLAGS_MSVC_COMPAT) + $${target_prefix}.COMPILER_MACROS += QMAKE_CFLAGS_MSVC_COMPAT + vars = $$qtVariablesFromMSVC($$QMAKE_CXX, $$QMAKE_CFLAGS_MSVC_COMPAT) + } else { + vars = $$qtVariablesFromMSVC($$QMAKE_CXX) + } + } else: gcc|ghs { + vars = $$qtVariablesFromGCC($$QMAKE_CXX) + } + for (v, vars) { + !contains(v, "[A-Z_]+ = .*"): next() + # Set both for the outer scope ... + eval($$v) + v ~= s/ .*// + isEmpty($$v): error("Compiler produced empty value for $${v}.") + # ... and save QMAKE_(HOST_)?CXX. in the cache. + cache($${target_prefix}.$$v, set stash, $$v) + $${target_prefix}.COMPILER_MACROS += $$v + } + cache($${target_prefix}.COMPILER_MACROS, set stash) +} else { + # load from the cache + for (i, $${target_prefix}.COMPILER_MACROS): \ + $$i = $$eval($${target_prefix}.$$i) +} + +# Populate QMAKE_COMPILER_DEFINES and some compatibility variables. +# The $$format_number() calls strip leading zeros to avoid misinterpretation as octal. +QMAKE_COMPILER_DEFINES += __cplusplus=$$QT_COMPILER_STDCXX +!isEmpty(QMAKE_MSC_VER): \ + QMAKE_COMPILER_DEFINES += _MSC_VER=$$QMAKE_MSC_VER _MSC_FULL_VER=$$QMAKE_MSC_FULL_VER +!isEmpty(QMAKE_ICC_VER): \ + QMAKE_COMPILER_DEFINES += __INTEL_COMPILER=$$QMAKE_ICC_VER __INTEL_COMPILER_UPDATE=$$QMAKE_ICC_UPDATE_VER +!isEmpty(QMAKE_APPLE_CC): \ + QMAKE_COMPILER_DEFINES += __APPLE_CC__=$$QMAKE_APPLE_CC +!isEmpty(QMAKE_APPLE_CLANG_MAJOR_VERSION): \ + QMAKE_COMPILER_DEFINES += __clang__ \ + __clang_major__=$$QMAKE_APPLE_CLANG_MAJOR_VERSION \ + __clang_minor__=$$QMAKE_APPLE_CLANG_MINOR_VERSION \ + __clang_patchlevel__=$$QMAKE_APPLE_CLANG_PATCH_VERSION +!isEmpty(QMAKE_CLANG_MAJOR_VERSION): \ + QMAKE_COMPILER_DEFINES += __clang__ \ + __clang_major__=$$QMAKE_CLANG_MAJOR_VERSION \ + __clang_minor__=$$QMAKE_CLANG_MINOR_VERSION \ + __clang_patchlevel__=$$QMAKE_CLANG_PATCH_VERSION +!isEmpty(QMAKE_GCC_MAJOR_VERSION): \ + QMAKE_COMPILER_DEFINES += \ + __GNUC__=$$QMAKE_GCC_MAJOR_VERSION \ + __GNUC_MINOR__=$$QMAKE_GCC_MINOR_VERSION \ + __GNUC_PATCHLEVEL__=$$QMAKE_GCC_PATCH_VERSION +!isEmpty(QMAKE_GHS_VERSION): \ + QMAKE_COMPILER_DEFINES += __ghs__ __GHS_VERSION_NUMBER=$$QMAKE_GHS_VERSION + +QMAKE_CFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT +QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT + +clang_cl|intel_icl { + include(../common/msvc-based-version.conf) +} else: msvc { + include(../common/msvc-version.conf) +} + +# +# Determine and cache the default search paths +# + +defineReplace(qtMakeExpand) { + out = "$$1" + for(ever) { + m = $$replace(out, ".*\\$\\(EXPORT_([^)]+)\\).*", \\1) + equals(m, $$out): \ + return($$out) + out = $$replace(out, "\\$\\(EXPORT_$$m\\)", $$eval($$m)) + } +} + isEmpty($${target_prefix}.INCDIRS) { # # Get default include and library paths from compiler @@ -193,96 +288,4 @@ isEmpty($${target_prefix}.INCDIRS) { QMAKE_DEFAULT_LIBDIRS = $$eval($${target_prefix}.LIBDIRS) } -# -# Determine and cache the compiler version -# - -defineReplace(qtVariablesFromMSVC) { - ret = $$system("$$1 -nologo -E $$2 $$system_quote($$PWD/data/macros.cpp) 2>NUL", lines, ec) - !equals(ec, 0): qtCompilerError($$1, $$ret) - return($$ret) -} - -defineReplace(qtVariablesFromGCC) { - ret = $$system("$$1 -E $$system_quote($$PWD/data/macros.cpp) \ - 2>$$QMAKE_SYSTEM_NULL_DEVICE", lines, ec) - !equals(ec, 0): qtCompilerError($$1, $$ret) - return($$ret) -} - -isEmpty($${target_prefix}.COMPILER_MACROS) { - msvc { - clang_cl { - # We need to obtain the cl.exe version first - vars = $$qtVariablesFromMSVC(cl) - for (v, vars) { - isEmpty(v)|contains(v, $${LITERAL_HASH}.*): next() - eval($$v) - } - isEmpty(QMAKE_MSC_FULL_VER): error("Could not determine the Visual Studio version") - - QMAKE_CFLAGS_MSVC_COMPAT = $$replace(QMAKE_MSC_FULL_VER, "(..)(..)(.*)", \ - "-fms-compatibility-version=\\1.\\2.\\3") - cache($${target_prefix}.QMAKE_CFLAGS_MSVC_COMPAT, set stash, QMAKE_CFLAGS_MSVC_COMPAT) - $${target_prefix}.COMPILER_MACROS += QMAKE_CFLAGS_MSVC_COMPAT - vars = $$qtVariablesFromMSVC($$QMAKE_CXX, $$QMAKE_CFLAGS_MSVC_COMPAT) - } else { - vars = $$qtVariablesFromMSVC($$QMAKE_CXX) - } - } else: gcc|ghs { - vars = $$qtVariablesFromGCC($$QMAKE_CXX) - } - for (v, vars) { - !contains(v, "[A-Z_]+ = .*"): next() - # Set both for the outer scope ... - eval($$v) - v ~= s/ .*// - isEmpty($$v): error("Compiler produced empty value for $${v}.") - # ... and save QMAKE_(HOST_)?CXX. in the cache. - cache($${target_prefix}.$$v, set stash, $$v) - $${target_prefix}.COMPILER_MACROS += $$v - } - cache($${target_prefix}.COMPILER_MACROS, set stash) -} else { - # load from the cache - for (i, $${target_prefix}.COMPILER_MACROS): \ - $$i = $$eval($${target_prefix}.$$i) -} - unset(target_prefix) - -# Populate QMAKE_COMPILER_DEFINES and some compatibility variables. -# The $$format_number() calls strip leading zeros to avoid misinterpretation as octal. -QMAKE_COMPILER_DEFINES += __cplusplus=$$QT_COMPILER_STDCXX -!isEmpty(QMAKE_MSC_VER): \ - QMAKE_COMPILER_DEFINES += _MSC_VER=$$QMAKE_MSC_VER _MSC_FULL_VER=$$QMAKE_MSC_FULL_VER -!isEmpty(QMAKE_ICC_VER): \ - QMAKE_COMPILER_DEFINES += __INTEL_COMPILER=$$QMAKE_ICC_VER __INTEL_COMPILER_UPDATE=$$QMAKE_ICC_UPDATE_VER -!isEmpty(QMAKE_APPLE_CC): \ - QMAKE_COMPILER_DEFINES += __APPLE_CC__=$$QMAKE_APPLE_CC -!isEmpty(QMAKE_APPLE_CLANG_MAJOR_VERSION): \ - QMAKE_COMPILER_DEFINES += __clang__ \ - __clang_major__=$$QMAKE_APPLE_CLANG_MAJOR_VERSION \ - __clang_minor__=$$QMAKE_APPLE_CLANG_MINOR_VERSION \ - __clang_patchlevel__=$$QMAKE_APPLE_CLANG_PATCH_VERSION -!isEmpty(QMAKE_CLANG_MAJOR_VERSION): \ - QMAKE_COMPILER_DEFINES += __clang__ \ - __clang_major__=$$QMAKE_CLANG_MAJOR_VERSION \ - __clang_minor__=$$QMAKE_CLANG_MINOR_VERSION \ - __clang_patchlevel__=$$QMAKE_CLANG_PATCH_VERSION -!isEmpty(QMAKE_GCC_MAJOR_VERSION): \ - QMAKE_COMPILER_DEFINES += \ - __GNUC__=$$QMAKE_GCC_MAJOR_VERSION \ - __GNUC_MINOR__=$$QMAKE_GCC_MINOR_VERSION \ - __GNUC_PATCHLEVEL__=$$QMAKE_GCC_PATCH_VERSION -!isEmpty(QMAKE_GHS_VERSION): \ - QMAKE_COMPILER_DEFINES += __ghs__ __GHS_VERSION_NUMBER=$$QMAKE_GHS_VERSION - -QMAKE_CFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT -QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_MSVC_COMPAT - -clang_cl|intel_icl { - include(../common/msvc-based-version.conf) -} else: msvc { - include(../common/msvc-version.conf) -} -- cgit v1.2.3 From 45e4dfb449fb15632e5144cf671e38943fa1455f Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 17 Dec 2018 20:57:18 +0100 Subject: qmake: rewrite msvc/nmake cross-build environment setup rather than reproducing vcvarsall.bat's functionality as hard-wired code in the nmake generator, just invoke the actual script from toolchain.prf. this is much easier, more future proof, and - critically - makes the detected variables available to configure's new library & header search facilities. [ChangeLog][Important Behavior Changes][qmake][WinRT] Cross-builds will now ignore pre-set values of %INCLUDE% and %LIB% when building target executables. If necessary, use configure's -I and -L switches when building Qt, and pass QMAKE_INCDIR and QMAKE_LIBDIR on qmake's command line when building own projects. Change-Id: I36f53e8880d6523f3f6f7a44d40d87d04bd06854 Reviewed-by: Thomas Miller Reviewed-by: Oliver Wolff --- mkspecs/features/data/dumpvcvars.bat | 44 ++++++++ mkspecs/features/toolchain.prf | 146 ++++++++++++++++++++++-- mkspecs/winrt-arm-msvc2015/qmake.conf | 1 - mkspecs/winrt-arm-msvc2017/qmake.conf | 1 - mkspecs/winrt-x64-msvc2015/qmake.conf | 1 - mkspecs/winrt-x64-msvc2017/qmake.conf | 1 - mkspecs/winrt-x86-msvc2015/qmake.conf | 1 - mkspecs/winrt-x86-msvc2017/qmake.conf | 1 - qmake/generators/win32/msvc_nmake.cpp | 201 ---------------------------------- 9 files changed, 181 insertions(+), 216 deletions(-) create mode 100644 mkspecs/features/data/dumpvcvars.bat diff --git a/mkspecs/features/data/dumpvcvars.bat b/mkspecs/features/data/dumpvcvars.bat new file mode 100644 index 0000000000..4721da2e39 --- /dev/null +++ b/mkspecs/features/data/dumpvcvars.bat @@ -0,0 +1,44 @@ +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: +:: +:: Copyright (C) 2018 The Qt Company Ltd. +:: Contact: https://www.qt.io/licensing/ +:: +:: This file is part of the tools applications of the Qt Toolkit. +:: +:: $QT_BEGIN_LICENSE:GPL-EXCEPT$ +:: 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 General Public License Usage +:: Alternatively, this file may be used under the terms of the GNU +:: General Public License version 3 as published by the Free Software +:: Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +:: 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-3.0.html. +:: +:: $QT_END_LICENSE$ +:: +::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + +@echo off + +REM We clear INCLUDE and LIB, because we want to obtain pristine values. +REM PATH cannot be cleared, because then the script does not even run, +REM and it would be counterproductive anyway (see toolchain.prf). +set INCLUDE= +set LIB= + +call %* || exit 1 +REM VS2015 does not set errorlevel in case of failure. +if "%INCLUDE%" == "" exit 1 + +echo =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+= +echo %INCLUDE% +echo %LIB% +echo %PATH% diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf index 734a7fbf86..2a7cbabc54 100644 --- a/mkspecs/features/toolchain.prf +++ b/mkspecs/features/toolchain.prf @@ -1,3 +1,13 @@ +defineTest(qtToolchainError) { + msg = \ + $$1 \ + "===================" \ + $$2 \ + "===================" \ + $$3 + error($$join(msg, $$escape_expand(\\n))) +} + defineTest(qtCompilerError) { !cross_compile: \ what = @@ -5,13 +15,8 @@ defineTest(qtCompilerError) { what = " host" else: \ what = " target" - msg = \ - "Cannot run$$what compiler '$$1'. Output:" \ - "===================" \ - $$2 \ - "===================" \ - "Maybe you forgot to setup the environment?" - error($$join(msg, $$escape_expand(\\n))) + qtToolchainError("Cannot run$$what compiler '$$1'. Output:", $$2, \ + "Maybe you forgot to setup the environment?") } cross_compile:host_build: \ @@ -125,6 +130,36 @@ defineReplace(qtMakeExpand) { } } +defineReplace(qtSplitPathList) { + paths = $$split(1, $$QMAKE_DIRLIST_SEP) + ret = + for (p, paths): \ + ret += $$clean_path($$p) + return($$ret) +} + +defineReplace(qtNmakePathList) { + paths = + for (p, 1): \ + paths += $$shell_path($$p) + paths ~= s,$${LITERAL_HASH},^$${LITERAL_HASH},g + paths ~= s,\\$,\$\$,g + return($$join(paths, $$QMAKE_DIRLIST_SEP)) +} + +msvc { + arch = $$lower($$VCPROJ_ARCH) + equals(arch, x64): \ # may be "win32" or undefined + arch = amd64 + else: !equals(arch, arm):!equals(arch, arm64): \ # may be "win32" or undefined + arch = x86 + # Consider only WinRT and ARM64 desktop builds to be cross-builds - + # the host is assumed to be Intel and capable of running the target + # executables (so building for x64 on x86 will break). + winrt|equals(arch, arm64): \ + CONFIG += msvc_cross +} + isEmpty($${target_prefix}.INCDIRS) { # # Get default include and library paths from compiler @@ -264,9 +299,89 @@ isEmpty($${target_prefix}.INCDIRS) { } } } + } else: msvc_cross { + # Use a batch file, because %VAR% in the system() call expands to + # the pre-script-call value, and !VAR! cannot be enabled outside + # a batch file without invoking another shell instance. + cmd = $$system_quote($$system_path($$PWD/data/dumpvcvars.bat)) + + hostArch = $$QMAKE_HOST.arch + equals(hostArch, x86_64): \ + hostArch = amd64 + !equals(arch, $$hostArch): \ + arch = $${hostArch}_$$arch + + isEmpty(MSVC_VER): \ + error("Mkspec does not specify MSVC_VER. Cannot continue.") + versionAtLeast(MSVC_VER, 15.0) { + dir = $$(VSINSTALLDIR) + isEmpty(dir): \ + dir = $$read_registry(HKLM, \ + "Software\\Microsoft\\VisualStudio\\SxS\\VS7\\$$MSVC_VER", 32) + isEmpty(dir): \ + error("Failed to find the Visual Studio installation directory.") + cmd += $$system_quote($$dir\\VC\\Auxiliary\\Build\\vcvarsall.bat) $$arch + } else { + dir = $$(VCINSTALLDIR) + isEmpty(dir): \ + dir = $$read_registry(HKLM, \ + "Software\\Microsoft\\VisualStudio\\$$MSVC_VER\\Setup\\VC\\ProductDir", 32) + isEmpty(dir): \ + error("Failed to find the Visual C installation directory.") + cmd += $$system_quote($$dir\\vcvarsall.bat) $$arch + } + winrt: cmd += store + + isEmpty(WINSDK_VER): \ + error("Mkspec does not specify WINSDK_VER. Cannot continue.") + # We prefer the environment variable, because that may work around + # a broken registry entry after uninstalling a newer SDK. + # However, we do that only if the major+minor SDK version matches + # the one requested by the mkspec, as we might be building for a + # newer target than the host. + winsdk_ver = $$(WindowsSDKVersion) + !isEmpty(winsdk_ver) { + winsdk_ver ~= s,\\\\$,, # Work around SDK breakage. + !equals(WINSDK_VER, $$replace(winsdk_ver, ^(\\d+\\.\\d+).*$, \\1)): \ + winsdk_ver = + } + !isEmpty(winsdk_ver) { + cmd += $$winsdk_ver + } else { + winsdk_ver = $$read_registry(HKLM, \ + "Software\\Microsoft\\Microsoft SDKs\\Windows\\v$$WINSDK_VER\\ProductVersion", 32) + isEmpty(winsdk_ver): \ + error("Windows SDK $$WINSDK_VER requested by mkspec is not installed. Cannot continue.") + cmd += $${winsdk_ver}.0 + } + + output = $$system("$$cmd 2>&1", lines, ec) + !equals(ec, 0): \ + qtToolchainError("SDK setup script failed. Output:", $$output, \ + "Command was: $$cmd") + lines = $$output + for(ever) { + isEmpty(lines): \ + break() + line = $$take_first(lines) + equals(line, "=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+="): \ + break() + } + !count(lines, 3): \ + qtToolchainError("SDK setup script returned unexpected output:", $$output, \ + "Command was: $$cmd") + + # These contain only paths for the target. + QMAKE_DEFAULT_INCDIRS = $$qtSplitPathList($$member(lines, 0)) + QMAKE_DEFAULT_LIBDIRS = $$qtSplitPathList($$member(lines, 1)) + # PATH is inherently for the host, and paths that are not shadowed + # by vcvarsall.bat are assumed to contain only tools that work for + # both host and target builds. + QMAKE_DEFAULT_PATH = $$qtSplitPathList($$member(lines, 2)) + # We de-duplicate, because the script just prepends to the paths for + # the host, some of which are identical to the ones for the target. + QMAKE_DEFAULT_PATH = $$unique(QMAKE_DEFAULT_PATH) } else: msvc { - # This doesn't differentiate between host and target, - # but neither do the compilers. LIB = $$getenv("LIB") QMAKE_DEFAULT_LIBDIRS = $$split(LIB, $$QMAKE_DIRLIST_SEP) INCLUDE = $$getenv("INCLUDE") @@ -283,9 +398,22 @@ isEmpty($${target_prefix}.INCDIRS) { cache($${target_prefix}.INCDIRS, set stash, QMAKE_DEFAULT_INCDIRS) !isEmpty(QMAKE_DEFAULT_LIBDIRS): \ cache($${target_prefix}.LIBDIRS, set stash, QMAKE_DEFAULT_LIBDIRS) + !isEmpty(QMAKE_DEFAULT_PATH): \ + cache($${target_prefix}.PATH, set stash, QMAKE_DEFAULT_PATH) } else { QMAKE_DEFAULT_INCDIRS = $$eval($${target_prefix}.INCDIRS) QMAKE_DEFAULT_LIBDIRS = $$eval($${target_prefix}.LIBDIRS) + QMAKE_DEFAULT_PATH = $$eval($${target_prefix}.PATH) +} + +msvc_cross { + qmake_inc_exp.name = INCLUDE + qmake_inc_exp.value = $$qtNmakePathList($$QMAKE_DEFAULT_INCDIRS) + qmake_lib_exp.name = LIB + qmake_lib_exp.value = $$qtNmakePathList($$QMAKE_DEFAULT_LIBDIRS) + qmake_path_exp.name = PATH + qmake_path_exp.value = $$qtNmakePathList($$QMAKE_DEFAULT_PATH) + QMAKE_EXPORTED_VARIABLES += qmake_inc_exp qmake_lib_exp qmake_path_exp } unset(target_prefix) diff --git a/mkspecs/winrt-arm-msvc2015/qmake.conf b/mkspecs/winrt-arm-msvc2015/qmake.conf index 8bca6f4af8..bc113d4954 100644 --- a/mkspecs/winrt-arm-msvc2015/qmake.conf +++ b/mkspecs/winrt-arm-msvc2015/qmake.conf @@ -15,6 +15,5 @@ QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib One VCPROJ_ARCH = ARM WINSDK_VER = 10.0 -WINTARGET_VER = winv10.0 WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in WINRT_MANIFEST.architecture = arm diff --git a/mkspecs/winrt-arm-msvc2017/qmake.conf b/mkspecs/winrt-arm-msvc2017/qmake.conf index bf571d620c..1160d5766d 100644 --- a/mkspecs/winrt-arm-msvc2017/qmake.conf +++ b/mkspecs/winrt-arm-msvc2017/qmake.conf @@ -15,6 +15,5 @@ QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib One VCPROJ_ARCH = ARM WINSDK_VER = 10.0 -WINTARGET_VER = winv10.0 WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in WINRT_MANIFEST.architecture = arm diff --git a/mkspecs/winrt-x64-msvc2015/qmake.conf b/mkspecs/winrt-x64-msvc2015/qmake.conf index d503399e3c..d1d1eb6513 100644 --- a/mkspecs/winrt-x64-msvc2015/qmake.conf +++ b/mkspecs/winrt-x64-msvc2015/qmake.conf @@ -15,6 +15,5 @@ QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib One VCPROJ_ARCH = x64 WINSDK_VER = 10.0 -WINTARGET_VER = winv10.0 WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in WINRT_MANIFEST.architecture = x64 diff --git a/mkspecs/winrt-x64-msvc2017/qmake.conf b/mkspecs/winrt-x64-msvc2017/qmake.conf index cb2209fa23..dce896bd47 100644 --- a/mkspecs/winrt-x64-msvc2017/qmake.conf +++ b/mkspecs/winrt-x64-msvc2017/qmake.conf @@ -15,6 +15,5 @@ QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib One VCPROJ_ARCH = x64 WINSDK_VER = 10.0 -WINTARGET_VER = winv10.0 WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in WINRT_MANIFEST.architecture = x64 diff --git a/mkspecs/winrt-x86-msvc2015/qmake.conf b/mkspecs/winrt-x86-msvc2015/qmake.conf index 37ce0e5525..06f059b600 100644 --- a/mkspecs/winrt-x86-msvc2015/qmake.conf +++ b/mkspecs/winrt-x86-msvc2015/qmake.conf @@ -14,6 +14,5 @@ QMAKE_LFLAGS += /SAFESEH /MACHINE:X86 /NODEFAULTLIB:kernel32.lib QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib VCPROJ_ARCH = Win32 WINSDK_VER = 10.0 -WINTARGET_VER = winv10.0 WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in WINRT_MANIFEST.architecture = x86 diff --git a/mkspecs/winrt-x86-msvc2017/qmake.conf b/mkspecs/winrt-x86-msvc2017/qmake.conf index 3c9506bbad..94fb68f6c0 100644 --- a/mkspecs/winrt-x86-msvc2017/qmake.conf +++ b/mkspecs/winrt-x86-msvc2017/qmake.conf @@ -14,6 +14,5 @@ QMAKE_LFLAGS += /SAFESEH /MACHINE:X86 /NODEFAULTLIB:kernel32.lib QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib VCPROJ_ARCH = Win32 WINSDK_VER = 10.0 -WINTARGET_VER = winv10.0 WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in WINRT_MANIFEST.architecture = x86 diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp index 548d2e8575..aa3d389b67 100644 --- a/qmake/generators/win32/msvc_nmake.cpp +++ b/qmake/generators/win32/msvc_nmake.cpp @@ -34,23 +34,10 @@ #include #include -#include - #include QT_BEGIN_NAMESPACE -static QString nmakePathList(const QStringList &list) -{ - QStringList pathList; - pathList.reserve(list.size()); - for (const QString &path : list) - pathList.append(QDir::cleanPath(path)); - - return QDir::toNativeSeparators(pathList.join(QLatin1Char(';'))) - .replace('#', QLatin1String("^#")).replace('$', QLatin1String("$$")); -} - NmakeMakefileGenerator::NmakeMakefileGenerator() : usePCH(false), usePCHC(false) { @@ -70,194 +57,6 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t) if(Option::mkfile::do_stub_makefile) return MakefileGenerator::writeStubMakefile(t); #endif - if (!project->isHostBuild()) { - const QString msvcVer = project->first("MSVC_VER").toQString(); - if (msvcVer.isEmpty()) { - fprintf(stderr, "Mkspec does not specify MSVC_VER. Cannot continue.\n"); - return false; - } - - bool winrtBuild = false; - bool crossPlatformDesktopBuild = false; - QString arch = project->first("VCPROJ_ARCH").toQString().toLower(); - if (project->isActiveConfig(QStringLiteral("winrt"))) { - winrtBuild = true; - - // Only add explicit support for arm64 cross-platform desktop builds. - } else if ((arch == QLatin1String("arm64")) && (msvcVer == QStringLiteral("15.0"))) { - crossPlatformDesktopBuild = true; - } - - if (winrtBuild || crossPlatformDesktopBuild) { - QString compiler; - QString compilerArch; - const ProStringList hostArch = project->values("QMAKE_TARGET.arch"); - if (msvcVer == QStringLiteral("15.0")) { - if (hostArch.contains("x86_64")) - compiler = QStringLiteral("HostX64/"); - else - compiler = QStringLiteral("HostX86/"); - if (arch == QLatin1String("arm")) { - compiler += QStringLiteral("arm"); - compilerArch = QStringLiteral("arm"); - } else if (arch == QLatin1String("x64")) { - compiler += QStringLiteral("x64"); - compilerArch = QStringLiteral("amd64"); - } else if (arch == QLatin1String("arm64")) { - compiler += QStringLiteral("arm64"); - compilerArch = QStringLiteral("arm64"); - } else { - arch = QStringLiteral("x86"); - compiler += QStringLiteral("x86"); - } - } else { - if (arch == QLatin1String("arm")) { - compiler = QStringLiteral("x86_arm"); - compilerArch = QStringLiteral("arm"); - } else if (arch == QLatin1String("x64")) { - const ProStringList hostArch = project->values("QMAKE_TARGET.arch"); - if (hostArch.contains("x86_64")) - compiler = QStringLiteral("amd64"); - else - compiler = QStringLiteral("x86_amd64"); - compilerArch = QStringLiteral("amd64"); - } else { - arch = QStringLiteral("x86"); - } - } - - const QString winsdkVer = project->first("WINSDK_VER").toQString(); - if (winsdkVer.isEmpty()) { - fprintf(stderr, "Mkspec does not specify WINSDK_VER. Cannot continue.\n"); - return false; - } - const QString targetVer = project->first("WINTARGET_VER").toQString(); - if (targetVer.isEmpty() && winrtBuild) { - fprintf(stderr, "Mkspec does not specify WINTARGET_VER. Cannot continue.\n"); - return false; - } - -#ifdef Q_OS_WIN - QString regKey; - if (msvcVer == QStringLiteral("15.0")) - regKey = QStringLiteral("Software\\Microsoft\\VisualStudio\\SxS\\VS7\\") + msvcVer; - else - regKey = QStringLiteral("Software\\Microsoft\\VisualStudio\\") + msvcVer + ("\\Setup\\VC\\ProductDir"); - const QString vcInstallDir = qt_readRegistryKey(HKEY_LOCAL_MACHINE, regKey, KEY_WOW64_32KEY); - if (vcInstallDir.isEmpty()) { - fprintf(stderr, "Failed to find the Visual Studio installation directory.\n"); - return false; - } - - const QString windowsPath = "Software\\Microsoft\\Microsoft SDKs\\Windows\\v"; - - regKey = windowsPath + winsdkVer + QStringLiteral("\\InstallationFolder"); - const QString kitDir = qt_readRegistryKey(HKEY_LOCAL_MACHINE, regKey, KEY_WOW64_32KEY); - if (kitDir.isEmpty()) { - fprintf(stderr, "Failed to find the Windows Kit installation directory.\n"); - return false; - } -#else - const QString vcInstallDir = "/fake/vc_install_dir"; - const QString kitDir = "/fake/sdk_install_dir"; -#endif // Q_OS_WIN - QStringList incDirs; - QStringList libDirs; - QStringList binDirs; - if (msvcVer == QStringLiteral("15.0")) { - const QString toolsInstallDir = qgetenv("VCToolsInstallDir"); - if (toolsInstallDir.isEmpty()) { - fprintf(stderr, "Failed to access tools installation dir.\n"); - return false; - } - - binDirs << toolsInstallDir + QStringLiteral("bin/") + compiler; - if (arch == QStringLiteral("x64")) - binDirs << toolsInstallDir + QStringLiteral("bin/HostX86/X86"); - binDirs << kitDir + QStringLiteral("bin/x86"); - binDirs << vcInstallDir + QStringLiteral("Common7/Tools"); - binDirs << vcInstallDir + QStringLiteral("Common7/ide"); - binDirs << vcInstallDir + QStringLiteral("MSBuild/15.0/bin"); - - incDirs << toolsInstallDir + QStringLiteral("include"); - incDirs << vcInstallDir + QStringLiteral("VC/Auxiliary/VS/include"); - - const QString crtVersion = qgetenv("UCRTVersion"); - if (crtVersion.isEmpty()) { - fprintf(stderr, "Failed to access CRT version.\n"); - return false; - } - const QString crtInclude = kitDir + QStringLiteral("Include/") + crtVersion; - const QString crtLib = kitDir + QStringLiteral("Lib/") + crtVersion; - incDirs << crtInclude + QStringLiteral("/ucrt"); - incDirs << crtInclude + QStringLiteral("/um"); - incDirs << crtInclude + QStringLiteral("/shared"); - incDirs << crtInclude + QStringLiteral("/winrt"); - - if (winrtBuild) { - libDirs << toolsInstallDir + QStringLiteral("lib/") + arch + QStringLiteral("/store"); - } else { - // Desktop projects may require the atl headers and libs. - incDirs << toolsInstallDir + QStringLiteral("atlmfc/include"); - libDirs << toolsInstallDir + QStringLiteral("atlmfc/lib/") + compilerArch; - libDirs << toolsInstallDir + QStringLiteral("lib/") + arch; - } - - libDirs << vcInstallDir + QStringLiteral("VC/Auxiliary/VS/lib/") + arch; - - libDirs << crtLib + QStringLiteral("/ucrt/") + arch; - libDirs << crtLib + QStringLiteral("/um/") + arch; - } else if (msvcVer == QStringLiteral("14.0")) { - binDirs << vcInstallDir + QStringLiteral("bin/") + compiler; - binDirs << vcInstallDir + QStringLiteral("bin/"); // Maybe remove for x86 again? - binDirs << kitDir + QStringLiteral("bin/") + (arch == QStringLiteral("arm") ? QStringLiteral("x86") : arch); - binDirs << vcInstallDir + QStringLiteral("../Common7/Tools/bin"); - binDirs << vcInstallDir + QStringLiteral("../Common7/Tools"); - binDirs << vcInstallDir + QStringLiteral("../Common7/ide"); - binDirs << kitDir + QStringLiteral("Windows Performance Toolkit/"); - - incDirs << vcInstallDir + QStringLiteral("include"); - incDirs << vcInstallDir + QStringLiteral("atlmfc/include"); - - const QString crtVersion = qgetenv("UCRTVersion"); - if (crtVersion.isEmpty()) { - fprintf(stderr, "Failed to access CRT version.\n"); - return false; - } - const QString crtInclude = kitDir + QStringLiteral("Include/") + crtVersion; - const QString crtLib = kitDir + QStringLiteral("Lib/") + crtVersion; - incDirs << crtInclude + QStringLiteral("/ucrt"); - incDirs << crtInclude + QStringLiteral("/um"); - incDirs << crtInclude + QStringLiteral("/shared"); - incDirs << crtInclude + QStringLiteral("/winrt"); - - libDirs << vcInstallDir + QStringLiteral("lib/store/") + compilerArch; - libDirs << vcInstallDir + QStringLiteral("atlmfc/lib") + compilerArch; - - libDirs << crtLib + QStringLiteral("/ucrt/") + arch; - libDirs << crtLib + QStringLiteral("/um/") + arch; - } else { - incDirs << vcInstallDir + QStringLiteral("/include"); - libDirs << vcInstallDir + QStringLiteral("/lib/store/") + compilerArch - << vcInstallDir + QStringLiteral("/lib/") + compilerArch; - binDirs << vcInstallDir + QStringLiteral("/bin/") + compiler - << vcInstallDir + QStringLiteral("/../Common7/IDE"); - libDirs << kitDir + QStringLiteral("/Lib/") + targetVer + ("/um/") + arch; - incDirs << kitDir + QStringLiteral("/include/um") - << kitDir + QStringLiteral("/include/shared") - << kitDir + QStringLiteral("/include/winrt"); - } - - binDirs << vcInstallDir + QStringLiteral("/bin"); - - // Inherit PATH - binDirs << QString::fromLocal8Bit(qgetenv("PATH")).split(QLatin1Char(';')); - - t << "\nINCLUDE = " << nmakePathList(incDirs); - t << "\nLIB = " << nmakePathList(libDirs); - t << "\nPATH = " << nmakePathList(binDirs) << '\n'; - } - } writeNmakeParts(t); return MakefileGenerator::writeMakefile(t); } -- 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 ++++++ tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp | 11 +++++++++++ 2 files changed, 17 insertions(+) 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); } diff --git a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp index 5d9b5ca95c..e6fac74ccc 100644 --- a/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp +++ b/tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp @@ -123,6 +123,7 @@ private slots: void compareCustomType(); void compareCustomEqualOnlyType(); void customDebugStream(); + void unknownType(); }; struct BaseGenericType @@ -2529,6 +2530,16 @@ void tst_QMetaType::customDebugStream() qDebug() << v1; } +void tst_QMetaType::unknownType() +{ + QMetaType invalid(QMetaType::UnknownType); + QVERIFY(!invalid.create()); + QVERIFY(!invalid.sizeOf()); + QVERIFY(!invalid.metaObject()); + int buffer = 0xBAD; + invalid.construct(&buffer); + QCOMPARE(buffer, 0xBAD); +} // Compile-time test, it should be possible to register function pointer types class Undefined; -- 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 --- config_help.txt | 2 +- src/gui/configure.json | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/config_help.txt b/config_help.txt index 7b5da3fbeb..fb37cbaed9 100644 --- a/config_help.txt +++ b/config_help.txt @@ -293,7 +293,7 @@ Gui, printing, widget options: -kms ............... Enable backends for KMS [auto] (Linux only) -linuxfb ........... Enable Linux Framebuffer support [auto] (Linux only) -mirclient ......... Enable Mir client support [no] (Linux only) - -xcb ............... Select used xcb-* libraries [system/qt/no] + -xcb ............... Enable X11 support. Select used xcb-* libraries [system/qt/no] (-qt-xcb still uses system version of libxcb itself) Input backends: 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 07685355b5a129dd65b08e39c96df4972924a809 Mon Sep 17 00:00:00 2001 From: Kari Oikarinen Date: Mon, 7 Jan 2019 09:33:46 +0200 Subject: Bump version Change-Id: I2bf8da98a140bdd9848139a96bea736708357a1a Reviewed-by: Jani Heikkinen --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index 5df08093cd..518aa07f06 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -4,4 +4,4 @@ CONFIG += warning_clean QT_SOURCE_TREE = $$PWD QT_BUILD_TREE = $$shadowed($$PWD) -MODULE_VERSION = 5.12.0 +MODULE_VERSION = 5.12.1 -- 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(-) 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(-) 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 --- mkspecs/features/egl.prf | 1 + src/platformsupport/eglconvenience/qt_egl_p.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/egl.prf b/mkspecs/features/egl.prf index 9fa0c9e219..4577785576 100644 --- a/mkspecs/features/egl.prf +++ b/mkspecs/features/egl.prf @@ -2,6 +2,7 @@ INCLUDEPATH += $$QMAKE_INCDIR_EGL LIBS_PRIVATE += $$QMAKE_LIBS_EGL QMAKE_CFLAGS += $$QMAKE_CFLAGS_EGL QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_EGL +DEFINES += $$QMAKE_DEFINES_EGL LIBS += $$QMAKE_LFLAGS_EGL for(p, QMAKE_LIBDIR_EGL) { LIBS_PRIVATE += -L$$p 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