summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Hold references to zone IDs alive during useEdward Welbourne2021-01-211-2/+8
| | | | | | | | | | | | | Restore holding of a getID() call's return in a QJNIObjectPrivate eliminated in commit 78cde1bfd94521bbe4972f31a79c959d0990ea77; this keeps the Java internal object alive for its lifetime, where it might otherwise be garbage-collected before we're done with it. Fixes: QTBUG-88610 Change-Id: Id65b059012f7bd3377a6562c1b647feb75a13679 Reviewed-by: BogDan Vatra <bogdan@kdab.com> (cherry picked from commit d5eda37baaea20b2411b6ef1ca0d41a2a71a06a6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* SQLite: Update to 3.34.0Andy Shaw2021-01-213-730/+2030
| | | | | | | | | | [ChangeLog][QtSQL][SQLite] Updated to 3.34.0 Fixes: QTBUG-90226 Change-Id: I2a489bec1fee2bdee7ea474094ca3db308699753 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 722a7dda56a5ac6d43c686c4fbf7b105b5544d88) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Hardcode a special case of using qOverload for slots without argumentsJarek Kobus2021-01-211-8/+19
| | | | | | | | | Fixes: QTBUG-90308 Change-Id: I35cd45679ded626654dd0e7e3eea8a7bb14c1d56 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> (cherry picked from commit 98a89fb711a15fcf9f541f7b4a8ae7492e5a445c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add new special QObjectPrivate::{connect, disconnect} for QMLAndrei Golubev2021-01-212-3/+52
| | | | | | | | | | | | | | | | | Original QML-specific connection mechanism ignores the receiver argument and uses sender as receiver. This causes uncontrollable memory growth in certain cases as connections on receiver persist even after receiver is destroyed New connect() with receiver parameter uses underlying API correctly, disconnect is provided for the symmetry (not sure it's really needed) Task-number: QTBUG-86368 Change-Id: I4580d75b617cb2c4dfb971a4dfb8e943e325572b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 6f520abdab7120789800208dde837b3836f762cc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: ensure we hide the edit menu while dragging on the selection handlesRichard Moe Gustavsen2021-01-201-0/+9
| | | | | | | | | | | | | | | | | | | | | iOS used to close the edit menu automatically when the user tapped on the screen (even for menus shown explicitly using the UIMenuController API). Apperently this has now changed (probably as a part of [UIMenuController setMenuVisible:] being deprecated in iOS 13). So we now need to hide it explicitly instead. Because of this, the edit menu would be showing together with the magnifier class while the user was dragging on any of the handles. This patch will fix this, so that we close the edit menu explicitly whenever the user starts dragging on a handle. Fixes: QTBUG-80298 Change-Id: Iff2032d64db1b582fa7f048c6a1f37ec8a1528af Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 2e35a03cd624c006b92cb95847231c8b1efde45b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Rasterizer: compute intersection factors only when neededEirik Aavitsland2021-01-201-7/+12
| | | | | | | | | | Fixes oss-fuzz issue 29285 Change-Id: I8f7e0bc898b119d153a36cef5a74371249ed7686 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Robert Loehning <robert.loehning@qt.io> (cherry picked from commit e1ed570f9d0ec3998f130e2c3870ef49e7994dbf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: ensure we close the edit menu when the user taps outside the input areaRichard Moe Gustavsen2021-01-201-32/+50
| | | | | | | | | | | | | | | | | | | | | | | | iOS used to close the edit menu automatically when the user tapped on the screen (even for menus shown explicitly using the UIMenuController API). Apperently this has now changed (probably as a part of [UIMenuController setMenuVisible:] being deprecated in iOS 13). So we now need to hide it explicitly. Because of this, we no longer close the edit menu if the user taps outside the input area. This patch will fix this by updating the logic in QIOSTapRecognizer to close the menu explicitly. There are some more details around when to show or hide the menu, which is commented on at the relevant places directly in the patch. Fixes: QTBUG-90332 Change-Id: I336e3f4003817b39c7abf63f963fde1f3ef87c20 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 427e639275be379e3577cd3b3c8a63a6b5e46d46) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QTzTimeZonePrivate::displayName()'s fallbackEdward Welbourne2021-01-201-1/+2
| | | | | | | | | | It previously fell back on abbreviation, a very poor choice. The base class does better than that, so use its implementation instead. Change-Id: I47cbfce815cd8b2b533d9c6aeebcf398e5852d02 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit f9fff26b2db8152dcae26c92054f031bdebd7bc1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make QStyle::proxy() always return the leaf proxySergio Martins2021-01-201-2/+4
| | | | | | | | | | | | | | For example: fusion -> proxy1 -> proxy2 Now returns proxy2. Fixes: QTBUG-85556 Change-Id: I2a60329f948b59ef7d0752d273bee3854a200547 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 61c3f3539c3d2d7dc867c3fef0270a2f5c9ed376) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QSsl: fix OpenSSL DLL names for Windows on ARMCameron Gutman2021-01-201-5/+9
| | | | | | | | | | | | OpenSSL adds an '-arm'/'-arm64' suffix to the DLL names when building for VC-WIN32-ARM or VC-WIN64-ARM. This needs to be accounted for in Qt to find the OpenSSL DLLs correctly. Fixes: QTBUG-89647 Change-Id: Ibc9b81e06f8e64c0676f335e13024fa7fe3a4fa3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit c111aad270f1d51c2e870ee25e9a6bba64b3cecc) Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Fix build with GCC 11: include <limits>Thiago Macieira2021-01-202-2/+5
| | | | | | | Fixes: QTBUG-90395 Change-Id: Iecc74d2000eb40dfbe7bfffd165b5dd3708b7a40 (cherry picked from commit 9c56d4da2ff631a8c1c30475bd792f6c86bda53c) Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* [Android] Fix Text select handle misplaced on fields inside QDialog issuesPekka Gehör2021-01-201-2/+2
| | | | | | | | | | | | Get cursorPoint from a mapToGlobal with a cursorRectangle of the selected inputMethod Fixes: QTBUG-65229 Fixes: QTBUG-58503 Change-Id: I89b056fa91c59d260f02164c9bd6672b5ada64d6 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit a5bb7b3ca510c301baf84e1dd46d5aeeb4986eb2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Generate Qt6EntryPointAdditionalTargetInfo independent of platformAlexey Edelev2021-01-201-7/+10
| | | | | | | | | | Move AdditionalTargetInfo generation for EntryPoint target out of WIN32 specific block Fixes: QTBUG-90414 Pick-to: dev Change-Id: I8dc34c939f12ef2073de630d4440a0892d8be909 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* macOS: Remove DontConfirmOverwrite workaroundMorten Johan Sørvig2021-01-201-9/+2
| | | | | | | | | | | | | Does not work any more on recent macOS versions. As a bonus, Qt now handles file names which contain “___qt_very_unlikely_prefix_” correctly. Task-number: QTBUG-39791 Change-Id: I944a68efa18edc72939d953ab32ecb53d8f8e1c4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit fded886ff4b9869c1a9e016e3fae05cc409c9ccd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Android: Finish composing text before Key handlingBartlomiej Moskal2021-01-191-0/+11
| | | | | | | | | | | | | If the sendKeyEvent was invoked, it means that the button not related with composing text was used. In such case composing text (if it exists) should be immediately finished. Fixes: QTBUG-85715 Change-Id: Ifbca067805b8d20f6a90f95b27210595abed964a Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 0d5b43bed4d75ce4d1f1c5a7b953288f5570350d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add missing since to QEvent::copy docsNicolas Fella2021-01-191-0/+1
| | | | | | | Change-Id: Idfadc1801b0e97a5030d2784a65ae658900efd12 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 9b2df27bb3a5e8fb788f7274013aa66d32d1250d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix problems with offset-derived ids for QTimeZoneEdward Welbourne2021-01-192-15/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating a time-zone from a UTC+offset name that isn't known to the system, QTimeZone (since the fix to QTBUG-77738 in 5.15.0) falls back to constructing a suitable UTC-offset backend; however, the id of this is not guaranteed to match the id passed in to the constructor. In all other cases, the id of a QTimeZone does match the id passed to its constructor. Some utcOffsetId testcases had different id() than the id passed to the constructor, due to mismatches where a zone was constructed using the fall-back but the generated id included its minutes (as :00) or omitted its seconds. The omission of seconds is clearly a bug, but we also don't want to include :00 for seconds when it's not needed. So change QTimeZonePrivate::isoOffsetFormat() to accept a QTimeZone::NameType to configure how much we include in an id. Its callers other than the relevant constructor (from offset) still get minutes, even when :00, but will also get seconds added if that isn't zero; and the constructor from offset now gets the short form obtained by omitting all trailing zeros. Since all valid whole-hour offset names that do include :00 for the minutes field are in fact known standard offset names, the elision of minutes will only affect zones created by ID in the case of a whole-hour offset given without :00 minutes specifier, so these shall necessarily in fact get the ID passed to the constructor. Creating by UTC-offset with a name that specifies zero seconds will result in a QTimeZone instance whose id() differs from what was passed to its constructor (eliding the :00 seconds and potentially also minutes, if also zero) but this should be the only case where a QTimeZone's id doesn't match the one passed to the constructor, when constructed by id. Fixed inconsistency between the offset-constructor's declaration (taking offset as int) and definition (taking qint32) in the process. Added an id check to the utcOffsetId() testcase. Amended two tests of offset-derived time-zones' IDs, added comments to make clear how one of those differs from a matching standard name test and converted two uses of QCOMPARE(, true) to QVERIFY(). [ChangeLog][QtCore][QTimeZone] QTimeZone instances created by offset from UTC (in seconds) shall now only include minutes in their ID when the offset is not a whole number of hours. They shall also include the seconds in their ID when the offset is not a whole number of minutes. Task-number: QTBUG-87435 Change-Id: I610e0a78e2aca51e12bfe003497434a998e93dc7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 50c63446f525a8625b6315597cb0897d89908d6b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Clarify setLibraryPaths behaviorPaul Wicking2021-01-191-3/+4
| | | | | | | | Fixes: QTBUG-89130 Change-Id: Id8460fd00dcfdcca174d523f8d97baef1a764f6f Reviewed-by: Topi Reiniö <topi.reinio@qt.io> (cherry picked from commit efa5a699729c6ff9f9d7991d12ed70139e3be669) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* ItemViews: Don't remove items on internal moveChristian Ehrlicher2021-01-192-4/+8
| | | | | | | | | | | | | | | When an itemview only allows internal moving of items it can happen that the target accepts the drag'n'drop operation since it's out of the control of Qt (e.g. Recycle Bin or an other application). Due to the nature of a move, the original item is deleted. Therefore check if the internal move target is the same as the source and don't delete it otherwse. Fixes: QTBUG-86020 Change-Id: I69de4b8d76d1b0f57338b402aee87580226cd6cb Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 12d8bb0709bf7982061cb0c3e608e4a581892e35) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix small typo in the QMdiArea documentationOliver Eftevaag2021-01-181-1/+1
| | | | | | | | | | Added missing whitespace character in the documentation for QMdiArea, in the 'detailed explanation' section. Change-Id: I6be1d664bc15e3e461c5fc3d8f82311cc6ea60ea Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit 3cb2b5bfe3e3c84dcd4c1a04c8c981dbaf85f0a4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QtEntryPoint: Fix linking Release against RelWithDebInfo with MSVCJoerg Bornemann2021-01-181-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | To be able to link a Release user project against a RelWithDebInfo Qt we set several IMPORTED_*_RELEASE properties in the *AdditionalTargetInfo.cmake file of each Qt module. The EntryPoint module however is a bit special as it is an INTERFACE_LIBRARY linking publicly against a static library (EntryPointimplementation). Its *AdditionalTargetInfo.cmake file was almost empty, because qt_internal_export_additional_targets_file was called before EntryPointImplementation was set up. Also, qt_internal_add_module, which calls qt_internal_export_additional_targets_file, does not know that we want to export the EntryPointImplementation target. We fix this by telling qt_internal_add_module(EntryPoint) to not generate the *AdditionalTargetInfo.cmake file and call qt_internal_export_additional_targets_file later to take the targets EntryPoint and EntryPointImplementation into consideration. qt_internal_add_module learned the option NO_ADDITIONAL_TARGET_INFO to turn off the generation of *AdditionalTargetInfo.cmake files. Fixes: QTBUG-90039 Change-Id: I68ec7125b538a57567035e7adb8dac3b213f95e6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit b0add5bf2f56c2afc8bdf27ccbb153414617250b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* eglfs: Use drmClose in drm/EGLDevice backendLaszlo Agocs2021-01-181-1/+1
| | | | | | | | Fixes: QTBUG-90350 Change-Id: I29a71e4abc2df7b777a895792bc5385a89223895 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 957344123672e891a25e55b54dcb012d2017b27a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add "Q_UNUSED" to (3rdparty) strtod.cc for a 32 bit code pathAndrei Golubev2021-01-172-0/+23
| | | | | | | | | | | Accidentally stepped on this thing. Cannot build Qt Core on 32-bit Ubuntu 16 without this patch. Fixes: QTBUG-90354 Change-Id: Iab5b2a317ee18b537b416eff008db29932fc043b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit b101f84f86e541fa30c0d6d2a4e549cf51118706) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* If available, use a version-specific qt<major-version>.confRalf Habacker2021-01-161-1/+4
| | | | | | | | | | | | | To enable the current Qt version to use a qt.conf that is independent from the previous version, a file named 'qt<major-version>.conf' is searched for first. If this file does not exist, a file with the name 'qt.conf' is searched for. Task-number: QTBUG-88635 Change-Id: If75b63f72a7bdbdf1de7729ea4ecb00810b58d12 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> (cherry picked from commit ab2c61e6384bbb5a0d154caa8f4784f9053147fe) Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix XCB launch key mappingAllan Sandfeld Jensen2021-01-163-37/+37
| | | | | | | | | | | | | | They have been reported wrong since Qt 4, and not fixed for behavior compatibility, fixing it for Qt 6. [ChangeLog][X11] XF86LaunchXX keys have been remapped, so the Qt names and X11 names match, instead of being 2 off. Fixes: QTBUG-25261 Change-Id: Ie3a8676439ae3e93a78218c9e7f4443565e84356 Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io> (cherry picked from commit cfd935fe6c26800befc10889afc0aebde311acca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Document QOpenGLWidget limitations without an alpha channelLaszlo Agocs2021-01-151-0/+13
| | | | | | | | Task-number: QTBUG-85869 Change-Id: I20fb70a451fc1ed93089ed699539fa12ac38fe73 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit b5ce973b29875d8cea6302de8ccfaa06d0b7c870) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Mark QFileDialog::DontConfirmOverwrite as unsupportedMorten Johan Sørvig2021-01-151-0/+3
| | | | | | | | | | | | | | | | | | The native NSSavePanel does not have an option corresponding to DontConfirmOverwrite. Qt has a workaround where the save-file-name is temporarily given a prefix in order do bypass the overwrite check, however this has stopped working on recent versions of macOS. (Confirmed on macOS 11) Users who want to use DontConfirmOverwrite should use Qt’s file dialog instead. Fixes: QTBUG-39791 Change-Id: Id3b9e6de72c2afc9526c96f1d9fdbce78db92aeb Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 9cd3ff2bdea0d5a009a8284288bbbdaaaec817be) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix convertToRGBA64PM for Grayscale16Allan Sandfeld Jensen2021-01-151-2/+1
| | | | | | | | | | | The input has been fetch into a set of uint32s, so no longer a string of ushorts. Fixes: QTBUG-90246 Change-Id: Id52a6824317b0744310008cc2ce2f726539b4c8c Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit ade24763c74ce506276218ec1ce0e307301717fe) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix setting active window as application's focus widgetSona Kurazyan2021-01-151-4/+5
| | | | | | | | | | | | | | | | | | | | | | | When setting the application's focus widget we search for the next child widget that can hold the focus and call its setFocus() method, which also updates focus widgets of all its parent wigets. In case if the focus widget is the active window itself, we only set it as the application's focus widget, but we don't update the focus widget of the active window itself. Because of this the focusWidget() method always results nullptr for the active window. This prevents from setting the focus back to active window after the focus has changed (for example after a context menu is closed, as in the bugreport). Transfer the focus to active window by calling the setFocus() method, as it is done in case of transferring the focus to any other widget. Fixes: QTBUG-85846 Change-Id: I91ebf182fd5bb7d451a1186e2f3e38c8d48acc4e Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 154573929a76d9051920756b19ed033c4b2ac649) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QTabBar/Windows: Fix close button icons being too small on high-res screensFriedemann Kleint2021-01-156-11/+32
| | | | | | | | | | Add 32x32 versions. Move the icon creation to a helper function. Fixes: QTBUG-88230 Change-Id: I6dda2084e0122234eacea17ac191a19f6855f466 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit f3251bcb878d655e5f897335ec6bc6dbf69323e7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix the tips still show when cursor move to another actionQiang Li2021-01-151-0/+2
| | | | | | | | | | | | In this case, the previous action's tip is still displayed when the cursor moves from one action with tip to another action without tip. Fixes: QTBUG-89082 Change-Id: I0a00595dc3d716725678487be9cbb363c4d3b392 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 3f3d5e6716d9130776b3613ccbd5595de7d4af8d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QApplication::font returns the font unstable according to the objectChunLin Wang2021-01-151-7/+11
| | | | | | | | | | If a default font was not registered for the widget's class, it returns the default font of its nearest registered superclass. Fixes: QTBUG-89910 Change-Id: I6e6b2c6a0044462f84db9f76a03be0c6cfaaae8e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit dafd26acbe7b08f5ddfe60432fe0e49422ac085c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Interbase: Don't error out if closing an already closed cursorAndy Shaw2021-01-141-1/+7
| | | | | | | Change-Id: If6964f5ae45c5ca4c0b34e417326fea1f33d7628 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> (cherry picked from commit 4d3d981144d810fbf1fe263741d36b07a9227621) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Widgets: fix setTabOrder for QAbstractSpinBox-like widgetsIvan Solovev2021-01-141-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | setTabOrder was not considering the case, when a child widget has its focus proxy set to its parent widget. This happens, for example, for the QLineEdit that is nested inside the QAbstractSpinBox. For such cases the lastFocusChild was calculated incorrectly, and, as a result, such child widgets were not correctly positioned in the focus chain. This could lead to an error while backtabbing. Here is a brief example. Suppose we have 3 widgets arranged like this: auto spinBoxOne = new QDoubleSpinBox; auto spinBoxTwo = new QDoubleSpinBox; auto button = new QPushButton; Then the default widget focus order is: - spinBoxOne - lineedit (from spinBoxOne) - spinBoxTwo - lineedit (from spinBoxTwo) - button Before this commit setting the explicit tab order changed the focus order in the following way: QWidget::setTabOrder(spinBoxOne, spinBoxTwo); QWidget::setTabOrder(spinBoxTwo, button); - spinBoxOne - spinBoxTwo - button - lineedit (from spinBoxOne) - lineedit (from spinBoxTwo) In this case, backtabbing from spinBoxOne actually leads us to lineedit (from spinBoxTwo), which refers to spinBoxTwo. And so we're stuck in a loop. This commit fixes the issue by handling such special case, and preserving correct focus order. Note: the actual unit-test in this patch uses QLineEdit instead of QPushButton, because one can't tab to buttons on macOS by default. However the general idea is the same. Fixes: QTBUG-81097 Change-Id: I5d16da7733a4d63f809cab28b8ca9e116b87cffa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 00505ed2b57d0a6911c8274af2bff883a93f583a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* AA_SynthesizeTouchForUnhandledMouseEvents: keep correct coordinatesShawn Rutledge2021-01-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | QGuiApplicationPrivate::processMouseEvent() sends a QWindowSystemInterfacePrivate::TouchEvent if the mouse event is not accepted and AA_SynthesizeTouchForUnhandledMouseEvents is enabled. A QPA TouchEvent always contains native touch points, which is why it calls QWindowSystemInterfacePrivate::fromNativeTouchPoints to translate the QMouseEvent's device-independent position back to the raw position that it would have had if it came from a real touchscreen. Therefore we must give that function touchpoints that are actually in native coordinates. It may be that some of this transformation could be avoided entirely, but here we prove that the existing way works correctly, by adding coordinate checking to the tst_QWindow::mouseToTouchTranslation() test. Task-number: QTBUG-86165 Change-Id: I4c9ca2b11e9eb76d79712c187db3eb9865da581a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit aeeac48cbdea744406f0c8abefe271f571b61d07) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QCache: when overwriting, store the new cost instead of the deltaMårten Nordheim2021-01-141-1/+2
| | | | | | | | | | | | The delta was clearly intended to be used on the total (and still is) but it also wound up getting stored in the cache, which wouldn't be a big problem unless the object was removed, in which case we could incidentally 'free up more space' than intended. Change-Id: Ib2b0f072d30da6d16a93dce60e4c5f6080c109fc Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit d2e2d0d3a6249ccbc17ec92acb32fec9a0d71807) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QGuiApplication: use global position to create local position for synthetic ↵Richard Moe Gustavsen2021-01-141-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | mouse events When QWidgetWindow handles a QTouchEvent, it will call updateTouchPointsForWidget() for each widget it tries to deliver the touch event to. This will make sure that the point's position() is updated to be local to the widget being processed. The problem is that we never reset this overwriting of local positions in the event after we're done. So if we later try to synthesize a mouse event from it, the local position in the fake mouse event will be based on the local position inside a random widget, and not the original local position sent from QPA. Rather than trying to store all the original local positions inside the event before going through this delivery logic, and reset it afterwards, we base the local position of the synthesized mouse event on the (unmodified) global position instead. Fixes: QTBUG-90033 Pick-to: dev Change-Id: I1588351482de7cce9c06d102db3686ea8dd0c118 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Fix VNC format conversionAllan Sandfeld Jensen2021-01-134-8/+9
| | | | | | | | | | | | | Pass the right from depth to the conversion function, and set the right format before creating the compositor image for RGB16 support. Fixes: QTBUG-85621 Change-Id: I76f46a3c2d8f1d2b040b790035dbdb0a960ff1a7 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 47c6b5b91e0d1271075d98ded5aa7a25296b5ee3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* a11y: Do not cache classes that don't have a factory pluginJan Arve Sæther2021-01-131-5/+4
| | | | | | | | | | | | | | | | | | | For Qt Widgets we thought it was a good idea to also store in the cache if a class didn't have a factory plugin. This worked fine there, since the number of QWidget classnames is quite limited (so the factory plugin cache will soon reach a limit) In QML however, classes are often suffixed with e.g. Button_QMLTYPE_123, Button_QMLTYPE_124 etc. This number suffix is just increased continuously. This could lead to that the factory plugin cache will grow ad infinitum, which will cause "memory leaks" in addition to a performance penalty. Fixes: QTBUG-75106 Change-Id: I9ba189f989f0b90ab62a2c54a2e9230236a998d8 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 583668005d4d6399fc16d165dcb6a5af2b94323d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix read-only pseudo-state in QTextEdit/Browser stylesheetEirik Aavitsland2021-01-131-0/+13
| | | | | | | | | | Was implemented for QLineEdit but not QTextEdit. Fixes: QTBUG-83056 Change-Id: I1e67ad0f1c230a062a1e12e8bc0b209c5289dc32 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 2054f451b1fc182fb3f53976b8f1e0026cfcd89a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix build with GCC and ltcgChristophe Giboudeaux2021-01-131-13/+18
| | | | | | | | | | | | The porting script could not handle this special case. To achieve the same thing, we'll use an intermediate 'OBJECT' library which will get the '-fno-lto' build flag if the conditions are met. Fixes: QTBUG-89426 Change-Id: Ied62502ce9c7f7fd6b89fab166f7bccfcd6e7433 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 2d4a40f93fd3f0fd31110ef7d19a12fc56c00967) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QComboBox: fix select all columns in the viewChristian Ehrlicher2021-01-131-2/+4
| | | | | | | | | | | | | | | When the QComboBox gets a custom view with multiple columns, only the first one is selected even the selection mode of the view is SelectRows. The selection changes afterwards properly honor the mode though. Therefore check for the selection mode and call setCurrentIndex() with the appropriate flags. Fixes: QTBUG-86776 Change-Id: Ieba7b9e009358e7b6e802b7847640161ec776c64 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit b3b28faf2627aad3a0c47fb4c7c711e0d19984aa) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Add more padding to width of non-editable comboboxesVolker Hilsheimer2021-01-131-2/+2
| | | | | | | | | | | | | | | | The width of the combobox took the space for the checkmark and the contents into account, but didn't provide any padding on the right side, resulting in the text hitting the right side of the combobox popup. Add another 12 pixels padding to the sizeFromContents implementation, which results in a symmetrical padding on both sides of the text. Fixes: QTBUG-88715 Change-Id: I811da73d11ce935c1fb83efabbe799f9a882e1d7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit ee409a536e7e1e4da28e235c4979a31cf40bb3c4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows font engine: Silence warnings about not being able to enumate font ↵Friedemann Kleint2021-01-131-2/+2
| | | | | | | | | | | | families Turn the warning into a qCDebug() statement and add explanatory comment. Fixes: QTBUG-85683 Change-Id: I2a6a7a089a660294f3e9c3096299c75635b3b215 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 29b2387587fe2ed2a73bdcbfa928acb755537284) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove QtDBus includesDavid Skoland2021-01-1315-107/+129
| | | | | | | | | | | | | | Per the discussion of QTBUG-88831, we determined that module-wide imports are unfortunate, especially for compile times. Following this, all QtDBus includes have been replaced with the headers for the classes actually used in each file. Additionally, some cleanup of header file order and format has been performed in the changed files. Change-Id: I62c1b75682a48422f0ba1168dd5d7bd0952808ac Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 9e09677c1dd4da92735736a0fbcb703416bf4d6d)
* rhi: gl: Reset tracked state upon a buffer update or readbackLaszlo Agocs2021-01-131-33/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...encountered in the command list. Move all, previously local, tracking variables into a struct. This allows creating helper functions to reduce error-prone repetition in the executeCommandBuffer() function body. The only real change in the patch is in the handling of Command::BufferSubData and Command::GetBufferSubData: here, instead of calling glBindBuffer directly, use a helper function that also resets the relevant state tracking variables. A subsequent Command::BindVertexBuffer or BindIndexBuffer will therefore correctly rebind the appropriate buffers. This is particularly relevant with certain command stream patterns exercised by some Qt Quick 3D scenes: - A View3D renders a mesh, - another View3D has some 2D Qt Quick content, as well as a model with the same mesh. When both View3Ds use the default Offscreen render mode, the resulting command list consists of segments along the lines of: 1. prepare resources for first View3D 2. render content for first View3D - this binds the vertex and index buffers for the mesh (state is tracked; all 1-4 steps are within the same command list, processed by a single call to executeCommandBuffer()) 3. prepare the content for the "inline" 2D Qt Quick scene - this may update vertex and index buffers, that may lead to adding BufferSubData commands to the list (tracked state (last vertex/index buffer) may need invalidation/updating - and that's where our problem lies) 4. the second View3Ds 3D content is rendered: a model with the same mesh as the last (Quick)3D draw call, so same vertex and index buffers. If #3 did not invalidate and/or update the tracked state, the glBindBuffer calls are (incorrectly) skipped. Fixes: QTBUG-89780 Change-Id: Icc933252f3993b8727d192e7ba4aa0f842bab51e Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 5f8efb259774040303f37d00b6307afd22857af2) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Revert "Windows QPA: Call QWSI::flushWindowSystemEvents() from WM_PAINT for ↵Morten Johan Sørvig2021-01-131-3/+2
| | | | | | | | | | | | | | | | | | | | full update only" This reverts commit a81dfb32d6f9e7a407567511c20b59e537f6a063. Paint immediately on WM_PAINT in all cases in order to avoid flicker on resize. The cases mentioned in commit a81dfb should no longer apply: - QTBUG-38327: QGLWidget is not supported in Qt 6. - QTBUG-39842: Fixed by using ExcludeUserInputEvents. Fixes: QTBUG-89688 Change-Id: If82cf7703d6663982769048e86a7060223730ce7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 9f894788dda8407c6221aaa1491cd54a5a2b4cb7)
* Set the PlaceholderText color in the palette from the stylesheet as wellAndy Shaw2021-01-121-0/+1
| | | | | | | | | | | The color should be used across the board, so the PlaceholderText color should also be respecting the one passed for Text and so on. Fixes: QTBUG-89815 Change-Id: I2accb3db35488f95a1c8ebacf2316a08ee416fac Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit bb00b63dee85bfe77bd721dd962c768e62c1b1e3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Add details to QFont::toStringPaul Wicking2021-01-121-1/+20
| | | | | | | | | | Add details that explain the return value. Fixes: QTBUG-81467 Change-Id: Ifad407a27259711fc9abe1bacc7ba9db105bdcc0 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 8c395a20eddc15ae923b7658f275fa87c8d33db9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Don't try to close already-closed/closing file dialogTor Arne Vestbø2021-01-121-1/+7
| | | | | | | | | | | | | | | | | | Doing so results in a warning about "modalSession has been exited prematurely - check for a reentrant call to endModalSession:", and on Big Sur will also result in the file failing to save because the return code from runModal will no longer be NSModalResponseOK. This would happen when the completion handler for beginSheetModalForWindow would call QNSOpenSavePanelDelegate_panelClosed, resulting in calls to QDialog::done(), which in turn tries to hide the dialog, via QCocoaFileDialogHelper::hideCocoaFilePanel(). Fixes: QTBUG-89959 Change-Id: I048afe3dcc7fe62e0d0273f12b4b2c0237abb052 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit 163d9c7cc46aa9174fdaaac8d64d8050f05c0a1f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>