From 932805807123833bb8f5ae9abda7e946f48d9f0c Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Wed, 2 Oct 2019 07:56:16 -0700 Subject: [PATCH 01/17] Fix crash when running QtCore: Stack is misaligned on x86-64 When our ELF entry point function is started by the kernel, the stack is aligned at 16 bytes. However, the stack is expected to be off by 8, due to a preceding CALL instruction which didn't exist. This cauases a crash further down as the compiler may generate aligned stack access. Change-Id: I1496b069cc534f1a838dfffd15c9dc4ef9e3869e Reviewed-by: Edward Welbourne --- src/corelib/global/qlibraryinfo.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 5634d6e6c3..f2ada4ab30 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -709,10 +709,14 @@ QT_END_NAMESPACE #include "private/qcoreapplication_p.h" +QT_WARNING_DISABLE_GCC("-Wattributes") +QT_WARNING_DISABLE_CLANG("-Wattributes") +QT_WARNING_DISABLE_INTEL(2621) + extern const char qt_core_interpreter[] __attribute__((section(".interp"))) = ELF_INTERPRETER; -extern "C" void qt_core_boilerplate(); +extern "C" void qt_core_boilerplate() __attribute__((force_align_arg_pointer)); void qt_core_boilerplate() { printf("This is the QtCore library version " QT_BUILD_STR "\n" From 425c59783c960e9f568b6c5e8920774ada9b87e5 Mon Sep 17 00:00:00 2001 From: Kirill Burtsev Date: Mon, 1 Jul 2019 18:44:39 +0200 Subject: [PATCH 02/17] Xcb: fix rounding error in reporting screen refresh rate Screen refresh rate might not be just integer but with decimal part like, for example, 59.97 Hz. Fix calculation from raw xcb data and its store type as it is qreal already for QScreen::refreshRate API. Task-number: QTBUG-73911 Change-Id: Ia0494e953176c2854f0ed42c4498a29cfef16106 Reviewed-by: Shawn Rutledge --- src/plugins/platforms/xcb/qxcbscreen.cpp | 2 +- src/plugins/platforms/xcb/qxcbscreen.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/xcb/qxcbscreen.cpp b/src/plugins/platforms/xcb/qxcbscreen.cpp index a5a2aeb9aa..0cf0942dab 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.cpp +++ b/src/plugins/platforms/xcb/qxcbscreen.cpp @@ -790,7 +790,7 @@ void QXcbScreen::updateRefreshRate(xcb_randr_mode_t mode) xcb_randr_mode_info_t *modeInfo = modesIter.data; if (modeInfo->id == mode) { const uint32_t dotCount = modeInfo->htotal * modeInfo->vtotal; - m_refreshRate = (dotCount != 0) ? modeInfo->dot_clock / dotCount : 0; + m_refreshRate = (dotCount != 0) ? modeInfo->dot_clock / qreal(dotCount) : 0; m_mode = mode; break; } diff --git a/src/plugins/platforms/xcb/qxcbscreen.h b/src/plugins/platforms/xcb/qxcbscreen.h index ec3b07bfb7..914ce6307d 100644 --- a/src/plugins/platforms/xcb/qxcbscreen.h +++ b/src/plugins/platforms/xcb/qxcbscreen.h @@ -226,7 +226,7 @@ private: QRect m_availableGeometry; Qt::ScreenOrientation m_orientation = Qt::PrimaryOrientation; QXcbCursor *m_cursor; - int m_refreshRate = 60; + qreal m_refreshRate = 60.0; int m_pixelDensity = 1; QEdidParser m_edid; }; From 56029e1e98b8f019b344ae0c9a01d12a47d29866 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCning?= Date: Mon, 7 Oct 2019 10:22:01 +0200 Subject: [PATCH 03/17] Blacklist Desktop GL for Mobile Intel 4 Series Express Chipset Using desktop GL with this graphics card causes crashes e.g. when using Qt WebEngine. Fixes: QTBUG-58772 Change-Id: I90e12aab4475c17be262e391ff0989cebf0b3ec4 Reviewed-by: Laszlo Agocs --- .../windows/openglblacklists/default.json | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/windows/openglblacklists/default.json b/src/plugins/platforms/windows/openglblacklists/default.json index 3cfa7e3856..e37351f9e0 100644 --- a/src/plugins/platforms/windows/openglblacklists/default.json +++ b/src/plugins/platforms/windows/openglblacklists/default.json @@ -152,6 +152,18 @@ "features": [ "disable_program_cache" ] - } + }, + { + "id": 13, + "description": "Disable DesktopGL on Windows with Mobile Intel(R) 4 Series Express Chipset Family graphics card (QTBUG-58772)", + "vendor_id": "0x8086", + "device_id": [ "0x2A42" ], + "os": { + "type": "win" + }, + "features": [ + "disable_desktopgl" + ] + } ] } From 0c1d23db7bada763f1e5d82cebda0e7738549b48 Mon Sep 17 00:00:00 2001 From: Leena Miettinen Date: Wed, 2 Oct 2019 12:05:32 +0200 Subject: [PATCH 04/17] Doc: Add info about QDBusConnection::ExportChildObjects Child objects need QObject::objectName. Fixes: QTBUG-17740 Change-Id: Iebf8bcd7252f8a441d7c265aae3d4dd81b3cfa54 Reviewed-by: Paul Wicking Reviewed-by: Frederik Gladhorn --- src/dbus/qdbusconnection.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp index 2c2dfc1ff6..296d5b369f 100644 --- a/src/dbus/qdbusconnection.cpp +++ b/src/dbus/qdbusconnection.cpp @@ -870,8 +870,12 @@ bool QDBusConnection::disconnect(const QString &service, const QString &path, co This function does not replace existing objects: if there is already an object registered at path \a path, this function will return false. Use unregisterObject() to unregister it first. + The ExportChildObjects flag exports child objects on D-Bus based on the + path of the registered objects and the QObject::objectName of the child. + Therefore, it is important for the child object to have an object name. + You cannot register an object as a child object of an object that - was registered with QDBusConnection::ExportChildObjects. + was registered with ExportChildObjects. */ bool QDBusConnection::registerObject(const QString &path, QObject *object, RegisterOptions options) { @@ -890,8 +894,12 @@ bool QDBusConnection::registerObject(const QString &path, QObject *object, Regis This function does not replace existing objects: if there is already an object registered at path \a path, this function will return false. Use unregisterObject() to unregister it first. + The ExportChildObjects flag exports child objects on D-Bus based on the + path of the registered objects and the QObject::objectName of the child. + Therefore, it is important for the child object to have an object name. + You cannot register an object as a child object of an object that - was registered with QDBusConnection::ExportChildObjects. + was registered with ExportChildObjects. */ bool QDBusConnection::registerObject(const QString &path, const QString &interface, QObject *object, RegisterOptions options) { From ce2fc51914f809369d5096e7a0621229dd9eaef9 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 30 Sep 2019 15:27:19 +0200 Subject: [PATCH 05/17] Add check for global share context for QOpenGLWidget initialize Fixes: QTBUG-78863 Change-Id: I678f66a2057fb9c98863e19eb09042306e72f68a Reviewed-by: Laszlo Agocs --- src/widgets/kernel/qopenglwidget.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/widgets/kernel/qopenglwidget.cpp b/src/widgets/kernel/qopenglwidget.cpp index 374ea53726..a88054a0d0 100644 --- a/src/widgets/kernel/qopenglwidget.cpp +++ b/src/widgets/kernel/qopenglwidget.cpp @@ -788,10 +788,12 @@ void QOpenGLWidgetPrivate::initialize() if (initialized) return; - // Get our toplevel's context with which we will share in order to make the - // texture usable by the underlying window's backingstore. + // If no global shared context get our toplevel's context with which we + // will share in order to make the texture usable by the underlying window's backingstore. QWidget *tlw = q->window(); - QOpenGLContext *shareContext = get(tlw)->shareContext(); + QOpenGLContext *shareContext = qt_gl_global_share_context(); + if (!shareContext) + shareContext = get(tlw)->shareContext(); // If shareContext is null, showing content on-screen will not work. // However, offscreen rendering and grabFramebuffer() will stay fully functional. From b6ce61f486a06ded273d518d871906f9a53ab7c1 Mon Sep 17 00:00:00 2001 From: Kari Hormi Date: Mon, 7 Oct 2019 16:21:33 +0300 Subject: [PATCH 06/17] Fix text not rendering properly after setAlignment call Sometimes when setAlignment is called, the text stops rendering correctly at some point. Adding relayoutDocument call to setAlignment fixes the problem. Fixes: QTBUG-78728 Change-Id: Iab1cf161f0c8d700804448733338c813b5bf9762 Reviewed-by: Ville Voutilainen --- src/widgets/widgets/qtextedit.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp index 0ae63f2dd5..2b3a46ae56 100644 --- a/src/widgets/widgets/qtextedit.cpp +++ b/src/widgets/widgets/qtextedit.cpp @@ -746,6 +746,7 @@ void QTextEdit::setAlignment(Qt::Alignment a) QTextCursor cursor = d->control->textCursor(); cursor.mergeBlockFormat(fmt); d->control->setTextCursor(cursor); + d->relayoutDocument(); } /*! From 53ac8094b13d52b7da8b029cf4716827241283c3 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 7 Oct 2019 10:25:50 +0200 Subject: [PATCH 07/17] Fix PRE_TARGETDEPS for iOS projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This variable was ignored for iOS projects, because the generated Makefile includes xcodebuild.mk that defines its own default target. Export PRE_TARGETDEPS to the Makefile before including xcodebuild.mk and use it there for the dependencies of the generic build targets. Fixes: QTBUG-41325 Change-Id: I5faa82e05570974b5a844ae95b0a012c3badc64a Reviewed-by: Tor Arne Vestbø --- mkspecs/features/uikit/xcodebuild.mk | 4 ++-- mkspecs/features/uikit/xcodebuild.prf | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mkspecs/features/uikit/xcodebuild.mk b/mkspecs/features/uikit/xcodebuild.mk index 0c8d99f4b8..e1156d0e76 100644 --- a/mkspecs/features/uikit/xcodebuild.mk +++ b/mkspecs/features/uikit/xcodebuild.mk @@ -27,8 +27,8 @@ distclean: clean_all $(EXPORT_SUBTARGETS): % : %-build # Generic targets -%_first: $(firstword $(call targets, %)) ; -%_all: $(call targets, %) ; +%_first: $(EXPORT_PRE_TARGETDEPS) $(firstword $(call targets, %)) ; +%_all: $(EXPORT_PRE_TARGETDEPS) $(call targets, %) ; # Actions %-build: ACTION = build diff --git a/mkspecs/features/uikit/xcodebuild.prf b/mkspecs/features/uikit/xcodebuild.prf index 7a6b2acfc2..01022c7b99 100644 --- a/mkspecs/features/uikit/xcodebuild.prf +++ b/mkspecs/features/uikit/xcodebuild.prf @@ -29,6 +29,8 @@ cmd = "$$QMAKE_QMAKE $$system_quote($$_PRO_FILE_) -spec macx-xcode $$args" debug(1, "Generating Xcode project in $$OUT_PWD using '$$cmd'") system("$$QMAKE_CD $$system_quote($$OUT_PWD) && $$cmd") +QMAKE_EXTRA_VARIABLES += PRE_TARGETDEPS + # Subtargets for(build, BUILDS): \ From ca81c884f876d54a21c70b09652f053be4c5b45c Mon Sep 17 00:00:00 2001 From: Alex Henrie Date: Tue, 13 Aug 2019 17:25:27 -0600 Subject: [PATCH 08/17] Include XDG font locations in QStandardPaths::FontsLocation on Linux ~/.fonts was deprecated in 2012, see https://wiki.archlinux.org/index.php/Font_configuration#Fontconfig_configuration Few people keep fonts there anymore. Change-Id: Ide048e1df2c2db4856a38c574df36663ab684f89 Reviewed-by: David Faure --- src/corelib/io/qstandardpaths.cpp | 2 +- src/corelib/io/qstandardpaths_unix.cpp | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qstandardpaths.cpp b/src/corelib/io/qstandardpaths.cpp index f56fef7f8e..3b5f2f97da 100644 --- a/src/corelib/io/qstandardpaths.cpp +++ b/src/corelib/io/qstandardpaths.cpp @@ -232,7 +232,7 @@ QT_BEGIN_NAMESPACE \row \li DocumentsLocation \li "~/Documents" \row \li FontsLocation - \li "~/.fonts" + \li "~/.fonts", "~/.local/share/fonts", "/usr/local/share/fonts", "/usr/share/fonts" \row \li ApplicationsLocation \li "~/.local/share/applications", "/usr/local/share/applications", "/usr/share/applications" \row \li MusicLocation diff --git a/src/corelib/io/qstandardpaths_unix.cpp b/src/corelib/io/qstandardpaths_unix.cpp index eaa545b4fd..3d4a349c8c 100644 --- a/src/corelib/io/qstandardpaths_unix.cpp +++ b/src/corelib/io/qstandardpaths_unix.cpp @@ -348,6 +348,9 @@ QStringList QStandardPaths::standardLocations(StandardLocation type) break; case FontsLocation: dirs += QDir::homePath() + QLatin1String("/.fonts"); + dirs += xdgDataDirs(); + for (int i = 1; i < dirs.count(); ++i) + dirs[i].append(QLatin1String("/fonts")); break; default: break; From a1ea49878927dfe267416c795b50f3d5bdfa0b84 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Tue, 30 Jul 2019 11:07:18 +0200 Subject: [PATCH 09/17] configure: Do use pkg-config --libs for static libs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This ensures that also linker commands like -pthread are returned. Fixes: QTBUG-77159 Change-Id: If9ab3797ccfb52c6b96a4ab120c59fd8896d5466 Reviewed-by: Jörg Bornemann (cherry picked from commit 4ddc50c0cd16ddd146ea9ea21d6565c8f4a5e2bc) Reviewed-by: Joerg Bornemann --- mkspecs/features/qt_configure.prf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf index 9be4fb6f1f..81110e9f6d 100644 --- a/mkspecs/features/qt_configure.prf +++ b/mkspecs/features/qt_configure.prf @@ -825,9 +825,7 @@ defineTest(qtConfLibrary_pkgConfig) { !qtConfResolveLibs($${1}.libs, $$libs): \ return(false) contains($${1}.libs, ".*\\.$${QMAKE_EXTENSION_STATICLIB}$") { - qtRunLoggedCommand("$$pkg_config --static --libs-only-L $$args", libpaths)|return(false) - qtRunLoggedCommand("$$pkg_config --static --libs-only-l $$args", libs)|return(false) - eval(libs = $$libpaths $$libs) + qtRunLoggedCommand("$$pkg_config --static --libs $$args", libs)|return(false) !qtConfResolveLibs($${1}.libs, $$libs): \ return(false) } From 8c092570fcd1330dd916f31d46e8472b7817ec80 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 9 Oct 2019 15:21:13 +0200 Subject: [PATCH 10/17] Fix warning about out of bounds access in QString::operator[] Fixes runtime warnings that got triggered by change c2d2757bccc68e1b981df059786c2e76f2969530. Change-Id: I50620b179de8608f45d6f2ef053eeb8b1e10ae43 Reviewed-by: Simon Hausmann --- src/gui/text/qtextodfwriter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/text/qtextodfwriter.cpp b/src/gui/text/qtextodfwriter.cpp index 9721243454..6d23866392 100644 --- a/src/gui/text/qtextodfwriter.cpp +++ b/src/gui/text/qtextodfwriter.cpp @@ -358,7 +358,7 @@ void QTextOdfWriter::writeBlock(QXmlStreamWriter &writer, const QTextBlock &bloc int precedingSpaces = 0; int exportedIndex = 0; for (int i=0; i <= fragmentText.count(); ++i) { - QChar character = fragmentText[i]; + QChar character = (i == fragmentText.count() ? QChar() : fragmentText.at(i)); bool isSpace = character.unicode() == ' '; // find more than one space. -> From ba26496647bca4b37fc2319b553b95966823b941 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Tue, 8 Oct 2019 13:16:00 +0200 Subject: [PATCH 11/17] Don't crash when calling jumpToFrame() on an empty QMovie Properly return an invalid frame when calling jumpToFrame() with a non existent frame number. Fixes: QTBUG-79029 Change-Id: Ic40f4a6de3106fab42c0bb6c961194be47b04e31 Reviewed-by: Eirik Aavitsland --- src/gui/image/qmovie.cpp | 2 +- tests/auto/gui/image/qmovie/tst_qmovie.cpp | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/gui/image/qmovie.cpp b/src/gui/image/qmovie.cpp index 79203c7b98..f03c8836df 100644 --- a/src/gui/image/qmovie.cpp +++ b/src/gui/image/qmovie.cpp @@ -416,7 +416,7 @@ QFrameInfo QMoviePrivate::infoForFrame(int frameNumber) } else { // We've read all frames now. Return an end marker haveReadAll = true; - return QFrameInfo::endMarker(); + return frameNumber == greatestFrameNumber + 1 ? QFrameInfo::endMarker() : QFrameInfo(); } } } diff --git a/tests/auto/gui/image/qmovie/tst_qmovie.cpp b/tests/auto/gui/image/qmovie/tst_qmovie.cpp index 4e9e9b8115..c8217b2cec 100644 --- a/tests/auto/gui/image/qmovie/tst_qmovie.cpp +++ b/tests/auto/gui/image/qmovie/tst_qmovie.cpp @@ -62,6 +62,7 @@ private slots: #ifndef QT_NO_WIDGETS void infiniteLoop(); #endif + void emptyMovie(); }; // Testing get/set functions @@ -220,5 +221,13 @@ void tst_QMovie::infiniteLoop() } #endif +void tst_QMovie::emptyMovie() +{ + QMovie movie; + movie.setCacheMode(QMovie::CacheAll); + movie.jumpToFrame(100); + QCOMPARE(movie.currentFrameNumber(), -1); +} + QTEST_MAIN(tst_QMovie) #include "tst_qmovie.moc" From 2d7ec5922a15da44fc5bbcbd9a7b6b7e00820fcd Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Wed, 9 Oct 2019 14:27:21 +0200 Subject: [PATCH 12/17] Fix compile with tracing enabled: include QStringList header Change-Id: I40f737338d10a871442bb453fe1eeede9dacec79 Reviewed-by: Simon Hausmann --- src/tools/tracegen/provider.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/tracegen/provider.h b/src/tools/tracegen/provider.h index 9be0c33d89..a4baf56815 100644 --- a/src/tools/tracegen/provider.h +++ b/src/tools/tracegen/provider.h @@ -42,6 +42,7 @@ #include #include +#include #include struct Tracepoint From 63a3b26b6b2dae88a44ad6a4917563b5331823d6 Mon Sep 17 00:00:00 2001 From: Milian Wolff Date: Wed, 9 Oct 2019 14:48:53 +0200 Subject: [PATCH 13/17] Fix QMake build system to support trace points in a cross-compiled build CONFIG(cross_compile) implies CONFIG(force_bootstrap). The latter is errorneously used within qt_tracepoints.prf and to decide when tracegen is to be build. For the tracepoints, we just need to check if etw/lttng trace points are enabled. For tracegen, we don't need to check anything - it doesn't depend on etw or lttng, it is just a code generator similar to moc or rcc and should be handled like these tools. Change-Id: I3784b37db10680efd0ed7ee7860059bdf62b4118 Reviewed-by: Simon Hausmann --- mkspecs/features/qt_tracepoints.prf | 2 +- src/src.pro | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/mkspecs/features/qt_tracepoints.prf b/mkspecs/features/qt_tracepoints.prf index d1b45a47cb..56d315e1cd 100644 --- a/mkspecs/features/qt_tracepoints.prf +++ b/mkspecs/features/qt_tracepoints.prf @@ -16,7 +16,7 @@ PROVIDER_NAME = qt$$lower($$MODULE) INCLUDEPATH += $$absolute_path($$TRACEGEN_DIR, $$OUT_PWD) HEADER_PATH = $$OUT_PWD/$$TRACEGEN_DIR/$${PROVIDER_NAME}_tracepoints_p$${first(QMAKE_EXT_H)} -!force_bootstrap:if(qtConfig(lttng)|qtConfig(etw)) { +if(qtConfig(lttng)|qtConfig(etw)) { SOURCE_PATH = $$OUT_PWD/$$TRACEGEN_DIR/$${PROVIDER_NAME}_tracepoints$${first(QMAKE_EXT_CPP)} isEmpty(BUILDS)|build_pass { diff --git a/src/src.pro b/src/src.pro index b704ccd7ab..ce3db6d783 100644 --- a/src/src.pro +++ b/src/src.pro @@ -70,7 +70,7 @@ src_winmain.depends = sub-corelib # just for the module .pri file src_corelib.subdir = $$PWD/corelib src_corelib.target = sub-corelib -src_corelib.depends = src_tools_moc src_tools_rcc src_tools_qfloat16_tables +src_corelib.depends = src_tools_moc src_tools_rcc src_tools_tracegen src_tools_qfloat16_tables src_xml.subdir = $$PWD/xml src_xml.target = sub-xml @@ -157,17 +157,12 @@ src_android.subdir = $$PWD/android src_3rdparty_freetype.depends += src_corelib } } -SUBDIRS += src_tools_bootstrap src_tools_moc src_tools_rcc src_tools_qfloat16_tables +SUBDIRS += src_tools_bootstrap src_tools_moc src_tools_rcc src_tools_tracegen src_tools_qfloat16_tables qtConfig(regularexpression):pcre2 { SUBDIRS += src_3rdparty_pcre2 src_corelib.depends += src_3rdparty_pcre2 } -TOOLS = src_tools_moc src_tools_rcc src_tools_qlalr src_tools_qfloat16_tables -!force_bootstrap:if(qtConfig(lttng)|qtConfig(etw)) { - SUBDIRS += src_tools_tracegen - src_corelib.depends += src_tools_tracegen - TOOLS += src_tools_tracegen -} +TOOLS = src_tools_moc src_tools_rcc src_tools_tracegen src_tools_qlalr src_tools_qfloat16_tables SUBDIRS += src_corelib src_tools_qlalr win32:SUBDIRS += src_winmain qtConfig(network) { From d2ae838a7c6a49eb826ddf8de115306d11dd4d30 Mon Sep 17 00:00:00 2001 From: Eirik Aavitsland Date: Tue, 8 Oct 2019 13:47:28 +0200 Subject: [PATCH 14/17] Item views: fix regression causing unexpected widget overlapping A certain geometry adjustment was (practically) introduced in Qt 5.11, and caused very surprising behavior, where item widgets will often overwrite neighbouring cells. This has resulted in a number of bug reports. Since the adjustment has such serious side effects, and does not seem to be relevant any longer for the issue for which it was intended, remove it here. More details: From early Qt 4 times, QStyledItemDelegate would do some automatic expansion of the geometry of editor widgets - but only if the layout was RightToLeft. Hence, the effect of it was rarely seen. QTBUG-37433 did, for Qt 5.10, and complained about it. However, the resulting code change did not remove the adjustment, but instead extended it to apply to the normal LeftToRight layout also. Hence, more users experienced it, and reported it as a regression. Also, now in Qt 5.13, it seems Qt has changed in other ways, and the geometry adjustment no longer seems to help (or indeed make any difference to) the original case in QTBUG-37433. Fixes: QTBUG-78495 Fixes: QTBUG-76011 Fixes: QTBUG-68476 Change-Id: I4a4e873969eb1d89843f98fc63d90371207515d1 Reviewed-by: Paul Olav Tvete --- src/widgets/itemviews/qstyleditemdelegate.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp index 22067851cb..702e290da3 100644 --- a/src/widgets/itemviews/qstyleditemdelegate.cpp +++ b/src/widgets/itemviews/qstyleditemdelegate.cpp @@ -514,15 +514,6 @@ void QStyledItemDelegate::updateEditorGeometry(QWidget *editor, QStyle *style = widget ? widget->style() : QApplication::style(); QRect geom = style->subElementRect(QStyle::SE_ItemViewItemText, &opt, widget); - const int delta = qSmartMinSize(editor).width() - geom.width(); - if (delta > 0) { - //we need to widen the geometry - if (editor->layoutDirection() == Qt::RightToLeft) - geom.adjust(-delta, 0, 0, 0); - else - geom.adjust(0, 0, delta, 0); - } - editor->setGeometry(geom); } From 9845c06d1f8c3b30697cdf96b569849ee2372f47 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Thu, 10 Oct 2019 10:41:33 +0200 Subject: [PATCH 15/17] DTLS auto-test(s) - fix a buggy logic with pending datagrams MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes: QTBUG-79128 Change-Id: Ifebd5b056541b7732b15b5cf063ad22ab754a64c Reviewed-by: Mårten Nordheim --- tests/auto/network/ssl/qdtls/tst_qdtls.cpp | 2 +- tests/auto/network/ssl/qdtlscookie/tst_qdtlscookie.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/auto/network/ssl/qdtls/tst_qdtls.cpp b/tests/auto/network/ssl/qdtls/tst_qdtls.cpp index 6a94eee389..4dfdf14e5b 100644 --- a/tests/auto/network/ssl/qdtls/tst_qdtls.cpp +++ b/tests/auto/network/ssl/qdtls/tst_qdtls.cpp @@ -1131,7 +1131,7 @@ void tst_QDtls::handshakeReadyRead() QUdpSocket *socket = qobject_cast(sender()); Q_ASSERT(socket); - if (!socket->pendingDatagramSize()) + if (socket->pendingDatagramSize() <= 0) return; const bool isServer = socket == &serverSocket; diff --git a/tests/auto/network/ssl/qdtlscookie/tst_qdtlscookie.cpp b/tests/auto/network/ssl/qdtlscookie/tst_qdtlscookie.cpp index c90e9cb2c8..a273ceaa17 100644 --- a/tests/auto/network/ssl/qdtlscookie/tst_qdtlscookie.cpp +++ b/tests/auto/network/ssl/qdtlscookie/tst_qdtlscookie.cpp @@ -352,7 +352,7 @@ void tst_QDtlsCookie::receiveMessage(QUdpSocket *socket, QByteArray *message, { Q_ASSERT(socket && message); - if (!socket->pendingDatagramSize()) + if (socket->pendingDatagramSize() <= 0) testLoop.enterLoopMSecs(handshakeTimeoutMS); QVERIFY(!testLoop.timeout()); @@ -377,7 +377,7 @@ void tst_QDtlsCookie::serverReadyRead() { Q_ASSERT(clientsToWait); - if (!serverSocket.pendingDatagramSize()) + if (serverSocket.pendingDatagramSize() <= 0) return; QByteArray hello; @@ -410,7 +410,7 @@ void tst_QDtlsCookie::clientReadyRead() QUdpSocket *clientSocket = qobject_cast(sender()); Q_ASSERT(clientSocket); - if (!clientSocket->pendingDatagramSize()) + if (clientSocket->pendingDatagramSize() <= 0) return; QDtls *handshake = nullptr; From 3dbc7596a3b7aca37e80f76288d3ab761ddd247a Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Tue, 8 Oct 2019 10:56:44 +0200 Subject: [PATCH 16/17] Drag'n'Drop: fix crash when widgets are destroyed during event handling Widgets might be destroyed when handling a dragMoveEvent, in which case the following code will operate on dangling pointers or null pointers. Use a QPointer to watch for the original event receiver to disappear, and add the necessary checks for the objects we deliver events to being null. Change-Id: I4ca2f182540ae21113f4bea4e5c569e983cc58bf Fixes: QTBUG-78907 Reviewed-by: Gatis Paeglis --- src/widgets/kernel/qwidgetwindow.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp index fbc71cd0ea..aad505ed29 100644 --- a/src/widgets/kernel/qwidgetwindow.cpp +++ b/src/widgets/kernel/qwidgetwindow.cpp @@ -885,7 +885,7 @@ void QWidgetWindow::handleDragEnterEvent(QDragEnterEvent *event, QWidget *widget void QWidgetWindow::handleDragMoveEvent(QDragMoveEvent *event) { - auto *widget = findDnDTarget(m_widget, event->pos()); + QPointer widget = findDnDTarget(m_widget, event->pos()); if (!widget) { event->ignore(); if (m_dragTarget) { // Send DragLeave to previous @@ -908,14 +908,18 @@ void QWidgetWindow::handleDragMoveEvent(QDragMoveEvent *event) QGuiApplication::forwardEvent(m_dragTarget, &leaveEvent, event); m_dragTarget = nullptr; } - // Send DragEnter to new widget. - handleDragEnterEvent(static_cast(event), widget); - // Handling 'DragEnter' should suffice for the application. - translated.setDropAction(event->dropAction()); - translated.setAccepted(event->isAccepted()); - // The drag enter event is always immediately followed by a drag move event, - // see QDragEnterEvent documentation. - QGuiApplication::forwardEvent(m_dragTarget, &translated, event); + // widget might have been deleted when handling the leaveEvent + if (widget) { + // Send DragEnter to new widget. + handleDragEnterEvent(static_cast(event), widget); + // Handling 'DragEnter' should suffice for the application. + translated.setDropAction(event->dropAction()); + translated.setAccepted(event->isAccepted()); + // The drag enter event is always immediately followed by a drag move event, + // see QDragEnterEvent documentation. + if (m_dragTarget) + QGuiApplication::forwardEvent(m_dragTarget, &translated, event); + } } event->setAccepted(translated.isAccepted()); event->setDropAction(translated.dropAction()); From 472f5331ca8091b191944650d043a288dac7c3e8 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 7 Oct 2019 09:15:37 +0200 Subject: [PATCH 17/17] Doc: Fix QMAKE_EXTRA_TARGETS snippet description The snippet uses the Unix touch command, not qmake's touch function. Change-Id: I71d1460447249b8941ce4bdbb494bb419e13b119 Reviewed-by: Oliver Wolff Reviewed-by: Edward Welbourne 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 da3aa6b248..ed7fe60fdc 100644 --- a/qmake/doc/src/qmake-manual.qdoc +++ b/qmake/doc/src/qmake-manual.qdoc @@ -4690,7 +4690,7 @@ The definitions above define a qmake target called \c mytarget, containing a Makefile target called \c{.buildfile} which in turn is generated with the - \l{touchfunction}{touch()} function. Finally, the + \c touch command. Finally, the \c{.depends} member specifies that \c mytarget depends on \c mytarget2, another target that is defined afterwards. \c mytarget2 is a dummy target. It is only defined to echo some text to the console.