summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Android: Fix Application becomes unresponsive issuePekka Gehör2021-06-075-4/+25
| | | | | | | | | | Block key events until the plugin is running. Fixes: QTBUG-67944 Pick-to: 5.15 Change-Id: Iea47f2e94d850141834a7e8fc26218be2cacf660 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 2262a9cd2d135d5ea2ade42460496c88d8b2c292)
* Fix the crashes when animated QTreeWidgetItems are hiddenQiang Li2021-05-311-1/+3
| | | | | | | | | | | | | | | | | | QTreeView's drawTree implementation performs lazy layouting when calling itemDecorationAt. If animations are enabled, this can change the list of items, and invalidate the copy made earlier. Don't copy the list of items, use a reference instead so that code iterating over the items later operates on valid data. Add an assert in the private itemHeight method, it must not be called with an index that is out of bounds. Fixes: QTBUG-42469 Change-Id: Ifdb782881447912e00baffd1c407de10a1d8d0d4 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit f140ef04a0c54c2c8a699db33433b8d7235d137c)
* QComboBox: add space for scrollbar if needed after showing popupVolker Hilsheimer2021-05-311-6/+13
| | | | | | | | | | | | | | | | | | QComboBox tests if a horizontal scrollbar is needed before sizing and showing the popup, but QListView only knows whether a scrollbar is needed only after laying itself out during the initial show and paint event. So test whether the need has arisen as part of this initial layout, and then provide the additional space. Resizing the widget after showing it is not ideal, but in practice makes no visible difference (and it's either way preferable to not being able to access the item covered by the scrollbar). Fixes: QTBUG-93736 Change-Id: I0bf077e18116ce174ae7f9218cb3b0dfa82964e1 Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 11e88eaa6df629a2c23a60815a1f7826dd2ac31a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QComboBox: propagate style change on widget to internal containerVolker Hilsheimer2021-05-312-9/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When changing the style of the combobox, the change will not propagate to the internal container widget, so the changeEvent handler won't be called. This is correct (as per QWidget::setStyle documentation). QComboBoxPrivateContainer asks the combobox style for relevant settings, such as the frame style, which is then used for sizing and positioning. If the combobox's and container's settings become inconsistent, then the combobox popup will not get the correct size and/or position. Move some of the style-dependent changes into a separate function and call it when the QComboBox::changeEvent handles the style change so that both widgets have a consistent set of settings. Add a test case that verifies that the style is asked for the relevant setting when the style changes. Note: QComboBox does a lot of style-dependent setup work in different places, which is quite messy and complex. Trying to consolidate that further breaks tests though, so this change is doing the minimum necessary to fix the reported issue. Fixes: QTBUG-92488 Change-Id: Ia957d504b2d800add26fc0565be727b5c08a5358 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit d36ef40d18b40cfc6f57c1002079f02a15eb41d3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QLocalSocket: fix inclusions in namespaced buildsGiuseppe D'Angelo2021-05-311-1/+4
| | | | | | | | | | An include statement appeared after opening the Qt namespace, thus injecting symbols in there. Move it outside. Change-Id: I8e95e821b36ad4e4ceed5b0645bf8ebf7e531e06 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 99e95a2cc6ddec5ebd7f69489811be2e9aef98b9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QAbstractItemModelTester false positiveLuca Beldi2021-05-311-2/+2
| | | | | | | | | | | When rows are removed from a model with no columns, the test should not report a problem if indexes are invalid Fixes: QTBUG-92886 Change-Id: I7a042dfdb2575f87208a00cbed13db3869807f84 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit fed2c0d23614df1b96dcc8746223501b07597a52) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QTreeModel calling beginRemoveRows twiceLuca Beldi2021-05-311-11/+7
| | | | | | | | | | | | | | For items that are children of other items, removeRows calls beginRemoveRows directly and then once again inside takeChild() The signal blocker that dates back to the monolitic import from Nokia prevents the model from emitting extra signals but the persistent indexes are corrupted nonetheless. Fixes: QTBUG-90030 Change-Id: I5bc4b2598bf13247683b113faeec22471f1f04a4 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit 6ec3fa2842b5c4714dc9a3953b2721ef70dd957b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* PCRE2: upgrade to 10.37Giuseppe D'Angelo2021-05-3114-179/+973
| | | | | | | | | | New upstream release. Change-Id: I3a7e6c3d6706c940c0a279e4b63e1bfd96cc242c Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 4ee4b7a8716dd2ffb7b67032aaa0766bc9b33bdb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* minor: Clean up areMetricsTooLarge() conditionsEskil Abrahamsen Blomfeldt2021-05-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This amends e2bdff3555f8c2a275c7bbcf964d939a5f489100. The linearAdvance property has some history. First it was a 16 bit value (allowing for 10.6 fixed point numbers). Then it was turned into 22 bits to fit the 16 bits of Freetype integer parts into it (16.6). Then back to 10.6. Then in b7e436738756b1d5d7a45201b7a7204d7fe128a1 it was turned back into 16.6 again. But this was accidentally reverted as part of a bad conflict resolution in afb326f07109da0035112e6f56e683e37b8a5d72. Since there was no check for it, we would sometimes overflow the linearAdvance, but only in the rare cases where the width and height did not also overflow. Specifically this is the case for whitespace, which always has a width of 0 regardless of the advance. This change just moves the linearAdvance condition in together with the other checks to avoid fragmentation, and also adds this fun story to the commit log. Change-Id: Iaac09942f4c50d1aced4a160b6eabb11eb8e6373 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> (cherry picked from commit a5085d7f6ac0ee4e066431ec9a99b7e0f13d2d0c)
* wasm: fix unicode keyboard handlingLorn Potter2021-05-301-145/+9
| | | | | | | | | | | | We can simplify and reduce the lookup table by casting to unicode for all printable keys. This means that non US/ASCII keyboards will have better support. Fixes: QTBUG-84494 Change-Id: I60aa6320cf1b5d82910ed77e136246d301bfc09a Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 7c233d4034237e268a513741ce69a0cd6ef47519) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid mixing atomic futex changes and QAtomicAllan Sandfeld Jensen2021-05-291-29/+17
| | | | | | | | | | | | | Either the mix of futex and atomic, or the mix of 32-bit futex and 64-bit atomic doesn't work. In any case, the existing code leads to bad behavior. Fixes: QTBUG-92188 Change-Id: Icc6ba28d6e2465c373d00e84f4da2b92c037e797 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 2d9cc639a4a7a5e97979a6034364bd67dfa10c23) Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Android: Reset m_usePrimaryClip when clearing the clip dataAndy Shaw2021-05-281-1/+2
| | | | | | | | | | | The variable needs to be set to false when we clear the clip data as there is no primary clip anymore so we should not try to access it when setting new data. Fixes: QTBUG-93831 Change-Id: I309270dc075fcb0457607561ee23e12f7eb6397f Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 96982bab0c5ff855100c1dcde23d090348be53db)
* Android: Remove NoSuchMethodException errorPekka Gehör2021-05-281-0/+5
| | | | | | | | | | CleanUp NoSuchMethodException error(QtActivity.notifyQtAndroidPluginRunning) appears on application start up. Fixes: QTBUG-93620 Change-Id: Ic835e00d02af17e1b48c0ff66d82e5957c635deb Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit 066a1de8e7b198dbe99cdecefeae94d5f0e5f289)
* QVector: fix compilation failure in C++20 mode w/strict iteratorsMarc Mutz2021-05-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given QVector<int> v(count, 0); GCC 10 in C++2a mode complained: /d/Qt/5.15.2/gcc_64/include/QtCore/qvector.h:532:18: error: ambiguous overload for ‘operator!=’ (operand types are ‘int*’ and ‘QTypedArrayData<int>::iterator’) 532 | while (i != d->begin()) | ~~^~~~~~~~~~~~~ /d/Qt/5.15.2/gcc_64/include/QtCore/qarraydata.h:148:21: note: candidate: ‘bool QTypedArrayData<T>::iterator::operator==(const QTypedArrayData<T>::iterator&) const [with T = int]’ (reversed) 148 | inline bool operator==(const iterator &o) const { return i == o.i; } | ^~~~~~~~ /d/Qt/5.15.2/gcc_64/include/QtCore/qvector.h:532:18: note: candidate: ‘operator!=(int*, int*)’ (built-in) 532 | while (i != d->begin()) | ~~^~~~~~~~~~~~~ Fix by making `i` an QTypedArrayData::iterator, not a T*. A more thorough fix would systematically evaluate the impact of C++20 relational operator changes on the whole Qt codebase, but this is out of scope for this patch. [ChangeLog][QtCore][QVector] Fixed a compile error in QVector(int, T) that occurred in C++20 mode with QT_STRICT_ITERATORS. Change-Id: Ia71e2bb7d9e252b13fb31cca00ed58a011d52971 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* macOS: respect underline attribute in menu item fontsVolker Hilsheimer2021-05-281-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>
* macOS: don't show invisible separator itemsVolker Hilsheimer2021-05-282-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>
* QXcb: don't dereference pointer before checkingVolker Hilsheimer2021-05-281-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>
* iOS: Accessibility: Don't cut off the last character from the text valueAndy Shaw2021-05-281-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>
* iOS: Accessibility: Set the correct traits for EditableTextAndy Shaw2021-05-281-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>
* Allow for arguments that have an equals as part of itAndy Shaw2021-05-271-3/+3
| | | | | | | | | | | Since you can pass a define to org.gradle.jvmargs that can have the name=value approach, then we need to ensure that this is accounted for. Task-number: QTBUG-88989 Change-Id: I2a795bff7ce683eca521b3a987293b3320accb6a Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> (cherry picked from commit a8a6558a84471a939d2d23977e394acadd2fcc6a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Write out the HTML correctly for nested listsAndy Shaw2021-05-272-3/+27
| | | | | | | | | | | | | | | When we are having nested lists then we need to ensure that the HTML is outputted correctly so that the closing list and item tags are placed in the right order. [ChangeLog][QtGui][QTextDocument] The output of toHtml() now handles nested lists correctly. Fixes: QTBUG-88374 Change-Id: I88afba0f897aeef78d4835a3124097fe6fd4d55e Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 72a5151403f107c445e20cf548ca2e7309c88ce7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QSqlTableModel::orderByClause(): Quote the table nameFriedemann Kleint2021-05-271-1/+2
| | | | | | | | | | | This ensures correct handling of names with special characters. Fixes: QTBUG-92584 Change-Id: I95c7c54d9c7ee00b221a55f3d07ef1ec3a3bd217 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 21b3b54193b9d90ee377fdfa306e21d2fdfe2837)
* macOS: Fix synthesized boldEskil Abrahamsen Blomfeldt2021-05-271-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | When a user requested bold and there was no available font for this (which is quite common with CJK fonts and in fact is the case for the official Japanese font on the system), we should synthesize the boldness. This was done by checking if the requested font weight boldness matched the one in the font's traits, and if not, we flag the font boldness to be synthesized. But when initializing the font, we would first override the requested weight with the selected font's weight, *before* performing the check above. So even if there was a mismatch, we would not catch this and as a result, e.g. the system Japanese font would never be bold. [ChangeLog][macOS] Fixed an issue where boldness would not be correctly synthesized for families with no bold variant. Fixes: QTBUG-85634 Change-Id: I36da59d7689455e29cca283cb0724a0841095918 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 76d3cda88469137050f6aab4bbb8578061fe25f2)
* SQLite: Update SQLite to v3.35.5Andy Shaw2021-05-273-94/+187
| | | | | | | | | | [ChangeLog][QtSQL][SQLite] Updated SQLite to v3.35.5 Change-Id: I7e1f5a4b6eb48d9f6105d7f08b35a2c62fc79660 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 75d8623752e67a39e2ee04e5233dc502e63a17f1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Qt xcb: remove false detects of Qt::GroupSwitchModifierAleksei Nikiforov2021-05-261-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>
* Do not remove non-widget items when removeWidget() called with nullptrPiotr Srebrny2021-05-261-0/+5
| | | | | | | | | | | | child->widget() returns null if the layout item is not a widget. Thus, calling removeWidget(nullptr) will remove all non-widget items such as layouts or strechers. Change-Id: I772c1158d0f7e8e2850b6e571b0405a2896f09b8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit 867c0b8d8a53974074b1fff5b132f3ae9f150066) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QFileSystemModel fails to locate a host from root's visible childrenDongmei Wang2021-05-261-2/+5
| | | | | | | | | | | | | | | | | | | In QFileSystemModel, in some cases the hostname in a UNC path is converted to lower case and stored in the root node's visibleChildren. When QFileSystemModel sets the UNC path as the root path, it tries to get the row number for the host, but it didn't convert the hostname to lower case before getting the row number, which resulted in the host not found in the root node's visible children. As a result, it returns -1, an invalid row number. Change the behavior to find the node for the host using the host name case-insensitive and then get the row number. Fixes: QTBUG-71701 Change-Id: Ib95c7b6d2bc22fd82f2789b7004b6fc82dfcb13b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alex Blasche <alexander.blasche@qt.io> (cherry picked from commit e253a30238ed1a93877780428c035d3b7a53e22a) Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Moc: parse trailing return typeMårten Nordheim2021-05-261-9/+21
| | | | | | | Fixes: QTBUG-71123 Change-Id: I1c3749f0892fddcc433c9afcb1d6d7c30c97c9d9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit 12b8283f899ebcf401d974927314b9531334a56e)
* Fix antialiasing of rotated non-smooth scaled imagesAllan Sandfeld Jensen2021-05-251-1/+2
| | | | | | | | | The fast-path can't antialias edges, and shouldn't be used when that is requested. Change-Id: I3a0ce120ab96a6f95d11c165d1f5b356dae009fe Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit ab216eaebf6d028367fddb93897bfb7ad694cc46)
* Fix QUrl::fromLocalFile with long path prefixKarsten Heimrich2021-05-251-2/+20
| | | | | | | | | | | | | After commit 3966b571 the function was kinda broken already, though this got unnoticed since it was not covered by an the auto-test. This commit adds another test case with Windows native separators and removes the use of QDir::fromNativeSeparators. Instead use the original code from QDir::fromNativeSeparators to replace the backslashes. Change-Id: I190560d0e75cb8c177d63b142aa4be5b01498da2 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit 06689a2d7a18882535819ed13ac7248c81330529) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QStringView::mid() to behave as documented when passed -1 for lengthAndy Shaw2021-05-241-1/+2
| | | | | | | | | | | With 84b53a4514c the behaviour was documented to be the same as QString::mid(), however this did not account for when -1 is passed for the length when it should get the rest of the string. So this ensures this behavior is put in place. Fixes: QTBUG-93677 Change-Id: Id41e136d78a13ff369508e37e6c679c76c6ae399 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QDockWidget, macOS: don't drag on native widgetsRichard Moe Gustavsen2021-05-241-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | When using native dock widgets on macOS, it will currently fail if you try to drag on a dock widget inside QMainWindow to make it floating. The reason is that the drag will basically start as as drag inside one NSWindow (QMainWindow), but continue as a drag on another NSWindow (QDockWidget). And this is not handled well by AppKit, especially since the NSView where the drag was started is reparented into a new NSWindow (the floating QDockWidget) while the dragging is ongoing. And there seems to be no practical solution to how we can support this from the cocoa QPA plugin This patch will therefore change the logic in QDockWidget to simply make the dock widget floating if you drag on it, rather than actually starting a drag (but only for the described case). Fixes: QTBUG-70137 Change-Id: Ic309ee8f419b9c14894255205867bce11dc0c414 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 3224c6d7d150164241c13ccf7d47377a39c0a6bb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add note about the risk of setting min-width/height in a style sheetVolker Hilsheimer2021-05-241-2/+8
| | | | | | | | Task-number: QTBUG-86677 Change-Id: I1e5e10ee79d80fee40d04afe439489d6ce16a43e Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 6fd480142bd253de095c1e4b79c119c9ed7d20a5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* cocoa: be more careful about rejecting frame strut eventsRichard Moe Gustavsen2021-05-241-7/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The m_buttons property is meant to hold the currently pressed mouse buttons done on the contents part of a QNSView. But m_buttons can sometimes get out of sync with AppKit (NSEvent.pressedMouseButtons). One way this is shown to happen is if you do a mouse press on a native child widget (that is backed by it's own QNSView), and then convert the widget to a top-level window before the release. In that case, the underlying QNSView will be reparented from one NSWindow to another, which will result in the old NSWindow getting the mouseUp call instead of the new window. The result is that we don't update m_buttons for the reparented QNSView, which will instead be left as "pressed". As a result of m_buttons being stuck in a faulty state, we also refuse to send out QEvent::NonClientAreaMouseMove events to the top-level widget. This because QNSView thinks that it's already in a dragging state that started on the content part of the view (and not on the strut). As a result, it can sometimes be impossible to dock a QDockWidget back into a QMainWindow, since we basically don't send out any frame-drag events to Qt for the new dock window. We can reason that if you start a mouse press on the frame strut, you cannot at the same time have an active mouse press on the view contents. This patch will therefore remove the buttons that we know was pressed on the frame strut from m_buttons. This will at least (be one way to) clear the faulty pressed state, and will let us send mouse press/drag/release (and after that, move) frame strut events to Qt. Task-number: QTBUG-70137 Change-Id: If51e1fe57d2531b659d39de85658893dae6391e3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 78b6050d60ba97ffb66e79bcde6ea306108e41dd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: Keep undo/redo widgets enabled on the undo shortcut bar after undoTamás Martinec2021-05-241-1/+14
| | | | | | | | | | | | Having two undo/redo operations on the rebuilt undo stack always enables the undo/redo widgets on the shorcut bar. This might be more desirable than the current behavior that only allows one undo from the shortcut bar. Fixes: QTBUG-63393 Change-Id: I2c99f27895def47b58534035461ceb7b4e5c3057 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 3b155973c494e847b821f0b5675a061f4e424a6c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix memory leak when using small caps fontEskil Abrahamsen Blomfeldt2021-05-231-4/+8
| | | | | | | | | | | | | | | | The small caps version of a font is kept as a QFontPrivate* which is manually reference counted, but we neglected to actually delete it when the reference count went to 0. [ChangeLog][Fonts] Fixed a memory leak when initializing a small caps font. Fixes: QTBUG-93068 Change-Id: Icc7fb7a59bf523da84d2e6fa026940a7d1230525 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Robert Löhning <robert.loehning@qt.io> (cherry picked from commit 11a40defff51dae2476e0da9f2b995a3a0f3bda8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QTestlib: Fix formatting of pointers in QCOMPAREFriedemann Kleint2021-05-222-1/+7
| | | | | | | | | | | After 1ed8a7bff503aacf55f7f880ddaad461ea15e5e1, volatile needs to be specified for toString(), else it is not used by compare_ptr_helper(). Add an overload. Change-Id: I3c335f324df346233623272d1014c8360ca33160 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 6fff7bb2692ecda1cff8624f5eccc0a2528fb693) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Cherry-pick upstream patch for non-gcc/clang/msvc compilersAllan Sandfeld Jensen2021-05-223-4/+15
| | | | | | | | | | Fix build w/ non-GCC-compatible Un*x/Arm compilers Fixes: QTBUG-93779 Pick-to: dev 6.1 6.0 5.15 5.12 Change-Id: Ib52e9ded6e2814c7998d6cd798e945da0f87f7a1 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 4341f6763b8a737ebc07bb78ead22bc05a1a515b)
* Windows: Add synthesized fonts also when there is a style nameEskil Abrahamsen Blomfeldt2021-05-223-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Windows can synthesize certain font traits for us, we used to register these in the font database so that we could match against them. But after change 469b13916983aff4625657eecbb7d2399cac901d, this in principle no longer happens, because we opt out whenever there is a style name (which there usually is, this could be e.g. "Regular" for a normal font). The result of this was that if we looked for a bold variant of a font, we would not find it. In cases where a multi-engine was used, the request for bold would still survive in the multi engine's fontDef, so we would still pick it up later and apply the synthesis. But when NoFontMerging was set, then we would override the weight in the fontDef with the one from the font database. Since the comment documents that the additional registrations are there to make sure all the variants that Windows can synthesize are available for matching, it does not make sense to skip them just because the font has a style name. So this is a partial revert of 469b13916983aff4625657eecbb7d2399cac901d. Note: This exposed an error in QFontDatabase::isSmoothlyScalable(). The style parameter here is not the "styleName" (as in sub-family), but actually predates that API. Instead it is the "style" as returned by QFontDatabase::styles(), which may be the style name, but it can also be the generated description of the style and weight. In the latter case, we would return false for fonts that are actually smoothly scalable, which is incorrect. This caused a failure in tst_QFontMetrics::metrics(). To remedy this, we add an additional condition, and also match the style if it matches the generated descripion of the style key. [ChangeLog][Windows] Fixed an issue where bold/italic would not be synthesized for fonts if QFont::NoFontMerging was set. Fixes: QTBUG-91398 Change-Id: Id2166a47ae2d386536cf6e5e27ff09165ae8a23a Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit f385b8827a75688b8a2cbd51e8da8a602d7f9567)
* Windows: Work-around misreporting of Script and RomanEskil Abrahamsen Blomfeldt2021-05-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | Two legacy bitmap fonts are misreported as TMPF_VECTOR on Windows: Roman and Script. This causes them to be marked as scalable, and the automatic fallback to NativeRendering in Qt Quick does not kick in - causing the text elements to look empty instead. To work around this, we exploit the peculiarity that the type of these two fonts is reported as "0" in the enumeration, which is not a valid value. No other fonts on the system is reported as type 0, so we simply detect this error case and mark the fonts as non-scalable, which is the safer choice. [ChangeLog][Windows] Fixed text in "Roman" and "Script" bitmap fonts not showing in Qt Quick applications. Fixes: QTBUG-85826 Change-Id: Id889f0dedb1d529e6dd64c6da9e17e303f4a9d04 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit a1e405ce11eb6760ccca13cf1b4e5d20fa3916e9)
* Android: fix wrong position of cursor hander in split screenBartlomiej Moskal2021-05-211-4/+8
| | | | | | | | | | | | Use activity window position to fix position of cursor hander. In case without splti sceen, position of activity window is equal (0, 0), so it does not have any effect. Fixes: QTBUG-91362 Change-Id: Icae9f19308112a78bdddf168abe81ffe7b6e4fae Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit 547228bf86281733c09a0638c57a4384c664f66e)
* Android: handle ImEnterKeyType flagBartlomiej Moskal2021-05-212-1/+28
| | | | | | | | | | | | | | | | | Replace KEYCODE_ENTER to KEYCODE_TAB if IME_ACTION_NEXT or IME_ACTION_PREVIOUS flag is set. Before this change any of imKeyEntryType [1] was handled as default return key. After the fix, event is changed to Tab or Backtab (if any of mentioned flag is set) [1] https://doc.qt.io/qt-5/qt.html#EnterKeyType-enum Fixes: QTBUG-61652 Change-Id: Ia27aa308fdae75bc17d1e892d17048c5afa3e2cb Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit e5686b35f07ea54f59e81d04a054bd832bee69b9)
* Apply the Core compile definitions to the big resource targetsAlexey Edelev2021-05-211-0/+3
| | | | | | | | | | Resource object library needs using the interface compile definitions of the Core library to apply correct QT_NAMESPACE to the generated code. Also this adds an explicit dependency to the Core library. Fixes: QTBUG-85702 Change-Id: Id37812d01373bf13a63aea13248bf689debfff0b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Update bundled libjpeg-turbo to version 2.1.0Eirik Aavitsland2021-05-2139-667/+1079
| | | | | | | | | | [ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 2.1.0 Change-Id: I82a58609120923c18f6031fec7d597138ec473ee Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 127f617387c00139dddbfc9438ab032e24559566) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QSpdyProtocolHandler: don't rely on device being availableMårten Nordheim2021-05-201-1/+2
| | | | | | | | The device is not necessarily available so don't assert on it. This is due to having the slot connected by QueuedConnection. Change-Id: Ic957d4d7d0c6e3fc580c056b9984df9ca728e363 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Avoid processing-intensive painting of high number of tiny dashesEirik Aavitsland2021-05-201-9/+35
| | | | | | | | | | | | When stroking a dashed path, an unnecessary amount of processing would be spent if there is a huge number of dashes visible, e.g. because of scaling. Since the dashes are too small to be indivdually visible anyway, just replace with a semi-transparent solid line for such cases. Change-Id: I9e9f7861257ad5bce46a0cf113d1a9d7824911e6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit f4d791b330d02777fcaf02938732892eb3167e9b)
* QVnc: clip requested screen region to available screen imageEirik Aavitsland2021-05-201-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>
* Simplify bundled libjpeg buildEirik Aavitsland2021-05-203-2/+2
| | | | | | | | | | | | 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)
* Apply specialData font capitalization to non-rawFont textAllan Sandfeld Jensen2021-05-171-2/+12
| | | | | | | | | | | | We were not using the capitalization details from specialData in the regular path of QTextEngine::itemize() causing it to be ignored. Fixes: QTBUG-90840 Change-Id: I7bb71fad4009f6d0685905a946c36ac1d24d8d3c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit 5fa80f6cd792d0f7ead782037b9870796de05acb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Avoid fast transform paint path on values it can't handleAllan Sandfeld Jensen2021-05-171-2/+6
| | | | | | | | | | | It has a problem with very small targets, and coordinates can't exceed the same bounds we have on dimensions. Fixes: QTBUG-93475 Change-Id: If5b3af324f4e525cee3dc448ba41fdd8a91cc880 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit ddc5af9f17474129223c7bbac58b57bb3ed0ff74) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>