From 2afc8e3ad67989644576f232187003ba0c6b7a4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Fri, 12 Jan 2018 14:16:43 +0100 Subject: [PATCH 01/17] Add bearer plugin removal notice to changelog Task-number: QTBUG-40332 Change-Id: Ie975ad86a235ccfff0c3f72bb108b6fa9a89ad13 Reviewed-by: Timur Pocheptsov --- dist/changes-5.9.4 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dist/changes-5.9.4 b/dist/changes-5.9.4 index 0bb768424fa..f0cc6007c22 100644 --- a/dist/changes-5.9.4 +++ b/dist/changes-5.9.4 @@ -65,6 +65,12 @@ QtCore QtNetwork --------- + - Bearer Management: + * [QTBUG-40332] The nativewifi (Windows) bearer plugin was determined + to be causing network interference in the form of system-wide higher + latency and has been disabled. The CoreWlan (macOS) plugin has also + been disabled. + - QUdpSocket: * [QTBUG-64718] Fixed a regression from Qt 5.9.3 caused by an apparent Win32 API quirk we triggered when using readDatagram(), resulting in From 0d9208cecbbd9ed08e4ffb6540729668e3bd7754 Mon Sep 17 00:00:00 2001 From: Gabriel de Dietrich Date: Mon, 15 Jan 2018 12:59:22 -0800 Subject: [PATCH 02/17] QMacStyle: Revert state changes for PE_IndicatorMenuCheckMark MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The changes introduced in 0e810e27a5e5a6c2e244ca439fbdf4f4ccc5b3da turn out to be incompatible with our style sheets styling. We partially revert the style option state check, so that the look for a highlighted PE_IndicatorMenuCheckMark only depends on State_On, as it's expected in QWindowsStyle and QCommonStyle. [ChangeLog][QtWidgets][QMacStyle] PE_IndicatorMenuCheckMark goes back to only depend on State_On for its highlighted look. Change-Id: I20f8e712196b5515bd5528ff6eedcdca9df5856f Task-number: QTBUG-65773 Reviewed-by: Thorbjørn Lund Martsum --- src/widgets/styles/qmacstyle_mac.mm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index f45bf7011f7..e6436f82a64 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -3389,13 +3389,12 @@ AHIG would have (20, 8, 10) here but that makes } break; case PE_IndicatorMenuCheckMark: { - if (!(opt->state & State_On)) - break; QColor pc; - if (opt->state & State_Selected) + if (opt->state & State_On) pc = opt->palette.highlightedText().color(); else pc = opt->palette.text().color(); + QCFType checkmarkColor = CGColorCreateGenericRGB(static_cast(pc.redF()), static_cast(pc.greenF()), static_cast(pc.blueF()), @@ -4493,8 +4492,7 @@ static inline QPixmap darkenPixmap(const QPixmap &pixmap) const int xp = contentRect.x() + macItemFrame; checkmarkOpt.rect = QRect(xp, contentRect.y() - checkmarkOpt.fontMetrics.descent(), mw, mh); - checkmarkOpt.state |= State_On; // Always on. Never rendered when off. - checkmarkOpt.state.setFlag(State_Selected, active); + checkmarkOpt.state.setFlag(State_On, active); checkmarkOpt.state.setFlag(State_Enabled, enabled); if (widgetSize == QAquaSizeMini) checkmarkOpt.state |= State_Mini; From 9de2ef6f5ab3b21b4e1679e010ee488193cb41e4 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 16 Jan 2018 08:23:55 +0100 Subject: [PATCH 03/17] QWidget: Fix a crash when platform window creation fails Add a check on the platform window to QWidgetPrivate::create_sys(). Task-number: QTBUG-65783 Change-Id: I077882e1cf22ef49bb6f578f7460493ef48c9627 Reviewed-by: Richard Moe Gustavsen --- src/widgets/kernel/qwidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index b38565493e1..1fea3836ec5 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1480,7 +1480,8 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO if (q->windowType() != Qt::Desktop || q->testAttribute(Qt::WA_NativeWindow)) { win->create(); // Enable nonclient-area events for QDockWidget and other NonClientArea-mouse event processing. - win->handle()->setFrameStrutEventsEnabled(true); + if (QPlatformWindow *platformWindow = win->handle()) + platformWindow->setFrameStrutEventsEnabled(true); } data.window_flags = win->flags(); From 40e87491886957696486b87dc2dedec2adaf6e1a Mon Sep 17 00:00:00 2001 From: Alexander Shevchenko Date: Wed, 10 Jan 2018 17:51:54 +0200 Subject: [PATCH 04/17] unify windows mkspecs: update definitions mingw-w64 toolchain: - add missing compiler definitions, similar to 'msvc-desktop.conf' toolchain, - describe the reasons of missing compiler definitions, available in 'msvc-desktop.conf' toolchain, - add missing 'QMAKE_CXXFLAGS' and 'QMAKE_CXXFLAGS_WARN_ON' variables, similar to 'msvc-desktop.conf' toolchain. ICC on Windows toolchain: - add 'QMAKE_CFLAGS_OPTIMIZE_FULL' variable, similar to 'gcc-base.conf' toolchain, though left it unused for now, - add missing flags to 'QMAKE_CFLAGS' variable, similar to 'msvc-desktop.conf' toolchain, - update deprecated 'Qwd' flag with 'Qdiag-disable', - use 'QMAKE_CFLAGS_OPTIMIZE_DEBUG' variable instead of '-Od' flag, similar to 'gcc-base.conf' toolchain (ICC implies '-O2' optimization level by default, while MSVC implies '-Od'), - add 'QMAKE_CFLAGS_UTF8_SOURCE' variable, similar to 'msvc-version.conf' toolchain; use a workaround to initialize it, until '-utf-8' flag would be supported by ICC on Windows, - update deprecated '-Qstd=c++1z' flag with '-Qstd=c++17', MSVC toolchain: - remove 'incremental' from MSVC 'CONFIG' variable, since it has relevance only for the Unix generator, - add 'QMAKE_CFLAGS_OPTIMIZE_DEBUG' variable, used in ICC for Windows toolchain, - add empty 'QMAKE_LIBS' variable, similar to 'win32-g++' toolchain, - add 'uuid.lib' library to 'QMAKE_LIBS_GUI' variable, similar to 'win32-g++' toolchain, - add C++14 and C++17 language support flags, though left them disabled for now, similar to 'win32-icc' toolchain. Change-Id: Ideef62d0422674184836faa655bfc5d09a5f612f Reviewed-by: Joerg Bornemann Reviewed-by: Kai Koehne Reviewed-by: Oswald Buddenhagen --- mkspecs/common/msvc-desktop.conf | 6 ++++-- mkspecs/common/msvc-version.conf | 5 +++++ mkspecs/win32-g++/qmake.conf | 9 +++++++-- mkspecs/win32-icc/qmake.conf | 15 +++++++++------ 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/mkspecs/common/msvc-desktop.conf b/mkspecs/common/msvc-desktop.conf index 496ca1179dd..546b9cf3cb8 100644 --- a/mkspecs/common/msvc-desktop.conf +++ b/mkspecs/common/msvc-desktop.conf @@ -15,7 +15,7 @@ MAKEFILE_GENERATOR = MSVC.NET QMAKE_PLATFORM = win32 QMAKE_COMPILER = msvc -CONFIG += incremental flat debug_and_release debug_and_release_target precompile_header autogen_precompile_source embed_manifest_dll embed_manifest_exe +CONFIG += flat debug_and_release debug_and_release_target precompile_header autogen_precompile_source embed_manifest_dll embed_manifest_exe DEFINES += UNICODE _UNICODE WIN32 QMAKE_COMPILER_DEFINES += _WIN32 contains(QMAKE_TARGET.arch, x86_64) { @@ -23,6 +23,7 @@ contains(QMAKE_TARGET.arch, x86_64) { QMAKE_COMPILER_DEFINES += _WIN64 } +QMAKE_CFLAGS_OPTIMIZE_DEBUG = -Od QMAKE_CFLAGS_OPTIMIZE = -O2 QMAKE_CFLAGS_OPTIMIZE_SIZE = -O1 @@ -92,7 +93,8 @@ QMAKE_EXTENSION_SHLIB = dll QMAKE_PREFIX_STATICLIB = QMAKE_EXTENSION_STATICLIB = lib -QMAKE_LIBS_GUI = gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib ws2_32.lib ole32.lib user32.lib advapi32.lib +QMAKE_LIBS = +QMAKE_LIBS_GUI = gdi32.lib comdlg32.lib oleaut32.lib imm32.lib winmm.lib ws2_32.lib ole32.lib uuid.lib user32.lib advapi32.lib QMAKE_LIBS_NETWORK = ws2_32.lib QMAKE_LIBS_OPENGL = glu32.lib opengl32.lib gdi32.lib user32.lib QMAKE_LIBS_OPENGL_ES2 = gdi32.lib user32.lib diff --git a/mkspecs/common/msvc-version.conf b/mkspecs/common/msvc-version.conf index ba74c49f9c7..cfafb06305e 100644 --- a/mkspecs/common/msvc-version.conf +++ b/mkspecs/common/msvc-version.conf @@ -85,6 +85,11 @@ greaterThan(QMAKE_MSC_VER, 1909) { # API is used in direct2d, but also in multimedia, positioning and sensors. # We can try again with a later version of Visual Studio. # QMAKE_CXXFLAGS_STRICTCXX = -permissive- + # MSVC partially supports the following, but '__cplusplus' definition is set + # as for C++98 until MSVC fully conforms with C++14, see + # https://developercommunity.visualstudio.com/content/problem/139261/msvc-incorrectly-defines-cplusplus.html + # QMAKE_CXXFLAGS_CXX14 = -std:c++14 + # QMAKE_CXXFLAGS_CXX1Z = -std:c++latest } greaterThan(QMAKE_MSC_VER, 1910) { diff --git a/mkspecs/win32-g++/qmake.conf b/mkspecs/win32-g++/qmake.conf index a4955e99f30..96c94e7021e 100644 --- a/mkspecs/win32-g++/qmake.conf +++ b/mkspecs/win32-g++/qmake.conf @@ -16,8 +16,11 @@ include(../common/g++-base.conf) MAKEFILE_GENERATOR = MINGW QMAKE_PLATFORM = win32 mingw CONFIG += debug_and_release debug_and_release_target precompile_header -DEFINES += UNICODE _UNICODE -QMAKE_COMPILER_DEFINES += __GNUC__ WIN32 +DEFINES += UNICODE _UNICODE WIN32 +QMAKE_COMPILER_DEFINES += __GNUC__ _WIN32 +# can't add 'DEFINES += WIN64' and 'QMAKE_COMPILER_DEFINES += _WIN64' defines for +# x86_64 platform similar to 'msvc-desktop.conf' toolchain, because, unlike for MSVC, +# 'QMAKE_TARGET.arch' is inherently unavailable. QMAKE_CC = $${CROSS_COMPILE}gcc QMAKE_LEX = flex @@ -30,6 +33,8 @@ QMAKE_CFLAGS_WARN_ON += -Wextra QMAKE_CFLAGS_SSE2 += -mstackrealign QMAKE_CXX = $${CROSS_COMPILE}g++ +QMAKE_CXXFLAGS = $$QMAKE_CFLAGS +QMAKE_CXXFLAGS_WARN_ON = $$QMAKE_CFLAGS_WARN_ON QMAKE_CXXFLAGS_RTTI_ON = -frtti QMAKE_CXXFLAGS_RTTI_OFF = -fno-rtti QMAKE_CXXFLAGS_EXCEPTIONS_ON = -fexceptions -mthreads diff --git a/mkspecs/win32-icc/qmake.conf b/mkspecs/win32-icc/qmake.conf index 4d18b1cc55e..c66d73383a2 100644 --- a/mkspecs/win32-icc/qmake.conf +++ b/mkspecs/win32-icc/qmake.conf @@ -4,7 +4,7 @@ # Written for Intel C++ Compiler on Windows / icl 16.0 or higher # -# Use the Microsoft (R) C/C++ Optimizing Compiler configuration, +# Use the Microsoft C/C++ Optimizing Compiler configuration, # since ICC on Windows pretends to be MSVC include(../common/msvc-desktop.conf) @@ -13,11 +13,14 @@ include(../common/msvc-desktop.conf) QMAKE_COMPILER += intel_icl +QMAKE_CFLAGS_OPTIMIZE_FULL = -O3 + QMAKE_CC = icl -QMAKE_CFLAGS = -nologo -Zm200 /Qprec /Qwd1744,1738,809,3373 -QMAKE_CFLAGS_WARN_ON = -W3 /Qwd673 -QMAKE_CFLAGS_WARN_OFF = -W0 /Qwd673 -QMAKE_CFLAGS_DEBUG = -Od -Zi -MDd +QMAKE_CFLAGS = -nologo -Zc:wchar_t -Qprec -Zm200 -Qdiag-disable:1744,1738,809,3373 +QMAKE_CFLAGS_WARN_ON = -W3 -Qdiag-disable:673 +QMAKE_CFLAGS_WARN_OFF = -W0 -Qdiag-disable:673 +QMAKE_CFLAGS_DEBUG = $$QMAKE_CFLAGS_OPTIMIZE_DEBUG -Zi -MDd +QMAKE_CFLAGS_UTF8_SOURCE = -Qoption,cpp,--unicode_source_kind,UTF-8 QMAKE_CFLAGS_LTCG = -Qipo QMAKE_CFLAGS_DISABLE_LTCG = -Qno-ipo @@ -44,7 +47,7 @@ QMAKE_CXXFLAGS_WARN_OFF = $$QMAKE_CFLAGS_WARN_OFF QMAKE_CXXFLAGS_CXX11 = -Qstd=c++11 # ICC supports the following but Qt won't compile #QMAKE_CXXFLAGS_CXX14 = -Qstd=c++14 -#QMAKE_CXXFLAGS_CXX1Z = -Qstd=c++1z +#QMAKE_CXXFLAGS_CXX1Z = -Qstd=c++17 QMAKE_CXXFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG QMAKE_CXXFLAGS_DISABLE_LTCG = $$QMAKE_CFLAGS_DISABLE_LTCG From 8c023326c79b4fdb7eaa26600b1af622f5bce318 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Thu, 11 Jan 2018 12:26:32 +0100 Subject: [PATCH 05/17] config_help.txt: document that some sanitize combinations are not valid Saves people the trouble of trying it out themselves. When I tried "address" and "thread", I got: cc1plus: error: -fsanitize=address and -fsanitize=kernel-address are incompatible with -fsanitize=thread Change-Id: I48ae817e60d0b71d5349e1dbce8706cc8430c2c4 Reviewed-by: Edward Welbourne Reviewed-by: Oswald Buddenhagen --- config_help.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/config_help.txt b/config_help.txt index 9c424391a91..0bb440b5560 100644 --- a/config_help.txt +++ b/config_help.txt @@ -121,6 +121,9 @@ Build options: -gcov ................ Instrument with the GCov code coverage tool [no] -sanitize {address|thread|memory|undefined} Instrument with the specified compiler sanitizer. + Note that some sanitizers cannot be combined; + for example, -sanitize address cannot be combined with + -sanitize thread. -c++std .... Select C++ standard [c++1z/c++14/c++11] (Not supported with MSVC) From a57585961823cfc4d9a20ffd5dde3520c9229d61 Mon Sep 17 00:00:00 2001 From: Andre Hartmann Date: Wed, 17 Jan 2018 20:56:34 +0100 Subject: [PATCH 06/17] QThreadPool: Add missing semicolon after class in documentation Makes it easier to copy and paste the snippet into a code editor. Change-Id: I27c0a7aa268bd4fd0af885e929f67a28f083dabf Reviewed-by: Thiago Macieira --- .../doc/snippets/code/src_corelib_concurrent_qthreadpool.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/doc/snippets/code/src_corelib_concurrent_qthreadpool.cpp b/src/corelib/doc/snippets/code/src_corelib_concurrent_qthreadpool.cpp index a1372976ae8..ba31972aa12 100644 --- a/src/corelib/doc/snippets/code/src_corelib_concurrent_qthreadpool.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_concurrent_qthreadpool.cpp @@ -55,7 +55,7 @@ class HelloWorldTask : public QRunnable { qDebug() << "Hello world from thread" << QThread::currentThread(); } -} +}; HelloWorldTask *hello = new HelloWorldTask(); // QThreadPool takes ownership and deletes 'hello' automatically From 1aae404a4cf7f92d4135c1b24a3b6efef6c54708 Mon Sep 17 00:00:00 2001 From: Frank Richter Date: Tue, 18 Oct 2016 12:36:23 +0200 Subject: [PATCH 07/17] QProcess/Windows: Include PID in pipe names Although qt_create_pipe() tries again if the pipe name is already in use, it doesn't handle the case when another user has created the pipe with the name (the error is "access denied" in that case). The chance that it happens is small, but it can be entirely eliminated by including a unique part in the pipe name, in this case the PID. [ChangeLog][Windows] Named pipes internally created by QProcess now contain the PID in their name to ensure uniqueness. Change-Id: I079f1b68695c1ddea3eccad241061d11e08b60f4 Reviewed-by: Oswald Buddenhagen Reviewed-by: Thiago Macieira --- src/corelib/io/qprocess_win.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index 05c9d6594c4..fa9efcb1ce5 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -102,7 +102,7 @@ static void qt_create_pipe(Q_PIPE *pipe, bool isInputPipe) // ### The user must make sure to call qsrand() to make the pipe names less predictable. // ### Replace the call to qrand() with a secure version, once we have it in Qt. _snwprintf(pipeName, sizeof(pipeName) / sizeof(pipeName[0]), - L"\\\\.\\pipe\\qt-%X", qrand()); + L"\\\\.\\pipe\\qt-%lX-%X", long(QCoreApplication::applicationPid()), qrand()); DWORD dwOpenMode = FILE_FLAG_OVERLAPPED; DWORD dwOutputBufferSize = 0; From 2b47afadc0fcc9a2617d5c9e8be0ee035762e0b9 Mon Sep 17 00:00:00 2001 From: Frank Richter Date: Wed, 12 Jul 2017 17:15:10 +0200 Subject: [PATCH 08/17] gtk3: Disable native file dialogs on GTK3 < 3.15.5 Showing file dialogs if running on a system that has an older GTK3 version installed results in a crash. Do a version check at runtime and disable native file dialog support if the version is too old. (GTK3 bug: https://bugzilla.gnome.org/show_bug.cgi?id=725164) Change-Id: I77bd23f1298333412bae04f52153e1a224ddf470 Reviewed-by: Oswald Buddenhagen Reviewed-by: J-P Nurmi Reviewed-by: Dmitry Shachnev --- src/plugins/platformthemes/gtk3/qgtk3theme.cpp | 17 ++++++++++++++++- src/plugins/platformthemes/gtk3/qgtk3theme.h | 2 ++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/plugins/platformthemes/gtk3/qgtk3theme.cpp b/src/plugins/platformthemes/gtk3/qgtk3theme.cpp index 6447776f253..077955eb4e2 100644 --- a/src/plugins/platformthemes/gtk3/qgtk3theme.cpp +++ b/src/plugins/platformthemes/gtk3/qgtk3theme.cpp @@ -153,7 +153,7 @@ bool QGtk3Theme::usePlatformNativeDialog(DialogType type) const case ColorDialog: return true; case FileDialog: - return true; + return useNativeFileDialog(); case FontDialog: return true; default: @@ -167,6 +167,8 @@ QPlatformDialogHelper *QGtk3Theme::createPlatformDialogHelper(DialogType type) c case ColorDialog: return new QGtk3ColorDialogHelper; case FileDialog: + if (!useNativeFileDialog()) + return nullptr; return new QGtk3FileDialogHelper; case FontDialog: return new QGtk3FontDialogHelper; @@ -185,4 +187,17 @@ QPlatformMenuItem* QGtk3Theme::createPlatformMenuItem() const return new QGtk3MenuItem; } +bool QGtk3Theme::useNativeFileDialog() +{ + /* Require GTK3 >= 3.15.5 to avoid running into this bug: + * https://bugzilla.gnome.org/show_bug.cgi?id=725164 + * + * While this bug only occurs when using widget-based file dialogs + * (native GTK3 dialogs are fine) we have to disable platform file + * dialogs entirely since we can't avoid creation of a platform + * dialog helper. + */ + return gtk_check_version(3, 15, 5) == 0; +} + QT_END_NAMESPACE diff --git a/src/plugins/platformthemes/gtk3/qgtk3theme.h b/src/plugins/platformthemes/gtk3/qgtk3theme.h index 52036680c65..abc5dbfd175 100644 --- a/src/plugins/platformthemes/gtk3/qgtk3theme.h +++ b/src/plugins/platformthemes/gtk3/qgtk3theme.h @@ -59,6 +59,8 @@ class QGtk3Theme : public QGnomeTheme QPlatformMenuItem* createPlatformMenuItem() const Q_DECL_OVERRIDE; static const char *name; +private: + static bool useNativeFileDialog(); }; QT_END_NAMESPACE From bed6292dde5c9a017a7cac7be6948471949174e8 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Thu, 7 Dec 2017 14:49:44 +0100 Subject: [PATCH 09/17] Win: Document limitation regarding registry types not being preserved QSettings does not preserve the original key type in the registry, it will set the type for the key based on the value that is being set. Therefore we should make it clear that existing key types will be overridden as this can cause some problems with types we do not directly support (such as REG_EXPAND_SZ). Task-number: QTBUG-2894 Change-Id: Ib2f2eed02759591e69fefb98a4a1f3cf897dd5cb Reviewed-by: Oswald Buddenhagen --- src/corelib/io/qsettings.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index d5460238ecb..9b930e7e144 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -2358,6 +2358,11 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, limitations is to store the settings using the IniFormat instead of the NativeFormat. + \li On Windows, when the Windows system registry is used, QSettings + does not preserve the original type of the value. Therefore, + the type of the value might change when a new value is set. For + example, a value with type \c REG_EXPAND_SZ will change to \c REG_SZ. + \li On \macos and iOS, allKeys() will return some extra keys for global settings that apply to all applications. These keys can be read using value() but cannot be changed, only shadowed. From 3149d0fb13bacc20b75ad8ca650c71df9edd8734 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 18 Jan 2018 12:51:21 +0100 Subject: [PATCH 10/17] use correct path separators when invoking testcases on windows Change-Id: Iad541f0d62ffdb2751da6225b9d40229d7d9a03f Reviewed-by: Joerg Bornemann Reviewed-by: Edward Welbourne --- mkspecs/features/testcase.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/testcase.prf b/mkspecs/features/testcase.prf index 3e1537dde0a..8d51c9d028c 100644 --- a/mkspecs/features/testcase.prf +++ b/mkspecs/features/testcase.prf @@ -44,7 +44,7 @@ unix { $${type}.commands += $${TEST_TARGET_DIR}/$(QMAKE_TARGET) } else { # Windows - !isEmpty(TEST_TARGET_DIR): TEST_TARGET_DIR = $${TEST_TARGET_DIR}$${QMAKE_DIR_SEP} + !isEmpty(TEST_TARGET_DIR): TEST_TARGET_DIR = $$shell_path($$TEST_TARGET_DIR)$${QMAKE_DIR_SEP} $${type}.commands += $${TEST_TARGET_DIR}$(TARGET) } From e86f3c018833141776db2d15772ba53995656eac Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 28 Jul 2017 13:25:27 +0200 Subject: [PATCH 11/17] qmake: require a drive in a DOS path for it to be absolute For Q_OS_WIN, a path is only truly absolute if it includes a drive letter; merely starting with a slash is not enough. (We can't support UNC paths, so don't even try: qmake runs various commands in the source directory using CMD.exe, which doesn't support UNC as PWD.) This requires, when resolving a path relative to a root, transcribing the root's drive to such not-quite-absolute paths. Changed QMakeGlobals, $$absolute_path() and $$relative_path() to now use IoUtils::resolvePath() rather than delegating to QDir's absolute path method, since that doesn't correctly recognize the need for a drive letter (and qmake did run into problems with some paths, from splitPathList and a failing test, as a result). Moved existing ioUtils tests for handling of relative / absolute paths out into separate functions and expanded significantly. Fixed some existing tests to use an absolute path where one is needed; added two tests involving driveless (but rooted) paths; and fixed the test init to set a value for QT_HOST_DATA/src property (the lack of which lead to an assertion failure with this fix). Task-number: QTBUG-50839 Change-Id: I2bfc13c1bfbe1ae09997274622ea55cb3de31b43 Reviewed-by: Oswald Buddenhagen --- qmake/library/ioutils.cpp | 23 +++-- qmake/library/qmakebuiltins.cpp | 13 +-- qmake/library/qmakeglobals.cpp | 15 ++-- tests/auto/tools/qmakelib/evaltest.cpp | 46 +++++++--- tests/auto/tools/qmakelib/tst_qmakelib.cpp | 97 ++++++++++++++++++++-- tests/auto/tools/qmakelib/tst_qmakelib.h | 5 ++ 6 files changed, 157 insertions(+), 42 deletions(-) diff --git a/qmake/library/ioutils.cpp b/qmake/library/ioutils.cpp index 684bcb9a371..afd41912fee 100644 --- a/qmake/library/ioutils.cpp +++ b/qmake/library/ioutils.cpp @@ -66,21 +66,22 @@ IoUtils::FileType IoUtils::fileType(const QString &fileName) bool IoUtils::isRelativePath(const QString &path) { - if (path.startsWith(QLatin1Char('/'))) - return false; #ifdef QMAKE_BUILTIN_PRFS if (path.startsWith(QLatin1String(":/"))) return false; #endif #ifdef Q_OS_WIN - if (path.startsWith(QLatin1Char('\\'))) - return false; - // Unlike QFileInfo, this won't accept a relative path with a drive letter. - // Such paths result in a royal mess anyway ... + // Unlike QFileInfo, this considers only paths with both a drive prefix and + // a subsequent (back-)slash absolute: if (path.length() >= 3 && path.at(1) == QLatin1Char(':') && path.at(0).isLetter() - && (path.at(2) == QLatin1Char('/') || path.at(2) == QLatin1Char('\\'))) + && (path.at(2) == QLatin1Char('/') || path.at(2) == QLatin1Char('\\'))) { return false; -#endif + } + // (... unless, of course, they're UNC, which qmake fails on anyway) +#else + if (path.startsWith(QLatin1Char('/'))) + return false; +#endif // Q_OS_WIN return true; } @@ -100,6 +101,12 @@ QString IoUtils::resolvePath(const QString &baseDir, const QString &fileName) return QString(); if (isAbsolutePath(fileName)) return QDir::cleanPath(fileName); +#ifdef Q_OS_WIN // Add drive to otherwise-absolute path: + if (fileName.at(0).unicode() == '/' || fileName.at(0).unicode() == '\\') { + Q_ASSERT(isAbsolutePath(baseDir)); + return QDir::cleanPath(baseDir.left(2) + fileName); + } +#endif // Q_OS_WIN return QDir::cleanPath(baseDir + QLatin1Char('/') + fileName); } diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp index 1b98cbd909a..e4b00a6cb35 100644 --- a/qmake/library/qmakebuiltins.cpp +++ b/qmake/library/qmakebuiltins.cpp @@ -1173,9 +1173,9 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand( if (args.count() > 2) { evalError(fL1S("absolute_path(path[, base]) requires one or two arguments.")); } else { - QString rstr = QDir::cleanPath( - QDir(args.count() > 1 ? args.at(1).toQString(m_tmp2) : currentDirectory()) - .absoluteFilePath(args.at(0).toQString(m_tmp1))); + QString arg = args.at(0).toQString(m_tmp1); + QString baseDir = args.count() > 1 ? args.at(1).toQString(m_tmp2) : currentDirectory(); + QString rstr = arg.isEmpty() ? baseDir : IoUtils::resolvePath(baseDir, arg); ret << (rstr.isSharedWith(m_tmp1) ? args.at(0) : args.count() > 1 && rstr.isSharedWith(m_tmp2) @@ -1187,9 +1187,10 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinExpand( if (args.count() > 2) { evalError(fL1S("relative_path(path[, base]) requires one or two arguments.")); } else { - QDir baseDir(args.count() > 1 ? args.at(1).toQString(m_tmp2) : currentDirectory()); - QString rstr = baseDir.relativeFilePath(baseDir.absoluteFilePath( - args.at(0).toQString(m_tmp1))); + QString arg = args.at(0).toQString(m_tmp1); + QString baseDir = args.count() > 1 ? args.at(1).toQString(m_tmp2) : currentDirectory(); + QString absArg = arg.isEmpty() ? baseDir : IoUtils::resolvePath(baseDir, arg); + QString rstr = QDir(baseDir).relativeFilePath(absArg); ret << (rstr.isSharedWith(m_tmp1) ? args.at(0) : ProString(rstr).setSource(args.at(0))); } break; diff --git a/qmake/library/qmakeglobals.cpp b/qmake/library/qmakeglobals.cpp index b6dc8b20b66..d733d479cf0 100644 --- a/qmake/library/qmakeglobals.cpp +++ b/qmake/library/qmakeglobals.cpp @@ -68,6 +68,7 @@ #endif QT_BEGIN_NAMESPACE +using namespace QMakeInternal; // for IoUtils #define fL1S(s) QString::fromLatin1(s) @@ -96,9 +97,9 @@ QString QMakeGlobals::cleanSpec(QMakeCmdLineParserState &state, const QString &s { QString ret = QDir::cleanPath(spec); if (ret.contains(QLatin1Char('/'))) { - QString absRet = QDir(state.pwd).absoluteFilePath(ret); + QString absRet = IoUtils::resolvePath(state.pwd, ret); if (QFile::exists(absRet)) - ret = QDir::cleanPath(absRet); + ret = absRet; } return ret; } @@ -126,10 +127,10 @@ QMakeGlobals::ArgumentReturn QMakeGlobals::addCommandLineArguments( user_template_prefix = arg; break; case ArgCache: - cachefile = args[*pos] = QDir::cleanPath(QDir(state.pwd).absoluteFilePath(arg)); + cachefile = args[*pos] = IoUtils::resolvePath(state.pwd, arg); break; case ArgQtConf: - qtconf = args[*pos] = QDir::cleanPath(QDir(state.pwd).absoluteFilePath(arg)); + qtconf = args[*pos] = IoUtils::resolvePath(state.pwd, arg); break; default: if (arg.startsWith(QLatin1Char('-'))) { @@ -259,11 +260,11 @@ QStringList QMakeGlobals::splitPathList(const QString &val) const { QStringList ret; if (!val.isEmpty()) { - QDir bdir; + QString cwd(QDir::currentPath()); const QStringList vals = val.split(dirlist_sep); ret.reserve(vals.length()); for (const QString &it : vals) - ret << QDir::cleanPath(bdir.absoluteFilePath(it)); + ret << IoUtils::resolvePath(cwd, it); } return ret; } @@ -318,7 +319,7 @@ bool QMakeGlobals::initProperties() return false; data = proc.readAll(); #else - if (FILE *proc = QT_POPEN(QString(QMakeInternal::IoUtils::shellQuote(qmake_abslocation) + if (FILE *proc = QT_POPEN(QString(IoUtils::shellQuote(qmake_abslocation) + QLatin1String(" -query")).toLocal8Bit(), QT_POPEN_READ)) { char buff[1024]; while (!feof(proc)) diff --git a/tests/auto/tools/qmakelib/evaltest.cpp b/tests/auto/tools/qmakelib/evaltest.cpp index 03fd4753fdc..cf69cc40267 100644 --- a/tests/auto/tools/qmakelib/evaltest.cpp +++ b/tests/auto/tools/qmakelib/evaltest.cpp @@ -34,6 +34,12 @@ #include #include +#ifdef Q_OS_WIN +# define EVAL_DRIVE "R:" +#else +# define EVAL_DRIVE +#endif + void tst_qmakelib::addAssignments() { QTest::newRow("assignment") @@ -1599,20 +1605,28 @@ void tst_qmakelib::addReplaceFunctions(const QString &qindir) << true; QTest::newRow("$$absolute_path(): file & path") - << "VAR = $$absolute_path(dir/file.ext, /root/sub)" - << "VAR = /root/sub/dir/file.ext" + << "VAR = $$absolute_path(dir/file.ext, " EVAL_DRIVE "/root/sub)" + << "VAR = " EVAL_DRIVE "/root/sub/dir/file.ext" << "" << true; +#ifdef Q_OS_WIN + QTest::newRow("$$absolute_path(): driveless file & absolute path") + << "VAR = $$absolute_path(/root/sub/dir/file.ext, " EVAL_DRIVE "/other)" + << "VAR = " EVAL_DRIVE "/root/sub/dir/file.ext" + << "" + << true; +#endif + QTest::newRow("$$absolute_path(): absolute file & path") - << "VAR = $$absolute_path(/root/sub/dir/file.ext, /other)" - << "VAR = /root/sub/dir/file.ext" + << "VAR = $$absolute_path(" EVAL_DRIVE "/root/sub/dir/file.ext, " EVAL_DRIVE "/other)" + << "VAR = " EVAL_DRIVE "/root/sub/dir/file.ext" << "" << true; QTest::newRow("$$absolute_path(): empty file & path") - << "VAR = $$absolute_path('', /root/sub)" - << "VAR = /root/sub" + << "VAR = $$absolute_path('', " EVAL_DRIVE "/root/sub)" + << "VAR = " EVAL_DRIVE "/root/sub" << "" << true; @@ -1634,14 +1648,22 @@ void tst_qmakelib::addReplaceFunctions(const QString &qindir) << "" << true; +#ifdef Q_OS_WIN + QTest::newRow("$$relative_path(): driveless file & absolute path") + << "VAR = $$relative_path(/root/sub/dir/file.ext, " EVAL_DRIVE "/root/sub)" + << "VAR = dir/file.ext" + << "" + << true; +#endif + QTest::newRow("$$relative_path(): absolute file & path") - << "VAR = $$relative_path(/root/sub/dir/file.ext, /root/sub)" + << "VAR = $$relative_path(" EVAL_DRIVE "/root/sub/dir/file.ext, " EVAL_DRIVE "/root/sub)" << "VAR = dir/file.ext" << "" << true; QTest::newRow("$$relative_path(): empty file & path") - << "VAR = $$relative_path('', /root/sub)" + << "VAR = $$relative_path('', " EVAL_DRIVE "/root/sub)" << "VAR = ." << "" << true; @@ -2555,20 +2577,20 @@ void tst_qmakelib::addTestFunctions(const QString &qindir) << true; QTest::newRow("touch(): missing target") - << "touch(/does/not/exist, files/other.txt): OK = 1" + << "touch(" EVAL_DRIVE "/does/not/exist, files/other.txt): OK = 1" << "OK = UNDEF" #ifdef Q_OS_WIN - << "##:1: Cannot open /does/not/exist: The system cannot find the path specified." + << "##:1: Cannot open " EVAL_DRIVE "/does/not/exist: The system cannot find the path specified." #else << "##:1: Cannot touch /does/not/exist: No such file or directory." #endif << true; QTest::newRow("touch(): missing reference") - << "touch(" + wpath + ", /does/not/exist): OK = 1" + << "touch(" + wpath + ", " EVAL_DRIVE "/does/not/exist): OK = 1" << "OK = UNDEF" #ifdef Q_OS_WIN - << "##:1: Cannot open reference file /does/not/exist: The system cannot find the path specified." + << "##:1: Cannot open reference file " EVAL_DRIVE "/does/not/exist: The system cannot find the path specified." #else << "##:1: Cannot stat() reference file /does/not/exist: No such file or directory." #endif diff --git a/tests/auto/tools/qmakelib/tst_qmakelib.cpp b/tests/auto/tools/qmakelib/tst_qmakelib.cpp index b1250f4f1ad..4a4b20fe50d 100644 --- a/tests/auto/tools/qmakelib/tst_qmakelib.cpp +++ b/tests/auto/tools/qmakelib/tst_qmakelib.cpp @@ -42,6 +42,7 @@ void tst_qmakelib::initTestCase() #endif m_prop.insert(ProKey("P1"), ProString("prop val")); m_prop.insert(ProKey("QT_HOST_DATA/get"), ProString(m_indir)); + m_prop.insert(ProKey("QT_HOST_DATA/src"), ProString(m_indir)); QVERIFY(!m_indir.isEmpty()); QVERIFY(QDir(m_outdir).removeRecursively()); @@ -224,21 +225,99 @@ void tst_qmakelib::pathUtils() QVERIFY(IoUtils::isRelativePath(fn0)); QString fn1 = "/a/unix/file/path"; - QVERIFY(IoUtils::isAbsolutePath(fn1)); QCOMPARE(IoUtils::pathName(fn1).toString(), QStringLiteral("/a/unix/file/")); QCOMPARE(IoUtils::fileName(fn1).toString(), QStringLiteral("path")); +} -#ifdef Q_OS_WIN - QString fn0a = "c:file/path"; - QVERIFY(IoUtils::isRelativePath(fn0a)); +void tst_qmakelib::ioUtilRelativity_data() +{ + QTest::addColumn("path"); + QTest::addColumn("relative"); - QString fn1a = "c:\\file\\path"; - QVERIFY(IoUtils::isAbsolutePath(fn1a)); + static const struct { + const char *name; + const char *path; + bool relative; + } rows[] = { + { "resource", ":/resource", +#ifdef QMAKE_BUILTIN_PRFS + false +#else + true #endif + }, +#ifdef Q_OS_WIN // all the complications: + // (except UNC: unsupported) + { "drive-abs", "c:/path/to/file", false }, + { "drive-abs-bs", "c:\\path\\to\\file", false }, + { "drive-path", "c:path/to/file.txt", true }, + { "drive-path-bs", "c:path\\to\\file.txt", true }, + { "rooted", "/Users/qt/bin/true", true }, + { "rooted-bs", "\\Users\\qt\\bin\\true", true }, + { "drive-rel", "c:file.txt", true }, + { "subdir-bs", "path\\to\\file", true }, +#else + { "rooted", "/usr/bin/false", false }, +#endif // Q_OS_WIN + { "subdir", "path/to/file", true }, + { "simple", "file.name", true }, + { "empty", "", true } + }; + + for (unsigned int i = sizeof(rows) / sizeof(rows[0]); i-- > 0; ) + QTest::newRow(rows[i].name) << QString::fromLatin1(rows[i].path) + << rows[i].relative; +} + +void tst_qmakelib::ioUtilRelativity() +{ + QFETCH(QString, path); + QFETCH(bool, relative); + + QCOMPARE(IoUtils::isRelativePath(path), relative); +} + +void tst_qmakelib::ioUtilResolve_data() +{ + QTest::addColumn("base"); + QTest::addColumn("path"); + QTest::addColumn("expect"); + + static const struct { + const char *name; + const char *base; + const char *path; + const char *expect; + } data[] = { +#ifdef Q_OS_WIN // all the complications: + { "drive-drive", "a:/ms/dir", "z:/root/file", "z:/root/file" }, + { "drive-drive-bs", "a:\\ms\\dir", "z:\\root\\file", "z:/root/file" }, + { "drive-root", "a:/ms/dir", "/root/file", "a:/root/file" }, + { "drive-root-bs", "a:\\ms\\dir", "\\root\\file", "a:/root/file" }, + { "drive-sub", "a:/ms/dir", "sub/file", "a:/ms/dir/sub/file" }, + { "drive-sub-bs", "a:\\ms\\dir", "sub\\file", "a:/ms/dir/sub/file" }, + { "drive-rel", "a:/ms/dir", "file.txt", "a:/ms/dir/file.txt" }, + { "drive-rel-bs", "a:\\ms\\dir", "file.txt", "a:/ms/dir/file.txt" }, +#else + { "abs-abs", "/a/unix/dir", "/root/file", "/root/file" }, + { "abs-sub", "/a/unix/dir", "sub/file", "/a/unix/dir/sub/file" }, + { "abs-rel", "/a/unix/dir", "file.txt", "/a/unix/dir/file.txt" }, +#endif // Q_OS_WIN + }; + + for (unsigned i = sizeof(data) / sizeof(data[0]); i-- > 0; ) + QTest::newRow(data[i].name) << QString::fromLatin1(data[i].base) + << QString::fromLatin1(data[i].path) + << QString::fromLatin1(data[i].expect); +} + +void tst_qmakelib::ioUtilResolve() +{ + QFETCH(QString, base); + QFETCH(QString, path); + QFETCH(QString, expect); - QString fnbase = "/another/dir"; - QCOMPARE(IoUtils::resolvePath(fnbase, fn0), QStringLiteral("/another/dir/file/path")); - QCOMPARE(IoUtils::resolvePath(fnbase, fn1), QStringLiteral("/a/unix/file/path")); + QCOMPARE(IoUtils::resolvePath(base, path), expect); } void QMakeTestHandler::print(const QString &fileName, int lineNo, int type, const QString &msg) diff --git a/tests/auto/tools/qmakelib/tst_qmakelib.h b/tests/auto/tools/qmakelib/tst_qmakelib.h index e75dedb7ec8..acfeb43ecdb 100644 --- a/tests/auto/tools/qmakelib/tst_qmakelib.h +++ b/tests/auto/tools/qmakelib/tst_qmakelib.h @@ -48,7 +48,12 @@ private slots: void quoteArgUnix(); void quoteArgWin_data(); void quoteArgWin(); + void pathUtils(); + void ioUtilRelativity_data(); + void ioUtilRelativity(); + void ioUtilResolve_data(); + void ioUtilResolve(); void proString(); void proStringList(); From b772d9cbd786a2180f8ead923a04b537c8904ddd Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 15 Jan 2018 12:02:16 +0100 Subject: [PATCH 12/17] fix example source installation of qrc/rc files in subdirs such a project structure violates the assumption that the referenced resources are specified relative to the sub-project root, so we must resolve them to absolute paths manually. Task-number: QTBUG-65753 Change-Id: I8bcd5c6e7d7c6a713e5fcd3668be7d2f23169501 Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_example_installs.prf | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/mkspecs/features/qt_example_installs.prf b/mkspecs/features/qt_example_installs.prf index 668669e4cd7..c9ce926b1a9 100644 --- a/mkspecs/features/qt_example_installs.prf +++ b/mkspecs/features/qt_example_installs.prf @@ -44,19 +44,25 @@ contains(TEMPLATE, .*app): \ for(ex, EXAMPLE_FILES): \ sourcefiles += $$files($$absolute_path($$ex, $$_PRO_FILE_PWD_)) for(res, RESOURCES) { - rfile = $$cat($$absolute_path($$res, $$_PRO_FILE_PWD_), lines) - for(rline, rfile) { + !contains(res, \\.qrc$): \ + next() + rfile = $$absolute_path($$res, $$_PRO_FILE_PWD_) + rpath = $$dirname(rfile) + rcont = $$cat($$rfile, lines) + for (rline, rcont) { resrc = $$replace(rline, ^[ \\t]*]*>([^<]+)[ \\t]*$, \\1) !equals(resrc, $$rline): \ - sourcefiles += $$resrc + sourcefiles += $$absolute_path($$resrc, $$rpath) } } for(res, RC_FILE) { - rfile = $$cat($$absolute_path($$res, $$_PRO_FILE_PWD_), lines) - for(rline, rfile) { + rfile = $$absolute_path($$res, $$_PRO_FILE_PWD_) + rpath = $$dirname(rfile) + rcont = $$cat($$rfile, lines) + for (rline, rcont) { resrc = $$replace(rline, "^\\d+\\s+ICON\\s+[^\"]*\"([^\"]+)\"\$", \\1) !equals(resrc, $$rline): \ - sourcefiles += $$resrc + sourcefiles += $$absolute_path($$resrc, $$rpath) } } sourcefiles += \ From f6f6958a3e71230d4f2ef4db54d8d7fa010fa58b Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Wed, 17 Jan 2018 14:44:32 +0100 Subject: [PATCH 13/17] configure: inline D3D11_QUERY_DATA_TIMESTAMP_DISJOINT test amends a96656a8fb. Change-Id: Ic434c272bfe985ea0410090537b8a22aad3192f1 Reviewed-by: Thiago Macieira --- .../win/angle_d3d11_qdtd/angle_d3d11_qdtd.cpp | 47 ------------------- .../win/angle_d3d11_qdtd/angle_d3d11_qdtd.pro | 3 -- src/gui/configure.json | 8 +++- 3 files changed, 7 insertions(+), 51 deletions(-) delete mode 100644 config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.cpp delete mode 100644 config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.pro diff --git a/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.cpp b/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.cpp deleted file mode 100644 index 2dde2914a23..00000000000 --- a/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.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**) -{ - D3D11_QUERY_DATA_TIMESTAMP_DISJOINT qdtd; - (void)qdtd; - return 0; -} diff --git a/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.pro b/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.pro deleted file mode 100644 index f1e530ab6e6..00000000000 --- a/config.tests/win/angle_d3d11_qdtd/angle_d3d11_qdtd.pro +++ /dev/null @@ -1,3 +0,0 @@ -SOURCES = angle_d3d11_qdtd.cpp -CONFIG -= qt -CONFIG += console diff --git a/src/gui/configure.json b/src/gui/configure.json index 1252dc507c2..f7377eb903e 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -595,7 +595,13 @@ "angle_d3d11_qdtd": { "label": "D3D11_QUERY_DATA_TIMESTAMP_DISJOINT", "type": "compile", - "test": "win/angle_d3d11_qdtd" + "test": { + "include": "d3d11.h", + "main": [ + "D3D11_QUERY_DATA_TIMESTAMP_DISJOINT qdtd;", + "(void) qdtd;" + ] + } }, "directwrite2": { "label": "DirectWrite 2", From 016ab238b66d84a58b665782d25daaffdf1708bd Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 7 Dec 2017 11:59:30 +0100 Subject: [PATCH 14/17] configure: express dependency of fontconfig on freetype more clearly use a "use" entry instead of including the transitive dep into the list of libraries. this also removes the redundant check of freetype features from the fontconfig test code. Change-Id: I86b78028255c9bf0a62be5ec0f97a62ef3fda36f Reviewed-by: Joerg Bornemann Reviewed-by: Thiago Macieira --- src/gui/configure.json | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/gui/configure.json b/src/gui/configure.json index f7377eb903e..1e4e56422f7 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -164,25 +164,20 @@ "label": "Fontconfig", "test": { "head": [ - "#include ", - "#include FT_FREETYPE_H", "#include ", "#ifndef FC_RGBA_UNKNOWN", "# error This version of fontconfig is tool old, it is missing the FC_RGBA_UNKNOWN define", - "#endif", - "#if ((FREETYPE_MAJOR*10000 + FREETYPE_MINOR*100 + FREETYPE_PATCH) < 20110)", - "# error This version of freetype is too old.", "#endif" ], "main": [ - "FT_Face face = 0;", "FcPattern *pattern = 0;" ] }, "sources": [ - { "type": "pkgConfig", "args": "fontconfig freetype2" }, - { "type": "freetype", "libs": "-lfontconfig -lfreetype" } - ] + { "type": "pkgConfig", "args": "fontconfig" }, + { "type": "freetype", "libs": "-lfontconfig" } + ], + "use": "freetype" }, "gbm": { "label": "GBM", From f9b8ea4b0eaea94a6d724a0955b13fd8a97d96e3 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 6 Dec 2016 13:44:00 +0100 Subject: [PATCH 15/17] Fix QMacTimeZonePrivate::previousTransition() for early after epoch The native APIs don't support previous transition, only next after a stipulated date. The prior code started its search at the epoch; if used for a time before the first transition after the epoch, this found no transitions so returned invalid data, when the last transition before the epoch would have been suitable. It also wound through all transitions since the epoch, on its way to the selected time, which was potentially laborious. Instead, start a year before the stipulated time; this should get a transition if the zone uses DST. If it doesn't, start with the first known transition and binary-chop our way to one within a year of the last before the stipulated time; then wind forward one transition at a time, as before. The chopping is actually faster than binary: each time we find a transition after the interval mid-point but early enough, we move the early end of our interval to the transition, which is later than the old interval's middle. Using halving, starting with a vast interval, should thus only incur modest cost, while ensuring we give up early when no transition data is available at all or the zone's first transition ever was after the stipulated time. Task-number: QTBUG-65443 Change-Id: I96c14540fc2600837e6a22e480fb8dc36cb37220 (cherry picked from commit 7c0b706488b0edcc2fd6db7870db700ff0548f21) (cherry picked from commit a090076e93487f8e461d9b866b9da1c0c21cb59b) Reviewed-by: Andy Shaw Reviewed-by: Jason Dolan --- src/corelib/tools/qtimezoneprivate_mac.mm | 88 ++++++++++++++++++----- 1 file changed, 70 insertions(+), 18 deletions(-) diff --git a/src/corelib/tools/qtimezoneprivate_mac.mm b/src/corelib/tools/qtimezoneprivate_mac.mm index 4e9a432fbfa..fa0dd87cfcf 100644 --- a/src/corelib/tools/qtimezoneprivate_mac.mm +++ b/src/corelib/tools/qtimezoneprivate_mac.mm @@ -226,27 +226,79 @@ QTimeZonePrivate::Data QMacTimeZonePrivate::previousTransition(qint64 beforeMSecsSinceEpoch) const { - // No direct Mac API, so get all transitions since epoch and return the last one - QList secsList; - if (beforeMSecsSinceEpoch > 0) { - const int endSecs = beforeMSecsSinceEpoch / 1000.0; - NSTimeInterval prevSecs = 0; - NSTimeInterval nextSecs = 0; - NSDate *nextDate = [NSDate dateWithTimeIntervalSince1970:nextSecs]; - // If invalid may return a nil date or an Epoch date + // The native API only lets us search forward, so we need to find an early-enough start: + const NSTimeInterval lowerBound = std::numeric_limits::min(); + const qint64 endSecs = beforeMSecsSinceEpoch / 1000; + const int year = 366 * 24 * 3600; // a (long) year, in seconds + NSTimeInterval prevSecs = endSecs; // sentinel for later check + NSTimeInterval nextSecs = prevSecs - year; + NSTimeInterval tranSecs = lowerBound; // time at a transition; may be > endSecs + + NSDate *nextDate = [NSDate dateWithTimeIntervalSince1970:nextSecs]; + nextDate = [m_nstz nextDaylightSavingTimeTransitionAfterDate:nextDate]; + if (nextDate != nil + && (tranSecs = [nextDate timeIntervalSince1970]) < endSecs) { + // There's a transition within the last year before endSecs: + nextSecs = tranSecs; + } else { + // Need to start our search earlier: + nextDate = [NSDate dateWithTimeIntervalSince1970:lowerBound]; nextDate = [m_nstz nextDaylightSavingTimeTransitionAfterDate:nextDate]; - nextSecs = [nextDate timeIntervalSince1970]; - while (nextDate != nil && nextSecs > prevSecs && nextSecs < endSecs) { - secsList.append(nextSecs); - prevSecs = nextSecs; - nextDate = [m_nstz nextDaylightSavingTimeTransitionAfterDate:nextDate]; + if (nextDate != nil) { + NSTimeInterval lateSecs = nextSecs; nextSecs = [nextDate timeIntervalSince1970]; - } + Q_ASSERT(nextSecs <= endSecs - year || nextSecs == tranSecs); + /* + We're looking at the first ever transition for our zone, at + nextSecs (and our zone *does* have at least one transition). If + it's later than endSecs - year, then we must have found it on the + initial check and therefore set tranSecs to the same transition + time (which, we can infer here, is >= endSecs). In this case, we + won't enter the binary-chop loop, below. + + In the loop, nextSecs < lateSecs < endSecs: we have a transition + at nextSecs and there is no transition between lateSecs and + endSecs. The loop narrows the interval between nextSecs and + lateSecs by looking for a transition after their mid-point; if it + finds one < endSecs, nextSecs moves to this transition; otherwise, + lateSecs moves to the mid-point. This soon enough narrows the gap + to within a year, after which walking forward one transition at a + time (the "Wind through" loop, below) is good enough. + */ + + // Binary chop to within a year of last transition before endSecs: + while (nextSecs + year < lateSecs) { + // Careful about overflow, not fussy about rounding errors: + NSTimeInterval middle = nextSecs / 2 + lateSecs / 2; + NSDate *split = [NSDate dateWithTimeIntervalSince1970:middle]; + split = [m_nstz nextDaylightSavingTimeTransitionAfterDate:split]; + if (split != nil + && (tranSecs = [split timeIntervalSince1970]) < endSecs) { + nextDate = split; + nextSecs = tranSecs; + } else { + lateSecs = middle; + } + } + Q_ASSERT(nextDate != nil); + // ... and nextSecs < endSecs unless first transition ever was >= endSecs. + } // else: we have no data - prevSecs is still endSecs, nextDate is still nil } - if (secsList.size() >= 1) - return data(qint64(secsList.constLast()) * 1000); - else - return invalidData(); + // Either nextDate is nil or nextSecs is at its transition. + + // Wind through remaining transitions (spanning at most a year), one at a time: + while (nextDate != nil && nextSecs < endSecs) { + prevSecs = nextSecs; + nextDate = [m_nstz nextDaylightSavingTimeTransitionAfterDate:nextDate]; + nextSecs = [nextDate timeIntervalSince1970]; + if (nextSecs <= prevSecs) // presumably no later data available + break; + } + if (prevSecs < endSecs) // i.e. we did make it into that while loop + return data(qint64(prevSecs * 1e3)); + + // No transition data; or first transition later than requested time. + return invalidData(); } QByteArray QMacTimeZonePrivate::systemTimeZoneId() const From 957c1d9abd854a3b5c43ace807ab7cbf89c91491 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 28 Jul 2017 13:25:41 +0200 Subject: [PATCH 16/17] Use a proper test for absolute path for qmake's location QFileInfo.isRelative() deems any path starting with a slash to be absolute; on MS-Win, such paths need a drive specifier (unless they're UNC), so use IoUtils's more robust test for absolute paths. Change-Id: I7d0872a87833cbf1cc1a6ef107941adc4c529624 Reviewed-by: Oswald Buddenhagen --- qmake/option.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qmake/option.cpp b/qmake/option.cpp index 4da2a1ae2c9..8e457a2626c 100644 --- a/qmake/option.cpp +++ b/qmake/option.cpp @@ -28,6 +28,7 @@ #include "option.h" #include "cachekeys.h" +#include #include #include #include @@ -38,6 +39,8 @@ QT_BEGIN_NAMESPACE +using namespace QMakeInternal; + EvalHandler Option::evalHandler; QMakeGlobals *Option::globals; ProFileCache *Option::proFileCache; @@ -325,7 +328,7 @@ Option::init(int argc, char **argv) #endif if(Option::qmake_mode == Option::QMAKE_GENERATE_NOTHING) Option::qmake_mode = default_mode(argv0); - if(!argv0.isEmpty() && !QFileInfo(argv0).isRelative()) { + if (!argv0.isEmpty() && IoUtils::isAbsolutePath(argv0)) { globals->qmake_abslocation = argv0; } else if (argv0.contains(QLatin1Char('/')) #ifdef Q_OS_WIN From 13f6eb9773c0a4c64da7070be4ac3bbf66f8c82d Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 10 Jan 2018 16:29:17 +0100 Subject: [PATCH 17/17] Doc: Mention exact Qt version the third party attributions apply to MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We do add, remove or update third party code in minor releases, sometimes even in patch level releases. However, the documentation is supposed to be valid for all existing Qt 5 versions, but doing this for attributions would require infrastructure we don't have. Therefore rather make it explicit which Qt version the attributions apply to. Also mention since when Qt is available under LGPLv3 (starting with Qt 5.4). Task-number: QTBUG-65665 Change-Id: I328b5bf0c143f78ea61aad51f0644c3cbb6dee49 Reviewed-by: Edward Welbourne Reviewed-by: Topi Reiniö --- doc/global/macros.qdocconf | 1 + src/corelib/doc/src/qtcore-index.qdoc | 7 ++++--- src/gui/doc/src/qtgui.qdoc | 5 +++-- src/sql/doc/src/qtsql.qdoc | 5 +++-- src/testlib/doc/src/qttest-index.qdoc | 5 +++-- 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/doc/global/macros.qdocconf b/doc/global/macros.qdocconf index 5544da425a9..dbf8c5cc6a6 100644 --- a/doc/global/macros.qdocconf +++ b/doc/global/macros.qdocconf @@ -18,6 +18,7 @@ macro.QA = "\\e{Qt Assistant}" macro.QD = "\\e{Qt Designer}" macro.QL = "\\e{Qt Linguist}" macro.QQV = "\\e{Qt QML Viewer}" +macro.QtVersion = "$QT_VERSION" macro.param = "\\e" macro.raisedaster.HTML = "*" macro.rarrow.HTML = "→" diff --git a/src/corelib/doc/src/qtcore-index.qdoc b/src/corelib/doc/src/qtcore-index.qdoc index 9004c018ed0..04af0e9416b 100644 --- a/src/corelib/doc/src/qtcore-index.qdoc +++ b/src/corelib/doc/src/qtcore-index.qdoc @@ -104,17 +104,18 @@ \section1 Licenses and Attributions Qt Core is available under commercial licenses from \l{The Qt Company}. - In addition, it is available under the + In addition, it is available under free software licenses. Since Qt 5.4, + these free software licenses are \l{GNU Lesser General Public License, version 3}, or the \l{GNU General Public License, version 2}. See \l{Qt Licensing} for further details. Executables on Windows potentially link against \l{The qtmain Library}. This library is available - under commercial licenses, and in addition under the + under commercial licenses and also under the \l{BSD 3-clause "New" or "Revised" License}. - Furthermore Qt Core potentially contains third party + Furthermore, Qt Core in Qt \QtVersion may contain third party modules under following permissive licenses: \generatelist{groupsbymodule attributions-qtcore} diff --git a/src/gui/doc/src/qtgui.qdoc b/src/gui/doc/src/qtgui.qdoc index a9fe520d5e9..9a486569c9b 100644 --- a/src/gui/doc/src/qtgui.qdoc +++ b/src/gui/doc/src/qtgui.qdoc @@ -190,12 +190,13 @@ \section1 Licenses and Attributions Qt GUI is available under commercial licenses from \l{The Qt Company}. - In addition, it is available under the + In addition, it is available under free software licenses. Since Qt 5.4, + these free software licenses are \l{GNU Lesser General Public License, version 3}, or the \l{GNU General Public License, version 2}. See \l{Qt Licensing} for further details. - Furthermore Qt GUI potentially contains third party + Furthermore, Qt GUI in Qt \QtVersion may contain third-party modules under following permissive licenses: \generatelist{groupsbymodule attributions-qtgui} diff --git a/src/sql/doc/src/qtsql.qdoc b/src/sql/doc/src/qtsql.qdoc index 56d714becf6..f0d74739b01 100644 --- a/src/sql/doc/src/qtsql.qdoc +++ b/src/sql/doc/src/qtsql.qdoc @@ -54,12 +54,13 @@ \section1 Licenses and Attributions Qt SQL is available under commercial licenses from \l{The Qt Company}. - In addition, it is available under the + In addition, it is available under free software licenses. Since Qt 5.4, + these free software licenses are \l{GNU Lesser General Public License, version 3}, or the \l{GNU General Public License, version 2}. See \l{Qt Licensing} for further details. - Furthermore Qt SQL potentially contains third party + Furthermore, Qt SQL in Qt \QtVersion may contain third party modules under following permissive licenses: \generatelist{groupsbymodule attributions-qtsql} diff --git a/src/testlib/doc/src/qttest-index.qdoc b/src/testlib/doc/src/qttest-index.qdoc index 36ebfee463b..f5b077e8e8d 100644 --- a/src/testlib/doc/src/qttest-index.qdoc +++ b/src/testlib/doc/src/qttest-index.qdoc @@ -53,12 +53,13 @@ \section1 Licenses and Attributions Qt Test is available under commercial licenses from \l{The Qt Company}. - In addition, it is available under the + In addition, it is available under free software licenses. Since Qt 5.4, + these free software licenses are \l{GNU Lesser General Public License, version 3}, or the \l{GNU General Public License, version 2}. See \l{Qt Licensing} for further details. - Furthermore Qt Test potentially contains third party + Furthermore, Qt Test in Qt \QtVersion may contain third party modules under following permissive licenses: \generatelist{groupsbymodule attributions-qttestlib}