From fc049052812bfa0b63af1f3c5fcadf1eb582e775 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Mon, 19 Aug 2019 15:04:42 +0200 Subject: macOS: Bail out early in case a popup is closed by a mouseDown MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It can happen that AppKit calls -mouseDown: on a popup's view, but we consider the click to be outside of popup's area (happens on the 1-pixel edge of a 'geometry', QRect::contains() returns false). If we send close event to essentially 'self', m_platformWindow is becoming nullptr. So we bail out early, no further processing is needed. Fixes: QTBUG-77348 Change-Id: I224943e6bcf4ae052412ef7dc7b23a94f999aa19 Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qnsview_mouse.mm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/cocoa/qnsview_mouse.mm b/src/plugins/platforms/cocoa/qnsview_mouse.mm index a887cb841d..3a5a074264 100644 --- a/src/plugins/platforms/cocoa/qnsview_mouse.mm +++ b/src/plugins/platforms/cocoa/qnsview_mouse.mm @@ -389,14 +389,16 @@ } // Close the popups if the click was outside. if (!inside) { + bool selfClosed = false; Qt::WindowType type = QCocoaIntegration::instance()->activePopupWindow()->window()->type(); while (QCocoaWindow *popup = QCocoaIntegration::instance()->popPopupWindow()) { + selfClosed = self == popup->view(); QWindowSystemInterface::handleCloseEvent(popup->window()); QWindowSystemInterface::flushWindowSystemEvents(); } // Consume the mouse event when closing the popup, except for tool tips // were it's expected that the event is processed normally. - if (type != Qt::ToolTip) + if (type != Qt::ToolTip || selfClosed) return; } } -- cgit v1.2.3 From a847f5cd8562d3d42fb4cbdb42367466119f8d5f Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Mon, 5 Aug 2019 08:51:10 -0700 Subject: Fix qErrnoWarning() printing no error in some conditions Because it allocates memory, it may call system functions that set errno or Win32's GetLastError(). [ChangeLog][QtCore] Fixed a bug that made qErrnoWarning() say there was no error when generating the error message. Fixes: QTBUG-77322 Change-Id: Ife213d861bb14c1787e1fffd15b811a4f83cf3e7 Reviewed-by: Friedemann Kleint --- src/corelib/global/qlogging.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qlogging.cpp b/src/corelib/global/qlogging.cpp index 1a74757032..bf9c2ed2be 100644 --- a/src/corelib/global/qlogging.cpp +++ b/src/corelib/global/qlogging.cpp @@ -1923,12 +1923,14 @@ void qErrnoWarning(const char *msg, ...) { // qt_error_string() will allocate anyway, so we don't have // to be careful here (like we do in plain qWarning()) + QString error_string = qt_error_string(-1); // before vasprintf changes errno/GetLastError() + va_list ap; va_start(ap, msg); QString buf = QString::vasprintf(msg, ap); va_end(ap); - buf += QLatin1String(" (") + qt_error_string(-1) + QLatin1Char(')'); + buf += QLatin1String(" (") + error_string + QLatin1Char(')'); QMessageLogContext context; qt_message_output(QtCriticalMsg, context, buf); } -- cgit v1.2.3 From fe2aaf1b904ad0cb6246813430aeb7ea1a137609 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 6 Aug 2019 14:31:54 +0200 Subject: qmake: Quote path to project file in Xcode project Makefile rule MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I40aba757486548ef9f319d3176e89eb7129a007e Reviewed-by: Jörg Bornemann --- mkspecs/features/mac/default_post.prf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mkspecs/features/mac/default_post.prf b/mkspecs/features/mac/default_post.prf index 60b2eb2117..26bd3e2e98 100644 --- a/mkspecs/features/mac/default_post.prf +++ b/mkspecs/features/mac/default_post.prf @@ -270,7 +270,7 @@ xcode_product_bundle_identifier_setting.value = "$${xcode_product_bundle_identif QMAKE_MAC_XCODE_SETTINGS += xcode_product_bundle_identifier_setting !macx-xcode { - generate_xcode_project.commands = @$(QMAKE) -spec macx-xcode $(EXPORT__PRO_FILE_) $$QMAKE_ARGS + generate_xcode_project.commands = @$(QMAKE) -spec macx-xcode \"$(EXPORT__PRO_FILE_)\" $$QMAKE_ARGS generate_xcode_project.target = xcodeproj QMAKE_EXTRA_VARIABLES += _PRO_FILE_ QMAKE_EXTRA_TARGETS += generate_xcode_project -- cgit v1.2.3 From 626340d45882c7dcb9e56e7bdbae38f04a5b1cd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 20 Aug 2019 15:05:19 +0200 Subject: iOS: Fix NSUInteger vs NSInteger comparison warning Change-Id: I700132084c208f4ce63e0fc0516ebc3df7881ab0 Reviewed-by: Timur Pocheptsov --- src/plugins/platforms/ios/quiview_accessibility.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/ios/quiview_accessibility.mm b/src/plugins/platforms/ios/quiview_accessibility.mm index 458ddcc9b8..6612dc131e 100644 --- a/src/plugins/platforms/ios/quiview_accessibility.mm +++ b/src/plugins/platforms/ios/quiview_accessibility.mm @@ -101,7 +101,7 @@ - (id)accessibilityElementAtIndex:(NSInteger)index { [self initAccessibility]; - if (index >= [m_accessibleElements count]) + if (NSUInteger(index) >= [m_accessibleElements count]) return nil; return m_accessibleElements[index]; } -- cgit v1.2.3 From c4aa90cb566a58ce3e2a18de134b83d0a959fed2 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 21 Aug 2019 10:05:33 +0200 Subject: Point out that dynamically modified meta objects are not threadsafe Given that this is an exception, it doesn't invalidate the general thread-safety of static meta objects, and putting a locking mechanism into Qt for this would be complete over- (and performance-)kill. Task-number: QTBUG-70915 Change-Id: I4a538b977f5c2e8173cb236023e5d9ca34add5b5 Reviewed-by: Ulf Hermann --- src/corelib/kernel/qmetaobject.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/corelib/kernel/qmetaobject.cpp b/src/corelib/kernel/qmetaobject.cpp index 666bb6eace..927d03f830 100644 --- a/src/corelib/kernel/qmetaobject.cpp +++ b/src/corelib/kernel/qmetaobject.cpp @@ -112,6 +112,13 @@ QT_BEGIN_NAMESPACE are returned by classInfo(), and you can search for pairs with indexOfClassInfo(). + \note Operations that use the meta object system are generally thread- + safe, as QMetaObjects are typically static read-only instances + generated at compile time. However, if meta objects are dynamically + modified by the application (for instance, when using QQmlPropertyMap), + then the application has to explicitly synchronize access to the + respective meta object. + \sa QMetaClassInfo, QMetaEnum, QMetaMethod, QMetaProperty, QMetaType, {Meta-Object System} */ -- cgit v1.2.3