From bf059f61338b45e974786d6300f522b3e72a7faa Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 2 Mar 2020 14:33:07 +0100 Subject: Android: Include the resConfigs so that the package can be uploaded The Google Play Store requires the resConfigs to be set to something valid otherwise it will not accept the package, so we default it to "en" to ensure it is valid. Fixes: QTBUG-81735 Change-Id: I1180481a1e5b88057aed2417716ca4d334080c00 Reviewed-by: BogDan Vatra --- src/android/templates/build.gradle | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/android/templates/build.gradle b/src/android/templates/build.gradle index 3087d08c83..171fe0b996 100644 --- a/src/android/templates/build.gradle +++ b/src/android/templates/build.gradle @@ -59,4 +59,8 @@ android { aaptOptions { noCompress 'rcc' } + + defaultConfig { + resConfigs "en" + } } -- cgit v1.2.3 From 6806cb341ca5f21d0136f890ccd317d71aa3cab6 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Mon, 2 Mar 2020 14:27:45 +0200 Subject: Android: fix apk generation on Android API 23+ Starting with Android API 23+ gradle enables uncompressed native libs by default. We must set android.bundle.enableUncompressedNativeLibs = false to gradle.properties, to force it to compress them and extract them on the device. Fixes: QTBUG-80766 Change-Id: Ia6d8d9179a341bbe7f8dc254a3b31d2ee8d7a5d7 Reviewed-by: Andy Shaw --- src/tools/androiddeployqt/main.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index 3d378024c9..80612d34ac 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -2295,6 +2295,7 @@ bool buildAndroidProject(const Options &options) QString gradlePropertiesPath = options.outputDirectory + QLatin1String("gradle.properties"); GradleProperties gradleProperties = readGradleProperties(gradlePropertiesPath); + gradleProperties["android.bundle.enableUncompressedNativeLibs"] = "false"; gradleProperties["buildDir"] = "build"; gradleProperties["qt5AndroidDir"] = (options.qtInstallDirectory + QLatin1String("/src/android/java")).toUtf8(); gradleProperties["androidCompileSdkVersion"] = options.androidPlatform.split(QLatin1Char('-')).last().toLocal8Bit(); -- cgit v1.2.3 From 2f52afda8e77429c00029f94e887ed37dfb4e584 Mon Sep 17 00:00:00 2001 From: Kirill Burtsev Date: Tue, 3 Mar 2020 17:26:53 +0100 Subject: QLibraryInfo: avoid unneeded conversion for path prefix Ammends 4ac872639e. Change return type for getPrefix to eliminate toLatin1/fromLocal8bit conversion of initial value for relocatable prefix to preserve not-latin1 characters and return valid prefix path. Fixes: QTBUG-81462 Change-Id: I15cfa49e9e440e257b04dd31803cd1478f3b07f5 Reviewed-by: Alexandru Croitor Reviewed-by: Joerg Bornemann --- src/corelib/global/qlibraryinfo.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 7d6beaf9c2..acc73389ed 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -661,7 +661,7 @@ static QString getHostPrefixFromHostBinDir() #endif #ifndef QT_BUILD_QMAKE_BOOTSTRAP -static const char *getPrefix( +static QString getPrefix( #ifdef QT_BUILD_QMAKE QLibraryInfo::PathGroup group #endif @@ -670,15 +670,13 @@ static const char *getPrefix( #if defined(QT_BUILD_QMAKE) # if QT_CONFIGURE_CROSSBUILD if (group == QLibraryInfo::DevicePaths) - return QT_CONFIGURE_PREFIX_PATH; + return QString::fromLocal8Bit(QT_CONFIGURE_PREFIX_PATH); # endif - static QByteArray extPrefixPath = getExtPrefixFromHostBinDir().toLatin1(); - return extPrefixPath.constData(); + return getExtPrefixFromHostBinDir(); #elif QT_CONFIG(relocatable) - static QByteArray prefixPath = getRelocatablePrefix().toLatin1(); - return prefixPath.constData(); + return getRelocatablePrefix(); #else - return QT_CONFIGURE_PREFIX_PATH; + return QString::fromLocal8Bit(QT_CONFIGURE_PREFIX_PATH); #endif } #endif // QT_BUILD_QMAKE_BOOTSTRAP @@ -794,7 +792,7 @@ QLibraryInfo::rawLocation(LibraryLocation loc, PathGroup group) if (!fromConf) { const char * volatile path = 0; if (loc == PrefixPath) { - path = getPrefix( + ret = getPrefix( #ifdef QT_BUILD_QMAKE group #endif -- cgit v1.2.3 From 2c1b4e37b936f64d6b52e2bc10ff97184a714b9a Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Wed, 4 Mar 2020 07:44:22 +0100 Subject: Fix CVE-2020-9327 in SQLite This was taken from abc473fb8fb99900 in SQLite, ref: https://www.sqlite.org/cgi/src/info/abc473fb8fb99900 Fixes: QTBUG-82533 Change-Id: I9840e29f19a0b861229987f5b59d8585ba2e55dc Reviewed-by: Simon Hausmann --- .../patches/0001-Fix-CVE-2020-9327-in-SQLite.patch | 203 +++++++++++++++++++++ src/3rdparty/sqlite/sqlite3.c | 31 +++- 2 files changed, 225 insertions(+), 9 deletions(-) create mode 100644 src/3rdparty/sqlite/patches/0001-Fix-CVE-2020-9327-in-SQLite.patch (limited to 'src') diff --git a/src/3rdparty/sqlite/patches/0001-Fix-CVE-2020-9327-in-SQLite.patch b/src/3rdparty/sqlite/patches/0001-Fix-CVE-2020-9327-in-SQLite.patch new file mode 100644 index 0000000000..4fbb2ee339 --- /dev/null +++ b/src/3rdparty/sqlite/patches/0001-Fix-CVE-2020-9327-in-SQLite.patch @@ -0,0 +1,203 @@ +From 63566d1fff2665b777650594eec6eefd3587e177 Mon Sep 17 00:00:00 2001 +From: Andy Shaw +Date: Wed, 4 Mar 2020 07:44:22 +0100 +Subject: [PATCH] Fix CVE-2020-9327 in SQLite + +This was taken from abc473fb8fb99900 in SQLite, ref: +https://www.sqlite.org/cgi/src/info/abc473fb8fb99900 + +Fixes: QTBUG-82533 +Change-Id: I9840e29f19a0b861229987f5b59d8585ba2e55dc +--- + .../0001-Fix-CVE-2020-9327-in-SQLite.patch | 96 +++++++++++++++++++ + src/3rdparty/sqlite/sqlite3.c | 31 ++++-- + 2 files changed, 118 insertions(+), 9 deletions(-) + create mode 100644 src/3rdparty/sqlite/patches/0001-Fix-CVE-2020-9327-in-SQLite.patch + +diff --git a/src/3rdparty/sqlite/patches/0001-Fix-CVE-2020-9327-in-SQLite.patch b/src/3rdparty/sqlite/patches/0001-Fix-CVE-2020-9327-in-SQLite.patch +new file mode 100644 +index 0000000000..e0e8206db5 +--- /dev/null ++++ b/src/3rdparty/sqlite/patches/0001-Fix-CVE-2020-9327-in-SQLite.patch +@@ -0,0 +1,96 @@ ++From f79860e0fe251e3267a3cd5558dce98f918e0caa Mon Sep 17 00:00:00 2001 ++From: Andy Shaw ++Date: Wed, 4 Mar 2020 07:44:22 +0100 ++Subject: [PATCH] Fix CVE-2020-9327 in SQLite ++ ++Fixes: QTBUG-82533 ++Change-Id: I9840e29f19a0b861229987f5b59d8585ba2e55dc ++--- ++ src/3rdparty/sqlite/sqlite3.c | 31 ++++++++++++++++++++++--------- ++ 1 file changed, 22 insertions(+), 9 deletions(-) ++ ++diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c ++index 55dc686ee0..dfe5323a59 100644 ++--- a/src/3rdparty/sqlite/sqlite3.c +++++ b/src/3rdparty/sqlite/sqlite3.c ++@@ -17428,8 +17428,11 @@ struct Table { ++ */ ++ #ifndef SQLITE_OMIT_VIRTUALTABLE ++ # define IsVirtual(X) ((X)->nModuleArg) +++# define ExprIsVtab(X) \ +++ ((X)->op==TK_COLUMN && (X)->y.pTab!=0 && (X)->y.pTab->nModuleArg) ++ #else ++ # define IsVirtual(X) 0 +++# define ExprIsVtab(X) 0 ++ #endif ++ ++ /* ++@@ -104133,19 +104136,25 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){ ++ case TK_LT: ++ case TK_LE: ++ case TK_GT: ++- case TK_GE: +++ case TK_GE: { +++ Expr *pLeft = pExpr->pLeft; +++ Expr *pRight = pExpr->pRight; ++ testcase( pExpr->op==TK_EQ ); ++ testcase( pExpr->op==TK_NE ); ++ testcase( pExpr->op==TK_LT ); ++ testcase( pExpr->op==TK_LE ); ++ testcase( pExpr->op==TK_GT ); ++ testcase( pExpr->op==TK_GE ); ++- if( (pExpr->pLeft->op==TK_COLUMN && IsVirtual(pExpr->pLeft->y.pTab)) ++- || (pExpr->pRight->op==TK_COLUMN && IsVirtual(pExpr->pRight->y.pTab)) +++ /* The y.pTab=0 assignment in wherecode.c always happens after the +++ ** impliesNotNullRow() test */ +++ if( (pLeft->op==TK_COLUMN && ALWAYS(pLeft->y.pTab!=0) +++ && IsVirtual(pLeft->y.pTab)) +++ || (pRight->op==TK_COLUMN && ALWAYS(pRight->y.pTab!=0) +++ && IsVirtual(pRight->y.pTab)) ++ ){ ++- return WRC_Prune; +++ return WRC_Prune; ++ } ++- +++ } ++ default: ++ return WRC_Continue; ++ } ++@@ -142591,7 +142600,8 @@ static int isAuxiliaryVtabOperator( ++ ** MATCH(expression,vtab_column) ++ */ ++ pCol = pList->a[1].pExpr; ++- if( pCol->op==TK_COLUMN && IsVirtual(pCol->y.pTab) ){ +++ testcase( pCol->op==TK_COLUMN && pCol->y.pTab==0 ); +++ if( ExprIsVtab(pCol) ){ ++ for(i=0; iu.zToken, aOp[i].zOp)==0 ){ ++ *peOp2 = aOp[i].eOp2; ++@@ -142613,7 +142623,8 @@ static int isAuxiliaryVtabOperator( ++ ** with function names in an arbitrary case. ++ */ ++ pCol = pList->a[0].pExpr; ++- if( pCol->op==TK_COLUMN && IsVirtual(pCol->y.pTab) ){ +++ testcase( pCol->op==TK_COLUMN && pCol->y.pTab==0 ); +++ if( ExprIsVtab(pCol) ){ ++ sqlite3_vtab *pVtab; ++ sqlite3_module *pMod; ++ void (*xNotUsed)(sqlite3_context*,int,sqlite3_value**); ++@@ -142636,10 +142647,12 @@ static int isAuxiliaryVtabOperator( ++ int res = 0; ++ Expr *pLeft = pExpr->pLeft; ++ Expr *pRight = pExpr->pRight; ++- if( pLeft->op==TK_COLUMN && IsVirtual(pLeft->y.pTab) ){ +++ testcase( pLeft->op==TK_COLUMN && pLeft->y.pTab==0 ); +++ if( ExprIsVtab(pLeft) ){ ++ res++; ++ } ++- if( pRight && pRight->op==TK_COLUMN && IsVirtual(pRight->y.pTab) ){ +++ testcase( pRight && pRight->op==TK_COLUMN && pRight->y.pTab==0 ); +++ if( pRight && ExprIsVtab(pRight) ){ ++ res++; ++ SWAP(Expr*, pLeft, pRight); ++ } ++-- ++2.21.0 (Apple Git-122.2) ++ +diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c +index 55dc686ee0..dfe5323a59 100644 +--- a/src/3rdparty/sqlite/sqlite3.c ++++ b/src/3rdparty/sqlite/sqlite3.c +@@ -17428,8 +17428,11 @@ struct Table { + */ + #ifndef SQLITE_OMIT_VIRTUALTABLE + # define IsVirtual(X) ((X)->nModuleArg) ++# define ExprIsVtab(X) \ ++ ((X)->op==TK_COLUMN && (X)->y.pTab!=0 && (X)->y.pTab->nModuleArg) + #else + # define IsVirtual(X) 0 ++# define ExprIsVtab(X) 0 + #endif + + /* +@@ -104133,19 +104136,25 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){ + case TK_LT: + case TK_LE: + case TK_GT: +- case TK_GE: ++ case TK_GE: { ++ Expr *pLeft = pExpr->pLeft; ++ Expr *pRight = pExpr->pRight; + testcase( pExpr->op==TK_EQ ); + testcase( pExpr->op==TK_NE ); + testcase( pExpr->op==TK_LT ); + testcase( pExpr->op==TK_LE ); + testcase( pExpr->op==TK_GT ); + testcase( pExpr->op==TK_GE ); +- if( (pExpr->pLeft->op==TK_COLUMN && IsVirtual(pExpr->pLeft->y.pTab)) +- || (pExpr->pRight->op==TK_COLUMN && IsVirtual(pExpr->pRight->y.pTab)) ++ /* The y.pTab=0 assignment in wherecode.c always happens after the ++ ** impliesNotNullRow() test */ ++ if( (pLeft->op==TK_COLUMN && ALWAYS(pLeft->y.pTab!=0) ++ && IsVirtual(pLeft->y.pTab)) ++ || (pRight->op==TK_COLUMN && ALWAYS(pRight->y.pTab!=0) ++ && IsVirtual(pRight->y.pTab)) + ){ +- return WRC_Prune; ++ return WRC_Prune; + } +- ++ } + default: + return WRC_Continue; + } +@@ -142591,7 +142600,8 @@ static int isAuxiliaryVtabOperator( + ** MATCH(expression,vtab_column) + */ + pCol = pList->a[1].pExpr; +- if( pCol->op==TK_COLUMN && IsVirtual(pCol->y.pTab) ){ ++ testcase( pCol->op==TK_COLUMN && pCol->y.pTab==0 ); ++ if( ExprIsVtab(pCol) ){ + for(i=0; iu.zToken, aOp[i].zOp)==0 ){ + *peOp2 = aOp[i].eOp2; +@@ -142613,7 +142623,8 @@ static int isAuxiliaryVtabOperator( + ** with function names in an arbitrary case. + */ + pCol = pList->a[0].pExpr; +- if( pCol->op==TK_COLUMN && IsVirtual(pCol->y.pTab) ){ ++ testcase( pCol->op==TK_COLUMN && pCol->y.pTab==0 ); ++ if( ExprIsVtab(pCol) ){ + sqlite3_vtab *pVtab; + sqlite3_module *pMod; + void (*xNotUsed)(sqlite3_context*,int,sqlite3_value**); +@@ -142636,10 +142647,12 @@ static int isAuxiliaryVtabOperator( + int res = 0; + Expr *pLeft = pExpr->pLeft; + Expr *pRight = pExpr->pRight; +- if( pLeft->op==TK_COLUMN && IsVirtual(pLeft->y.pTab) ){ ++ testcase( pLeft->op==TK_COLUMN && pLeft->y.pTab==0 ); ++ if( ExprIsVtab(pLeft) ){ + res++; + } +- if( pRight && pRight->op==TK_COLUMN && IsVirtual(pRight->y.pTab) ){ ++ testcase( pRight && pRight->op==TK_COLUMN && pRight->y.pTab==0 ); ++ if( pRight && ExprIsVtab(pRight) ){ + res++; + SWAP(Expr*, pLeft, pRight); + } +-- +2.21.0 (Apple Git-122.2) + diff --git a/src/3rdparty/sqlite/sqlite3.c b/src/3rdparty/sqlite/sqlite3.c index 55dc686ee0..dfe5323a59 100644 --- a/src/3rdparty/sqlite/sqlite3.c +++ b/src/3rdparty/sqlite/sqlite3.c @@ -17428,8 +17428,11 @@ struct Table { */ #ifndef SQLITE_OMIT_VIRTUALTABLE # define IsVirtual(X) ((X)->nModuleArg) +# define ExprIsVtab(X) \ + ((X)->op==TK_COLUMN && (X)->y.pTab!=0 && (X)->y.pTab->nModuleArg) #else # define IsVirtual(X) 0 +# define ExprIsVtab(X) 0 #endif /* @@ -104133,19 +104136,25 @@ static int impliesNotNullRow(Walker *pWalker, Expr *pExpr){ case TK_LT: case TK_LE: case TK_GT: - case TK_GE: + case TK_GE: { + Expr *pLeft = pExpr->pLeft; + Expr *pRight = pExpr->pRight; testcase( pExpr->op==TK_EQ ); testcase( pExpr->op==TK_NE ); testcase( pExpr->op==TK_LT ); testcase( pExpr->op==TK_LE ); testcase( pExpr->op==TK_GT ); testcase( pExpr->op==TK_GE ); - if( (pExpr->pLeft->op==TK_COLUMN && IsVirtual(pExpr->pLeft->y.pTab)) - || (pExpr->pRight->op==TK_COLUMN && IsVirtual(pExpr->pRight->y.pTab)) + /* The y.pTab=0 assignment in wherecode.c always happens after the + ** impliesNotNullRow() test */ + if( (pLeft->op==TK_COLUMN && ALWAYS(pLeft->y.pTab!=0) + && IsVirtual(pLeft->y.pTab)) + || (pRight->op==TK_COLUMN && ALWAYS(pRight->y.pTab!=0) + && IsVirtual(pRight->y.pTab)) ){ - return WRC_Prune; + return WRC_Prune; } - + } default: return WRC_Continue; } @@ -142591,7 +142600,8 @@ static int isAuxiliaryVtabOperator( ** MATCH(expression,vtab_column) */ pCol = pList->a[1].pExpr; - if( pCol->op==TK_COLUMN && IsVirtual(pCol->y.pTab) ){ + testcase( pCol->op==TK_COLUMN && pCol->y.pTab==0 ); + if( ExprIsVtab(pCol) ){ for(i=0; iu.zToken, aOp[i].zOp)==0 ){ *peOp2 = aOp[i].eOp2; @@ -142613,7 +142623,8 @@ static int isAuxiliaryVtabOperator( ** with function names in an arbitrary case. */ pCol = pList->a[0].pExpr; - if( pCol->op==TK_COLUMN && IsVirtual(pCol->y.pTab) ){ + testcase( pCol->op==TK_COLUMN && pCol->y.pTab==0 ); + if( ExprIsVtab(pCol) ){ sqlite3_vtab *pVtab; sqlite3_module *pMod; void (*xNotUsed)(sqlite3_context*,int,sqlite3_value**); @@ -142636,10 +142647,12 @@ static int isAuxiliaryVtabOperator( int res = 0; Expr *pLeft = pExpr->pLeft; Expr *pRight = pExpr->pRight; - if( pLeft->op==TK_COLUMN && IsVirtual(pLeft->y.pTab) ){ + testcase( pLeft->op==TK_COLUMN && pLeft->y.pTab==0 ); + if( ExprIsVtab(pLeft) ){ res++; } - if( pRight && pRight->op==TK_COLUMN && IsVirtual(pRight->y.pTab) ){ + testcase( pRight && pRight->op==TK_COLUMN && pRight->y.pTab==0 ); + if( pRight && ExprIsVtab(pRight) ){ res++; SWAP(Expr*, pLeft, pRight); } -- cgit v1.2.3 From 7fcc4e0a57deb01de209ec8ff4d92c3a81e61fe9 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Fri, 6 Mar 2020 09:24:25 +0100 Subject: Windows QPA: Do not play sound for QMessageBox::NoIcon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Amends 2f366a63b20a943ae3099605c2cdb34009ca5602. Task-number: QTBUG-82682 Task-number: QTBUG-81342 Change-Id: I30f465bf432e27828db460f6dbbb59eee0cca8f2 Reviewed-by: Oliver Wolff Reviewed-by: André de la Rocha --- src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src') diff --git a/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp b/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp index 32a57473ad..fef5346eaf 100644 --- a/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp +++ b/src/plugins/platforms/windows/uiautomation/qwindowsuiaaccessibility.cpp @@ -105,6 +105,7 @@ static QString alertSound(const QObject *object) case Critical: return QStringLiteral("SystemHand"); } + return QString(); } return QStringLiteral("SystemAsterisk"); } -- cgit v1.2.3 From ddd0919bcf5bb630efce755cc21f364e36e23fca Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 11 Mar 2020 12:57:41 +0100 Subject: Do not crash on skipped Xlib visuals If XLIB_SKIP_ARGB_VISUALS is set, we might fail to find visuals for supported configurations. Task-number: QTBUG-81904 Change-Id: Ib0d26faabe430925881b7f2acfc5361df3af416b Reviewed-by: Laszlo Agocs --- src/platformsupport/glxconvenience/qglxconvenience.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/platformsupport/glxconvenience/qglxconvenience.cpp b/src/platformsupport/glxconvenience/qglxconvenience.cpp index 81bccb1c25..e2f4922c8a 100644 --- a/src/platformsupport/glxconvenience/qglxconvenience.cpp +++ b/src/platformsupport/glxconvenience/qglxconvenience.cpp @@ -224,6 +224,8 @@ GLXFBConfig qglx_findConfig(Display *display, int screen , QSurfaceFormat format } QXlibPointer visual(glXGetVisualFromFBConfig(display, candidate)); + if (!visual) + continue; int actualRed; int actualGreen; int actualBlue; -- cgit v1.2.3 From ffbf5ae11d8df95ec2bb0ed7c3c32be9a45eac0c Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Wed, 11 Mar 2020 19:15:10 +0100 Subject: Fix potential out-of-bounds or nullptr access MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This ammends change baed8534bc1dac36a9d0ef4240fc14398076a192, which might have introduced a hard to reproduce segmentation fault when the screen number is out of bounds, or when the QScreen object doesn't return a valid pointer for QScreen::handle. As the issue doesn't reliably reproduce, this is a speculative fix that adds bounds and nullptr checking. Change-Id: I0cec0a344e80159ee1723d840f207267a608cef4 Fixes: QTBUG-82807 Reviewed-by: Tor Arne Vestbø Reviewed-by: Volker Hilsheimer --- src/widgets/kernel/qtooltip.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp index 1ec3612457..45835a2043 100644 --- a/src/widgets/kernel/qtooltip.cpp +++ b/src/widgets/kernel/qtooltip.cpp @@ -402,10 +402,10 @@ void QTipLabel::placeTip(const QPoint &pos, QWidget *w) #endif //QT_NO_STYLE_STYLESHEET QPoint p = pos; - int screenNumber = getTipScreen(pos, w); - QScreen *screen = QGuiApplication::screens().at(screenNumber); - if (screen) { - const QPlatformScreen *platformScreen = screen->handle(); + const QScreen *screen = QGuiApplication::screens().value(getTipScreen(pos, w), + QGuiApplication::primaryScreen()); + // a QScreen's handle *should* never be null, so this is a bit paranoid + if (const QPlatformScreen *platformScreen = screen ? screen->handle() : nullptr) { const QSize cursorSize = QHighDpi::fromNativePixels(platformScreen->cursor()->size(), platformScreen); QPoint offset(2, cursorSize.height()); -- cgit v1.2.3 From 1a18e138f4d17c219c6ffd6e4396c30b960818b4 Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 18 Mar 2020 13:57:21 +0100 Subject: Android: Fix deployment on Windows host The paths in the build properties require forward slashes apparently. On Windows, we would default to native backslashes and they would be stripped from the path. Converting to forward slashes fixes the problem. Issue was introduced by dd04fb639bf357e66d0586faed78a3043a62819e, since before that, the NDK path was retrieved from the environment. Fixes: QTBUG-82944 Change-Id: I6c51113efcf671461a5871991b3225a52b95266c Reviewed-by: BogDan Vatra --- src/tools/androiddeployqt/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index 80612d34ac..c2710c5619 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -2287,8 +2287,8 @@ static bool mergeGradleProperties(const QString &path, GradleProperties properti bool buildAndroidProject(const Options &options) { GradleProperties localProperties; - localProperties["sdk.dir"] = options.sdkPath.toUtf8(); - localProperties["ndk.dir"] = options.ndkPath.toUtf8(); + localProperties["sdk.dir"] = QDir::fromNativeSeparators(options.sdkPath).toUtf8(); + localProperties["ndk.dir"] = QDir::fromNativeSeparators(options.ndkPath).toUtf8(); if (!mergeGradleProperties(options.outputDirectory + QLatin1String("local.properties"), localProperties)) return false; -- cgit v1.2.3