From ef2d1e3970407a83078e61cc54ca6bf7f0f971ac Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 27 Sep 2017 09:23:10 +0200 Subject: [PATCH 01/12] Extend the MariaDB define check to cover the later versions too Change-Id: Ide89b4e07feb116bf152cbf3f5630d313e8ba0f1 Reviewed-by: Edward Welbourne --- src/plugins/sqldrivers/mysql/qsql_mysql.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp index 53a72779a96..18c8b484628 100644 --- a/src/plugins/sqldrivers/mysql/qsql_mysql.cpp +++ b/src/plugins/sqldrivers/mysql/qsql_mysql.cpp @@ -1160,14 +1160,14 @@ static void qLibraryInit() # endif // MYSQL_VERSION_ID #endif // Q_NO_MYSQL_EMBEDDED -#ifdef MARIADB_BASE_VERSION +#if defined(MARIADB_BASE_VERSION) || defined(MARIADB_VERSION_ID) qAddPostRoutine([]() { mysql_server_end(); }); #endif } static void qLibraryEnd() { -#if !defined(MARIADB_BASE_VERSION) +#if !defined(MARIADB_BASE_VERSION) && !defined(MARIADB_VERSION_ID) # if !defined(Q_NO_MYSQL_EMBEDDED) # if MYSQL_VERSION_ID > 40000 # if (MYSQL_VERSION_ID >= 40110 && MYSQL_VERSION_ID < 50000) || MYSQL_VERSION_ID >= 50003 From 3e2c9302427e4d33745059f8165373bd9b650eae Mon Sep 17 00:00:00 2001 From: Kari Oikarinen Date: Wed, 28 Mar 2018 16:23:49 +0300 Subject: [PATCH 02/12] tst_QEventLoop: Remove unconditional qWait() Task-number: QTBUG-63992 Change-Id: I9d9e3966252f01cded489313561641e1c0292b91 Reviewed-by: Gatis Paeglis --- tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp index 109f5b77f68..482ed8d1306 100644 --- a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp +++ b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp @@ -586,7 +586,6 @@ void tst_QEventLoop::deliverInDefinedOrder() } } - QTest::qWait(30); for (int o = 0; o < NbObject; o++) { QTRY_COMPARE(objects[o].count, int(NbEvent)); } From 32d9cf7310a874864799bec13c267fc503e79aba Mon Sep 17 00:00:00 2001 From: Kari Oikarinen Date: Thu, 5 Apr 2018 09:53:56 +0300 Subject: [PATCH 03/12] Fix tst_QFiledialog::completer The test was failing because the files it expected to create were not actually visible on the disk. This was because 189e9c93d7ed42202ad51507c8944d64e9a7888d made QTemporaryFile use unnamed files if the file name is not actually requested. Fix by forcing the temporary file to be made with the requested name. CI has not caught this because the test executable is marked insignificant_test on Linux. Change-Id: Ibe0244fdfcc66acf3be4314da51b4c0b3b520b71 Reviewed-by: Simon Hausmann --- tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp index 05410f4a0f5..90f8457b7fd 100644 --- a/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp +++ b/tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp @@ -471,6 +471,9 @@ void tst_QFiledialog::completer() for (int i = 0; i < 10; ++i) { TemporaryFilePtr file(new QTemporaryFile(startPath + QStringLiteral("/rXXXXXX"))); QVERIFY2(file->open(), qPrintable(file->errorString())); + // Force the temporary file to materialize with the requested name + (void) file->fileName(); + QVERIFY(file->exists()); files.append(file); } } From 49a760e454158a666b09f9ca8eb54b4fb121aae5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 9 Apr 2018 15:41:19 +0200 Subject: [PATCH 04/12] iOS: Remove sending of duplicate touch events after broken merge The merge in 0f315adf9199ef resulted in keeping both code paths, in effect sending two touch events for each native touch event, and also re-introduced the bug fixed by sending the touch events asynchronously in some cases. Change-Id: Id81f02d9597f4e0baeaddbdf9057fa32b6c31b2f Reviewed-by: Frederik Gladhorn Reviewed-by: Lars Knoll --- src/plugins/platforms/ios/quiview.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/ios/quiview.mm b/src/plugins/platforms/ios/quiview.mm index 584dfe9b41a..29afae71769 100644 --- a/src/plugins/platforms/ios/quiview.mm +++ b/src/plugins/platforms/ios/quiview.mm @@ -439,7 +439,7 @@ Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.input.tablet") } if (m_activeTouches.isEmpty()) return; - QWindowSystemInterface::handleTouchEvent(m_qioswindow->window(), timeStamp, iosIntegration->touchDevice(), m_activeTouches.values()); + if (!static_cast(self.window).sendingEvent) { // The event is likely delivered as part of delayed touch delivery, via // _UIGestureEnvironmentSortAndSendDelayedTouches, due to one of the two From 4160315fb59810438ecab39520264d299994799d Mon Sep 17 00:00:00 2001 From: Anton Kudryavtsev Date: Tue, 10 Apr 2018 11:48:14 +0300 Subject: [PATCH 05/12] QSplitter::indexOf: fix documentation Change-Id: I2943c076879cbf229f209743b3b5c1f5fcd78302 Reviewed-by: Friedemann Kleint --- src/widgets/widgets/qsplitter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp index 8e4c8464027..55f2dd24211 100644 --- a/src/widgets/widgets/qsplitter.cpp +++ b/src/widgets/widgets/qsplitter.cpp @@ -1200,8 +1200,8 @@ QWidget *QSplitter::replaceWidget(int index, QWidget *widget) /*! \fn int QSplitter::indexOf(QWidget *widget) const - Returns the index in the splitter's layout of the specified \a widget. This - also works for handles. + Returns the index in the splitter's layout of the specified \a widget, + or -1 if \a widget is not found. This also works for handles. Handles are numbered from 0. There are as many handles as there are child widgets, but the handle at position 0 is always hidden. From 28f9b35b35e7c9964f22f4e28aac9c6093401900 Mon Sep 17 00:00:00 2001 From: Mikhail Svetkin Date: Mon, 9 Apr 2018 14:20:44 +0200 Subject: [PATCH 06/12] Fix integer overflow (1 << (' ' - 1)) On platforms where integer by default is int32(max is 2147483647) and (1 << (' ' - 1)) will be 2147483648 Change-Id: I790d33bd4e473925d6897dd87cbffdfe8dd7938f Reviewed-by: Thiago Macieira Reviewed-by: Edward Welbourne --- src/corelib/tools/qlocale_p.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/corelib/tools/qlocale_p.h b/src/corelib/tools/qlocale_p.h index 7eb8b7372c1..6669ae7c8bb 100644 --- a/src/corelib/tools/qlocale_p.h +++ b/src/corelib/tools/qlocale_p.h @@ -419,15 +419,15 @@ QString qt_readEscapedFormatString(QStringView format, int *idx); bool qt_splitLocaleName(const QString &name, QString &lang, QString &script, QString &cntry); int qt_repeatCount(QStringView s); -enum { AsciiSpaceMask = (1 << (' ' - 1)) | - (1 << ('\t' - 1)) | // 9: HT - horizontal tab - (1 << ('\n' - 1)) | // 10: LF - line feed - (1 << ('\v' - 1)) | // 11: VT - vertical tab - (1 << ('\f' - 1)) | // 12: FF - form feed - (1 << ('\r' - 1)) }; // 13: CR - carriage return +enum { AsciiSpaceMask = (1u << (' ' - 1)) | + (1u << ('\t' - 1)) | // 9: HT - horizontal tab + (1u << ('\n' - 1)) | // 10: LF - line feed + (1u << ('\v' - 1)) | // 11: VT - vertical tab + (1u << ('\f' - 1)) | // 12: FF - form feed + (1u << ('\r' - 1)) }; // 13: CR - carriage return Q_DECL_CONSTEXPR inline bool ascii_isspace(uchar c) { - return c >= 1U && c <= 32U && (uint(AsciiSpaceMask) >> uint(c - 1)) & 1U; + return c >= 1u && c <= 32u && (AsciiSpaceMask >> uint(c - 1)) & 1u; } #if defined(Q_COMPILER_CONSTEXPR) From 4eeafe1cbfa6a80a059df0df0a791840bca32b42 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Mon, 9 Apr 2018 21:46:34 +0100 Subject: [PATCH 07/12] Fix crash if dock widget gets deleted while dragging By using a QPointer. Change-Id: I16832dadc9cd8cefc4f9f276b1242c0000097b95 Reviewed-by: Friedemann Kleint Reviewed-by: Richard Moe Gustavsen Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/widgets/widgets/qmainwindowlayout.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp index 9b38da340cb..9cf2e7de1f8 100644 --- a/src/widgets/widgets/qmainwindowlayout.cpp +++ b/src/widgets/widgets/qmainwindowlayout.cpp @@ -68,6 +68,7 @@ #include #include #include +#include #ifndef QT_NO_DEBUG_STREAM # include @@ -1654,7 +1655,7 @@ void QMainWindowLayout::keepSize(QDockWidget *w) class QMainWindowTabBar : public QTabBar { QMainWindow *mainWindow; - QDockWidget *draggingDock; // Currently dragging (detached) dock widget + QPointer draggingDock; // Currently dragging (detached) dock widget public: QMainWindowTabBar(QMainWindow *parent); protected: @@ -1665,7 +1666,7 @@ protected: }; QMainWindowTabBar::QMainWindowTabBar(QMainWindow *parent) - : QTabBar(parent), mainWindow(parent), draggingDock(0) + : QTabBar(parent), mainWindow(parent) { setExpanding(false); } From a35c6a49c938fefbf25332cc5a2dc760f6d0c4ed Mon Sep 17 00:00:00 2001 From: Dmitry Shachnev Date: Tue, 10 Apr 2018 14:01:47 +0300 Subject: [PATCH 08/12] glx: Fix loading OpenGL library when libGL.so symlink is missing Task-number: QTBUG-67537 Change-Id: Ib59bc27582f44b0c6b04efa57c44d877e1685bbb Reviewed-by: Gatis Paeglis Reviewed-by: Laszlo Agocs Reviewed-by: Oswald Buddenhagen --- .../platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp index d37eb572a6f..baf3dbd42af 100644 --- a/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/gl_integrations/xcb_glx/qglxintegration.cpp @@ -639,6 +639,8 @@ QFunctionPointer QGLXContext::getProcAddress(const char *procName) extern const QString qt_gl_library_name(); // QLibrary lib(qt_gl_library_name()); QLibrary lib(QLatin1String("GL")); + if (!lib.load()) + lib.setFileNameAndVersion(QLatin1String("GL"), 1); glXGetProcAddressARB = (qt_glXGetProcAddressARB) lib.resolve("glXGetProcAddressARB"); #endif } From 0e204c7dc42627619db9684a9bca031ee545faf7 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 29 Jan 2018 19:34:42 +0100 Subject: [PATCH 09/12] don't call qmake's exists() with an empty argument Change-Id: I73330bd1c2de1734c5ac5c668ff9af7e85fc902a Reviewed-by: Joerg Bornemann --- mkspecs/features/create_cmake.prf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf index bb5083c925b..66acedef552 100644 --- a/mkspecs/features/create_cmake.prf +++ b/mkspecs/features/create_cmake.prf @@ -53,7 +53,9 @@ contains(CMAKE_INCLUDE_DIR, "^\\.\\./.*") { CMAKE_INCLUDE_DIR_IS_ABSOLUTE = True } -!exists($$first(QT.$${MODULE}_private.includes)): CMAKE_NO_PRIVATE_INCLUDES = true +isEmpty(QT.$${MODULE}_private.includes)| \ + !exists($$first(QT.$${MODULE}_private.includes)): \ + CMAKE_NO_PRIVATE_INCLUDES = true CMAKE_LIB_DIR = $$cmakeRelativePath($$[QT_INSTALL_LIBS], $$[QT_INSTALL_PREFIX]) contains(CMAKE_LIB_DIR,"^\\.\\./.*") { From 2c6801cb37ed5a14435cf2f76ae115eeda0d210e Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 5 Dec 2017 19:58:50 +0100 Subject: [PATCH 10/12] configure: cache test output as well that way we can create a config.log which is consistent with the end state even if (some) tests are not executed this time around. Change-Id: Ia953ede62d6640aab912559f435ceb1f9ec6d9dc Reviewed-by: Joerg Bornemann --- mkspecs/features/configure_base.prf | 20 ++++++++++++++++++++ mkspecs/features/qt_configure.prf | 24 +++++++++++++++++++----- 2 files changed, 39 insertions(+), 5 deletions(-) diff --git a/mkspecs/features/configure_base.prf b/mkspecs/features/configure_base.prf index e870e2ee106..73e0273f18f 100644 --- a/mkspecs/features/configure_base.prf +++ b/mkspecs/features/configure_base.prf @@ -23,9 +23,29 @@ QMAKE_MAKE_NAME = $$basename(QMAKE_MAKE) # Make sure we don't inherit MAKEFLAGS - -i in particular is fatal. QMAKE_MAKE = "$${SETENV_PFX}MAKEFLAGS=$$SETENV_SFX $$QMAKE_MAKE" +QMAKE_PERSIST_LOG = false +QMAKE_PERSISTED_LOG = + defineTest(qtLog) { write_file($$QMAKE_CONFIG_LOG, 1, append) $$QMAKE_CONFIG_VERBOSE: for (l, 1): log("$$l$$escape_expand(\\n)") + $$QMAKE_PERSIST_LOG { + QMAKE_PERSISTED_LOG += $$1 + export(QMAKE_PERSISTED_LOG) + } +} + +defineTest(qtPersistLog) { + QMAKE_PERSIST_LOG = true + QMAKE_PERSISTED_LOG = + export(QMAKE_PERSIST_LOG) + export(QMAKE_PERSISTED_LOG) +} + +defineReplace(qtPersistedLog) { + QMAKE_PERSIST_LOG = false + export(QMAKE_PERSIST_LOG) + return($$QMAKE_PERSISTED_LOG) } defineTest(qtRunLoggedCommand) { diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 98fff59ea1d..6e29eaa2b7d 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -710,13 +710,14 @@ defineTest(qtConfHandleLibrary) { } use_args = $$eval($${lpfx}.literal_args) - qtConfLoadResult($${lpfx}, $$1) { + qtConfLoadResult($${lpfx}, $$1, "library") { $$eval($${lpfx}.result): \ qtConfExportLibrary($$1) return() } qtLogTestIntro($${lpfx}, "looking for library $${1}") + qtPersistLog() result = false for (s, $${lpfx}.sources._KEYS_) { @@ -768,6 +769,9 @@ defineTest(qtConfHandleLibrary) { break() } + $${lpfx}.msgs = $$qtPersistedLog() + export($${lpfx}.msgs) + qtLogTestResult($${lpfx}, $$result) $${lpfx}.result = $$result @@ -1023,7 +1027,7 @@ defineTest(qtLogTestIntro) { label = $$eval($${1}.label) isEmpty(label): return() - log("Checking for $${label}... ") + isEmpty(3): log("Checking for $${label}... ") $$QMAKE_CONFIG_VERBOSE: log("$$escape_expand(\\n)") write_file($$QMAKE_CONFIG_LOG, 2, append) } @@ -1043,14 +1047,14 @@ defineTest(qtLogTestResult) { msg = "test $$1 FAILED" } $$QMAKE_CONFIG_VERBOSE: log_msg = $$msg - logn("$$log_msg") + isEmpty(3): logn("$$log_msg") write_file($$QMAKE_CONFIG_LOG, msg, append) } defineTest(qtConfSaveResult) { equals($${1}.cache, -): \ return() - keys = result $$eval($${1}.cache) + keys = result msgs $$eval($${1}.cache) cont = "cache.$${2}._KEYS_ = $$keys" cache.$${2}._KEYS_ = $$keys export(cache.$${2}._KEYS_) @@ -1073,6 +1077,12 @@ defineTest(qtConfLoadResult) { $${1}.$${k} = $$eval(cache.$${2}.$${k}) export($${1}.$${k}) } + # we could print the cached result, but that's basically just noise - + # the explicitly generated summary is supposed to contain all relevant + # information. + qtLogTestIntro($$1, "loaded result for $$3 $$1", false) + qtLog($$eval($${1}.msgs)) + qtLogTestResult($$1, $$eval($${1}.result), false) return(true) } @@ -1153,14 +1163,18 @@ defineTest(qtRunSingleTest) { # note: we do this only after resolving the dependencies and the # preparation (which may resolve libraries), so that caching does # not alter the execution order (and thus the output). - qtConfLoadResult($${tpfx}, $$1): \ + qtConfLoadResult($${tpfx}, $$1, "config test"): \ return() qtLogTestIntro($${tpfx}, "executing config test $${1}") + qtPersistLog() result = false $${call}($${tpfx}): result = true + $${tpfx}.msgs = $$qtPersistedLog() + export($${tpfx}.msgs) + qtLogTestResult($${tpfx}, $$result) $${tpfx}.result = $$result From 436a6fbb835906e1c62a11dfc7de61461ec767b0 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Tue, 27 Mar 2018 14:19:11 +0200 Subject: [PATCH 11/12] configure: make plain -xcb switch effective the option is a quad enum, with "yes" meaning "either system or qt". the distinction is made only in the "system-xcb" feature, while "xcb" itself must be forced on in the "yes" case. Task-number: QTBUG-67251 Change-Id: Ib706e79a902ae0f1b64ca6d4611c9214b7b7e928 Reviewed-by: Lars Knoll Reviewed-by: Gatis Paeglis --- src/gui/configure.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/configure.json b/src/gui/configure.json index 220662ea8ec..219385a1087 100644 --- a/src/gui/configure.json +++ b/src/gui/configure.json @@ -1268,7 +1268,7 @@ "label": "XCB", "section": "Platform plugins", "autoDetect": "!config.darwin", - "enable": "input.xcb == 'system' || input.xcb == 'qt'", + "enable": "input.xcb == 'system' || input.xcb == 'qt' || input.xcb == 'yes'", "condition": "libs.xcb", "output": [ "privateFeature" ] }, From 95c8f24b71445956651a5d1eade9475dceb16675 Mon Sep 17 00:00:00 2001 From: Juan Jose Casafranca Date: Sat, 17 Mar 2018 15:47:01 +0100 Subject: [PATCH 12/12] Enable BuiltIn input in the shader graph builder BuiltIn inputs shouldnt be translated into a code input. We comment the input line for this variables Change-Id: I3b7d2fd06afc6a122d90a999fc5a5246fc93234e Reviewed-by: Rafael Roquetto --- src/gui/util/qshadergenerator.cpp | 4 ++++ src/gui/util/qshaderlanguage_p.h | 1 + tests/auto/gui/util/qshadergenerator/tst_qshadergenerator.cpp | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/src/gui/util/qshadergenerator.cpp b/src/gui/util/qshadergenerator.cpp index 31c2f74746a..ae45c03fd15 100644 --- a/src/gui/util/qshadergenerator.cpp +++ b/src/gui/util/qshadergenerator.cpp @@ -61,6 +61,8 @@ namespace return ""; // Although fragment shaders for <=2 only have fixed outputs case QShaderLanguage::Uniform: return "uniform"; + case QShaderLanguage::BuiltIn: + return "//"; } } else { switch (qualifier) { @@ -72,6 +74,8 @@ namespace return "out"; case QShaderLanguage::Uniform: return "uniform"; + case QShaderLanguage::BuiltIn: + return "//"; } } diff --git a/src/gui/util/qshaderlanguage_p.h b/src/gui/util/qshaderlanguage_p.h index 5c7819a3b8b..e392a6c7bbf 100644 --- a/src/gui/util/qshaderlanguage_p.h +++ b/src/gui/util/qshaderlanguage_p.h @@ -64,6 +64,7 @@ namespace QShaderLanguage enum StorageQualifier : char { Const = 1, Input, + BuiltIn, Output, Uniform }; diff --git a/tests/auto/gui/util/qshadergenerator/tst_qshadergenerator.cpp b/tests/auto/gui/util/qshadergenerator/tst_qshadergenerator.cpp index d0a0225055e..82197f815ef 100644 --- a/tests/auto/gui/util/qshadergenerator/tst_qshadergenerator.cpp +++ b/tests/auto/gui/util/qshadergenerator/tst_qshadergenerator.cpp @@ -372,6 +372,8 @@ namespace { return "const"; case QShaderLanguage::Input: return "varying"; + case QShaderLanguage::BuiltIn: + return "//"; case QShaderLanguage::Output: return ""; // Although fragment shaders for <=2 only have fixed outputs case QShaderLanguage::Uniform: @@ -383,6 +385,8 @@ namespace { return "const"; case QShaderLanguage::Input: return "in"; + case QShaderLanguage::BuiltIn: + return "//"; case QShaderLanguage::Output: return "out"; case QShaderLanguage::Uniform: