summaryrefslogtreecommitdiffstats
path: root/src/plugins
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* macOS: don't let windows that are transparent for input become key windowVolker Hilsheimer2021-02-202-2/+3
| | | | | | | | | | | | | Such windows are typically used as mostly transparent overlays on top of other windows underneath. Letting such an overlay become the key window breaks cursor updates and focus handling. Fixes: QTBUG-83632 Change-Id: I192d419a5bdb8dfa0e9223e9fbbd7876c62fe743 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 24b07b2b2d367c61b911c8f3a72f7209ef7e00d2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Unbreak binary compatibility in QStyleOptionHeaderVolker Hilsheimer2021-02-191-2/+4
| | | | | | | | | | | | | | | | | | 4d943846128118e1b9932a17ce6f977a0f4127a5 introduced a new data member to QStyleOptionHeader, and reduced the size of the orientation member. This changed the binary layout of class instances, and breaks ABI. 180c662b0790c6eceffdcb4661681d7df1541a2d added another member within the new bitfield. Introduce a new QStyleOptionHeaderV2 class instead with the new members, and use that in QHeaderView, and the styles using the new members. Fixes: QTBUG-91224 Change-Id: I47e6841e6652e4b67f247b7b4514e90be5609156 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit 4c6579eacded086ad014b0fd2432095362c1d131) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: unset old states and set new ones for windowLiang Qi2021-02-151-16/+33
| | | | | | | | | | This partly reverts a02959bb5b43a3f9d881e5213ceedf535202b6a1. Fixes: QTBUG-87078 Change-Id: I69e18ad3c0a8d142b2e1f5ab87990addc97d9df1 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit f61b140482d9578c07410a5979379e44e05352e5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNetworkInformation fixupsMårten Nordheim2021-02-125-0/+8
| | | | | | | | | | | | | Addressing feedback that came after the reviews ended from both bot and people. Added CLASS_NAME to the CMakeLists files for the plugins so that cmake can generate the correct import. Fixes: QTBUG-91061 Change-Id: Ib3f1e863100c1c421a6c0a4081b1d40696d67b23 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 92b15beb9aa09467583230a018c23114bb666a8e)
* Android: take JavaVM() from QJniEnvironment and not QtAndroidPrivateAssam Boudjelthia2021-02-111-2/+2
| | | | | | | | Task-number: QTBUG-89482 Change-Id: Idfd442afc90c00e672b28b43c78c789813f46c7d Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit 3348107c038cbac724e33d6bb30671ddddc1505a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: Disable three-finger-tap editing interaction menu when there's no focus ↵Tor Arne Vestbø2021-02-111-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | object A typical Qt application, such as a QML application, is a single full screen QUIView, containing all of the granular controls of the UI. The view accepts first responder status, so that we can pass on text input to a possible text field inside the UI. That however triggers iOS to bring up the editing interaction menu whenever the user taps with three fingers, as iOS can't know that only parts of our view is suitable for interaction. To mitigate that we override the editingInteractionConfiguration getter of the view, as documented, and dynamically report the correct enablement based on whether we have an active focus object that accepts input. This works because iOS queries the getter from the three finger tap gesture recognizer, before showing the menu. Change-Id: I0874340c42e437e1d7251896993f2eafe122f09e Fixes: QTBUG-89735 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit f0f00dbd119e0169bc81aa761e4d548e4ecf2214) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: don't report selection changed if it didn't changeRichard Moe Gustavsen2021-02-111-1/+5
| | | | | | | | | | | | | | | | | | | Be more careful about reporting a new selection to Qt. The code for handling IM selection events in QQuickTextArea is quite complex and need to take pre-edit text into account. The latter means that when the pre-edit text changes, as a result of the user composing a word, the width of the pre-edit text will also change (and as such, the cursor rectangle). But the cursor position itself stays the same. And for this reason, it emits cursorRectChanged more often than strictly needed. But rather than trying to clean that up, we do some extra checking before we send the IM event from QPA in the first place. Fixes: QTBUG-63018 Change-Id: I689d989c3fe5d61ef2b1dbee7a70418b7790bce9 Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit be06164201d7d9ccdbaaff343af2e8f3662c044d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix compilation of the QPSQLDriverPlugin plugin with enabled PCHAlexey Edelev2021-02-101-0/+11
| | | | | | | | | | | | | | | | PostgreSQL package delivers several header files such as pthread, zlib, zconf, uuid, etc. within Windows installation package. The headers are exposed to the compiler by PostgreSQL include paths and have different versions. When compiling PCH of the QPSQLDriverPlugin plugin, MinGW uses the pthread.h header from the PostgreSQL include paths, that cause an error related to pthread implementation mismatch. Disable PCH for the QPSQLDriverPlugin plugin, when using MinGW. Fixes: QTBUG-90850 Change-Id: I0be91bbefe37731acb2658d679b5b644ef552b23 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 43cb801ccb10e2d9efd230803822761b794fd4fb)
* eglfs: kms: Log gbm bo handle and stride as wellLaszlo Agocs2021-02-081-1/+2
| | | | | | | Change-Id: Ie345a3f4a4ab0407e3c532c6385ae31ca698d628 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 3bda970935d4d54c07fa1d6454e2472abff66a77) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix compiler warnings for QFontMetrics useAssam Boudjelthia2021-02-081-1/+1
| | | | | | | Change-Id: I4c416280cef8c316258817184e94962c250370da Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit d6b9200e329281269ad8c74177f2b2621798ae56) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: close edit menu upon focus transferRichard Moe Gustavsen2021-02-051-0/+3
| | | | | | | | | | | | | | | | | If you select text, the edit menu will show. But if you tap directly inside another input field, and as such, transfer focus, the menu will continue to stay visible. This patch will ensure that we hide the edit menu when the input field that it was requested for looses focus. Fixes: QTBUG-90937 Change-Id: I1d97bd57fc793826a3170404795b06a1e058d1b7 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 0bae5fbabbb64371b1b6c646ce0a32e084e42f83) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* a11y: Report mixed state if QCheckBox is PartiallyCheckedJan Arve Sæther2021-02-051-0/+2
| | | | | | | | | | | Previously it only returned checked or unchecked for a tri-state checkbox. Fixes: QTBUG-84616 Change-Id: Ife72098e35f8295fd389bda232de5478ffa7e87f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f4887aca1e5ac7b90abf862d7c9828417a74a1b6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QNetworkInformation backend for AndroidMårten Nordheim2021-02-056-0/+520
| | | | | | | | | | | | | | Based on the old bearer manager code! A lot of the old code went away though since it had been deprecated in the time since it was written. Pick-to: dev Task-number: QTBUG-86966 Change-Id: I21a6db1d4ebd8367084355a8e3202f4c05d9dce5 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* SCNetworkReachability based backend for QNetworkInformationMårten Nordheim2021-02-053-0/+159
| | | | | | | | | | | For macOS/iOS. Based on the code Timur wrote for QNetworkStatusMonitor, and uses QNetworkConnectionMonitor. It has less detail than the other backends which is unfortunate but should be fine! Pick-to: dev Task-number: QTBUG-86966 Change-Id: I0d5930d539f9668f001d6f85c86c9df0803d0f60 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* NetworkManager based backend for QNetworkInformationMårten Nordheim2021-02-055-0/+435
| | | | | | | | | | | | For Linux. Based on the code from the old bearer plugin for NetworkManager with changes to fit better the objective of QNetworkInformation. Pick-to: dev Task-number: QTBUG-86966 Change-Id: I90c3488ff31ef6dfdcfb877c0e9c592c6c328a89 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* iOS: hide edit menu if typing on the input panelRichard Moe Gustavsen2021-02-041-4/+8
| | | | | | | | | | | | | | | | | On iOS, if you select some text, the edit menu will show on top of it. And if you tap on the screen (or inside the menu) it will hide. But if you type on the input panel, it will stay open. This is wrong. This patch will keep better track of whether or not the edit menu was opened by us, and if it was, ensure we close it also if the cursor moves by typing on the input panel. Fixes: QTBUG-90860 Change-Id: I0a51382030560182e7925c8b694b42e50943514e Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit b39081230428a9cc08389342c4610d11b2ee210d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: fix compiler warnings for Android inputAssam Boudjelthia2021-02-044-48/+61
| | | | | | | | | | | QPointingDevice requires using the constructor to set its settings in Qt 6. Replace + with | operator and return QKeyCombination instead of int. Change-Id: Id3da469cc13b34ec7b55afa751dbc04601880df6 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 4493b90224f575e5570afeb1ec181be5c4e74b09)
* macOS: Reduce duplicated code for showing file dialogsTor Arne Vestbø2021-02-022-75/+37
| | | | | | | | | | The initialization was duplicated across the different modes. We now do the setup once, in a shared showPanel:withParent function. This also simplifies and removes the need to store the return code. Change-Id: I3c4da48cfef92bcc59c76cffa15b40150de1a9e1 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Reduce duplicated updates of file dialog propertiesTor Arne Vestbø2021-02-021-13/+6
| | | | | Change-Id: I2017bfdfa6d5598405d700680ecaaf04fd6023fd Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Refactor computing of accepted extensions in file dialogsTor Arne Vestbø2021-02-021-21/+20
| | | | | Change-Id: Ie71db5a0ab66dd9d157b53297cbb9aba248fa8af Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Use single variable to track file dialog in QCocoaFileDialogHelperTor Arne Vestbø2021-02-021-64/+74
| | | | | | | | | | | | | | Relying on Objective-C's no-op behavior when sending messages to nil was nifty, but a bit confusing when trying to track the ownership model of the class. It's now explicit at the call sites what's going on (a cast). The canSelectHiddenExtension property is valid both save and open panels, but AppKit will only show it for save panels. Change-Id: I8e12d629639e2179d155b2ecda1bb2dab2a5757d Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* NetworkListManager based backend for QNetworkInformationMårten Nordheim2021-02-024-0/+384
| | | | | | | | | | For Windows. Based on the code I wrote for QNetworkStatusMonitor. It also renames the netlistmgr feature, avoiding the abbreviation. Locally my MinGW fails the networklistmanager feature test so it may not be supported on MinGW, likely leaving it without a backend at all. Change-Id: I13bbe4127edc2a9c0bb91602c95f1cb206a85a69 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Make setSelectionOnFocusObject() take native pixelsMorten Sørvig2021-02-021-6/+1
| | | | | | | | | | | | Change the setSelectionOnFocusObject() to take geometry arguments in native pixels, in order to be consistent with other QPlatformInputContext API. Calling code which pass non-native geometry must be updated (in practice only the Android platform plugin). Change-Id: I1c61b8cf583afe607567d6056ca7ff23cc3de3f3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* iOS: Use new QPlatformInputContext geometry APIMorten Sørvig2021-02-013-25/+22
| | | | | | | | This enables support for QT_SCALE_FACTOR on iOS. Fixes: QTBUG-74978 Change-Id: Ibcf0741c178e44802065e472e096a5f4c7d6f3cf Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Windows: Fix frame margins calculationMorten Johan Sørvig2021-02-011-3/+2
| | | | | | | | | | | | | | | Passing nullptr to QHighDpi::toNativePixels() is seldom correct, and will work only on the main screen. Instead, call frameMargins() on the platform window (instead of on the QWindow) and get the margins directly in native pixels. Pick-to: 5.15 Fixes: QTBUG-90716 Change-Id: Id7b31ec3246010c367781b64ed832c589bbaeb0d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add geometry accessors to QPlatformInputContextMorten Johan Sørvig2021-02-011-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Currently the platform plugins use the public QInputMethod API when querying geometry. However, QInputMethod returns geometry in device independent pixels, while the platform plugins require geometry in native pixels. Add new API to QPlatformInputContext which returns input geometry in the native window coordinate system: QRectF inputItemRectangle() QRectF inputItemClipRectangle() QRectF cursorRectangle() QRectF anchorRectangle() QRectF keyboardRectangle() These make the relevant QHighDpi calls internally, and such calls can then be moved out of the platform plugins. Disambiguate inputItemRectangle() in qandroidinputcontext.cpp by renaming it to screenInputItemRectangle(). Change-Id: I561745b64fb197d64e3dfddcf0751528bb8d0605 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* iOS: always hide edit menu when showing the magnifier glassRichard Moe Gustavsen2021-02-011-6/+1
| | | | | | | | | | | | | | | | | | | Bug: If you do a press and hold on a line edit, the edit menu will show to let you select a word etc. If you now do another press and hold to bring back the magnifier glass, the edit menu will stay open while you move the magnifier glass. This patch will ensure that we always hide the edit menu when we show the magnifier. There is never a case where both of them should show at the same time. By hiding the menu from the place where we show the magnifier means that we can remove code from the QIOSSelectionRecognizer that used to do this for one of the cases from before. Pick-to: 6.0 5.15 Fixes: QTBUG-90743 Change-Id: If2a92f94422c730c2b223129d96f5bc3bf3deeee Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Fix compilation of ibase sqldriver plugin, added overrideAndreas Buhr2021-02-011-1/+1
| | | | | | | | With gcc 10.2, I cannot compile qtbase without this patch. Pick-to: 6.0 5.15 Change-Id: I5be48947e2301d5befeec397291c0da597f7eb63 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Cocoa: When validating menus, account for modal window only if activeAndy Shaw2021-01-291-4/+3
| | | | | | | | | | | | When a modal window is WindowModal then it is possible for another top level window to be active and therefore the menus shown may be valid for the window. So we can still allow the menu items to be validated in the context of that window. Fixes: QTBUG-74088 Pick-to: 6.0 5.15 Change-Id: Ifb9c3fe12654b2972e0e3c368dc093fae1ed4cc8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Make QJniObject and QJniEnvironment public APIAssam Boudjelthia2021-01-2723-280/+303
| | | | | | | | | | | | | | | | | | | | As part of Qt 6 restructring for the extras modules, this change exposes the Jni APIs which are very important for Android platform. This patch adds the APIs QJniObject, QJniEnvironment, QJniExceptionCleaner based from private QtCore and QtAndroidExtras. The Jni interface is cross-platform which justifies the name, but currently, this API is used mainly for Android, and the naming comes generic without Android keyword to avoid any future limitation on supporting other platforms. [ChangeLog][QtCore] Add new QJniObject, QJniEnvironment and QJniExceptionCleaner APIs. Task-number: QTBUG-89482 Fixes: QTBUG-89633 Change-Id: I4382dd53a225375759b9d042f6035a4a9810572b Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Add qHypot() to qmath.h, exposing and extending std::hypot()Edward Welbourne2021-01-271-3/+3
| | | | | | | | | | | | | | | | | | | | We have plenty of places where we add some squares and take a square root; this may be done more accurately and faster by hypot(). Introduce QHypotHelper to handle hypot with more than 3 parameters, and with 3 when the C++17 version is missing (which it never should be). Include an overload taking arbitrarily many valus and ensure that we can use qHypot() with qfloat16. Illustrate with some example uses, add some tests. [ChangeLog][QtCore][QMath] Header <QMath> now provides qHypot(), an implementation of std::hypot() taking arbitrarily many numeric values, including support for qfloat16, while avoiding the overflow and underflow problems that arise when naively taking the square root of a sum of squares. Change-Id: Ia4e3913fe83fc27d17d8e7f1a52f03ad445c1fed Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* ibase: Fix the compilation and include it again so it can be detectedAndy Shaw2021-01-264-19/+36
| | | | | Change-Id: I38721155f090173862da8beab8cb04b2e015dcff Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Add upstream version of FindPostgreSQL.cmakeAlexey Edelev2021-01-261-3/+0
| | | | | | | | | | | | Add CMake upstream(3.20.0) version of FindPostgreSQL.cmake, to avoid server-related headers lookup. Avoid using the Qt version of the PostgreSQL module, if it's older than the CMake's one. Fixes: QTBUG-89639 Change-Id: I71a0c3508000901969933aea8a08d1ad431db711 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Android: Fix deprecated QVariant usageAndy Nichols2021-01-261-1/+1
| | | | | Change-Id: Ib14bbba726d1da352933ed418931d69443720946 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Clean up QCocoaFileDialogHelperTor Arne Vestbø2021-01-262-338/+262
| | | | | | | | | | | | | | | | | | | - Remove indirections via helper functions that did nothing but redirect. - Remove unneeded checks of !m_helper in delegate. The helper is always valid for a delegate. - Use m_ prefix for member variables, as in the rest of Qt. - Implement init: as per modern Objective-C recommendations. - Remove respondsToSelector checks that were not needed. - Use modern Objective-C property syntax. - Fix code style issues/formatting. - Remove unused functions. - Reorder and remove unused includes. - Class-initialize member variables. Change-Id: Iedc084b67bb496b2ef13001a0e6aa46d4574eb57 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>