From 7319c342c34f6bcc8f0322e9613c6296331f1487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 13 Feb 2019 12:52:33 +0100 Subject: [PATCH 01/32] macOS: Implement QNSWindow/QNSPanel mixin using preprocessor includes We want to share the implementation between the two classes, but Objective-C doesn't natively have a mixin-feature. Instead of using dynamic super-calls at runtime (which worked fine, but added complexity), we now do the mixin at compile time using the preprocessor. The dynamic-super feature is left in, in case we need it in other areas in the future. Change-Id: I95dfa7f18cba86cc518e963dd018944ef113ac06 Reviewed-by: Timur Pocheptsov --- src/plugins/platforms/cocoa/qnswindow.h | 8 - src/plugins/platforms/cocoa/qnswindow.mm | 336 +++++++++++------------ 2 files changed, 158 insertions(+), 186 deletions(-) diff --git a/src/plugins/platforms/cocoa/qnswindow.h b/src/plugins/platforms/cocoa/qnswindow.h index dcbcd58901..2827e41049 100644 --- a/src/plugins/platforms/cocoa/qnswindow.h +++ b/src/plugins/platforms/cocoa/qnswindow.h @@ -60,15 +60,7 @@ QT_FORWARD_DECLARE_CLASS(QCocoaWindow) #define QNSWindowProtocol QT_MANGLE_NAMESPACE(QNSWindowProtocol) @protocol QNSWindowProtocol -@optional -- (BOOL)canBecomeKeyWindow; -- (BOOL)worksWhenModal; -- (void)sendEvent:(NSEvent*)theEvent; - (void)closeAndRelease; -- (void)dealloc; -- (BOOL)isOpaque; -- (NSColor *)backgroundColor; -- (NSString *)description; @property (nonatomic, readonly) QCocoaWindow *platformWindow; @end diff --git a/src/plugins/platforms/cocoa/qnswindow.mm b/src/plugins/platforms/cocoa/qnswindow.mm index 28a9fa8607..3a1a04f887 100644 --- a/src/plugins/platforms/cocoa/qnswindow.mm +++ b/src/plugins/platforms/cocoa/qnswindow.mm @@ -37,6 +37,8 @@ ** ****************************************************************************/ +#if !defined(QNSWINDOW_PROTOCOL_IMPLMENTATION) + #include "qnswindow.h" #include "qcocoawindow.h" #include "qcocoahelpers.h" @@ -89,183 +91,10 @@ static bool isMouseEvent(NSEvent *ev) } @end -#define super USE_qt_objcDynamicSuper_INSTEAD - @implementation QNSWindow - -+ (void)load -{ - const Class windowClass = [self class]; - const Class panelClass = [QNSPanel class]; - - unsigned int protocolCount; - Protocol **protocols = class_copyProtocolList(windowClass, &protocolCount); - for (unsigned int i = 0; i < protocolCount; ++i) { - Protocol *protocol = protocols[i]; - - unsigned int methodDescriptionsCount; - objc_method_description *methods = protocol_copyMethodDescriptionList( - protocol, NO, YES, &methodDescriptionsCount); - - for (unsigned int j = 0; j < methodDescriptionsCount; ++j) { - objc_method_description method = methods[j]; - class_addMethod(panelClass, method.name, - class_getMethodImplementation(windowClass, method.name), - method.types); - } - free(methods); - } - - free(protocols); -} - -- (QCocoaWindow *)platformWindow -{ - return qnsview_cast(self.contentView).platformWindow; -} - -- (NSString *)description -{ - NSMutableString *description = [NSMutableString stringWithString:qt_objcDynamicSuper()]; - -#ifndef QT_NO_DEBUG_STREAM - QString contentViewDescription; - QDebug debug(&contentViewDescription); - debug.nospace() << "; contentView=" << qnsview_cast(self.contentView) << ">"; - - NSRange lastCharacter = [description rangeOfComposedCharacterSequenceAtIndex:description.length - 1]; - [description replaceCharactersInRange:lastCharacter withString:contentViewDescription.toNSString()]; -#endif - - return description; -} - -- (BOOL)canBecomeKeyWindow -{ - QCocoaWindow *pw = self.platformWindow; - if (!pw) - return NO; - - if (pw->shouldRefuseKeyWindowAndFirstResponder()) - return NO; - - if ([self isKindOfClass:[QNSPanel class]]) { - // Only tool or dialog windows should become key: - Qt::WindowType type = pw->window()->type(); - if (type == Qt::Tool || type == Qt::Dialog) - return YES; - - return NO; - } else { - // The default implementation returns NO for title-bar less windows, - // override and return yes here to make sure popup windows such as - // the combobox popup can become the key window. - return YES; - } -} - -- (BOOL)canBecomeMainWindow -{ - BOOL canBecomeMain = YES; // By default, windows can become the main window - - // Windows with a transient parent (such as combobox popup windows) - // cannot become the main window: - QCocoaWindow *pw = self.platformWindow; - if (!pw || pw->window()->transientParent()) - canBecomeMain = NO; - - return canBecomeMain; -} - -- (BOOL)worksWhenModal -{ - if ([self isKindOfClass:[QNSPanel class]]) { - if (QCocoaWindow *pw = self.platformWindow) { - Qt::WindowType type = pw->window()->type(); - if (type == Qt::Popup || type == Qt::Dialog || type == Qt::Tool) - return YES; - } - } - - return qt_objcDynamicSuper(); -} - -- (BOOL)isOpaque -{ - return self.platformWindow ? - self.platformWindow->isOpaque() : qt_objcDynamicSuper(); -} - -/*! - Borderless windows need a transparent background - - Technically windows with NSWindowStyleMaskTexturedBackground - (such as windows with unified toolbars) need to draw the textured - background of the NSWindow, and can't have a transparent - background, but as NSWindowStyleMaskBorderless is 0, you can't - have a window with NSWindowStyleMaskTexturedBackground that is - also borderless. -*/ -- (NSColor *)backgroundColor -{ - return self.styleMask == NSWindowStyleMaskBorderless - ? [NSColor clearColor] : qt_objcDynamicSuper(); -} - -- (void)sendEvent:(NSEvent*)theEvent -{ - qCDebug(lcQpaEvents) << "Sending" << theEvent << "to" << self; - - // We might get events for a NSWindow after the corresponding platform - // window has been deleted, as the NSWindow can outlive the QCocoaWindow - // e.g. if being retained by other parts of AppKit, or in an auto-release - // pool. We guard against this in QNSView as well, as not all callbacks - // come via events, but if they do there's no point in propagating them. - if (!self.platformWindow) - return; - - // Prevent deallocation of this NSWindow during event delivery, as we - // have logic further below that depends on the window being alive. - [[self retain] autorelease]; - - const char *eventType = object_getClassName(theEvent); - if (QWindowSystemInterface::handleNativeEvent(self.platformWindow->window(), - QByteArray::fromRawData(eventType, qstrlen(eventType)), theEvent, nullptr)) { - return; - } - - qt_objcDynamicSuper(theEvent); - - if (!self.platformWindow) - return; // Platform window went away while processing event - - QCocoaWindow *pw = self.platformWindow; - if (pw->frameStrutEventsEnabled() && isMouseEvent(theEvent)) { - NSPoint loc = [theEvent locationInWindow]; - NSRect windowFrame = [self convertRectFromScreen:self.frame]; - NSRect contentFrame = self.contentView.frame; - if (NSMouseInRect(loc, windowFrame, NO) && !NSMouseInRect(loc, contentFrame, NO)) - [qnsview_cast(pw->view()) handleFrameStrutMouseEvent:theEvent]; - } -} - -- (void)closeAndRelease -{ - qCDebug(lcQpaWindow) << "Closing and releasing" << self; - [self close]; - [self release]; -} - -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wobjc-missing-super-calls" -- (void)dealloc -{ - qCDebug(lcQpaWindow) << "Deallocating" << self; - self.delegate = nil; - - qt_objcDynamicSuper(); -} -#pragma clang diagnostic pop +#define QNSWINDOW_PROTOCOL_IMPLMENTATION 1 +#include "qnswindow.mm" +#undef QNSWINDOW_PROTOCOL_IMPLMENTATION + (void)applicationActivationChanged:(NSNotification*)notification { @@ -326,7 +155,158 @@ static bool isMouseEvent(NSEvent *ev) @end @implementation QNSPanel -// Implementation shared with QNSWindow, see +[QNSWindow load] above +#define QNSWINDOW_PROTOCOL_IMPLMENTATION 1 +#include "qnswindow.mm" +#undef QNSWINDOW_PROTOCOL_IMPLMENTATION @end -#undef super +#else // QNSWINDOW_PROTOCOL_IMPLMENTATION + +// The following methods are mixed in to the QNSWindow and QNSPanel classes via includes + +- (QCocoaWindow *)platformWindow +{ + return qnsview_cast(self.contentView).platformWindow; +} + +- (NSString *)description +{ + NSMutableString *description = [NSMutableString stringWithString:[super description]]; + +#ifndef QT_NO_DEBUG_STREAM + QString contentViewDescription; + QDebug debug(&contentViewDescription); + debug.nospace() << "; contentView=" << qnsview_cast(self.contentView) << ">"; + + NSRange lastCharacter = [description rangeOfComposedCharacterSequenceAtIndex:description.length - 1]; + [description replaceCharactersInRange:lastCharacter withString:contentViewDescription.toNSString()]; +#endif + + return description; +} + +- (BOOL)canBecomeKeyWindow +{ + QCocoaWindow *pw = self.platformWindow; + if (!pw) + return NO; + + if (pw->shouldRefuseKeyWindowAndFirstResponder()) + return NO; + + if ([self isKindOfClass:[QNSPanel class]]) { + // Only tool or dialog windows should become key: + Qt::WindowType type = pw->window()->type(); + if (type == Qt::Tool || type == Qt::Dialog) + return YES; + + return NO; + } else { + // The default implementation returns NO for title-bar less windows, + // override and return yes here to make sure popup windows such as + // the combobox popup can become the key window. + return YES; + } +} + +- (BOOL)canBecomeMainWindow +{ + BOOL canBecomeMain = YES; // By default, windows can become the main window + + // Windows with a transient parent (such as combobox popup windows) + // cannot become the main window: + QCocoaWindow *pw = self.platformWindow; + if (!pw || pw->window()->transientParent()) + canBecomeMain = NO; + + return canBecomeMain; +} + +- (BOOL)worksWhenModal +{ + if ([self isKindOfClass:[QNSPanel class]]) { + if (QCocoaWindow *pw = self.platformWindow) { + Qt::WindowType type = pw->window()->type(); + if (type == Qt::Popup || type == Qt::Dialog || type == Qt::Tool) + return YES; + } + } + + return [super worksWhenModal]; +} + +- (BOOL)isOpaque +{ + return self.platformWindow ? + self.platformWindow->isOpaque() : [super isOpaque]; +} + +/*! + Borderless windows need a transparent background + + Technically windows with NSWindowStyleMaskTexturedBackground + (such as windows with unified toolbars) need to draw the textured + background of the NSWindow, and can't have a transparent + background, but as NSWindowStyleMaskBorderless is 0, you can't + have a window with NSWindowStyleMaskTexturedBackground that is + also borderless. +*/ +- (NSColor *)backgroundColor +{ + return self.styleMask == NSWindowStyleMaskBorderless + ? [NSColor clearColor] : [super backgroundColor]; +} + +- (void)sendEvent:(NSEvent*)theEvent +{ + qCDebug(lcQpaEvents) << "Sending" << theEvent << "to" << self; + + // We might get events for a NSWindow after the corresponding platform + // window has been deleted, as the NSWindow can outlive the QCocoaWindow + // e.g. if being retained by other parts of AppKit, or in an auto-release + // pool. We guard against this in QNSView as well, as not all callbacks + // come via events, but if they do there's no point in propagating them. + if (!self.platformWindow) + return; + + // Prevent deallocation of this NSWindow during event delivery, as we + // have logic further below that depends on the window being alive. + [[self retain] autorelease]; + + const char *eventType = object_getClassName(theEvent); + if (QWindowSystemInterface::handleNativeEvent(self.platformWindow->window(), + QByteArray::fromRawData(eventType, qstrlen(eventType)), theEvent, nullptr)) { + return; + } + + [super sendEvent:theEvent]; + + if (!self.platformWindow) + return; // Platform window went away while processing event + + QCocoaWindow *pw = self.platformWindow; + if (pw->frameStrutEventsEnabled() && isMouseEvent(theEvent)) { + NSPoint loc = [theEvent locationInWindow]; + NSRect windowFrame = [self convertRectFromScreen:self.frame]; + NSRect contentFrame = self.contentView.frame; + if (NSMouseInRect(loc, windowFrame, NO) && !NSMouseInRect(loc, contentFrame, NO)) + [qnsview_cast(pw->view()) handleFrameStrutMouseEvent:theEvent]; + } +} + +- (void)closeAndRelease +{ + qCDebug(lcQpaWindow) << "Closing and releasing" << self; + [self close]; + [self release]; +} + +- (void)dealloc +{ + qCDebug(lcQpaWindow) << "Deallocating" << self; + self.delegate = nil; + + [super dealloc]; +} + +#endif From 0a2e91328e6340b6ecfeb4ee202ab1527cefaeca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 13 Feb 2019 13:50:02 +0100 Subject: [PATCH 02/32] macOS: Set up platform window reference before initializing QNSWindow/Panel Initializing the window will end up in [NSWindow _commonAwake], which calls many of the getters. We need to set up the platform window reference first, so we can properly reflect the window's state during initialization. Change-Id: I5349273b1930ee8a57dc518db74be90d2426f61c Reviewed-by: Timur Pocheptsov --- src/plugins/platforms/cocoa/qcocoascreen.mm | 3 +- src/plugins/platforms/cocoa/qcocoawindow.mm | 3 +- src/plugins/platforms/cocoa/qnswindow.h | 3 ++ src/plugins/platforms/cocoa/qnswindow.mm | 55 ++++++++++++--------- 4 files changed, 39 insertions(+), 25 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoascreen.mm b/src/plugins/platforms/cocoa/qcocoascreen.mm index 830a387fd1..6a5b0e6e3e 100644 --- a/src/plugins/platforms/cocoa/qcocoascreen.mm +++ b/src/plugins/platforms/cocoa/qcocoascreen.mm @@ -410,8 +410,7 @@ QWindow *QCocoaScreen::topLevelAt(const QPoint &point) const if (![nsWindow conformsToProtocol:@protocol(QNSWindowProtocol)]) continue; - id proto = static_cast >(nsWindow); - QCocoaWindow *cocoaWindow = proto.platformWindow; + QCocoaWindow *cocoaWindow = qnsview_cast(nsWindow.contentView).platformWindow; if (!cocoaWindow) continue; window = cocoaWindow->window(); diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 2718dc9600..d1047e1965 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -1539,7 +1539,8 @@ QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel) // Deferring window creation breaks OpenGL (the GL context is // set up before the window is shown and needs a proper window) backing:NSBackingStoreBuffered defer:NO - screen:cocoaScreen->nativeScreen()]; + screen:cocoaScreen->nativeScreen() + platformWindow:this]; Q_ASSERT_X(nsWindow.screen == cocoaScreen->nativeScreen(), "QCocoaWindow", "Resulting NSScreen should match the requested NSScreen"); diff --git a/src/plugins/platforms/cocoa/qnswindow.h b/src/plugins/platforms/cocoa/qnswindow.h index 2827e41049..5fc48d826f 100644 --- a/src/plugins/platforms/cocoa/qnswindow.h +++ b/src/plugins/platforms/cocoa/qnswindow.h @@ -60,6 +60,9 @@ QT_FORWARD_DECLARE_CLASS(QCocoaWindow) #define QNSWindowProtocol QT_MANGLE_NAMESPACE(QNSWindowProtocol) @protocol QNSWindowProtocol +- (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSWindowStyleMask)style + backing:(NSBackingStoreType)backingStoreType defer:(BOOL)flag screen:(NSScreen *)screen + platformWindow:(QCocoaWindow*)window; - (void)closeAndRelease; @property (nonatomic, readonly) QCocoaWindow *platformWindow; @end diff --git a/src/plugins/platforms/cocoa/qnswindow.mm b/src/plugins/platforms/cocoa/qnswindow.mm index 3a1a04f887..52f765eb31 100644 --- a/src/plugins/platforms/cocoa/qnswindow.mm +++ b/src/plugins/platforms/cocoa/qnswindow.mm @@ -162,11 +162,28 @@ static bool isMouseEvent(NSEvent *ev) #else // QNSWINDOW_PROTOCOL_IMPLMENTATION -// The following methods are mixed in to the QNSWindow and QNSPanel classes via includes +// The following content is mixed in to the QNSWindow and QNSPanel classes via includes + +{ + // Member variables + QPointer m_platformWindow; +} + +- (instancetype)initWithContentRect:(NSRect)contentRect styleMask:(NSWindowStyleMask)style + backing:(NSBackingStoreType)backingStoreType defer:(BOOL)defer screen:(NSScreen *)screen + platformWindow:(QCocoaWindow*)window +{ + // Initializing the window will end up in [NSWindow _commonAwake], which calls many + // of the getters below. We need to set up the platform window reference first, so + // we can properly reflect the window's state during initialization. + m_platformWindow = window; + + return [super initWithContentRect:contentRect styleMask:style backing:backingStoreType defer:defer screen:screen]; +} - (QCocoaWindow *)platformWindow { - return qnsview_cast(self.contentView).platformWindow; + return m_platformWindow; } - (NSString *)description @@ -187,16 +204,15 @@ static bool isMouseEvent(NSEvent *ev) - (BOOL)canBecomeKeyWindow { - QCocoaWindow *pw = self.platformWindow; - if (!pw) + if (!m_platformWindow) return NO; - if (pw->shouldRefuseKeyWindowAndFirstResponder()) + if (m_platformWindow->shouldRefuseKeyWindowAndFirstResponder()) return NO; if ([self isKindOfClass:[QNSPanel class]]) { // Only tool or dialog windows should become key: - Qt::WindowType type = pw->window()->type(); + Qt::WindowType type = m_platformWindow->window()->type(); if (type == Qt::Tool || type == Qt::Dialog) return YES; @@ -215,8 +231,7 @@ static bool isMouseEvent(NSEvent *ev) // Windows with a transient parent (such as combobox popup windows) // cannot become the main window: - QCocoaWindow *pw = self.platformWindow; - if (!pw || pw->window()->transientParent()) + if (!m_platformWindow || m_platformWindow->window()->transientParent()) canBecomeMain = NO; return canBecomeMain; @@ -224,12 +239,10 @@ static bool isMouseEvent(NSEvent *ev) - (BOOL)worksWhenModal { - if ([self isKindOfClass:[QNSPanel class]]) { - if (QCocoaWindow *pw = self.platformWindow) { - Qt::WindowType type = pw->window()->type(); - if (type == Qt::Popup || type == Qt::Dialog || type == Qt::Tool) - return YES; - } + if (m_platformWindow && [self isKindOfClass:[QNSPanel class]]) { + Qt::WindowType type = m_platformWindow->window()->type(); + if (type == Qt::Popup || type == Qt::Dialog || type == Qt::Tool) + return YES; } return [super worksWhenModal]; @@ -237,8 +250,7 @@ static bool isMouseEvent(NSEvent *ev) - (BOOL)isOpaque { - return self.platformWindow ? - self.platformWindow->isOpaque() : [super isOpaque]; + return m_platformWindow ? m_platformWindow->isOpaque() : [super isOpaque]; } /*! @@ -266,7 +278,7 @@ static bool isMouseEvent(NSEvent *ev) // e.g. if being retained by other parts of AppKit, or in an auto-release // pool. We guard against this in QNSView as well, as not all callbacks // come via events, but if they do there's no point in propagating them. - if (!self.platformWindow) + if (!m_platformWindow) return; // Prevent deallocation of this NSWindow during event delivery, as we @@ -274,23 +286,22 @@ static bool isMouseEvent(NSEvent *ev) [[self retain] autorelease]; const char *eventType = object_getClassName(theEvent); - if (QWindowSystemInterface::handleNativeEvent(self.platformWindow->window(), + if (QWindowSystemInterface::handleNativeEvent(m_platformWindow->window(), QByteArray::fromRawData(eventType, qstrlen(eventType)), theEvent, nullptr)) { return; } [super sendEvent:theEvent]; - if (!self.platformWindow) + if (!m_platformWindow) return; // Platform window went away while processing event - QCocoaWindow *pw = self.platformWindow; - if (pw->frameStrutEventsEnabled() && isMouseEvent(theEvent)) { + if (m_platformWindow->frameStrutEventsEnabled() && isMouseEvent(theEvent)) { NSPoint loc = [theEvent locationInWindow]; NSRect windowFrame = [self convertRectFromScreen:self.frame]; NSRect contentFrame = self.contentView.frame; if (NSMouseInRect(loc, windowFrame, NO) && !NSMouseInRect(loc, contentFrame, NO)) - [qnsview_cast(pw->view()) handleFrameStrutMouseEvent:theEvent]; + [qnsview_cast(m_platformWindow->view()) handleFrameStrutMouseEvent:theEvent]; } } From 11111c5a7d71024f281322d9b310ce37210fc4c2 Mon Sep 17 00:00:00 2001 From: Yuhang Zhao <2546789017@qq.com> Date: Wed, 13 Feb 2019 20:18:39 +0800 Subject: [PATCH 03/32] qmake: Optimize for speed instead of size Change-Id: Ide06365f3ba0db673749a9938afc18fdf7480542 Reviewed-by: Christian Ehrlicher Reviewed-by: Joerg Bornemann --- qmake/Makefile.win32 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index 3f13df884a..506e9deb19 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -13,7 +13,7 @@ QMKSRC = $(SOURCE_PATH)\qmake !if "$(QMAKESPEC)" == "win32-icc" CXX = icl LINKER = xilink -CFLAGS_EXTRA = /Zc:forScope /Qstd=c++11 +CFLAGS_EXTRA = /Zc:forScope /Qstd=c++11 /O3 !elseif "$(QMAKESPEC)" == "win32-clang-msvc" CXX = clang-cl LINKER = lld-link @@ -30,7 +30,7 @@ PCH_OBJECT = qmake_pch.obj !endif CFLAGS_BARE = -c -Fo./ -Fdqmake.pdb \ - -W2 -nologo -O1 \ + -W2 -nologo -O2 \ $(CFLAGS_EXTRA) \ -I$(QMKSRC) -I$(QMKSRC)\library -I$(QMKSRC)\generators -I$(QMKSRC)\generators\unix -I$(QMKSRC)\generators\win32 -I$(QMKSRC)\generators\mac \ -I$(INC_PATH) -I$(INC_PATH)\QtCore -I$(INC_PATH)\QtCore\$(QT_VERSION) -I$(INC_PATH)\QtCore\$(QT_VERSION)\QtCore \ From 8796e3016fae1672e727e2fa4e48f671a0c667ba Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 11 Feb 2019 12:50:03 +0100 Subject: [PATCH 04/32] Android: Add support for getting the UiLanguages From API 24 it is possible to get the UiLanguages correctly from Android so if API 24 or later is available we should use this. If it is not available, then it will fallback to the original behavior of using the system language. Fixes: QTBUG-68019 Change-Id: I4cfbc2b807b361c08da56a74100ba59abf5f2d0f Reviewed-by: Edward Welbourne --- .../platforms/android/qandroidsystemlocale.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/plugins/platforms/android/qandroidsystemlocale.cpp b/src/plugins/platforms/android/qandroidsystemlocale.cpp index 7fe36aa9bc..f9d566ff1a 100644 --- a/src/plugins/platforms/android/qandroidsystemlocale.cpp +++ b/src/plugins/platforms/android/qandroidsystemlocale.cpp @@ -40,6 +40,7 @@ #include "qandroidsystemlocale.h" #include "androidjnimain.h" #include +#include #include "qdatetime.h" #include "qstringlist.h" #include "qvariant.h" @@ -162,6 +163,23 @@ QVariant QAndroidSystemLocale::query(QueryType type, QVariant in) const return m_locale.createSeparatedList(in.value()); case LocaleChanged: Q_ASSERT_X(false, Q_FUNC_INFO, "This can't happen."); + case UILanguages: { + if (QtAndroidPrivate::androidSdkVersion() >= 24) { + QJNIObjectPrivate localeListObject = + QJNIObjectPrivate::callStaticObjectMethod("android/os/LocaleList", "getDefault", + "()Landroid/os/LocaleList;"); + if (localeListObject.isValid()) { + QString lang = localeListObject.callObjectMethod("toLanguageTags", + "()Ljava/lang/String;").toString(); + // Some devices return with it enclosed in []'s so check if both exists before + // removing to ensure it is formatted correctly + if (lang.startsWith(QChar('[')) && lang.endsWith(QChar(']'))) + lang = lang.mid(1, lang.length() - 2); + return lang.split(QChar(',')); + } + } + return QVariant(); + } default: break; } From 3c74042c3db8c68e47ed1f0c2ecd4d39a2d84912 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Mon, 11 Feb 2019 14:22:13 +0200 Subject: [PATCH 05/32] Load main library as soon as possible Delaying the main library load cause serious problems for people who want to access it's functions from java before the main method is called. Change-Id: I87f3a8282003395e003b06978048762eeabe6548 Fixes: QTBUG-68813 Reviewed-by: Andy Shaw --- .../qt5/android/QtActivityDelegate.java | 17 +++-- .../org/qtproject/qt5/android/QtNative.java | 65 +++++++++++-------- .../qt5/android/QtServiceDelegate.java | 14 ++-- 3 files changed, 51 insertions(+), 45 deletions(-) diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java index 02033859e9..4b87c25787 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java @@ -606,11 +606,14 @@ public class QtActivityDelegate } QtNative.loadQtLibraries(loaderParams.getStringArrayList(NATIVE_LIBRARIES_KEY)); ArrayList libraries = loaderParams.getStringArrayList(BUNDLED_LIBRARIES_KEY); - QtNative.loadBundledLibraries(libraries, QtNativeLibrariesDir.nativeLibrariesDir(m_activity)); + String nativeLibsDir = QtNativeLibrariesDir.nativeLibrariesDir(m_activity); + QtNative.loadBundledLibraries(libraries, nativeLibsDir); m_mainLib = loaderParams.getString(MAIN_LIBRARY_KEY); // older apps provide the main library as the last bundled library; look for this if the main library isn't provided - if (null == m_mainLib && libraries.size() > 0) + if (null == m_mainLib && libraries.size() > 0) { m_mainLib = libraries.get(libraries.size() - 1); + libraries.remove(libraries.size() - 1); + } if (loaderParams.containsKey(EXTRACT_STYLE_KEY)) { String path = loaderParams.getString(EXTRACT_STYLE_KEY); @@ -664,8 +667,8 @@ public class QtActivityDelegate } catch (Exception e) { e.printStackTrace(); } - - return true; + m_mainLib = QtNative.loadMainLibrary(m_mainLib, nativeLibsDir); + return m_mainLib != null; } public boolean startApplication() @@ -728,11 +731,7 @@ public class QtActivityDelegate @Override public void run() { try { - String nativeLibraryDir = QtNativeLibrariesDir.nativeLibrariesDir(m_activity); - QtNative.startApplication(m_applicationParameters, - m_environmentVariables, - m_mainLib, - nativeLibraryDir); + QtNative.startApplication(m_applicationParameters, m_environmentVariables, m_mainLib); m_started = true; } catch (Exception e) { e.printStackTrace(); diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java index 5562c010aa..1d2b70ab5f 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtNative.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtNative.java @@ -231,6 +231,41 @@ public class QtNative }); } + public static String loadMainLibrary(final String mainLibrary, final String nativeLibraryDir) + { + final String[] res = new String[1]; + res[0] = null; + m_qtThread.run(new Runnable() { + @Override + public void run() { + try { + String mainLibNameTemplate = "lib" + mainLibrary + ".so"; + File f = new File(nativeLibraryDir + mainLibNameTemplate); + if (!f.exists()) { + try { + ActivityInfo info = m_activity.getPackageManager().getActivityInfo(m_activity.getComponentName(), + PackageManager.GET_META_DATA); + String systemLibraryDir = QtNativeLibrariesDir.systemLibrariesDir; + if (info.metaData.containsKey("android.app.system_libs_prefix")) + systemLibraryDir = info.metaData.getString("android.app.system_libs_prefix"); + f = new File(systemLibraryDir + mainLibNameTemplate); + } catch (Exception e) { + e.printStackTrace(); + return; + } + } + if (!f.exists()) + return; + System.load(f.getAbsolutePath()); + res[0] = f.getAbsolutePath(); + } catch (Exception e) { + Log.e(QtTAG, "Can't load '" + mainLibrary + "'", e); + } + } + }); + return res[0]; + } + public static void setActivity(Activity qtMainActivity, QtActivityDelegate qtActivityDelegate) { synchronized (m_mainActivityMutex) { @@ -308,46 +343,20 @@ public class QtNative }); } - public static boolean startApplication(String params, - final String environment, - String mainLibrary, - String nativeLibraryDir) throws Exception + public static boolean startApplication(String params, final String environment, String mainLib) throws Exception { - String mainLibNameTemplate = "lib" + mainLibrary + ".so"; - File f = new File(nativeLibraryDir + mainLibNameTemplate); - if (!f.exists()) { - try { - ActivityInfo info = m_activity.getPackageManager().getActivityInfo(m_activity.getComponentName(), - PackageManager.GET_META_DATA); - String systemLibraryDir = QtNativeLibrariesDir.systemLibrariesDir; - if (info.metaData.containsKey("android.app.system_libs_prefix")) - systemLibraryDir = info.metaData.getString("android.app.system_libs_prefix"); - f = new File(systemLibraryDir + mainLibNameTemplate); - } catch (Exception e) { - - } - } - if (!f.exists()) - throw new Exception("Can't find main library '" + mainLibrary + "'"); - if (params == null) params = "-platform\tandroid"; - final String mainLibraryPath = f.getAbsolutePath(); final boolean[] res = new boolean[1]; res[0] = false; synchronized (m_mainActivityMutex) { if (params.length() > 0 && !params.startsWith("\t")) params = "\t" + params; - final String qtParams = f.getAbsolutePath() + params; + final String qtParams = mainLib + params; m_qtThread.run(new Runnable() { @Override public void run() { - try { - System.load(mainLibraryPath); - } catch (Exception e) { - Log.i(QtTAG, "Can't load '" + mainLibraryPath + "'", e); - } res[0] = startQtAndroidPlugin(qtParams, environment); setDisplayMetrics(m_displayMetricsScreenWidthPixels, m_displayMetricsScreenHeightPixels, diff --git a/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java b/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java index ae06fa6268..33bcb364de 100644 --- a/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java +++ b/src/android/jar/src/org/qtproject/qt5/android/QtServiceDelegate.java @@ -98,8 +98,8 @@ public class QtServiceDelegate private static final String APP_DISPLAY_METRIC_SCREEN_YDPI_KEY = "display.screen.dpi.y"; private static final String APP_DISPLAY_METRIC_SCREEN_DENSITY_KEY = "display.screen.density"; + private String m_mainLib = null; private Service m_service = null; - private String m_mainLib; private static String m_environmentVariables = null; private static String m_applicationParameters = null; @@ -142,9 +142,9 @@ public class QtServiceDelegate } QtNative.loadQtLibraries(loaderParams.getStringArrayList(NATIVE_LIBRARIES_KEY)); ArrayList libraries = loaderParams.getStringArrayList(BUNDLED_LIBRARIES_KEY); - QtNative.loadBundledLibraries(libraries, QtNativeLibrariesDir.nativeLibrariesDir(m_service)); + String nativeLibsDir = QtNativeLibrariesDir.nativeLibrariesDir(m_service); + QtNative.loadBundledLibraries(libraries, nativeLibsDir); m_mainLib = loaderParams.getString(MAIN_LIBRARY_KEY); - m_environmentVariables = loaderParams.getString(ENVIRONMENT_VARIABLES_KEY); String additionalEnvironmentVariables = "QT_ANDROID_FONTS_MONOSPACE=Droid Sans Mono;Droid Sans;Droid Sans Fallback" + "\tQT_ANDROID_FONTS_SERIF=Droid Serif" @@ -165,7 +165,8 @@ public class QtServiceDelegate else m_applicationParameters = ""; - return true; + m_mainLib = QtNative.loadMainLibrary(m_mainLib, nativeLibsDir); + return m_mainLib != null; } public boolean startApplication() @@ -173,10 +174,7 @@ public class QtServiceDelegate // start application try { String nativeLibraryDir = QtNativeLibrariesDir.nativeLibrariesDir(m_service); - QtNative.startApplication(m_applicationParameters, - m_environmentVariables, - m_mainLib, - nativeLibraryDir); + QtNative.startApplication(m_applicationParameters, m_environmentVariables, m_mainLib); return true; } catch (Exception e) { e.printStackTrace(); From 36a294d1aa18ba67989d505eadf4b9c2012c0c9e Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 13 Feb 2019 14:06:31 +0100 Subject: [PATCH 06/32] Emit returnPressed() signal for the lineEdit embedded in QDateTimeEdit f78842abe429dc9b42fd15dc8e9e842ab72dcf2b added the emission of the signal in QAbstractLineEdit::keyPressEvent(). This patch also emits it for QDateTimeEdit. Fixes: QTBUG-73725 Change-Id: I66d577f5d4b60ad57987b26e7a1c1f20fad47782 Reviewed-by: Edward Welbourne Reviewed-by: Richard Moe Gustavsen --- src/widgets/widgets/qdatetimeedit.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp index c66400f423..41d9faa5c2 100644 --- a/src/widgets/widgets/qdatetimeedit.cpp +++ b/src/widgets/widgets/qdatetimeedit.cpp @@ -1092,6 +1092,7 @@ void QDateTimeEdit::keyPressEvent(QKeyEvent *event) d->setSelected(d->currentSectionIndex, true); event->ignore(); emit editingFinished(); + emit d->edit->returnPressed(); return; default: #ifdef QT_KEYPAD_NAVIGATION From 55e31e6389c78218f1f9039a4bf642db68a86975 Mon Sep 17 00:00:00 2001 From: Dmitry Sokolov Date: Thu, 14 Feb 2019 11:12:18 +0100 Subject: [PATCH 07/32] Kludge popen/pclose calls on MS-Win For MS Visual Studio we need to use _popen() and _pclose() instead of the POSIX functions; and the pipe needs to be opened in binary mode. Change-Id: Ide0fb26a1e5f121b384b0baaf8100f26c614ccc6 Fixes: QTBUG-73810 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/tools/androiddeployqt/main.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index 712a8091fb..b0df833b87 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -43,6 +43,15 @@ #include #include + +#ifdef Q_CC_MSVC +#define popen _popen +#define QT_POPEN_READ "rb" +#define pclose _pclose +#else +#define QT_POPEN_READ "r" +#endif + static const bool mustReadOutputAnyway = true; // pclose seems to return the wrong error code unless we read the output void deleteRecursively(const QString &dirName) @@ -70,7 +79,7 @@ FILE *openProcess(const QString &command) QString processedCommand = command; #endif - return popen(processedCommand.toLocal8Bit().constData(), "r"); + return popen(processedCommand.toLocal8Bit().constData(), QT_POPEN_READ); } struct QtDependency @@ -1721,7 +1730,7 @@ bool scanImports(Options *options, QSet *usedDependencies) .arg(shellQuote(rootPath)) .arg(importPaths.join(QLatin1Char(' '))); - FILE *qmlImportScannerCommand = popen(qmlImportScanner.toLocal8Bit().constData(), "r"); + FILE *qmlImportScannerCommand = popen(qmlImportScanner.toLocal8Bit().constData(), QT_POPEN_READ); if (qmlImportScannerCommand == 0) { fprintf(stderr, "Couldn't run qmlimportscanner.\n"); return false; @@ -2160,7 +2169,7 @@ bool createAndroidProject(const Options &options) if (options.verbose) fprintf(stdout, " -- Command: %s\n", qPrintable(androidTool)); - FILE *androidToolCommand = popen(androidTool.toLocal8Bit().constData(), "r"); + FILE *androidToolCommand = popen(androidTool.toLocal8Bit().constData(), QT_POPEN_READ); if (androidToolCommand == 0) { fprintf(stderr, "Cannot run command '%s'\n", qPrintable(androidTool)); return false; From 441520141ead6dec74f3bdbb4c1d1e48d3356435 Mon Sep 17 00:00:00 2001 From: Dmitry Sokolov Date: Thu, 14 Feb 2019 10:49:52 +0100 Subject: [PATCH 08/32] Inline expression to bypass compiler bug MSVC managed to trigger the this != &other assertion in QString(const QString &other); so just skip creation of the intermediate string in the function whose body tripped over this. Change-Id: I687003cfc588531018c6069863ce2a76078c8e3f Fixes: QTBUG-73802 Reviewed-by: Joerg Bornemann --- qmake/generators/makefile.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 6a46df1af6..7762e47f41 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -81,8 +81,8 @@ bool MakefileGenerator::canExecute(const QStringList &cmdline, int *a) const QString MakefileGenerator::mkdir_p_asstring(const QString &dir, bool escape) const { - QString edir = escape ? escapeFilePath(Option::fixPathToTargetOS(dir, false, false)) : dir; - return "@" + makedir.arg(edir); + return "@" + makedir.arg( + escape ? escapeFilePath(Option::fixPathToTargetOS(dir, false, false)) : dir); } bool MakefileGenerator::mkdir(const QString &in_path) const From 4c759340081384e7b9fae5d2179d25016dc1dda6 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 7 Jan 2019 12:14:19 +0100 Subject: [PATCH 09/32] Fix a couple of SQL tests One of the tests was not added to the parent subdirectory pro so this is also rectified. Change-Id: I270f1c2882260e3e3fac83d074ed6444c5dece19 Reviewed-by: Edward Welbourne --- tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp | 2 +- tests/auto/sql/models/models.pro | 8 ++++---- .../qsqlrelationaldelegate/tst_qsqlrelationaldelegate.cpp | 3 ++- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp index 8cf43e243b..af6b6ca881 100644 --- a/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp +++ b/tests/auto/sql/kernel/qsqldatabase/tst_qsqldatabase.cpp @@ -909,7 +909,7 @@ void tst_QSqlDatabase::recordMySQL() FieldDef("date", QVariant::Date, QDate::currentDate()), FieldDef("datetime", QVariant::DateTime, dt), FieldDef("timestamp", QVariant::DateTime, dt, false), - FieldDef("time", QVariant::Time, dt.time()), + FieldDef("time", QVariant::String, dt.time()), FieldDef("year", QVariant::Int, 2003), FieldDef("char(20)", QVariant::String, "Blah"), FieldDef("varchar(20)", QVariant::String, "BlahBlah"), diff --git a/tests/auto/sql/models/models.pro b/tests/auto/sql/models/models.pro index 2c3ae4ef0a..da807f4351 100644 --- a/tests/auto/sql/models/models.pro +++ b/tests/auto/sql/models/models.pro @@ -1,8 +1,8 @@ TEMPLATE=subdirs -SUBDIRS=\ +qtHaveModule(widgets): SUBDIRS = \ qsqlquerymodel \ - qsqlrelationaltablemodel \ + qsqlrelationaldelegate + +SUBDIRS += qsqlrelationaltablemodel \ qsqltablemodel \ -!qtHaveModule(widgets): SUBDIRS -= \ - qsqlquerymodel diff --git a/tests/auto/sql/models/qsqlrelationaldelegate/tst_qsqlrelationaldelegate.cpp b/tests/auto/sql/models/qsqlrelationaldelegate/tst_qsqlrelationaldelegate.cpp index 36f592395e..a7089c06a1 100644 --- a/tests/auto/sql/models/qsqlrelationaldelegate/tst_qsqlrelationaldelegate.cpp +++ b/tests/auto/sql/models/qsqlrelationaldelegate/tst_qsqlrelationaldelegate.cpp @@ -158,12 +158,13 @@ void tst_QSqlRelationalDelegate::comboBoxEditor() QTest::keyClick(editor, Qt::Key_Down); QTest::keyClick(editor, Qt::Key_Enter); QCOMPARE(editor->currentText(), "mister"); + QTest::keyClick(tv.viewport(), Qt::Key_Tab); QVERIFY_SQL(model, submitAll()); QSqlQuery qry(db); QVERIFY_SQL(qry, exec("SELECT title_key FROM " + reltest1 + " WHERE id=1")); QVERIFY(qry.next()); - QCOMPARE(qry.value(0).toString(), "mister"); + QCOMPARE(qry.value(0).toString(), "2"); } QTEST_MAIN(tst_QSqlRelationalDelegate) From 2fc4635e9889ade1ae79b787cc18aae654e65e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 19 Feb 2019 11:14:53 +0100 Subject: [PATCH 10/32] macOS: Remove special handling for hiding tool windows on application hide MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code was needed when we had QCocoaWindow::hide(), that guarded the ordering out by checking the visible state of the NSWindow. We no longer have that method, and setVisible doesn't have the same guard. Added a comment in setVisible to prevent future travelers from adding logic that introduces the same situation. Change-Id: I0514619a303daceb1cd7d334f0de4bfce6c3e96f Reviewed-by: Andy Shaw Reviewed-by: Timur Pocheptsov Reviewed-by: Tor Arne Vestbø --- .../cocoa/qcocoaapplicationdelegate.mm | 36 ------------------- src/plugins/platforms/cocoa/qcocoawindow.mm | 5 +++ 2 files changed, 5 insertions(+), 36 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm index 9e3c89b6a4..e255719cc1 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm @@ -94,7 +94,6 @@ QT_USE_NAMESPACE bool startedQuit; NSObject *reflectionDelegate; bool inLaunch; - QWindowList hiddenWindows; } + (instancetype)sharedDelegate @@ -311,41 +310,6 @@ QT_USE_NAMESPACE return NO; // Someday qApp->quitOnLastWindowClosed(); when QApp and NSApp work closer together. } -- (void)applicationWillHide:(NSNotification *)notification -{ - if (reflectionDelegate - && [reflectionDelegate respondsToSelector:@selector(applicationWillHide:)]) { - [reflectionDelegate applicationWillHide:notification]; - } - - // When the application is hidden Qt will hide the popup windows associated with - // it when it has lost the activation for the application. However, when it gets - // to this point it believes the popup windows to be hidden already due to the - // fact that the application itself is hidden, which will cause a problem when - // the application is made visible again. - const QWindowList topLevelWindows = QGuiApplication::topLevelWindows(); - for (QWindow *topLevelWindow : topLevelWindows) { - if ((topLevelWindow->type() & Qt::Popup) == Qt::Popup && topLevelWindow->isVisible()) { - topLevelWindow->hide(); - - if ((topLevelWindow->type() & Qt::Tool) == Qt::Tool) - hiddenWindows << topLevelWindow; - } - } -} - -- (void)applicationDidUnhide:(NSNotification *)notification -{ - if (reflectionDelegate - && [reflectionDelegate respondsToSelector:@selector(applicationDidUnhide:)]) - [reflectionDelegate applicationDidUnhide:notification]; - - for (QWindow *window : qAsConst(hiddenWindows)) - window->show(); - - hiddenWindows.clear(); -} - - (void)applicationDidBecomeActive:(NSNotification *)notification { if (reflectionDelegate diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index d1047e1965..50adbad518 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -400,6 +400,11 @@ void QCocoaWindow::setVisible(bool visible) } } + // Note: We do not guard the order out by checking NSWindow.visible, as AppKit will + // in some cases, such as when hiding the application, order out and make a window + // invisible, but keep it in a list of "hidden windows", that it then restores again + // when the application is unhidden. We need to call orderOut explicitly, to bring + // the window out of this "hidden list". [m_view.window orderOut:nil]; if (m_view.window == [NSApp keyWindow] && !eventDispatcher()->hasModalSession()) { From 5c014a48dc9d831457184af1b4302cc4e61632a7 Mon Sep 17 00:00:00 2001 From: Lars Schmertmann Date: Mon, 28 Jan 2019 19:44:34 +0100 Subject: [PATCH 11/32] Add missing translations for Android Task-number: QTBUG-72895 Change-Id: Ia9f6d0809c1d8f408a0818367ceb96599c13cbca Reviewed-by: BogDan Vatra Reviewed-by: Sergey Belyashov Reviewed-by: Takumi ASAKI Reviewed-by: Liang Qi Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/android/java/res/values-el/strings.xml | 1 + src/android/java/res/values-es/strings.xml | 1 + src/android/java/res/values-et/strings.xml | 1 + src/android/java/res/values-fa/strings.xml | 1 + src/android/java/res/values-id/strings.xml | 1 + src/android/java/res/values-it/strings.xml | 1 + src/android/java/res/values-ja/strings.xml | 1 + src/android/java/res/values-ms/strings.xml | 1 + src/android/java/res/values-nb/strings.xml | 1 + src/android/java/res/values-nl/strings.xml | 1 + src/android/java/res/values-pl/strings.xml | 1 + src/android/java/res/values-pt-rBR/strings.xml | 1 + src/android/java/res/values-ro/strings.xml | 2 +- src/android/java/res/values-rs/strings.xml | 1 + src/android/java/res/values-ru/strings.xml | 1 + src/android/java/res/values-zh-rCN/strings.xml | 1 + src/android/java/res/values-zh-rTW/strings.xml | 1 + src/android/java/res/values/strings.xml | 2 +- 18 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/android/java/res/values-el/strings.xml b/src/android/java/res/values-el/strings.xml index 3cab212f2b..42b2b3b49d 100644 --- a/src/android/java/res/values-el/strings.xml +++ b/src/android/java/res/values-el/strings.xml @@ -3,4 +3,5 @@ Δεν ήταν δυνατή η εύρεση της υπηρεσίας Ministro. Δεν είναι δυνατή η εκκίνηση της εφαρμογής. Η εφαρμογή απαιτεί την υπηρεσία Ministro. Να εγκατασταθεί η υπηρεσία? Παρουσιάστηκε ένα κρίσιμο σφάλμα και η εφαρμογή δεν μπορεί να συνεχίσει. + Αυτή η έκδοση του Android δεν υποστηρίζεται. diff --git a/src/android/java/res/values-es/strings.xml b/src/android/java/res/values-es/strings.xml index cf0b54d0b0..1da33a6444 100644 --- a/src/android/java/res/values-es/strings.xml +++ b/src/android/java/res/values-es/strings.xml @@ -3,4 +3,5 @@ Servicio Ministro inesistente. Imposible ejecutar la aplicación. Esta aplicación requiere el servicio Ministro. Instalarlo? La aplicación ha causado un error grave y no es posible continuar. + Esta versión de Android no es compatible. diff --git a/src/android/java/res/values-et/strings.xml b/src/android/java/res/values-et/strings.xml index d55a3c1471..9620fd2bc8 100644 --- a/src/android/java/res/values-et/strings.xml +++ b/src/android/java/res/values-et/strings.xml @@ -3,4 +3,5 @@ Ei suuda leida Ministro teenust.\nProgrammi ei saa käivitada. See programm vajab Ministro teenust.\nKas soovite paigaldada? Programmiga juhtus fataalne viga.\nKahjuks ei saa jätkata. + Seda Androidi versiooni ei toetata. diff --git a/src/android/java/res/values-fa/strings.xml b/src/android/java/res/values-fa/strings.xml index a8d1b87444..d1ee06118a 100644 --- a/src/android/java/res/values-fa/strings.xml +++ b/src/android/java/res/values-fa/strings.xml @@ -3,4 +3,5 @@ سرویس Ministro را پیدا نمی‌کند. برنامه نمی‌تواند آغاز شود. این نرم‌افزار به سرویس Ministro احتیاج دارد. آیا دوست دارید آن را نصب کنید؟ خطایی اساسی در برنامه‌تان رخ داد و اجرای برنامه نمی‌تواند ادامه یابد. + این نسخه از Android پشتیبانی نمی شود diff --git a/src/android/java/res/values-id/strings.xml b/src/android/java/res/values-id/strings.xml index aaa5bda0de..b25f568ee9 100644 --- a/src/android/java/res/values-id/strings.xml +++ b/src/android/java/res/values-id/strings.xml @@ -3,4 +3,5 @@ Layanan Ministro tidak bisa ditemukan.\nAplikasi tidak bisa dimulai. Aplikasi ini membutuhkan layanan Ministro. Apakah Anda ingin menginstalnya? Aplikasi Anda mengalami kesalahan fatal dan tidak dapat melanjutkan. + Versi Android ini tidak didukung. diff --git a/src/android/java/res/values-it/strings.xml b/src/android/java/res/values-it/strings.xml index 4773419c44..9ba5fe2b1c 100644 --- a/src/android/java/res/values-it/strings.xml +++ b/src/android/java/res/values-it/strings.xml @@ -3,4 +3,5 @@ Servizio Ministro inesistente. Impossibile eseguire \nl\'applicazione. Questa applicazione richiede il servizio Ministro.Installarlo? L\'applicazione ha provocato un errore grave e non puo\' continuare. + Questa versione di Android non è supportata. diff --git a/src/android/java/res/values-ja/strings.xml b/src/android/java/res/values-ja/strings.xml index ba1cfda9ec..40da7dce48 100644 --- a/src/android/java/res/values-ja/strings.xml +++ b/src/android/java/res/values-ja/strings.xml @@ -3,4 +3,5 @@ Ministroサービスが見つかりません。\nアプリケーションが起動できません。 このアプリケーションにはMinistroサービスが必要です。 インストールしてもよろしいですか? アプリケーションで致命的なエラーが発生したため続行できません。 + このバージョンのAndroidはサポートされていません。 diff --git a/src/android/java/res/values-ms/strings.xml b/src/android/java/res/values-ms/strings.xml index 6e3952eaec..bd27890eb2 100644 --- a/src/android/java/res/values-ms/strings.xml +++ b/src/android/java/res/values-ms/strings.xml @@ -3,4 +3,5 @@ Tidak jumpa servis Ministro.\nAplikasi tidak boleh dimulakan. Aplikasi ini memerlukan servis Ministro. Adakah anda ingin pasang servis itu? Aplikasi anda menemui ralat muat dan tidak boleh diteruskan. + Versi Android ini tidak disokong. diff --git a/src/android/java/res/values-nb/strings.xml b/src/android/java/res/values-nb/strings.xml index 8a550e99a2..53529b7f52 100644 --- a/src/android/java/res/values-nb/strings.xml +++ b/src/android/java/res/values-nb/strings.xml @@ -3,4 +3,5 @@ Kan ikke finne tjenesten Ministro. Applikasjonen kan ikke starte. Denne applikasjonen krever tjenesten Ministro. Vil du installere denne? Applikasjonen fikk en kritisk feil og kan ikke fortsette + Denne versjonen av Android støttes ikke. diff --git a/src/android/java/res/values-nl/strings.xml b/src/android/java/res/values-nl/strings.xml index 8a45a724ff..7e54587f61 100644 --- a/src/android/java/res/values-nl/strings.xml +++ b/src/android/java/res/values-nl/strings.xml @@ -3,4 +3,5 @@ De Ministro service is niet gevonden.\nDe applicatie kan niet starten. Deze applicatie maakt gebruik van de Ministro service. Wilt u deze installeren? Er is een fatale fout in de applicatie opgetreden. De applicatie kan niet verder gaan. + Deze versie van Android wordt niet ondersteund. diff --git a/src/android/java/res/values-pl/strings.xml b/src/android/java/res/values-pl/strings.xml index 9fefc92dcd..e7feb01392 100644 --- a/src/android/java/res/values-pl/strings.xml +++ b/src/android/java/res/values-pl/strings.xml @@ -3,4 +3,5 @@ Usługa Ministro nie została znaleziona.\nAplikacja nie może zostać uruchomiona. Aplikacja wymaga usługi Ministro. Czy chcesz ją zainstalować? Wystąpił błąd krytyczny. Aplikacja zostanie zamknięta. + Ta wersja Androida nie jest obsługiwana. diff --git a/src/android/java/res/values-pt-rBR/strings.xml b/src/android/java/res/values-pt-rBR/strings.xml index 67ac3f9f98..4bac77c784 100644 --- a/src/android/java/res/values-pt-rBR/strings.xml +++ b/src/android/java/res/values-pt-rBR/strings.xml @@ -3,4 +3,5 @@ Não foi possível encontrar o serviço Ministro.\nA aplicação não pode iniciar. Essa aplicação requer o serviço Ministro. Gostaria de instalá-lo? Sua aplicação encontrou um erro fatal e não pode continuar. + Esta versão do Android não é suportada. diff --git a/src/android/java/res/values-ro/strings.xml b/src/android/java/res/values-ro/strings.xml index fef52ad3bd..d55c5b5c38 100644 --- a/src/android/java/res/values-ro/strings.xml +++ b/src/android/java/res/values-ro/strings.xml @@ -3,5 +3,5 @@ Serviciul Ministro nu poate fi găsit.\nAplicaţia nu poate porni. Această aplicaţie necesită serviciul Ministro.\nDoriţi să-l instalaţi? Aplicaţia dumneavoastră a întâmpinat o eroare fatală şi nu poate continua. - Versiune Android nesuportată. + Această versiune de Android nu este suportată. diff --git a/src/android/java/res/values-rs/strings.xml b/src/android/java/res/values-rs/strings.xml index 3194ce9022..2a1e8284ce 100644 --- a/src/android/java/res/values-rs/strings.xml +++ b/src/android/java/res/values-rs/strings.xml @@ -3,4 +3,5 @@ Ministro servise nije pronađen. Aplikacija ne može biti pokrenuta. Ova aplikacija zahteva Ministro servis. Želite li da ga instalirate? Vaša aplikacija je naišla na fatalnu grešku i ne može nastaviti sa radom. + Ova verzija Android-a nije podržana. diff --git a/src/android/java/res/values-ru/strings.xml b/src/android/java/res/values-ru/strings.xml index d3cee80f9d..ec853d22f9 100644 --- a/src/android/java/res/values-ru/strings.xml +++ b/src/android/java/res/values-ru/strings.xml @@ -3,4 +3,5 @@ Сервис Ministro не найден.\nПриложение нельзя запустить. Этому приложению необходим сервис Ministro. Вы хотите его установить? Ваше приложение столкнулось с фатальной ошибкой и не может более работать. + Эта версия Android не поддерживается. diff --git a/src/android/java/res/values-zh-rCN/strings.xml b/src/android/java/res/values-zh-rCN/strings.xml index 2eb1269880..58cdd89946 100644 --- a/src/android/java/res/values-zh-rCN/strings.xml +++ b/src/android/java/res/values-zh-rCN/strings.xml @@ -3,4 +3,5 @@ 无法找到Ministro服务。\n应用程序无法启动。 此应用程序需要Ministro服务。您想安装它吗? 您的应用程序遇到一个致命错误导致它无法继续。 + 这个版本的安卓系统不被支持。 diff --git a/src/android/java/res/values-zh-rTW/strings.xml b/src/android/java/res/values-zh-rTW/strings.xml index f6e68efa52..81d2bebdee 100644 --- a/src/android/java/res/values-zh-rTW/strings.xml +++ b/src/android/java/res/values-zh-rTW/strings.xml @@ -3,4 +3,5 @@ 無法找到Ministro服務。\n應用程序無法啟動。 此應用程序需要Ministro服務。您想安裝它嗎? 您的應用程序遇到一個致命錯誤導致它無法繼續。 + 這個版本的安卓系統不被支持。 diff --git a/src/android/java/res/values/strings.xml b/src/android/java/res/values/strings.xml index 95b3385924..0110948dcf 100644 --- a/src/android/java/res/values/strings.xml +++ b/src/android/java/res/values/strings.xml @@ -4,5 +4,5 @@ Can\'t find Ministro service.\nThe application can\'t start. This application requires Ministro service. Would you like to install it? Your application encountered a fatal error and cannot continue. - Unsupported Android version. + This version of Android is not supported. From 10565c5ef32457443cc950c26e2d8fab6941dac1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 13 Feb 2019 15:49:26 +0100 Subject: [PATCH 12/32] macOS: Decouple screen property updates from application delegate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I489c37131bf715d45f147964de4a8cd8c02adbcb Fixes: QTBUG-72966 Reviewed-by: Timur Pocheptsov Reviewed-by: Tor Arne Vestbø --- .../platforms/cocoa/qcocoaapplicationdelegate.mm | 12 ------------ src/plugins/platforms/cocoa/qcocoaintegration.h | 1 + src/plugins/platforms/cocoa/qcocoaintegration.mm | 3 +++ 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm index e255719cc1..2cf6672da9 100644 --- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm +++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm @@ -115,22 +115,10 @@ QT_USE_NAMESPACE self = [super init]; if (self) { inLaunch = true; - [[NSNotificationCenter defaultCenter] - addObserver:self - selector:@selector(updateScreens:) - name:NSApplicationDidChangeScreenParametersNotification - object:NSApp]; } return self; } -- (void)updateScreens:(NSNotification *)notification -{ - Q_UNUSED(notification); - if (QCocoaIntegration *ci = QCocoaIntegration::instance()) - ci->updateScreens(); -} - - (void)dealloc { [_dockMenu release]; diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.h b/src/plugins/platforms/cocoa/qcocoaintegration.h index 7de7e073de..04cb4e1226 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.h +++ b/src/plugins/platforms/cocoa/qcocoaintegration.h @@ -144,6 +144,7 @@ private: #endif QScopedPointer mPlatformTheme; QList mScreens; + QMacScopedObserver m_screensObserver; #ifndef QT_NO_CLIPBOARD QCocoaClipboard *mCocoaClipboard; #endif diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index f6a49dd74f..affbee35b7 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -206,6 +206,9 @@ QCocoaIntegration::QCocoaIntegration(const QStringList ¶mList) // by explicitly setting the presentation option to the magic 'default value', // which will resolve to an actual value and result in screen invalidation. cocoaApplication.presentationOptions = NSApplicationPresentationDefault; + + m_screensObserver = QMacScopedObserver([NSApplication sharedApplication], + NSApplicationDidChangeScreenParametersNotification, [&]() { updateScreens(); }); updateScreens(); QMacInternalPasteboardMime::initializeMimeTypes(); From 3a1a97dabe11238d1580c8afaf6fcd8ea74fea68 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Tue, 19 Feb 2019 15:41:21 +0100 Subject: [PATCH 13/32] tst_http2::earlyResponse - fix a flaky and somewhat broken test 1. Fix erroneous logic, which was triggered in 'h2' mode (non-TLS connection) - after the initial protocol upgrade/POST request was handled, the server (on Windows specifically) was erroneously handling upcoming DATA frames by replying with another redirect response. 2. Make the test less heavy by sending 1 MB of Qt::Uninitialize instead of 10 MB - theoretically this could cause a timeout before the redirected request finished successfully. Task-number: QTBUG-73873 Change-Id: I961e0a5f50252988edd46d0e73baf96ee22eef3f Reviewed-by: Edward Welbourne --- tests/auto/network/access/http2/http2srv.cpp | 14 ++++++++++++++ tests/auto/network/access/http2/http2srv.h | 1 + tests/auto/network/access/http2/tst_http2.cpp | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/auto/network/access/http2/http2srv.cpp b/tests/auto/network/access/http2/http2srv.cpp index 1f9ffb8985..6e2220fa67 100644 --- a/tests/auto/network/access/http2/http2srv.cpp +++ b/tests/auto/network/access/http2/http2srv.cpp @@ -431,6 +431,13 @@ void Http2Server::readReady() if (connectionError) return; + if (redirectSent) { + // We are a "single shot" server, working in 'h2' mode, + // responding with a redirect code. Don't bother to handle + // anything else now. + return; + } + if (upgradeProtocol) { handleProtocolUpgrade(); } else if (waitingClientPreface) { @@ -800,6 +807,13 @@ void Http2Server::sendResponse(quint32 streamID, bool emptyBody) HttpHeader header; if (redirectWhileReading) { + if (redirectSent) { + // This is a "single-shot" server responding with a redirect code. + return; + } + + redirectSent = true; + qDebug("server received HEADERS frame (followed by DATA frames), redirecting ..."); Q_ASSERT(targetPort); header.push_back({":status", "308"}); diff --git a/tests/auto/network/access/http2/http2srv.h b/tests/auto/network/access/http2/http2srv.h index 87a17ced8b..ae3f084fdc 100644 --- a/tests/auto/network/access/http2/http2srv.h +++ b/tests/auto/network/access/http2/http2srv.h @@ -193,6 +193,7 @@ private: // Redirect, with status code 308, as soon as we've seen headers, while client // may still be sending DATA frames. See tst_Http2::earlyResponse(). bool redirectWhileReading = false; + bool redirectSent = false; quint16 targetPort = 0; QAtomicInt interrupted; protected slots: diff --git a/tests/auto/network/access/http2/tst_http2.cpp b/tests/auto/network/access/http2/tst_http2.cpp index 235b78c34a..52e98c1fc1 100644 --- a/tests/auto/network/access/http2/tst_http2.cpp +++ b/tests/auto/network/access/http2/tst_http2.cpp @@ -473,7 +473,7 @@ void tst_Http2::earlyResponse() runEventLoop(); QVERIFY(serverPort); - sendRequest(1, QNetworkRequest::NormalPriority, {10000000, Qt::Uninitialized}); + sendRequest(1, QNetworkRequest::NormalPriority, {1000000, Qt::Uninitialized}); runEventLoop(); From ba58776a795b3ddeeb9587780122f0cdaaa22933 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 13 Feb 2019 13:48:21 +0100 Subject: [PATCH 14/32] winrt: Add support for Visual Studio 2019 Change-Id: I5a07a3d20425a8c7ce2b2477792c379afeff5680 Reviewed-by: Andre de la Rocha --- mkspecs/winrt-arm-msvc2019/qmake.conf | 19 ++++++++++ mkspecs/winrt-arm-msvc2019/qplatformdefs.h | 40 ++++++++++++++++++++ mkspecs/winrt-arm64-msvc2019/qmake.conf | 19 ++++++++++ mkspecs/winrt-arm64-msvc2019/qplatformdefs.h | 40 ++++++++++++++++++++ mkspecs/winrt-x64-msvc2019/qmake.conf | 19 ++++++++++ mkspecs/winrt-x64-msvc2019/qplatformdefs.h | 40 ++++++++++++++++++++ mkspecs/winrt-x86-msvc2019/qmake.conf | 18 +++++++++ mkspecs/winrt-x86-msvc2019/qplatformdefs.h | 40 ++++++++++++++++++++ 8 files changed, 235 insertions(+) create mode 100644 mkspecs/winrt-arm-msvc2019/qmake.conf create mode 100644 mkspecs/winrt-arm-msvc2019/qplatformdefs.h create mode 100644 mkspecs/winrt-arm64-msvc2019/qmake.conf create mode 100644 mkspecs/winrt-arm64-msvc2019/qplatformdefs.h create mode 100644 mkspecs/winrt-x64-msvc2019/qmake.conf create mode 100644 mkspecs/winrt-x64-msvc2019/qplatformdefs.h create mode 100644 mkspecs/winrt-x86-msvc2019/qmake.conf create mode 100644 mkspecs/winrt-x86-msvc2019/qplatformdefs.h diff --git a/mkspecs/winrt-arm-msvc2019/qmake.conf b/mkspecs/winrt-arm-msvc2019/qmake.conf new file mode 100644 index 0000000000..fe30a843eb --- /dev/null +++ b/mkspecs/winrt-arm-msvc2019/qmake.conf @@ -0,0 +1,19 @@ +# +# qmake configuration for winrt-arm-msvc2019 +# +# Written for Microsoft Visual C++ 2019 +# + +include(../common/winrt_winphone/qmake.conf) +DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 ARM __ARM__ __arm__ + +QMAKE_CFLAGS += -FS +QMAKE_CXXFLAGS += -FS +QMAKE_LFLAGS += /MACHINE:ARM /NODEFAULTLIB:kernel32.lib + +QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib + +VCPROJ_ARCH = ARM +WINSDK_VER = 10.0 +WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in +WINRT_MANIFEST.architecture = arm diff --git a/mkspecs/winrt-arm-msvc2019/qplatformdefs.h b/mkspecs/winrt-arm-msvc2019/qplatformdefs.h new file mode 100644 index 0000000000..4222bca8e1 --- /dev/null +++ b/mkspecs/winrt-arm-msvc2019/qplatformdefs.h @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the qmake spec 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 "../common/winrt_winphone/qplatformdefs.h" diff --git a/mkspecs/winrt-arm64-msvc2019/qmake.conf b/mkspecs/winrt-arm64-msvc2019/qmake.conf new file mode 100644 index 0000000000..8c16e93d26 --- /dev/null +++ b/mkspecs/winrt-arm64-msvc2019/qmake.conf @@ -0,0 +1,19 @@ +# +# qmake configuration for winrt-arm64-msvc2019 +# +# Written for Microsoft Visual C++ 2019 +# + +include(../common/winrt_winphone/qmake.conf) +DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 arm64 __arm64__ __arm64__ + +QMAKE_CFLAGS += -FS +QMAKE_CXXFLAGS += -FS +QMAKE_LFLAGS += /MACHINE:arm64 /NODEFAULTLIB:kernel32.lib + +QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib + +VCPROJ_ARCH = arm64 +WINSDK_VER = 10.0 +WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in +WINRT_MANIFEST.architecture = arm64 diff --git a/mkspecs/winrt-arm64-msvc2019/qplatformdefs.h b/mkspecs/winrt-arm64-msvc2019/qplatformdefs.h new file mode 100644 index 0000000000..4222bca8e1 --- /dev/null +++ b/mkspecs/winrt-arm64-msvc2019/qplatformdefs.h @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the qmake spec 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 "../common/winrt_winphone/qplatformdefs.h" diff --git a/mkspecs/winrt-x64-msvc2019/qmake.conf b/mkspecs/winrt-x64-msvc2019/qmake.conf new file mode 100644 index 0000000000..0d3b6d2196 --- /dev/null +++ b/mkspecs/winrt-x64-msvc2019/qmake.conf @@ -0,0 +1,19 @@ +# +# qmake configuration for winrt-x64-msvc2019 +# +# Written for Microsoft Visual C++ 2019 +# + +include(../common/winrt_winphone/qmake.conf) +DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X64 __X64__ __x64__ + +QMAKE_CFLAGS += -FS +QMAKE_CXXFLAGS += -FS +QMAKE_LFLAGS += /MACHINE:X64 /NODEFAULTLIB:kernel32.lib + +QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib + +VCPROJ_ARCH = x64 +WINSDK_VER = 10.0 +WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in +WINRT_MANIFEST.architecture = x64 diff --git a/mkspecs/winrt-x64-msvc2019/qplatformdefs.h b/mkspecs/winrt-x64-msvc2019/qplatformdefs.h new file mode 100644 index 0000000000..4222bca8e1 --- /dev/null +++ b/mkspecs/winrt-x64-msvc2019/qplatformdefs.h @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the qmake spec 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 "../common/winrt_winphone/qplatformdefs.h" diff --git a/mkspecs/winrt-x86-msvc2019/qmake.conf b/mkspecs/winrt-x86-msvc2019/qmake.conf new file mode 100644 index 0000000000..8948e20ab1 --- /dev/null +++ b/mkspecs/winrt-x86-msvc2019/qmake.conf @@ -0,0 +1,18 @@ +# +# qmake configuration for winrt-x86-msvc2019 +# +# Written for Microsoft Visual C++ 2019 +# + +include(../common/winrt_winphone/qmake.conf) +DEFINES += WINAPI_FAMILY=WINAPI_FAMILY_PC_APP WINAPI_PARTITION_PHONE_APP=1 X86 __X86__ __x86__ + +QMAKE_CFLAGS += -FS +QMAKE_CXXFLAGS += -FS +QMAKE_LFLAGS += /SAFESEH /MACHINE:X86 /NODEFAULTLIB:kernel32.lib + +QMAKE_LIBS += windowscodecs.lib WindowsApp.lib runtimeobject.lib OneCore.lib +VCPROJ_ARCH = Win32 +WINSDK_VER = 10.0 +WINRT_MANIFEST = $$PWD/../common/winrt_winphone/manifests/10.0/AppxManifest.xml.in +WINRT_MANIFEST.architecture = x86 diff --git a/mkspecs/winrt-x86-msvc2019/qplatformdefs.h b/mkspecs/winrt-x86-msvc2019/qplatformdefs.h new file mode 100644 index 0000000000..4222bca8e1 --- /dev/null +++ b/mkspecs/winrt-x86-msvc2019/qplatformdefs.h @@ -0,0 +1,40 @@ +/**************************************************************************** +** +** Copyright (C) 2019 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the qmake spec 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 "../common/winrt_winphone/qplatformdefs.h" From 130bede6196ba32cc7fcbd7773c7732045f0d80c Mon Sep 17 00:00:00 2001 From: Lars Schmertmann Date: Thu, 10 Jan 2019 15:11:18 +0100 Subject: [PATCH 15/32] Add translatable attribute to the app_name string to fix a lint warning Incomplete translation ---------------------- If an application has more than one locale, then all the strings declared in one language should also be translated in all other languages. If the string should not be translated, you can add the attribute translatable="false" on the element, or you can define all your non-translatable strings in a resource file called donottranslate.xml. Or, you can ignore the issue with a tools:ignore="MissingTranslation" attribute. Change-Id: I6f93f34fc36a06de9a0b687a93cf58df941dbbcb Reviewed-by: Andy Shaw --- src/tools/androiddeployqt/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index b0df833b87..f57c612244 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -1261,7 +1261,7 @@ bool updateStringsXml(const Options &options) fprintf(stderr, "Can't open %s for writing.\n", qPrintable(fileName)); return false; } - file.write(QByteArray("") + file.write(QByteArray("") .append(QFileInfo(options.applicationBinary).baseName().mid(sizeof("lib") - 1).toLatin1()) .append("\n")); return true; From ee8a5f4917d98a26f8dedd6802eac754d748b227 Mon Sep 17 00:00:00 2001 From: Mitch Curtis Date: Wed, 20 Feb 2019 13:17:51 +0100 Subject: [PATCH 16/32] Document that type information is lost when reading QSettings from INI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is quite an important detail for an otherwise useful format. We should make the user aware that they currently have a tradeoff: - Either you can store settings in one place on all platforms that your application targets and have to manually manage conversion from strings, or - Use native formats which can be hard to find and edit, but retain type information. Change-Id: Ic648524c9ebff25246d7cdefb7628ff5ddf84964 Reviewed-by: Jędrzej Nowacki --- src/corelib/io/qsettings.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/corelib/io/qsettings.cpp b/src/corelib/io/qsettings.cpp index 0d2bd72d75..ed61c4aca0 100644 --- a/src/corelib/io/qsettings.cpp +++ b/src/corelib/io/qsettings.cpp @@ -2167,6 +2167,9 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, \snippet settings/settings.cpp 15 + Note that type information is not preserved when reading settings from INI + files; all values will be returned as QString. + The \l{tools/settingseditor}{Settings Editor} example lets you experiment with different settings location and with fallbacks turned on or off. @@ -2448,7 +2451,10 @@ void QConfFileSettingsPrivate::ensureSectionParsed(QConfFile *confFile, On 32-bit Windows or from a 64-bit application on 64-bit Windows, this works the same as specifying NativeFormat. This enum value was added in Qt 5.7. - \value IniFormat Store the settings in INI files. + \value IniFormat Store the settings in INI files. Note that type information + is not preserved when reading settings from INI files; + all values will be returned as QString. + \value InvalidFormat Special value returned by registerFormat(). \omitvalue CustomFormat1 \omitvalue CustomFormat2 From 904617dfb83f39a6a379635b64fea6fcd00f241a Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Tue, 19 Feb 2019 13:25:12 +0100 Subject: [PATCH 17/32] Add missing increment of blacklisted tests for BXFAIL case The counter is just how many tests were blacklisted, regardless of their success or otherwise. Skipping its increment for BXFAIL is apt to introduce noise in our tracking of how many tests are blacklisted. Change-Id: I1dd74e5f6619121c21d8741be7bc4e2d1cb43fa9 Reviewed-by: Christian Stenger --- src/testlib/qtestlog.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/testlib/qtestlog.cpp b/src/testlib/qtestlog.cpp index 3285a6d8a7..c3e7385217 100644 --- a/src/testlib/qtestlog.cpp +++ b/src/testlib/qtestlog.cpp @@ -470,6 +470,8 @@ void QTestLog::addBXFail(const char *msg, const char *file, int line) QTEST_ASSERT(msg); QTEST_ASSERT(file); + ++QTest::blacklists; + QTest::TestLoggers::addIncident(QAbstractTestLogger::BlacklistedXFail, msg, file, line); } From a4b8e7141b3dd3bf3c2ac139b44ece0f74b054d8 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Fri, 15 Feb 2019 21:27:58 +0100 Subject: [PATCH 18/32] QtGui/Network/OpenGl/Widgets/Xml: use \nullptr in documentation Replace null and '\c nullptr' with \nullptr in the documentation. Change-Id: I58934eea06943309ba895833f1991629870ab45b Reviewed-by: Friedemann Kleint --- src/gui/kernel/qclipboard.cpp | 2 +- src/gui/kernel/qguiapplication.cpp | 2 +- src/gui/kernel/qopenglcontext.cpp | 3 +- src/gui/kernel/qplatformintegration.cpp | 4 +-- src/gui/kernel/qshortcutmap.cpp | 6 ++-- src/gui/opengl/qopenglfunctions.cpp | 7 ++-- src/gui/opengl/qopenglshaderprogram.cpp | 6 ++-- src/gui/painting/qbackingstore.cpp | 2 +- src/gui/text/qfontengine.cpp | 4 +-- src/gui/vulkan/qvulkaninstance.cpp | 2 +- src/network/access/qftp.cpp | 4 +-- src/network/socket/qlocalserver.cpp | 4 +-- src/network/socket/qnativesocketengine.cpp | 8 ++--- src/network/socket/qtcpserver.cpp | 2 +- .../ssl/qssldiffiehellmanparameters.cpp | 2 +- src/opengl/qglfunctions.cpp | 5 +-- src/opengl/qglshaderprogram.cpp | 6 ++-- src/testlib/qsignalspy.qdoc | 4 +-- src/widgets/dialogs/qfiledialog.cpp | 34 +++++++++---------- src/widgets/kernel/qlayout.cpp | 2 +- src/widgets/util/qundostack.cpp | 12 +++---- src/widgets/widgets/qsplitter.cpp | 4 +-- src/xml/sax/qxml.cpp | 7 ++-- 23 files changed, 70 insertions(+), 62 deletions(-) diff --git a/src/gui/kernel/qclipboard.cpp b/src/gui/kernel/qclipboard.cpp index a76150d91d..267c079ad9 100644 --- a/src/gui/kernel/qclipboard.cpp +++ b/src/gui/kernel/qclipboard.cpp @@ -439,7 +439,7 @@ void QClipboard::setPixmap(const QPixmap &pixmap, Mode mode) \fn QMimeData *QClipboard::mimeData(Mode mode) const Returns a pointer to a QMimeData representation of the current - clipboard data (can be NULL if the given \a mode is not + clipboard data (can be \nullptr if the given \a mode is not supported by the platform). The \a mode argument is used to control which part of the system diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 038b0857ae..4e0c45d8ae 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1023,7 +1023,7 @@ QList QGuiApplication::screens() } /*! - Returns the screen at \a point, or \c nullptr if outside of any screen. + Returns the screen at \a point, or \nullptr if outside of any screen. The \a point is in relation to the virtualGeometry() of each set of virtual siblings. If the point maps to more than one set of virtual siblings the first diff --git a/src/gui/kernel/qopenglcontext.cpp b/src/gui/kernel/qopenglcontext.cpp index 4847a62b0f..acb6c3fe94 100644 --- a/src/gui/kernel/qopenglcontext.cpp +++ b/src/gui/kernel/qopenglcontext.cpp @@ -1235,7 +1235,8 @@ void QOpenGLContext::deleteQGLContext() Returns the platform-specific handle for the OpenGL implementation that is currently in use. (for example, a HMODULE on Windows) - On platforms that do not use dynamic GL switch the return value is null. + On platforms that do not use dynamic GL switching, the return value + is \nullptr. The library might be GL-only, meaning that windowing system interface functions (for example EGL) may live in another, separate library. diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index bb20a160db..199ef0de07 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -291,7 +291,7 @@ QPlatformPixmap *QPlatformIntegration::createPlatformPixmap(QPlatformPixmap::Pix platform implementation is responsible for querying the configuriation from the provided native context. - Returns a pointer to a QPlatformOpenGLContext instance or \c NULL if the context could + Returns a pointer to a QPlatformOpenGLContext instance or \nullptr if the context could not be created. \sa QOpenGLContext @@ -647,7 +647,7 @@ void QPlatformIntegration::setApplicationIcon(const QIcon &icon) const pointer to the instance for which a platform-specific backend needs to be created. - Returns a pointer to a QPlatformOpenGLContext instance or \c NULL if the context could + Returns a pointer to a QPlatformOpenGLContext instance or \nullptr if the context could not be created. \sa QVulkanInstance diff --git a/src/gui/kernel/qshortcutmap.cpp b/src/gui/kernel/qshortcutmap.cpp index 3bb42c1c0b..0395c1db38 100644 --- a/src/gui/kernel/qshortcutmap.cpp +++ b/src/gui/kernel/qshortcutmap.cpp @@ -175,7 +175,7 @@ int QShortcutMap::addShortcut(QObject *owner, const QKeySequence &key, Qt::Short /*! \internal Removes a shortcut from the global map. - If \a owner is 0, all entries in the map with the key sequence specified + If \a owner is \nullptr, all entries in the map with the key sequence specified is removed. If \a key is null, all sequences for \a owner is removed from the map. If \a id is 0, any identical \a key sequences owned by \a owner are removed. @@ -222,7 +222,7 @@ int QShortcutMap::removeShortcut(int id, QObject *owner, const QKeySequence &key /*! \internal Changes the enable state of a shortcut to \a enable. - If \a owner is 0, all entries in the map with the key sequence specified + If \a owner is \nullptr, all entries in the map with the key sequence specified is removed. If \a key is null, all sequences for \a owner is removed from the map. If \a id is 0, any identical \a key sequences owned by \a owner are changed. @@ -260,7 +260,7 @@ int QShortcutMap::setShortcutEnabled(bool enable, int id, QObject *owner, const /*! \internal Changes the auto repeat state of a shortcut to \a enable. - If \a owner is 0, all entries in the map with the key sequence specified + If \a owner is \nullptr, all entries in the map with the key sequence specified is removed. If \a key is null, all sequences for \a owner is removed from the map. If \a id is 0, any identical \a key sequences owned by \a owner are changed. diff --git a/src/gui/opengl/qopenglfunctions.cpp b/src/gui/opengl/qopenglfunctions.cpp index 92770cb55f..8ec814296a 100644 --- a/src/gui/opengl/qopenglfunctions.cpp +++ b/src/gui/opengl/qopenglfunctions.cpp @@ -206,7 +206,8 @@ QOpenGLFunctions::QOpenGLFunctions() /*! Constructs a function resolver for \a context. If \a context - is null, then the resolver will be created for the current QOpenGLContext. + is \nullptr, then the resolver will be created for the current + QOpenGLContext. The context or another context in the group must be current. @@ -5035,8 +5036,8 @@ QOpenGLExtraFunctions::QOpenGLExtraFunctions() } /*! - Constructs a function resolver for context. If \a context is null, then - the resolver will be created for the current QOpenGLContext. + Constructs a function resolver for context. If \a context is \nullptr, + then the resolver will be created for the current QOpenGLContext. The context or another context in the group must be current. diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp index c39177080d..f225d5dc75 100644 --- a/src/gui/opengl/qopenglshaderprogram.cpp +++ b/src/gui/opengl/qopenglshaderprogram.cpp @@ -3667,7 +3667,8 @@ QVector QOpenGLShaderProgram::defaultInnerTessellationLevels() const Language (GLSL) are supported on this system; false otherwise. The \a context is used to resolve the GLSL extensions. - If \a context is null, then QOpenGLContext::currentContext() is used. + If \a context is \nullptr, then QOpenGLContext::currentContext() + is used. */ bool QOpenGLShaderProgram::hasOpenGLShaderPrograms(QOpenGLContext *context) { @@ -3694,7 +3695,8 @@ void QOpenGLShaderProgram::shaderDestroyed() this system; false otherwise. The \a context is used to resolve the GLSL extensions. - If \a context is null, then QOpenGLContext::currentContext() is used. + If \a context is \nullptr, then QOpenGLContext::currentContext() + is used. */ bool QOpenGLShader::hasOpenGLShaders(ShaderType type, QOpenGLContext *context) { diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp index d935deb4d6..3fab903c4d 100644 --- a/src/gui/painting/qbackingstore.cpp +++ b/src/gui/painting/qbackingstore.cpp @@ -208,7 +208,7 @@ static bool isRasterSurface(QWindow *window) The \a window must either be the top level window represented by this backingstore, or a non-transient child of that window. Passing - \c nullptr falls back to using the backingstore's top level window. + \nullptr falls back to using the backingstore's top level window. If the \a window is a child window, the \a region should be in child window coordinates, and the \a offset should be the child window's offset in relation diff --git a/src/gui/text/qfontengine.cpp b/src/gui/text/qfontengine.cpp index c363807e5e..1719855e68 100644 --- a/src/gui/text/qfontengine.cpp +++ b/src/gui/text/qfontengine.cpp @@ -1022,8 +1022,8 @@ void QFontEngine::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, glyph_metr Returns \c true if the font table idetified by \a tag exists in the font; returns \c false otherwise. - If \a buffer is NULL, stores the size of the buffer required for the font table data, - in bytes, in \a length. If \a buffer is not NULL and the capacity + If \a buffer is \nullptr, stores the size of the buffer required for the font table data, + in bytes, in \a length. If \a buffer is not \nullptr and the capacity of the buffer, passed in \a length, is sufficient to store the font table data, also copies the font table data to \a buffer. diff --git a/src/gui/vulkan/qvulkaninstance.cpp b/src/gui/vulkan/qvulkaninstance.cpp index 000c2b8caa..9895fec2ca 100644 --- a/src/gui/vulkan/qvulkaninstance.cpp +++ b/src/gui/vulkan/qvulkaninstance.cpp @@ -306,7 +306,7 @@ QVulkanInstance::QVulkanInstance() /*! Destructor. - \note current() will return \c nullptr once the instance is destroyed. + \note current() will return \nullptr once the instance is destroyed. */ QVulkanInstance::~QVulkanInstance() { diff --git a/src/network/access/qftp.cpp b/src/network/access/qftp.cpp index d33355c470..4e399f018f 100644 --- a/src/network/access/qftp.cpp +++ b/src/network/access/qftp.cpp @@ -1826,8 +1826,8 @@ int QFtp::cd(const QString &dir) is data available to read. You can then read the data with the read() or readAll() functions. - If \a dev is not 0, the data is written directly to the device \a - dev. Make sure that the \a dev pointer is valid for the duration + If \a dev is not \nullptr, the data is written directly to the device + \a dev. Make sure that the \a dev pointer is valid for the duration of the operation (it is safe to delete it when the commandFinished() signal is emitted). In this case the readyRead() signal is \e not emitted and you cannot read data with the diff --git a/src/network/socket/qlocalserver.cpp b/src/network/socket/qlocalserver.cpp index a9789b7d04..c5bd599a51 100644 --- a/src/network/socket/qlocalserver.cpp +++ b/src/network/socket/qlocalserver.cpp @@ -506,8 +506,8 @@ void QLocalServer::setMaxPendingConnections(int numConnections) /*! Waits for at most \a msec milliseconds or until an incoming connection is available. Returns \c true if a connection is available; otherwise - returns \c false. If the operation timed out and \a timedOut is not 0, - *timedOut will be set to true. + returns \c false. If the operation timed out and \a timedOut is not + \nullptr, *timedOut will be set to true. This is a blocking function call. Its use is ill-advised in a single-threaded GUI application, since the whole application will stop diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp index 8947a7ee8a..5126a5330f 100644 --- a/src/network/socket/qnativesocketengine.cpp +++ b/src/network/socket/qnativesocketengine.cpp @@ -999,8 +999,8 @@ void QNativeSocketEngine::close() /*! Waits for \a msecs milliseconds or until the socket is ready for - reading. If \a timedOut is not 0 and \a msecs milliseconds have - passed, the value of \a timedOut is set to true. + reading. If \a timedOut is not \nullptr and \a msecs milliseconds + have passed, the value of \a timedOut is set to true. Returns \c true if data is available for reading; otherwise returns false. @@ -1039,8 +1039,8 @@ bool QNativeSocketEngine::waitForRead(int msecs, bool *timedOut) /*! Waits for \a msecs milliseconds or until the socket is ready for - writing. If \a timedOut is not 0 and \a msecs milliseconds have - passed, the value of \a timedOut is set to true. + writing. If \a timedOut is not \nullptr and \a msecs milliseconds + have passed, the value of \a timedOut is set to true. Returns \c true if data is available for writing; otherwise returns false. diff --git a/src/network/socket/qtcpserver.cpp b/src/network/socket/qtcpserver.cpp index eddf789921..56c700ca8f 100644 --- a/src/network/socket/qtcpserver.cpp +++ b/src/network/socket/qtcpserver.cpp @@ -493,7 +493,7 @@ QHostAddress QTcpServer::serverAddress() const Waits for at most \a msec milliseconds or until an incoming connection is available. Returns \c true if a connection is available; otherwise returns \c false. If the operation timed out - and \a timedOut is not 0, *\a timedOut will be set to true. + and \a timedOut is not \nullptr, *\a timedOut will be set to true. This is a blocking function call. Its use is disadvised in a single-threaded GUI application, since the whole application will diff --git a/src/network/ssl/qssldiffiehellmanparameters.cpp b/src/network/ssl/qssldiffiehellmanparameters.cpp index 7fbcff2861..65041d4456 100644 --- a/src/network/ssl/qssldiffiehellmanparameters.cpp +++ b/src/network/ssl/qssldiffiehellmanparameters.cpp @@ -136,7 +136,7 @@ QSslDiffieHellmanParameters QSslDiffieHellmanParameters::fromEncoded(const QByte to check whether the Diffie-Hellman parameters were valid and loaded correctly. - In particular, if \a device is \c nullptr or not open for reading, an invalid + In particular, if \a device is \nullptr or not open for reading, an invalid object will be returned. \sa isValid() diff --git a/src/opengl/qglfunctions.cpp b/src/opengl/qglfunctions.cpp index 7fe7102510..f22f9f470b 100644 --- a/src/opengl/qglfunctions.cpp +++ b/src/opengl/qglfunctions.cpp @@ -170,7 +170,8 @@ QGLFunctions::QGLFunctions() /*! Constructs a function resolver for \a context. If \a context - is null, then the resolver will be created for the current QGLContext. + is \nullptr, then the resolver will be created for the current + QGLContext. An object constructed in this way can only be used with \a context and other contexts that share with it. Use initializeGLFunctions() @@ -305,7 +306,7 @@ bool QGLFunctions::hasOpenGLFeature(QGLFunctions::OpenGLFeature feature) const /*! Initializes GL function resolution for \a context. If \a context - is null, then the current QGLContext will be used. + is \nullptr, then the current QGLContext will be used. After calling this function, the QGLFunctions object can only be used with \a context and other contexts that share with it. diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp index 545df8fa44..35f60318be 100644 --- a/src/opengl/qglshaderprogram.cpp +++ b/src/opengl/qglshaderprogram.cpp @@ -3169,7 +3169,8 @@ GLenum QGLShaderProgram::geometryOutputType() const Language (GLSL) are supported on this system; false otherwise. The \a context is used to resolve the GLSL extensions. - If \a context is null, then QGLContext::currentContext() is used. + If \a context is \nullptr, then QGLContext::currentContext() is + used. */ bool QGLShaderProgram::hasOpenGLShaderPrograms(const QGLContext *context) { @@ -3207,7 +3208,8 @@ void QGLShaderProgram::shaderDestroyed() this system; false otherwise. The \a context is used to resolve the GLSL extensions. - If \a context is null, then QGLContext::currentContext() is used. + If \a context is \nullptr, then QGLContext::currentContext() is + used. \since 4.7 */ diff --git a/src/testlib/qsignalspy.qdoc b/src/testlib/qsignalspy.qdoc index 77affc9a4b..3352307d69 100644 --- a/src/testlib/qsignalspy.qdoc +++ b/src/testlib/qsignalspy.qdoc @@ -63,7 +63,7 @@ Constructs a new QSignalSpy that listens for emissions of the \a signal from the QObject \a object. If QSignalSpy is not able to listen for a - valid signal (for example, because \a object is null or \a signal does + valid signal (for example, because \a object is \nullptr or \a signal does not denote a valid signal of \a object), an explanatory warning message will be output using qWarning() and subsequent calls to \c isValid() will return false. @@ -77,7 +77,7 @@ Constructs a new QSignalSpy that listens for emissions of the \a signal from the QObject \a object. If QSignalSpy is not able to listen for a - valid signal (for example, because \a object is null or \a signal does + valid signal (for example, because \a object is \nullptr or \a signal does not denote a valid signal of \a object), an explanatory warning message will be output using qWarning() and subsequent calls to \c isValid() will return false. diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index d8a4ad5f24..625da78794 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -2129,8 +2129,8 @@ QString QFileDialog::labelText(DialogLabel label) const \snippet code/src_gui_dialogs_qfiledialog.cpp 8 The function creates a modal file dialog with the given \a parent widget. - If \a parent is not 0, the dialog will be shown centered over the parent - widget. + If \a parent is not \nullptr, the dialog will be shown centered over the + parent widget. The file dialog's working directory will be set to \a dir. If \a dir includes a file name, the file will be selected. Only files that match the @@ -2152,8 +2152,8 @@ QString QFileDialog::labelText(DialogLabel label) const native file dialog and not a QFileDialog. On Windows the dialog will spin a blocking modal event loop that will not - dispatch any QTimers, and if \a parent is not 0 then it will position the - dialog just below the parent's title bar. + dispatch any QTimers, and if \a parent is not \nullptr then it will position + the dialog just below the parent's title bar. On Unix/X11, the normal behavior of the file dialog is to resolve and follow symlinks. For example, if \c{/usr/tmp} is a symlink to \c{/var/tmp}, @@ -2242,8 +2242,8 @@ QUrl QFileDialog::getOpenFileUrl(QWidget *parent, \snippet code/src_gui_dialogs_qfiledialog.cpp 9 This function creates a modal file dialog with the given \a parent widget. - If \a parent is not 0, the dialog will be shown centered over the parent - widget. + If \a parent is not \nullptr, the dialog will be shown centered over the + parent widget. The file dialog's working directory will be set to \a dir. If \a dir includes a file name, the file will be selected. The filter is set to @@ -2261,8 +2261,8 @@ QUrl QFileDialog::getOpenFileUrl(QWidget *parent, native file dialog and not a QFileDialog. On Windows the dialog will spin a blocking modal event loop that will not - dispatch any QTimers, and if \a parent is not 0 then it will position the - dialog just below the parent's title bar. + dispatch any QTimers, and if \a parent is not \nullptr then it will position + the dialog just below the parent's title bar. On Unix/X11, the normal behavior of the file dialog is to resolve and follow symlinks. For example, if \c{/usr/tmp} is a symlink to \c{/var/tmp}, @@ -2434,8 +2434,8 @@ void QFileDialog::getOpenFileContent(const QString &nameFilter, const std::funct by the user. The file does not have to exist. It creates a modal file dialog with the given \a parent widget. If - \a parent is not 0, the dialog will be shown centered over the parent - widget. + \a parent is not \nullptr, the dialog will be shown centered over the + parent widget. \snippet code/src_gui_dialogs_qfiledialog.cpp 11 @@ -2461,9 +2461,9 @@ void QFileDialog::getOpenFileContent(const QString &nameFilter, const std::funct native file dialog and not a QFileDialog. On Windows the dialog will spin a blocking modal event loop that will not - dispatch any QTimers, and if \a parent is not 0 then it will position the - dialog just below the parent's title bar. On \macos, with its native file - dialog, the filter argument is ignored. + dispatch any QTimers, and if \a parent is not \nullptr then it will + position the dialog just below the parent's title bar. On \macos, with its + native file dialog, the filter argument is ignored. On Unix/X11, the normal behavior of the file dialog is to resolve and follow symlinks. For example, if \c{/usr/tmp} is a symlink to \c{/var/tmp}, @@ -2553,8 +2553,8 @@ QUrl QFileDialog::getSaveFileUrl(QWidget *parent, \snippet code/src_gui_dialogs_qfiledialog.cpp 12 This function creates a modal file dialog with the given \a parent widget. - If \a parent is not 0, the dialog will be shown centered over the parent - widget. + If \a parent is not \nullptr, the dialog will be shown centered over the + parent widget. The dialog's working directory is set to \a dir, and the caption is set to \a caption. Either of these may be an empty string in which case the @@ -2578,8 +2578,8 @@ QUrl QFileDialog::getSaveFileUrl(QWidget *parent, symlinks as regular directories. On Windows, the dialog will spin a blocking modal event loop that will not - dispatch any QTimers, and if \a parent is not 0 then it will position the - dialog just below the parent's title bar. + dispatch any QTimers, and if \a parent is not \nullptr then it will position + the dialog just below the parent's title bar. \warning Do not delete \a parent during the execution of the dialog. If you want to do this, you should create the dialog yourself using one of the diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp index f27851c7bb..e3f6a56875 100644 --- a/src/widgets/kernel/qlayout.cpp +++ b/src/widgets/kernel/qlayout.cpp @@ -109,7 +109,7 @@ static int menuBarHeightForWidth(QWidget *menubar, int w) /*! Constructs a new top-level QLayout, with parent \a parent. - \a parent may not be a \c nullptr. + \a parent may not be a \nullptr. The layout is set directly as the top-level layout for \a parent. There can be only one top-level layout for a diff --git a/src/widgets/util/qundostack.cpp b/src/widgets/util/qundostack.cpp index e928b9fe37..8788c42252 100644 --- a/src/widgets/util/qundostack.cpp +++ b/src/widgets/util/qundostack.cpp @@ -102,9 +102,9 @@ QT_BEGIN_NAMESPACE /*! Constructs a QUndoCommand object with the given \a parent and \a text. - If \a parent is not 0, this command is appended to parent's child list. - The parent command then owns this command and will delete it in its - destructor. + If \a parent is not \nullptr, this command is appended to parent's + child list. The parent command then owns this command and will delete + it in its destructor. \sa ~QUndoCommand() */ @@ -118,9 +118,9 @@ QUndoCommand::QUndoCommand(const QString &text, QUndoCommand *parent) /*! Constructs a QUndoCommand object with parent \a parent. - If \a parent is not 0, this command is appended to parent's child list. - The parent command then owns this command and will delete it in its - destructor. + If \a parent is not \nullptr, this command is appended to parent's + child list. The parent command then owns this command and will delete + it in its destructor. \sa ~QUndoCommand() */ diff --git a/src/widgets/widgets/qsplitter.cpp b/src/widgets/widgets/qsplitter.cpp index 0b90714363..98bb23caad 100644 --- a/src/widgets/widgets/qsplitter.cpp +++ b/src/widgets/widgets/qsplitter.cpp @@ -1232,7 +1232,7 @@ QSplitterHandle *QSplitter::createHandle() /*! Returns the handle to the left of (or above) the item in the - splitter's layout at the given \a index, or \c nullptr if there is no such item. + splitter's layout at the given \a index, or \nullptr if there is no such item. The handle at index 0 is always hidden. For right-to-left languages such as Arabic and Hebrew, the layout @@ -1251,7 +1251,7 @@ QSplitterHandle *QSplitter::handle(int index) const /*! Returns the widget at the given \a index in the splitter's layout, - or \c nullptr if there is no such widget. + or \nullptr if there is no such widget. \sa count(), handle(), indexOf(), insertWidget() */ diff --git a/src/xml/sax/qxml.cpp b/src/xml/sax/qxml.cpp index f4e6937146..0e3a87e883 100644 --- a/src/xml/sax/qxml.cpp +++ b/src/xml/sax/qxml.cpp @@ -2613,8 +2613,9 @@ void QXmlSimpleReaderPrivate::initIncrementalParsing() is returned. If no such feature exists the return value is undefined. - If \a ok is not 0: \c{*}\a{ok} is set to true if the reader has the - feature called \a name; otherwise \c{*}\a{ok} is set to false. + If \a ok is not \nullptr: \c{*}\a{ok} is set to true if the + reader has the feature called \a name; otherwise \c{*}\a{ok} is + set to false. \sa setFeature(), hasFeature() */ @@ -2643,7 +2644,7 @@ void QXmlSimpleReaderPrivate::initIncrementalParsing() If the reader has the property \a name, this function returns the value of the property; otherwise the return value is undefined. - If \a ok is not 0: if the reader has the \a name property + If \a ok is not \nullptr: if the reader has the \a name property \c{*}\a{ok} is set to true; otherwise \c{*}\a{ok} is set to false. \sa setProperty(), hasProperty() From ca32a373b31b087b602ca555151e01ed8ea601c1 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Wed, 20 Feb 2019 11:46:07 +1000 Subject: [PATCH 19/32] wasm: fix crash on window close MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I07d6edfbfbf056240262b833ccb708dc15f830a3 Fixes: QTBUG-73678 Task-number: QTBUG-73678 Reviewed-by: Edward Welbourne Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/wasm/qwasmwindow.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/wasm/qwasmwindow.cpp b/src/plugins/platforms/wasm/qwasmwindow.cpp index 25a0190053..39797cb09d 100644 --- a/src/plugins/platforms/wasm/qwasmwindow.cpp +++ b/src/plugins/platforms/wasm/qwasmwindow.cpp @@ -198,8 +198,10 @@ void QWasmWindow::injectMouseReleased(const QPoint &local, const QPoint &global, if (!hasTitleBar() || button != Qt::LeftButton) return; - if (closeButtonRect().contains(global) && m_activeControl == QWasmCompositor::SC_TitleBarCloseButton) + if (closeButtonRect().contains(global) && m_activeControl == QWasmCompositor::SC_TitleBarCloseButton) { window()->close(); + return; + } if (maxButtonRect().contains(global) && m_activeControl == QWasmCompositor::SC_TitleBarMaxButton) { window()->setWindowState(Qt::WindowMaximized); From 70b558ad5b7972178b990b33cbd73694775b265f Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Tue, 19 Feb 2019 17:07:50 +1000 Subject: [PATCH 20/32] wasm: fix system lib detection and use MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is a revert of eea08d376ac5cb35ff03be630923f21f7fa3aecd. We need these flags to be added to the compiler in order to find the emscripten ports to be able to use them. Task-number: QTBUG-73127 Change-Id: Icf70f456947aef04dc79b2328f2e95fb1e94fcf8 Reviewed-by: Morten Johan Sørvig --- mkspecs/wasm-emscripten/qmake.conf | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mkspecs/wasm-emscripten/qmake.conf b/mkspecs/wasm-emscripten/qmake.conf index 6c4e62aff2..a9ded4be12 100644 --- a/mkspecs/wasm-emscripten/qmake.conf +++ b/mkspecs/wasm-emscripten/qmake.conf @@ -21,6 +21,11 @@ EMCC_COMMON_LFLAGS = \ --bind \ -s \"BINARYEN_TRAP_MODE=\'clamp\'\" +EMCC_USE_PORTS_FLAGS = \ + -s USE_LIBPNG=1 \ + -s USE_FREETYPE=1 \ + -s USE_ZLIB=1 + # The -s arguments can also be used with release builds, # but are here in debug for clarity. EMCC_COMMON_LFLAGS_DEBUG = \ @@ -38,6 +43,9 @@ QMAKE_COMPILER += emscripten QMAKE_CC = emcc QMAKE_CXX = em++ +QMAKE_CFLAGS += $$EMCC_USE_PORTS_FLAGS +QMAKE_CXXFLAGS += $$EMCC_USE_PORTS_FLAGS + # Practical debugging setup: # "-g4" preserves function names for stack traces # "-Os" produces reasonably sized binaries From 7227e54445021b8c2ce4f4ab638cc7d43e32a5a7 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Wed, 20 Feb 2019 14:05:36 +0100 Subject: [PATCH 21/32] qmake: Fix COPIES for Visual Studio projects QINSTALLS is not set when Visual Studio projects are used. Use its resolved value in case that Visual Studio projects are generated. Change-Id: I8c21d4335971f45e56b3549086cb803c2d464158 Reviewed-by: Simon Hausmann --- mkspecs/features/file_copies.prf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/file_copies.prf b/mkspecs/features/file_copies.prf index 58e07bd393..8a718d8a81 100644 --- a/mkspecs/features/file_copies.prf +++ b/mkspecs/features/file_copies.prf @@ -44,7 +44,9 @@ for (cp, COPIES) { $${pfx}.output = $$path/${QMAKE_FUNC_FILE_IN_qtStripSrcDir_$$cp} } $${pfx}.input = $${pfx}.files - $${pfx}.commands = $(QINSTALL) ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} + contains(TEMPLATE, "vc.*"): copycommand = $$QMAKE_QMAKE -install qinstall + else: copycommand = $(QINSTALL) + $${pfx}.commands = $$copycommand ${QMAKE_FILE_IN} ${QMAKE_FILE_OUT} $${pfx}.name = COPY ${QMAKE_FILE_IN} $${pfx}.CONFIG = no_link no_clean target_predeps QMAKE_EXTRA_COMPILERS += $${pfx} From c79b27dbcb885dc1bca69d4605993f7a096887b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Tue, 11 Sep 2018 14:18:50 +0300 Subject: [PATCH 22/32] Remove "insignificant" flag from qfilesystemmodel test Due to removal of insignificant flag in tst_qfilesystemmode.pro a bunch of tests will either fail or crash in different operating systems. Task-number: QTBUG-70572 Task-number: QTBUG-70573 Task-number: QTBUG-29403 Change-Id: I44925187acd72e600d2fec4f2604b67c66ecdd6b Reviewed-by: Qt CI Bot Reviewed-by: Heikki Halmet --- tests/auto/widgets/dialogs/qfilesystemmodel/BLACKLIST | 11 +++++++++++ .../dialogs/qfilesystemmodel/qfilesystemmodel.pro | 5 +++-- .../dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp | 4 ++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 tests/auto/widgets/dialogs/qfilesystemmodel/BLACKLIST diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/BLACKLIST b/tests/auto/widgets/dialogs/qfilesystemmodel/BLACKLIST new file mode 100644 index 0000000000..01679eb6ee --- /dev/null +++ b/tests/auto/widgets/dialogs/qfilesystemmodel/BLACKLIST @@ -0,0 +1,11 @@ +winrt +[sort:QFileDialog usage] +ubuntu +b2qt +[specialFiles] +ubuntu +b2qt +[dirsBeforeFiles] +ubuntu +b2qt +windows diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/qfilesystemmodel.pro b/tests/auto/widgets/dialogs/qfilesystemmodel/qfilesystemmodel.pro index bc4671f60c..db8cf7de3f 100644 --- a/tests/auto/widgets/dialogs/qfilesystemmodel/qfilesystemmodel.pro +++ b/tests/auto/widgets/dialogs/qfilesystemmodel/qfilesystemmodel.pro @@ -1,3 +1,6 @@ +INCLUDEPATH += ../../../../shared +HEADERS += ../../../../shared/emulationdetector.h + CONFIG += testcase # This testcase can be slow on Windows and OS X, and may interfere with other file system tests. win32:testcase.timeout = 900 @@ -8,5 +11,3 @@ QT += core-private testlib SOURCES += tst_qfilesystemmodel.cpp TARGET = tst_qfilesystemmodel - -CONFIG += insignificant_test # QTBUG-29403 diff --git a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp index 9ee5292fcb..665a116a3a 100644 --- a/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp +++ b/tests/auto/widgets/dialogs/qfilesystemmodel/tst_qfilesystemmodel.cpp @@ -27,6 +27,7 @@ ****************************************************************************/ +#include #include #ifdef QT_BUILD_INTERNAL #include @@ -788,6 +789,9 @@ void tst_QFileSystemModel::sort() MyFriendFileSystemModel *myModel = new MyFriendFileSystemModel(); QTreeView *tree = new QTreeView(); + if (fileDialogMode && EmulationDetector::isRunningArmOnX86()) + QSKIP("Crashes in QEMU. QTBUG-70572"); + #ifdef QT_BUILD_INTERNAL if (fileDialogMode) myModel->d_func()->disableRecursiveSort = true; From 06b29a62de60a631af77ee887ccf2d24d6871df2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tony=20Saraj=C3=A4rvi?= Date: Wed, 20 Feb 2019 11:07:59 +0200 Subject: [PATCH 23/32] Add keyword "macos" to testlib blacklisting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With "macos" keyword in place, we can blacklist using that keyword instead of the old "osx". Change-Id: Ib7a2f88265271df152320cce8594b8f788b47687 Reviewed-by: Edward Welbourne Reviewed-by: Simon Hausmann Reviewed-by: Jędrzej Nowacki --- src/testlib/qtestblacklist.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/testlib/qtestblacklist.cpp b/src/testlib/qtestblacklist.cpp index f430294142..ae2913da9a 100644 --- a/src/testlib/qtestblacklist.cpp +++ b/src/testlib/qtestblacklist.cpp @@ -104,6 +104,7 @@ static QSet keywords() #endif #ifdef Q_OS_OSX << "osx" + << "macos" #endif #if defined(Q_OS_WIN) && !defined(Q_OS_WINRT) << "windows" From 1d3a162bfe38f8a3cd576ca17ea7e0f71a55e074 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 18 Feb 2019 13:15:31 +0100 Subject: [PATCH 24/32] Properly convert filename to bytearray when sending over portal We should be using QFile::encodeName() to properly convert filenames from string to bytearray. This takes user's locale into account. Change-Id: I090f73f21feb73af166e88baa0e7f4a595cdb25b Reviewed-by: Thiago Macieira --- .../xdgdesktopportal/qxdgdesktopportalfiledialog.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp index 5e94d1558e..dcf52921aa 100644 --- a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp +++ b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp @@ -48,6 +48,7 @@ #include #include +#include #include #include #include @@ -181,10 +182,10 @@ void QXdgDesktopPortalFileDialog::openPortal() if (d->saveFile) { if (!d->directory.isEmpty()) - options.insert(QLatin1String("current_folder"), d->directory.toLatin1().append('\0')); + options.insert(QLatin1String("current_folder"), QFile::encodeName(d->directory).append('\0')); if (!d->selectedFiles.isEmpty()) - options.insert(QLatin1String("current_file"), d->selectedFiles.first().toLatin1().append('\0')); + options.insert(QLatin1String("current_file"), QFile::encodeName(d->selectedFiles.first()).append('\0')); } // Insert filters From d3eb9e944ac73f238b8716bb25b8051377bba946 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Wed, 20 Feb 2019 13:30:52 +0100 Subject: [PATCH 25/32] Make tst_QUdpSocket::lincLocalIPv6 less sadistic MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It fails on CI (Windows 10). Given our qabstractsocket disables read notifications/stops emitting readyRead if it already has pending data (unbuffered, aka UDP socket type) - make sure we do not suffer from this. The change does not affect the test's logic (unless the logic was to fail), it just makes it more fail-proof. Change-Id: I6c9b7ded20478f675260872a2a7032b4f356f197 Fixes: QTBUG-73884 Reviewed-by: Edward Welbourne Reviewed-by: Mårten Nordheim --- tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp index 8ebb27e58c..707c1acf48 100644 --- a/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp +++ b/tests/auto/network/socket/qudpsocket/tst_qudpsocket.cpp @@ -1640,15 +1640,14 @@ void tst_QUdpSocket::linkLocalIPv6() sockets << s; } - QUdpSocket neutral; - QVERIFY(neutral.bind(QHostAddress(QHostAddress::AnyIPv6))); - QSignalSpy neutralReadSpy(&neutral, SIGNAL(readyRead())); - QByteArray testData("hello"); foreach (QUdpSocket *s, sockets) { + QUdpSocket neutral; + QVERIFY(neutral.bind(QHostAddress(QHostAddress::AnyIPv6))); + QSignalSpy neutralReadSpy(&neutral, SIGNAL(readyRead())); + QSignalSpy spy(s, SIGNAL(readyRead())); - neutralReadSpy.clear(); QVERIFY(s->writeDatagram(testData, s->localAddress(), neutral.localPort())); QTRY_VERIFY(neutralReadSpy.count() > 0); //note may need to accept a firewall prompt From 1c55948ee84f7e8ce4ec6532d7e34f4a1f3c3dea Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 20 Feb 2019 16:01:00 +0100 Subject: [PATCH 26/32] DBus: verify up to date with dbus-1.12.12 The attirubtion previously only sayd 1.12, so verified up to date at 1.12.12; and tweaked the header slightly to make it easier to verify (content is now in the same order as in the dbus sources). Updated the list of years in which Red Hat claims copyright on various parts. Fixes: QTBUG-72622 Change-Id: Idcec9edbf42860bca61d838e75889a55eb0859d5 Reviewed-by: Thiago Macieira --- src/dbus/dbus_minimal_p.h | 32 ++++++++++++++++---------------- src/dbus/qt_attribution.json | 2 +- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/dbus/dbus_minimal_p.h b/src/dbus/dbus_minimal_p.h index 869c02b59d..243c8ceaba 100644 --- a/src/dbus/dbus_minimal_p.h +++ b/src/dbus/dbus_minimal_p.h @@ -53,7 +53,7 @@ extern "C" { -// Equivalent to dbus-arch-deps.h +// Equivalent to dbus-arch-deps.h (generated from dbus-arch-deps.h.in) typedef qint64 dbus_int64_t; typedef quint64 dbus_uint64_t; typedef qint32 dbus_int32_t; @@ -78,7 +78,7 @@ struct DBusWatch; // which carry the following copyright: /* * Copyright (C) 2002, 2003 CodeFactory AB - * Copyright (C) 2004, 2005 Red Hat, Inc. + * Copyright (C) 2002, 2003, 2004, 2005 Red Hat, Inc. * * Licensed under the Academic Free License version 2.1 * @@ -103,6 +103,20 @@ typedef dbus_uint32_t dbus_unichar_t; typedef dbus_uint32_t dbus_bool_t; /* dbus-shared.h */ +typedef enum +{ + DBUS_BUS_SESSION, /**< The login session bus */ + DBUS_BUS_SYSTEM, /**< The systemwide bus */ + DBUS_BUS_STARTER /**< The bus that started us, if any */ +} DBusBusType; + +typedef enum +{ + DBUS_HANDLER_RESULT_HANDLED, /**< Message has had its effect - no need to run more handlers. */ + DBUS_HANDLER_RESULT_NOT_YET_HANDLED, /**< Message has not had any effect - see if other handlers want it. */ + DBUS_HANDLER_RESULT_NEED_MEMORY /**< Need more memory in order to return #DBUS_HANDLER_RESULT_HANDLED or #DBUS_HANDLER_RESULT_NOT_YET_HANDLED. Please try again later with more memory. */ +} DBusHandlerResult; + #define DBUS_SERVICE_DBUS "org.freedesktop.DBus" #define DBUS_PATH_DBUS "/org/freedesktop/DBus" #define DBUS_PATH_LOCAL "/org/freedesktop/DBus/Local" @@ -124,20 +138,6 @@ typedef dbus_uint32_t dbus_bool_t; #define DBUS_RELEASE_NAME_REPLY_NON_EXISTENT 2 /**< The given name does not exist on the bus */ #define DBUS_RELEASE_NAME_REPLY_NOT_OWNER 3 /**< Service is not an owner of the given name */ -typedef enum -{ - DBUS_BUS_SESSION, /**< The login session bus */ - DBUS_BUS_SYSTEM, /**< The systemwide bus */ - DBUS_BUS_STARTER /**< The bus that started us, if any */ -} DBusBusType; - -typedef enum -{ - DBUS_HANDLER_RESULT_HANDLED, /**< Message has had its effect - no need to run more handlers. */ - DBUS_HANDLER_RESULT_NOT_YET_HANDLED, /**< Message has not had any effect - see if other handlers want it. */ - DBUS_HANDLER_RESULT_NEED_MEMORY /**< Need more memory in order to return #DBUS_HANDLER_RESULT_HANDLED or #DBUS_HANDLER_RESULT_NOT_YET_HANDLED. Please try again later with more memory. */ -} DBusHandlerResult; - /* dbus-memory.h */ typedef void (* DBusFreeFunction) (void *memory); diff --git a/src/dbus/qt_attribution.json b/src/dbus/qt_attribution.json index 69d946ba5c..33eaee1ed1 100644 --- a/src/dbus/qt_attribution.json +++ b/src/dbus/qt_attribution.json @@ -7,7 +7,7 @@ "Description": "D-Bus is a message bus system, a simple way for applications to talk to one another.", "Homepage": "https://www.freedesktop.org/wiki/Software/dbus/", "Version": "Minimal supported is 1.2, compatible up to ...", - "Version": "1.12", + "Version": "dbus-1.12.12", "LicenseId": "AFL-2.1 OR GPL-2.0-or-later", "License": "Academic Free License v2.1, or GNU General Public License v2.0 or later", "LicenseFile": "LIBDBUS-1-LICENSE.txt", From 01f07fd2d1f4e9c6dfc755ffa1c30bb1281a0ff1 Mon Sep 17 00:00:00 2001 From: Lars Schmertmann Date: Tue, 15 Jan 2019 10:26:37 +0100 Subject: [PATCH 27/32] Rename the Indonesian Android translation folder to fix a lint warning Wrong locale name ----------------- From the java.util.Locale documentation: "Note that Java uses several deprecated two-letter codes. The Hebrew ("he") language code is rewritten as "iw", Indonesian ("id") as "in", and Yiddish ("yi") as "ji". This rewriting happens even if you construct your own Locale object, not just for instances returned by the various lookup methods. Because of this, if you add your localized resources in for example values-he they will not be used, since the system will look for values-iw instead. To work around this, place your resources in a values folder using the deprecated language code instead. See also: http://www.apps4android.org/?p=3695 https://issuetracker.google.com/issues/36908826 Change-Id: I726c43f282156b21e8d6b073029f3c3b8fd42a30 Reviewed-by: Edward Welbourne Reviewed-by: BogDan Vatra --- src/android/java/res/{values-id => values-in}/strings.xml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/android/java/res/{values-id => values-in}/strings.xml (100%) diff --git a/src/android/java/res/values-id/strings.xml b/src/android/java/res/values-in/strings.xml similarity index 100% rename from src/android/java/res/values-id/strings.xml rename to src/android/java/res/values-in/strings.xml From 46a20b90243149b0ecd1d44cab964e785648d214 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 13 Feb 2019 10:09:54 +0100 Subject: [PATCH 28/32] QProcess: Fix crash when calling closeWriteChannel on Windows We must deleteLater the pipe writer in closeChannel, because if you call closeWriteChannel() from a slot that is connected to a signal emitted from QWindowsPipeWriter, we'd operate on a deleted object. For consistency, we're calling QWindowsPipeWriter::stop before deleteLater and deduplicate the code. Fixes: QTBUG-73778 Change-Id: I61d3dedf57e9fd02517a108d13ffc85e006330f6 Reviewed-by: Christian Kandeler --- src/corelib/io/qprocess_win.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index cb4b2f9f91..3ba86063e3 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -362,16 +362,22 @@ void QProcessPrivate::destroyPipe(Q_PIPE pipe[2]) } } +template +void deleteWorker(T *&worker) +{ + if (!worker) + return; + worker->stop(); + worker->deleteLater(); + worker = nullptr; +} + void QProcessPrivate::closeChannel(Channel *channel) { - if (channel == &stdinChannel) { - delete stdinChannel.writer; - stdinChannel.writer = 0; - } else if (channel->reader) { - channel->reader->stop(); - channel->reader->deleteLater(); - channel->reader = 0; - } + if (channel == &stdinChannel) + deleteWorker(channel->writer); + else + deleteWorker(channel->reader); destroyPipe(channel->pipe); } From 1136c9849e26423f72d7a0a7a92be8c93c13d7a6 Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Thu, 21 Feb 2019 09:58:29 +0100 Subject: [PATCH 29/32] qmake: vcproj: Fix windeployqt config for dll targets Instead of hardcoding the target's extension to ".exe" we should rely on target information available in Visual Studio. $(TargetFileName) is documented as "The file name of the primary output file for the build (defined as base name + file extension)." so it can be used instead of $(TargetName) together with ".exe". Change-Id: I103d8d13456910617b2d53c9c8f4e2935eb93015 Reviewed-by: Kai Koehne --- qmake/generators/win32/msvc_vcproj.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp index 713a55d16b..f83e5c0247 100644 --- a/qmake/generators/win32/msvc_vcproj.cpp +++ b/qmake/generators/win32/msvc_vcproj.cpp @@ -1350,7 +1350,7 @@ void VcprojGenerator::initWinDeployQtTool() // structure manually by invoking windeployqt a second time, so that // the MDILXapCompile call succeeds and deployment continues. conf.windeployqt.CommandLine += commandLine - + QStringLiteral(" -list relative -dir \"$(MSBuildProjectDirectory)\" \"$(OutDir)\\$(TargetName).exe\" > ") + + QStringLiteral(" -list relative -dir \"$(MSBuildProjectDirectory)\" \"$(OutDir)\\$(TargetFileName)\" > ") + MakefileGenerator::shellQuote(conf.windeployqt.Record); conf.windeployqt.config = &vcProject.Configuration; conf.windeployqt.ExcludedFromBuild = false; From 3d7616a3160a5ae8bff5f901e4120ee152b43dc1 Mon Sep 17 00:00:00 2001 From: Gatis Paeglis Date: Tue, 19 Feb 2019 12:36:07 +0100 Subject: [PATCH 30/32] offscreen: remove false condition This plugin does not use any XCB libs. This patch amends 94a4f06fb88ec6c7fa5e31dfd28af4e9b3cdbdd8 and 744be250bf8dbd3e5065662f55a4655c14aa512c Change-Id: I33e2647ace3d9f32a420551b3b198e33a182a06f Reviewed-by: Michal Klocek Reviewed-by: Allan Sandfeld Jensen --- src/plugins/platforms/offscreen/offscreen.pro | 2 +- src/plugins/platforms/offscreen/qoffscreenintegration.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/platforms/offscreen/offscreen.pro b/src/plugins/platforms/offscreen/offscreen.pro index a8f230a7b1..f226132592 100644 --- a/src/plugins/platforms/offscreen/offscreen.pro +++ b/src/plugins/platforms/offscreen/offscreen.pro @@ -17,7 +17,7 @@ HEADERS = qoffscreenintegration.h \ OTHER_FILES += offscreen.json -qtConfig(system-xcb):qtConfig(xlib):qtConfig(opengl):!qtConfig(opengles2) { +qtConfig(xlib):qtConfig(opengl):!qtConfig(opengles2) { SOURCES += qoffscreenintegration_x11.cpp HEADERS += qoffscreenintegration_x11.h QT += glx_support-private diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp index efd8fdf3fa..f2933b7179 100644 --- a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp +++ b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp @@ -66,7 +66,7 @@ #include -#if QT_CONFIG(system_xcb) && QT_CONFIG(xlib) && QT_CONFIG(opengl) && !QT_CONFIG(opengles2) +#if QT_CONFIG(xlib) && QT_CONFIG(opengl) && !QT_CONFIG(opengles2) #include "qoffscreenintegration_x11.h" #endif @@ -225,7 +225,7 @@ QPlatformServices *QOffscreenIntegration::services() const QOffscreenIntegration *QOffscreenIntegration::createOffscreenIntegration() { -#if QT_CONFIG(system_xcb) && QT_CONFIG(xlib) && QT_CONFIG(opengl) && !QT_CONFIG(opengles2) +#if QT_CONFIG(xlib) && QT_CONFIG(opengl) && !QT_CONFIG(opengles2) QByteArray glx = qgetenv("QT_QPA_OFFSCREEN_NO_GLX"); if (glx.isEmpty()) return new QOffscreenX11Integration; From b5c16921cca0d5ae966a36cb451ec0b322b967ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Thu, 21 Feb 2019 15:29:48 +0100 Subject: [PATCH 31/32] wasm: make setting the cursor shape work again Commit 960af0d64 ported away from EM_ASM but also changed the logic. Set the canvas.style.cursor property, like it originally did. Change-Id: Ie4b23abeae54173894bff1db000a305c459684bb Reviewed-by: Lorn Potter --- src/plugins/platforms/wasm/qwasmcursor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/wasm/qwasmcursor.cpp b/src/plugins/platforms/wasm/qwasmcursor.cpp index 90431ab6a5..744b160dd1 100644 --- a/src/plugins/platforms/wasm/qwasmcursor.cpp +++ b/src/plugins/platforms/wasm/qwasmcursor.cpp @@ -53,7 +53,8 @@ void QWasmCursor::changeCursor(QCursor *windowCursor, QWindow *window) htmlCursorName = "auto"; // Set cursor on the main canvas - emscripten::val::global("window").set("cursor", emscripten::val(htmlCursorName.constData())); + emscripten::val canvasStyle = emscripten::val::module_property("canvas")["style"]; + canvasStyle.set("cursor", emscripten::val(htmlCursorName.constData())); } QByteArray QWasmCursor::cursorShapeToHtml(Qt::CursorShape shape) From c204f6e417fe9b10df29e0ba00c7a94e0aa52cef Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 20 Feb 2019 14:14:28 +0100 Subject: [PATCH 32/32] Update and expand public suffix list's attribution information Say where the git repo is, for finding commit IDs, but make clear that the download should come from the public site. Revised Description to the closest match to it I could find on the current web-site (on the home page). Mention where the script to convert the data live. Task-number: QTBUG-72623 Change-Id: Ie5f7b2b0c21cdf1c24e311c13866cb1bb02e6973 Reviewed-by: Allan Sandfeld Jensen --- src/corelib/io/qt_attribution.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/corelib/io/qt_attribution.json b/src/corelib/io/qt_attribution.json index e9eb9c85e4..c52df67d98 100644 --- a/src/corelib/io/qt_attribution.json +++ b/src/corelib/io/qt_attribution.json @@ -2,7 +2,7 @@ "Id": "psl", "Name": "The Public Suffix List", "QDocModule": "qtcore", - "Description": "The Public Suffix List is an initiative of the Mozilla Project, + "Description": "The Public Suffix List is an initiative of Mozilla, but is maintained as a community resource. It is available for use in any software, but was originally created to meet the needs of browser manufacturers. It allows browsers to, for example: @@ -14,9 +14,11 @@ It allows browsers to, for example: - Accurately sort history entries by site", "Files": "qurltlds_p.h", - "QtUsage": "Used in Qt Core to avoid \"supercookies\" being set in the cookie jar + "QtUsage": "See util/corelib/qurl-generateTLDs/ for code-generator", + "QtUsage": "Used in Qt Core to avoid setting \"supercookies\" in the cookie jar supported by Qt (by the QNetworkCookieJar class).", + "Homepage": "Consult https://github.com/publicsuffix/list for the sha1 but download from ...", "Homepage": "http://publicsuffix.org/", "Version": "Generated on 2018-01-04", "License": "Mozilla Public License 2.0",