summaryrefslogtreecommitdiffstats
path: root/src/plugins
Commit message (Collapse)AuthorAgeFilesLines
* iOS: cleanup connection when a screen disconnectsRichard Moe Gustavsen2021-06-161-1/+3
| | | | | | | | | | | | | | | | | The iOS port creates one QIOSViewController per connected screen. And each view controller listens for changes to the application state. The problem is that we never disconnect this connection again. So if a screen is removed, and the corresponing view controller is deallocated, the connection is still kept alive. This will cause crashes to occur when the signal emits, since the slot will then be accessing deleted memory. Fixes: QTBUG-76948 Change-Id: I758e51af9297cd62de193aae825f4475a2c7c3e5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit d829d54a42393d797c5f6ab3b80e88df35fad1e4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Prevent overly deep build dir hierarchy on WindowsJoerg Bornemann2021-06-111-2/+6
| | | | | | | | | | | | | | | | On Windows, building Qt with Ninja Multi-Config failed in a reasonably named build dir. The reason for that is our deep build dir hierarchy, created with add_subdirectory, and long target names like QNetworkListManagerNetworkInformationBackend within that hierarchy. Rename said target to QNLMNIBackend, and set AUTOGEN_BUILD_DIR to a short string that does not repeat the target name. Fixes: QTBUG-94211 Change-Id: Iea6fee012fa46d9bfb01142b60e6cb5273893c50 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit d23613acf7bfe37c1c78eb9aadc489e888e34dfb) Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* macOS: close visible gap between tab bar base line and tabsVolker Hilsheimer2021-06-111-1/+1
| | | | | | | | | | | | | | | | | Dock widgets enable the QTabBar::drawBase property, but the clip region left a gap of 3 pixels on each side between the base line and the tabs. Correct the size of the hole cut into the clip region accordingly. Visually tested on macOS 10.15.7 and macOS 11.2.1 using the dockwidgets and tabdialog example. As a drive-by, fix a spelling mistake in related documentation. Fixes: QTBUG-86362 Change-Id: Iada027999467741d0590576ee4508e6f41fb056d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit f5d6f8dca0c45f311b19731128a495392884ec8c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Keep NSWindow alive after handling windowShouldClose callbackTor Arne Vestbø2021-06-091-0/+9
| | | | | | | | | | | | | | | | | | | | | | Option-clicking the close-button on a window in macOS is a request to batch-close all the windows. When this happens we get an event in through the window that was clicked, which in turn results in AppKit calling windowShouldClose: for each window. We respond to that by explicitly closing each window (instead of just responding YES or NO), which results in the window being released and deallocated. This causes a crash when AppKit then follows up by closing each window after we responded YES to windowShouldClose. We work around this by keeping the window alive in the closest auto release pool, which is typically at the level of the runloop. This ensures that the window is alive for the duration of the logic that AppKit has for batch-closing windows. Fixes: QTBUG-92232 Change-Id: I68b6138eb8325af0576b438ffa011137fec27926 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 8a4e274dcf836f58c7417c11737bdded50a84dbd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* windows: gl: Print GetLastError() when makeCurrent failsLaszlo Agocs2021-06-091-1/+6
| | | | | | | | | | | | | | This matches the behavior of other implementations, such as QEGLPlatformContext: doing a qWarning with the relevant error from eglGetError() or equivalent is helpful when something goes wrong and should be common among QOpenGLPlatformContext implementations. Task-number: QTBUG-85714 Change-Id: Ifa5d22b83808c92ae92efcbcddc8d8c3d3ba34b1 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 03650696a1fb727a337865d43f068ddc7723a893) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: render shortcuts in context menus correctly alignedVolker Hilsheimer2021-06-031-2/+18
| | | | | | | | | | | | | | | | On macOS, shortcuts should be rendered along the imaginary line between the modifiers, and the key. The modifiers are right-aligned on the left side of that line, the key left aligned on the right side. Make an exception for multi-chord sequences, render those always left aligned. Fixes: QTBUG-73990 Change-Id: Ie03f3f40278700bdfafbfca7aa52075825e20234 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 64a64fd485bd78f44b93beb3d712db67b6d33c05) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: fix mimetype/namefilters handling for FileDialogAssam Boudjelthia2021-06-021-8/+9
| | | | | | | | | | | | | | | | | | | | | Android file dialog uses setType() to set the main mimetype for the dialog if no mimetype or multiple (+1) mimetypes are provided, then the additional mimetypes can be provided via EXTRA_MIME_TYPES flag. The problem was that the mimetypes deduction from the namefilters was: * the namefilter used was empty, now we take the first item nameFilters(), because mimetypes cannot be changed once the dialog is open anyway. * The regex extraction was getting a namefilter ending with an empty char and that was giving a mimetype of any format thus making it show all possible files. Fixes: QTBUG-83089 Change-Id: Ifaef40c2186732ad3a604d28e086409c35dafacf Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit ed431caa27672427d28f8ecde667a3a064ddda7e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* SQLite driver: fix crash when binding a QByteArray/QStringGiuseppe D'Angelo2021-06-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing SQLITE_STATIC to sqlite3_bind_*() means that ownership of the data stays in the caller, i.e. SQLite itself doesn't make a copy; such data must be therefore be kept valid until sqlite3_step() is called. The code in the SQLite driver uses that option to avoid copying byte array or string data. But, unlike what the comments in the code say, we do NOT keep the QByteArray/QString alive long enough: they're contained by a temporary QVariant object which gets destroyed at the end of the loop that binds each argument. Luckily the fix is simple: since that QVariant is just a copy of the QVariants used as bound parameters, and these are held in a container (which lives long enough), simply create a reference to the container's elements rather than a copy. This ensures that the data is alive by the time sqlite3_step() is called. This problem doesn't normally appear because of implicit sharing of QByteArray/QString. When the QVariant is copied, the inner element is just a shallow copy. Getting the pointer to the data, and destroying the QVariant, does not destroy the data (it's kept alive by the QByteArray/QString inside the *copied-from* QVariant). Of course there's a catch: if the *copied-from* QVariant contains a QString created via fromRawData, then everything blows up. In this case, 1. the copied QVariant is created (which bumps the QString refcount)¹ 2. the QString inside of it is accessed directly (via QVariant::constData) 3. utf16() is called on that string, which detaches it (!) 4. the result of utf16() is passed to SQLite, with SQLITE_STATIC 5. the copied QVariant is destroyed; this destroys the inner QString, which, being detached, deallocates the data too early. 6. sqlite3_step() is called, kaboom. (The copied-from QVariant still has the string created by fromRawData.) ¹ Note that QString uses the Small QVariant Optimization, so the QString object itself into the QVariant is copied, it's not just a *QVariant* refcount increase. Change-Id: Idcdb192809f1f8f79b4a901e1247f933eb06e854 Fixes: QTBUG-94070 Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 0f38259cb3aee5cce5a2af99af3f69712c9f1123) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: don't show invisible separator itemsVolker Hilsheimer2021-05-272-3/+8
| | | | | | | | | | | | | Give QCocoaMenu access to the item's visibility property by adding a public getter, and respect that state when syncing the separator to the corresponding QCocoaNSMenuItems. Fixes: QTBUG-88651 Change-Id: I7e238e5d3be141ec8f4e8f6f3ab22d761094d2d2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit a3f3af8a8fb8f8b09d1685df5ab836244f850a62) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: respect underline attribute in menu item fontsVolker Hilsheimer2021-05-271-2/+4
| | | | | | | | | | | | When we draw menu item text with CoreText instead of QPainter, then we need to translate QFont::underline() explicitly to an entry in the attribute dictionary. Task-number: QTBUG-73990 Change-Id: I7e0c258f7cf80a89b29517fa8122576342654de1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 5ac479f5990a4c2b09ea34fb98d10c17d405aa5e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Qt xcb: remove false detects of Qt::GroupSwitchModifierAleksei Nikiforov2021-05-271-3/+3
| | | | | | | | | | | | | | | | | | In some cases, if X11 is configured with CapsLock as keyboard language switch key, and CapsLock is toggled via Shift+CapsLock key combination, toggled CapsLock is falsely detected as Qt::GroupSwitchModifier for subsequent key events. This change fixes this false detect, but doesn't fix detection of Qt::GroupSwitchModifier which is likely still broken. Fixes: QTBUG-49771 Change-Id: I485e2d4f3c654707c62adaba367c1b8afb3fc36c Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 25a7034d78aeb12726a1052d64c0aa3314a1f69d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Silence warning C4996 (use of deprecated GetDesktopDpi)Kai Köhne2021-05-272-0/+6
| | | | | | | | | | | | | | | Silences warnings warning C4996: 'ID2D1Factory::GetDesktopDpi': Deprecated. Use DisplayInformation::LogicalDpi for Windows Store Apps or GetDpiForWindow for desktop apps. Using GetDpiForWindow sounds like the right approach, but it's not obvious where to get the window handle from here. Task-number: QTBUG-94043 Change-Id: I2fc005e0c970c8338184f4500b876774ec9d976b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit fd9c2c803363d2036ba497946c2eee58b4c4fe18) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Restore logic to set wantsBestResolutionOpenGLSurfaceTor Arne Vestbø2021-05-201-0/+8
| | | | | | | | | | | | | | | | | The logic was removed in 1fc7ca091b3fdda52381a383318a3a752ec21132 when we removed support for surface-backed views, based on the documentation for wantsBestResolutionOpenGLSurface noting that layer-backed views ignore the property. But in some cases, when plugin views are embedded into host views, and the host was built with a pre-10.14 SDK, AppKit seems to get confused, and we still need to set this property. Fixes: QTBUG-93770 Change-Id: Id67f2fcb8c090c0e01c05d00792eaef311146df1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 40878e75176880e95398604d9e63be2138cc642b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Fix warning about comparing different types in QCocoaScreen::isOnlineTor Arne Vestbø2021-05-201-2/+2
| | | | | | | Change-Id: Ieb70108d22bf254c69665e5b3e3a2988703e26a2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 640eb55c130c6c2c982dc212a8a5bd2b8fb7a225) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QXcb: don't dereference pointer before checkingVolker Hilsheimer2021-05-201-1/+2
| | | | | | | | | | | | | | | The virtualDesktop pointer is expected to be populated by queryPointer, but that method handles the case that there either is no reply, or that the reply doesn't match, in which case the pointer remains nullptr. Don't dereference it afterwards without checking. Addresses code checker warning a179d1087759bb6ca9c3380257bd70d6 Change-Id: I5877f26fd3b49327c0de3f2c918bb606bee8ac57 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit c2258e85a32b66cf7cbc59a4789e68c31c9955be) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix BASE argument of qt_add_resourcesJoerg Bornemann2021-05-181-87/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BASE argument of qt_add_resources now denotes the root point of the alias of the file. Before, BASE was merely prepended to every file that got passed to qt_add_resources. Old behavior: qt_add_resources(app "images" PREFIX "/" BASE "../shared" FILES "images/button.png") Alias is "../shared/images/button.png", and pro2cmake generated QT_RESOURCE_ALIAS assignments to fix this. New behavior: qt_add_resources(app "images" PREFIX "/" BASE "../shared" FILES "../shared/images/button.png") The alias is "images/button.png". No extra QT_RESOURCE_ALIAS assignment is needed. The new behavior is in effect for user projects and for Qt repositories that define QT_USE_FIXED_QT_ADD_RESOURCE_BASE. Qt repositories will be ported one by one to this new behavior. Then the old code path can be removed. Task-number: QTBUG-86726 Change-Id: Ib895edd4df8e97b54badadd9a1c34408beff131f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 92185d417de43237ae62eae55599c65922cd9a15) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: Accessibility: Set the correct traits for EditableTextAndy Shaw2021-05-141-1/+9
| | | | | | | | | | | | | Since the correct accessibility traits for EditableText are not available as a direct enum value, then we depend on the defaults for a UITextField to give us this information. Done-with: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Fixes: QTBUG-93494 Change-Id: If428414aec5ce571f0f8c0ecccffdbaf1c908120 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 08cd5580df382af5ddfe1c0c44bc9dd68e4cd1e7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows QPA/Vista style: Fix placeholder colorFriedemann Kleint2021-05-111-1/+10
| | | | | | | | | | | Bring back the code that was removed by 62c3dd5632b04a7ee2410cc2233c0d0605ad5bd6 to the Windows theme. Fixes: QTBUG-93635 Change-Id: I066e89d482a584c1719f6bfb6160710ee73e1b81 Reviewed-by: André de la Rocha <andre.rocha@qt.io> (cherry picked from commit 26638dfe3be009e886d5fc0b2ffa1879efee56b5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix passing QJniEnvironment to ANativeWindow_fromSurfaceMarius Kittler2021-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | The function ANativeWindow_fromSurface (as declared by `$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/android/native_window_jni.h` from version r22.b of the Android NDK) takes a `JNIEnv*` so `.jniEnv()` must be used. This prevents the following compilation error: ``` error: no matching function for call to 'ANativeWindow_f romSurface' m_nativeWindow = ANativeWindow_fromSurface(env, m_androidSurfaceObject.object()); ^~~~~~~~~~~~~~~~~~~~~~~~~ /opt/android-ndk/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include/android/native_window_jni.h:45:16: note: candidate function not viable: no known conversion from 'QJniEnvironment' t o 'JNIEnv *' (aka '_JNIEnv *') for 1st argument ANativeWindow* ANativeWindow_fromSurface(JNIEnv* env, jobject surface); ^ 1 error generated. ``` Change-Id: I70d75cb7edc5875314fcb8a70d51d0ef40442101 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 590f70a849d85c438385c313fb452f528fd304a4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: Accessibility: Don't cut off the last character from the text valueAndy Shaw2021-05-091-2/+1
| | | | | | | | | | | | The second parameter is the position of the first character not to be returned when calling text(). So it needs to be passed the length of the text, otherwise the last character is cut off. Task-number: QTBUG-93494 Change-Id: I7dd8324b3939220de125ba819b7b77588b21bd4b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 5c29f981fa069907678f961cf58ecefd64bf268b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Simplify bundled libjpeg buildEirik Aavitsland2021-05-061-1/+0
| | | | | | | | | | | | | Move the config headers of the bundled libjpeg back into its source directory, where they originally live, to avoid having to trick with the include path to find them. The goal is unification across maintained Qt branches, making version updates simpler. Change-Id: I5b574446bbd264b0a1cb3efceb4c1cb7203cac7d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 5df88b85c6e61409c5c759e78f32edaac7b2022f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* cocoa: move DEBUG_PASTEBOARD into logging categoryLiang Qi2021-05-053-62/+21
| | | | | | | Change-Id: I8f49c030588122adff3c0eab4189bfa7e6aeff09 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 9f8d5bceb47eafa79fdd9c2a5186e6a86be7fecb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: Implement QIOSScreen::logicalBaseDpi()Morten Sørvig2021-05-032-2/+2
| | | | | | | | | | | | | | | | logicalDpi() and logicalBaseDpi() should return the same DPI on iOS, in order to make Qt not apply a scale factor. Accomplish this by overriding logicalBaseDpi() instead of logicalDpi(). The default QPlatformScreen::logicalDpi() implementation will then call logicalBaseDpi(). Fixes: QTBUG-92579 Change-Id: I7a27cf61f0154cef32098069ab3dfb29ad6acf27 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit e3e070e87b3a8036f7200755ba32b57437304ee6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: Fix Application becomes unresponsive issuePekka Gehör2021-05-033-0/+11
| | | | | | | | | | Block key events until the plugin is running. Fixes: QTBUG-67944 Change-Id: Iea47f2e94d850141834a7e8fc26218be2cacf660 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 2262a9cd2d135d5ea2ade42460496c88d8b2c292) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QVnc: clip requested screen region to available screen imageEirik Aavitsland2021-04-301-2/+3
| | | | | | | | | | | Avoid potential oob memory access. Fixes: QTBUG-91770 Change-Id: I34fff1cf8dec5275572a027288b0e8310359d9f8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit c494c1e8754ed13b409133196d9db00bf7e0f2b5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Don't override action set during drop handlingAndy Shaw2021-04-291-1/+3
| | | | | | | | | | | | | | | | | When the drop has been handled, the target might have accepted a specific action by calling QDropEvent::setDropAction. Don't override that with the operation received by the OS if the drag'n'drop operation takes place within the same application. If the operation comes from outside, we have no choice but to trust the OS. This way the drag-site will get the action accepted by the drop-site when QDrag::drag returns. Fixes: QTBUG-77427 Change-Id: I0e4c86adeeea66b345966a03a3251fa62263b3e8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit a014300898bd3bd574ef19bba7123d4b5a07789b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Skip adding externally added plugins to the plugin meta-setsAlexey Edelev2021-04-271-3/+0
| | | | | | | | | Plugin meta-sets are not visible outside of the module build tree, so there is no point in adding dependencies for externally added plugins. Change-Id: Ica5b29b57c032f4fc9b128172aaa806392e9e581 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit bbe26a766748c00da5e2241a9c7ec5e714dd76ad)
* xcb: Add more debug info for XCB_INPUT eventLiang Qi2021-04-261-1/+44
| | | | | | | Change-Id: I99bba80659a103aa79426ae94cd04db2c5d851d6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 6a91ad7b5b429a9e277a4eedd7161b052b3acf68) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* SQLite: Handle tables and fields with a dot in the name correctlyAndy Shaw2021-04-231-9/+24
| | | | | | | | Fixes: QTBUG-91885 Change-Id: Iba76bb50266dd4fb5f50e4ea1549d1d2bb6e3431 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 66acee69a1563488e5950645c171d6be73dd5f70) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix build of QJpegPlugin in static Windows build with PCHAlexandru Croitor2021-04-211-0/+7
| | | | | | | | | | | | | | | | | | | | Fails with C:\Dev\qt\src\qtbase\src\3rdparty\libjpeg\src\jmorecfg.h(242): error C2371: 'boolean': redefinition; different basic types C:\Program Files (x86)\Windows Kits\10\include\10.0.18362.0\shared\rpcndr.h(193): note: see declaration of 'boolean' Don't use the precompiled header for the plugin source file. Amends f641a0dbcfd52e78e068357d9c66236798e043e8 Task-number: QTBUG-88093 Change-Id: I6a57f791139d866622f7406fec45c11be6b86418 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 2e2ef31d412befceb34f901d6ad2ce78a43c67a2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Read DPI from X Settings initially as wellIlya Fedin2021-04-202-7/+18
| | | | | | | | | | | | | | | | | | | | | | | Currently, Xft.dpi from X Resources is read initially, while changes are monitored for Xft/DPI from X Settings. These protocols are different and can have different values. E.g. MATE sets X Resources' Xft.dpi to 96.30859375, while X Settings' Xft/DPI is set to 197240 at 2x scale. This results in a very weird bug when Qt can't determine 2x scale initially, but if scale is changed at run time, Qt changes scale to the right value. The difference could be checked via xrdb -query and dump_xsettings (the second is from xsettingsd project). [ChangeLog] Qt now reads Xft/DPI from X settings at startup, and will prefer this value over Xft.dpi from X resources. Change-Id: If6adac0c88198579332ddebc673f1524f324c0e4 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 6560778616b090f8cc73700675ec2ef385953fb6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Replace conversion operator by operator* in QJniEnvironmentAssam Boudjelthia2021-04-153-5/+5
| | | | | | | | | | | | Since conversion operators do implicit conversion that might bring some potential issues while using the API, let's stick to having an operator* instead. Change-Id: Ie7ad5537958944b8d1c11d69fbd30284b4b0344d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 13592385723a9b81b3715b5344bdd04e6a393a12) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add QNX qpa to buildsMarianne Yrjänä2021-04-134-4/+189
| | | | | | | | | Task-number: QTBUG-91234 Change-Id: I978aff101ce29d2df74ced801911426ccd56e997 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: James McDonnell <jmcdonnell@blackberry.com> (cherry picked from commit 9c6721c106cfb593841e99b9670a3ba936254206) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't disable menu items that belong to the active modal windowVolker Hilsheimer2021-04-123-5/+18
| | | | | | | | | | | | | | | | | | | A popup/context menu created via QQuickPlatformMenu doesn't belong to any menubar, so by disabling items in a menu that doesn't belong to the currently active menubar (5b9f6862b1), we disabled all menu items in a QQuickPlatformMenu when a modal window was active. For such unrooted menus, use the QCocoaMenuObject data structure to record which window it is shown for, and only disable items if that window is not also the current modal window. Amends 5b9f6862b1aa474a392203c69f6db678d633cecf. Fixes: QTBUG-92040 Change-Id: I56b6d579e5e94689b43ca84d4637e35dc2cbeb4c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 2bdaf28034541cd57b0aa7c067fda8cfbffa0e94) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* [Android] Fix select handles misplacement on QDialogv6.1.0-beta3Pekka Gehör2021-04-011-6/+19
| | | | | | | | | | Get select handles {Left, Right}Point from a mapToGlobal with a cursorRectangle of anchorRectangle of the selected word/text Change-Id: I3425104c90f0efe6a1e4337328cf06dc93685b6f Task-number: QTBUG-90799 Pick-to: 5.15 6.0 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Windows QPA: Fix accessibility focus event for table/tree/listAndre de la Rocha2021-03-301-0/+11
| | | | | | | | | | | | | The focused element within a table, tree or list was not being informed in the UI Automation focus change events, causing the focused element to be missed by screen readers. Fixes: QTBUG-91029 Change-Id: I738502e6871358508b4510763018837c304b618e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit f1eccab04e01b3acc1a4b4c6a5fe7b3af3e2dcba) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Return the result we have already when getting an object with no nameAndy Shaw2021-03-301-1/+1
| | | | | | | | | | | This will ensure that something is set for the AutomationId based on the actual object and the parents that do have object names until it reaches one without an object name. Change-Id: I205485bc0ba772e321879e00e64ea8e1d8f1ba91 Reviewed-by: André de la Rocha <andre.rocha@qt.io> (cherry picked from commit 5577cbaac59e7fc198ea2c98c1e4268779fbf0b4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Include minus sign in ImhFormattedNumbersOnly's available keysEdward Welbourne2021-03-301-3/+1
| | | | | | | | | | | | | | | UIKeyboardTypeDecimalPad only provides digits and decimal point, no minus sign, but ImhFormattedNumbersOnly is documented to provide a minus sign as well. UIKeyboardTypeNumbersAndPunctuation includes punctuation, which should cover signs as well as decimal separator, so use that - same as for ImhPreferNumbers. A little more permissive than we want here, but that's better than more restrictive ! Fixes: QTBUG-91455 Change-Id: I0418946014e0a66d503e61704154fd7798a0b785 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 17bf553b76ebd688e58e4de4271407e2058d89ef) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Redundant condition: widgetHuang Jie2021-03-301-1/+1
| | | | | | | | | | Redundant condition: widget. '!widget || (widget && widget->isEnabled())' is equivalent to '!widget || widget->isEnabled()' Change-Id: Ife915bd5ea66f8ccff48a1612f8c78c263075c89 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit d3ec08eea060a9451f06c394bb85a6357504c61e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Rename QJniEnvironment exceptionCheckAndClear to checkAndClearExceptionsAssam Boudjelthia2021-03-301-2/+2
| | | | | | | | | | Address feedback from header view. Task-number: QTBUG-90211 Change-Id: Iad2b609598b16f66fd6ab09484fe6e6899981263 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit b9f27335e7462a15ac642841bb6d86ebebb349f9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: Protect against a possible crash after the window is deletedAndy Shaw2021-03-302-1/+3
| | | | | | | | | | | | | | | | | | If we are in a case where the original window is deleted before a new one is shown then we need to make sure that we are not still expecting that the original one has the focus. So we protect against the crash by only outputting the address of the object that previously had focus. A follow-up patch will be done for inclusion from 6.2 that will fix the root cause of the pointer being invalid when the only window is deleted before a new one is shown. Fixes: QTBUG-92173 Change-Id: Ifdb3fd6b6cb8fb8e8b79d2c325a30c27b298d8a9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit b050d4867f68c3d35493221d65d343749504c988) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix compilation with experimental x11 paint engine featureEskil Abrahamsen Blomfeldt2021-03-261-5/+7
| | | | | | | | | | | | | | | | | Adding support for vertical subpixel positions in d79a9b1a4f694a227ce62ccab9b44685a9755916 changed some private APIs which were used from the xcb-native-painting feature. This fixes this (it does not implement vertical subpixels but simply sets the vertical subpixel position to 0). It also adds a missing "override" which triggered the warnings-are-errors when compiling for me. Fixes: QTBUG-92011 Change-Id: If214a0d19a41e623ca9ef8e6215bc145f9846ae9 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 70251867a50f9f606a7ceaf2338375a67e413b83) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: use QXcbScrollingDevice for a touchpadShawn Rutledge2021-03-242-10/+26
| | | | | | | | | | | | | | When using XQuartz on macOS, the virtual pointer device is detected as a touchpad, not a mouse; but QXcbConnection::xi2HandleScrollEvent() expects the device to be an instance of QXcbScrollingDevice for storage of some state. A touchpad that has the scrolling capability must be that type, not a plain QPointingDevice. Fixes: QTBUG-91402 Change-Id: I1b82766d4a3f87f656e56c0d8904def26fb0979a Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit f85e70c569f4aa979004889d20de8acec9a790bf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Don't draw scrollbar handle when there is no rangeAndy Shaw2021-03-201-1/+1
| | | | | | | | | | If the minimum and maximum is set to be the same then we should not draw the handle. An empty groove should be shown instead. Change-Id: Ie79f55cd761f9a8f614967c40c23a7f59e700a0f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit aac33296e618e617ab9e05b3c71682a13f2d5dfc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* FileChooser portal: send window id in hexJan Grulich2021-03-081-1/+1
| | | | | | | | | | We send window id in decimal, however, it is expected to be send in hex. This causes a mismatch and makes portal dialog to show in background. Change-Id: Ibd77199bbb4a2ad4782a0457ddc5506c6b5608fe Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit acaabc9108dfe75530960cf8e3ec4f3602cd82e0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: make calling exit() conditional on an environment variableVille Voutilainen2021-03-051-2/+3
| | | | | | | | | Task-number: QTBUG-82617 Task-number: QTBUG-85449 Task-number: QTBUG-83043 Change-Id: I5ac67b5d57550e5a1f816e5db01f4aab31127283 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 6e0ce4ee8005d36ee5d080212b8d83b42ebcae17)
* Disable NetworkManager plugin for -no-dbusKai Koehne2021-02-241-1/+1
| | | | | | | | | | | | The plugin depends on Qt::DBus, so do not try to configure it if Qt::DBus is not available. Fixes: QTBUG-91155 Change-Id: I70ddca63a277cd57a253092f97160f89ebc76f06 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit ea1c35d5578e978b743350bc6ab7c61c50152ca6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* cmake: Don't give plugins PUBLIC usage requirementsCraig Scott2021-02-2441-76/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The pro2cmake.py conversion script faithfully reproduced the .pro files for the plugins, which specified the libraries as public. But in CMake, the implications of this are that public usage requirements should then be propagated to consumers. We don't expect any consumers, since a plugin is created as a MODULE library in CMake, so for Windows we don't even have an import library to link with. The only exception to this is for static builds where plugins are created as STATIC libraries instead, but only in certain controlled situations do we then link to plugins. Even then, usage requirements are not expected to propagate to the consumers, so these relationships should always be specified as private. This change warns on any PUBLIC usage requirements specified for a plugin. This check is disabled by default to avoid spamming CI builds for repos that haven't been fixed yet. The check can be enabled by a CMake cache option, which is intended for developers to use locally when fixing this issue in other repos (all plugins in qtbase should not trigger this warning as a result of changes in this commit). Task-number: QTBUG-90819 Change-Id: I09f2c8da77db1193ad3370f85d367dfc6ab7b9a6 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit fe29159aad0e03ca5eebabf910c90f279b222d03) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix handling of virtual/native pixels in QAndroidPlatformWindowAndreas Buhr2021-02-231-7/+14
| | | | | | | | | | | | | f92e1953699b2529cc6ea2fd399fe4f2b887e83c made sure a new QAndroidPlatformWindow always has a geometry. However, it did not take into account HiDPI handling. This patch fixes it and introduces proper HiDPI handling. Fixes: QTBUG-91161 Change-Id: Iddf31b7abfd0a1bada3b051ed4de3bf6c2897d8e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit dec429e0778493bc4e85d6b18202804d0bbbe5f1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: Pass the text to handleExtendedKeyEvent when knownAndy Shaw2021-02-231-4/+7
| | | | | | | | | | This will ensure that the QKeyEvent also has this information passed on as appropriate. Change-Id: I52436404115b453664b9b3414f8ec4e715dd6a28 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 5540c9c10754963375cd34f740e64b068c440a3e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>