From 5b22d1719881b5f061be6b832a96a1e4305d981f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 19 Dec 2019 10:36:15 +0100 Subject: Fix some issues of a clang-cl developer build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - qeasingcurve.cpp: Add a cast, fixing: qeasingcurve.cpp(1515,25): error: implicit conversion between pointer-to-function and pointer-to-object is a Microsoft extension [-Werror,-Wmicrosoft-cast] - Disable copy and move of QMainWindowLayoutSeparatorHelper, fixing: qbasictimer.h(59,5): note: 'QBasicTimer' has been explicitly marked deprecated here QT_DEPRECATED_X("copy-construction is unsupported; use move-construction instead") Task-number: QTBUG-63512 Change-Id: I4d12a29cb1dcd68da9f9316c9e42992f218e6045 Reviewed-by: Oliver Wolff Reviewed-by: André de la Rocha Reviewed-by: Shawn Rutledge --- src/corelib/tools/qeasingcurve.cpp | 2 +- src/widgets/widgets/qmainwindowlayout_p.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/corelib/tools/qeasingcurve.cpp b/src/corelib/tools/qeasingcurve.cpp index 52c8d13fe3..bf2fd2e401 100644 --- a/src/corelib/tools/qeasingcurve.cpp +++ b/src/corelib/tools/qeasingcurve.cpp @@ -1512,7 +1512,7 @@ QDebug operator<<(QDebug debug, const QEasingCurve &item) { QDebugStateSaver saver(debug); debug << "type:" << item.d_ptr->type - << "func:" << item.d_ptr->func; + << "func:" << reinterpret_cast(item.d_ptr->func); if (item.d_ptr->config) { debug << QString::fromLatin1("period:%1").arg(item.d_ptr->config->_p, 0, 'f', 20) << QString::fromLatin1("amp:%1").arg(item.d_ptr->config->_a, 0, 'f', 20) diff --git a/src/widgets/widgets/qmainwindowlayout_p.h b/src/widgets/widgets/qmainwindowlayout_p.h index 967b713096..f882908708 100644 --- a/src/widgets/widgets/qmainwindowlayout_p.h +++ b/src/widgets/widgets/qmainwindowlayout_p.h @@ -88,6 +88,10 @@ class QMainWindowLayoutSeparatorHelper QWidget *window() { return layout()->parentWidget(); } public: + Q_DISABLE_COPY_MOVE(QMainWindowLayoutSeparatorHelper) + + QMainWindowLayoutSeparatorHelper() = default; + QList hoverSeparator; QPoint hoverPos; -- cgit v1.2.3 From 6b835d5e51bafe93090286fa2acb36f3d5d8f719 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Fri, 3 Jan 2020 09:13:34 +0100 Subject: QTextDocument: Set the font family to be after the families set This amends a1f4321bbba2f3bff24d753ce766be738dbfa61a as the font families should take precedence over the font family set. If the font family is already included in the families then it should keep its placement. Otherwise it should be appended. Task-number: QTBUG-80475 Change-Id: I0049189c88b6879e57619815ec780960e9c0a300 Reviewed-by: Ulf Hermann Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/gui/text/qtextdocument.cpp | 6 ++---- tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp | 13 ++++++++++++- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp index 25c153910d..1353568ec1 100644 --- a/src/gui/text/qtextdocument.cpp +++ b/src/gui/text/qtextdocument.cpp @@ -2301,10 +2301,8 @@ static QStringList resolvedFontFamilies(const QTextCharFormat &format) { QStringList fontFamilies = format.fontFamilies().toStringList(); const QString mainFontFamily = format.fontFamily(); - if (!mainFontFamily.isEmpty() && !fontFamilies.startsWith(mainFontFamily)) { - fontFamilies.removeAll(mainFontFamily); - fontFamilies.prepend(mainFontFamily); - } + if (!mainFontFamily.isEmpty() && !fontFamilies.contains(mainFontFamily)) + fontFamilies.append(mainFontFamily); return fontFamilies; } diff --git a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp index e075c107b7..2944e88d70 100644 --- a/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp +++ b/tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp @@ -3597,7 +3597,18 @@ void tst_QTextDocument::mergeFontFamilies() cursor.setPosition(QByteArray("Hello World").length(), QTextCursor::KeepAnchor); cursor.mergeCharFormat(newFormat); - QVERIFY(td.toHtml().contains(QLatin1String("font-family:'Jokerman','MS Shell Dlg 2';"))); + QVERIFY(td.toHtml().contains(QLatin1String("font-family:'MS Shell Dlg 2','Jokerman';"))); + + QTextCharFormat newFormatFamilies; + newFormatFamilies.setFontFamilies({ QLatin1String("Arial"), QLatin1String("Helvetica") }); + cursor.mergeCharFormat(newFormatFamilies); + + QVERIFY(td.toHtml().contains(QLatin1String("font-family:'Arial','Helvetica','Jokerman'"))); + + newFormatFamilies.setFontFamilies({ QLatin1String("Arial"), QLatin1String("Jokerman"), QLatin1String("Helvetica") }); + cursor.mergeCharFormat(newFormatFamilies); + + QVERIFY(td.toHtml().contains(QLatin1String("font-family:'Arial','Jokerman','Helvetica'"))); } void tst_QTextDocument::clearUndoRedoStacks() -- cgit v1.2.3 From cca279338c5778fe09fa52384a1ffa5531885cf5 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 3 Jan 2020 13:51:39 +0100 Subject: CMake: Fix usage requirements for static builds of Qt on macOS When scanning the prl files to set up usage requirements for the Qt libraries we omitted "-framework Foo" flags. Those were passed as linker flags, but not as interface libraries. Consequently, the frameworks that are used by Qt libraries were missing on the link line when building against a statically built Qt. Fix this issue by scanning the dependencies for "-framework Foo" just like we do with "-lfoo" flags. Fixes: QTBUG-80855 Change-Id: Ie7804304141c86207d143a6e1005e78bdc099113 Reviewed-by: Cristian Adam Reviewed-by: Kyle Edwards --- .../features/data/cmake/Qt5BasicConfig.cmake.in | 28 +++++++++++++++------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in index 5077b8d8b4..26d4c17e6c 100644 --- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in +++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in @@ -72,18 +72,28 @@ function(_qt5_$${CMAKE_MODULE_NAME}_process_prl_file prl_file_location Configura string(REGEX REPLACE \"QMAKE_PRL_LIBS_FOR_CMAKE[ \\t]*=[ \\t]*([^\\n]*)\" \"\\\\1\" _static_depends \"${_prl_strings}\") string(REGEX REPLACE \"[ \\t]+\" \";\" _standard_libraries \"${CMAKE_CXX_STANDARD_LIBRARIES}\") set(_search_paths) + set(_framework_flag) string(REPLACE \"\\$\\$[QT_INSTALL_LIBS]\" \"${_qt5_install_libs}\" _static_depends \"${_static_depends}\") foreach(_flag ${_static_depends}) string(REPLACE \"\\\"\" \"\" _flag ${_flag}) - if(_flag MATCHES \"^-l(.*)$\") - # Handle normal libraries passed as -lfoo - set(_lib \"${CMAKE_MATCH_1}\") - foreach(_standard_library ${_standard_libraries}) - if(_standard_library MATCHES \"^${_lib}(\\\\.lib)?$\") - set(_lib_is_default_linked TRUE) - break() - endif() - endforeach() + if(_flag MATCHES \"^-framework$\") + # Handle the next flag as framework name + set(_framework_flag 1) + elseif(_framework_flag OR _flag MATCHES \"^-l(.*)$\") + if(_framework_flag) + # Handle Darwin framework bundles passed as -framework Foo + unset(_framework_flag) + set(_lib ${_flag}) + else() + # Handle normal libraries passed as -lfoo + set(_lib \"${CMAKE_MATCH_1}\") + foreach(_standard_library ${_standard_libraries}) + if(_standard_library MATCHES \"^${_lib}(\\\\.lib)?$\") + set(_lib_is_default_linked TRUE) + break() + endif() + endforeach() + endif() if (_lib_is_default_linked) unset(_lib_is_default_linked) elseif(_lib MATCHES \"^pthread$\") -- cgit v1.2.3 From 935736b8489a14db2f0f979db37d3e07f18713eb Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 19 Dec 2019 15:50:52 +0100 Subject: MinGW: Build in release mode by default Qt 5.14.0 switched the default from -debug-and-release to -debug only. Change this to -release, like on the other platforms. [ChangeLog][MinGW] Qt will by default be built in release mode. Use -debug-or-release to force the pre 5.14.0 default. Change-Id: I020268d0672c80cdc0259068c6dc2c743a794237 Reviewed-by: Joerg Bornemann --- configure.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.json b/configure.json index 23ef7625a6..644c864125 100644 --- a/configure.json +++ b/configure.json @@ -772,7 +772,7 @@ }, "debug": { "label": "Build for debugging", - "autoDetect": "features.developer-build || config.win32 || config.darwin" + "autoDetect": "features.developer-build || (config.win32 && !config.gcc) || config.darwin" }, "debug_and_release": { "label": "Compile libs in debug and release mode", -- cgit v1.2.3 From 9b4ec1393fde2af7deb39b9a2f98bcc93635603f Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 19 Dec 2019 13:12:34 +0100 Subject: MinGW: Allow debug-and-release builds Commit 4d289edb14aeb49 did disable debug-and-release for MinGW completely. While it makes sense to change the default, we should allow people to opt-in to old behavior by explicitly setting '-debug-and-release'. To allow differentiation between debug and release libraries debug dll's (again) have a 'd' suffix. Fixes: QTBUG-80792 Change-Id: I341b1a94788f490e975be6736159980cd9273f08 Reviewed-by: Joerg Bornemann --- configure.json | 4 ++-- mkspecs/features/qt_functions.prf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.json b/configure.json index 644c864125..1ae09ef386 100644 --- a/configure.json +++ b/configure.json @@ -776,8 +776,8 @@ }, "debug_and_release": { "label": "Compile libs in debug and release mode", - "autoDetect": "input.debug == ''", - "condition": "config.darwin || (config.win32 && !config.gcc)", + "autoDetect": "input.debug == '' && !(config.win32 && config.gcc)", + "condition": "config.darwin || config.win32", "output": [ "publicFeature", "publicQtConfig", "debugAndRelease" ] }, "force_debug_info": { diff --git a/mkspecs/features/qt_functions.prf b/mkspecs/features/qt_functions.prf index 661b7dd961..45d4492788 100644 --- a/mkspecs/features/qt_functions.prf +++ b/mkspecs/features/qt_functions.prf @@ -5,7 +5,7 @@ defineReplace(qtPlatformTargetSuffix) { else: CONFIG(debug, debug|release) { !debug_and_release|build_pass { mac: return($${suffix}_debug) - win32:!gcc: return($${suffix}d) + win32: return($${suffix}d) } } return($$suffix) -- cgit v1.2.3 From 7c65527a0297e8204f11dc394671da510ee63f10 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 19 Dec 2019 12:43:32 +0100 Subject: qmake: Document QML_IMPORT_PATH qmake itself does not use the variable, but Qt Creator does. Fixes: QTBUG-77866 Change-Id: I313d1ebe32dbc1eeac8d2d79b519349c7097a5a6 Reviewed-by: Leena Miettinen --- qmake/doc/src/qmake-manual.qdoc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc index 38b6d981ec..b002521a8e 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -1577,6 +1577,12 @@ \l{CONFIG}{CONFIG += lrelease} will be installed to. Does not have any effect if \l{CONFIG}{CONFIG += embed_translations} is set. + \target QML_IMPORT_PATH + \section1 QML_IMPORT_PATH + + This variable is only used by \l{Qt Creator Manual}{Qt Creator}. + See \l{Qt Creator: Using QML Modules with Plugins} for details. + \target QMAKE_systemvariable \section1 QMAKE -- cgit v1.2.3 From 6005d1ca16026e03e9b4b65fe59a9b23f4cf9e01 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 20 Dec 2019 10:59:47 +0100 Subject: Document -schannel option in configure -help Task-number: QTBUG-80928 Change-Id: I4c04d7411f96bddceda032dca85e82314c9565fd Reviewed-by: Joerg Bornemann --- config_help.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/config_help.txt b/config_help.txt index 32bdbe4d84..0231234cf9 100644 --- a/config_help.txt +++ b/config_help.txt @@ -258,6 +258,7 @@ Network options: -no-openssl .......... Do not use OpenSSL [default on Apple and WinRT] -openssl-linked ...... Use OpenSSL and link to libssl [no] -openssl-runtime ..... Use OpenSSL and dynamically load libssl [auto] + -schannel ............ Use Secure Channel [no] (Windows only) -securetransport ..... Use SecureTransport [auto] (Apple only) -sctp ................ Enable SCTP support [no] -- cgit v1.2.3 From 1535fc9fb9ddbfce1680979c0634b4fdf8d75fca Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 20 Dec 2019 15:41:32 +0100 Subject: tablets on xcb: report correct local coordinates to nested windows Change e4532224145a0a72cde9b40cb7fd39011624d1c1 tried to map global position directly from the desktop to the window that should receive the event. That's fine for single-window applications; but media players like OBS and VLC often use embedded windows to play video. So the mapping needs to traverse the window parent hierarchy somehow. In this patch it's done by calling QWindow::mapFromGlobal(), but that only works with integer coordinates (QPoint). To preserve the fix for QTBUG-48151 (and other jitter bugs), we need sub-pixel accuracy; so we have to add back the fractional part after mapping the int part. Fixes: QTBUG-77826 Change-Id: Ib52ce14138e477182e0ef53b0ff30ce1eff40372 Reviewed-by: Gatis Paeglis --- src/plugins/platforms/xcb/qxcbconnection_xi2.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp index 4639185416..0a82bbc7a9 100644 --- a/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp +++ b/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp @@ -1252,14 +1252,16 @@ void QXcbConnection::xi2ReportTabletEvent(const void *event, TabletData *tabletD if (Q_LIKELY(useValuators)) { const qreal value = scaleOneValuator(normalizedValue, physicalScreenArea.x(), physicalScreenArea.width()); global.setX(value); - local.setX(value - window->handle()->geometry().x()); + // mapFromGlobal is ok for nested/embedded windows, but works only with whole-number QPoint; + // so map it first, then add back the sub-pixel position + local.setX(window->mapFromGlobal(QPoint(int(value), 0)).x() + (value - int(value))); } break; case QXcbAtom::AbsY: if (Q_LIKELY(useValuators)) { qreal value = scaleOneValuator(normalizedValue, physicalScreenArea.y(), physicalScreenArea.height()); global.setY(value); - local.setY(value - window->handle()->geometry().y()); + local.setY(window->mapFromGlobal(QPoint(0, int(value))).y() + (value - int(value))); } break; case QXcbAtom::AbsPressure: -- cgit v1.2.3