summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* macOS: Notify socket notifier on connection error6.0Morten Johan Sørvig2021-07-021-3/+11
| | | | | | | | | | | | | | Enable kCFSocketConnectCallBack to get connection made/failed notifications. For the error case, the data pointer will be set (it points to an int with the error code). Change-Id: Ib51c0ae7c2c74d7bc2fea3c8b7aa9033a860f602 Fixes: QTBUG-91619 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit d492245d9f98e410e1748f28a598945244dbafa8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QVarLengthArray: fix aliasing error in insert(it, n, v)Marc Mutz2021-06-281-1/+1
| | | | | | | | | | | | | | | | | | Taking the copy after the resize is completely pointless: the copy is there to ensure that `t`, being a reference potentially aliasing an element in [begin(), end()[ before the resize(), isn't invalidated by the resize(), so it must be taken before resize(). Add a comment so the next rewrite doesn't cause this to be mixed up again. [ChangeLog][QtCore][QVarLengthArray] Fixed an aliasing bug affecting insertions of objects aliasing existing elements. Change-Id: I26bc449fa99bf8d09a19147a12a69ac4314cc61d Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit 6e57e41f9aef5ccfa122c10bc6253d47dafd93d2) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: fix cursorTheme update issueTang Haixiang2021-06-241-2/+6
| | | | | | | | | | | | | | | | Clear the cache when cursor theme changed. Idealy we should subscribe root window's RESOURCE_MANAGER property to update cursor theme via Xcursor. KDE already has a daemon KDE GTK Configurator to sync KDE settings to GTK. Then we can register the fallback there both for KDE and GTK changes. See also https://invent.kde.org/plasma/kde-gtk-config Fixes: QTBUG-94538 Change-Id: Ia4de30930a0dc1dc306c61e1553970c3dab67bd6 Reviewed-by: Liang Qi <liang.qi@qt.io> (cherry picked from commit 7311cdc0d2c10d47511e5b4850e3b348ea10e0d8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xkb.compose: get locale from user env settingsLiang Qi2021-06-211-4/+10
| | | | | | | | | | | | | | The setlocale call will only give useful results if the program had previously set the current locale using setlocale... See also "Compose Locale" section in xkbcommon doc: https://xkbcommon.org/doc/current/group__compose.html#compose-locale Fixes: QTBUG-85529 Change-Id: I65b1ac86ea54445bc3a2e1707df79bd9f732ab46 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 73ea9f032864566cc019d286b2f210b78cd70a3d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix license information for libjpeg-turboKai Köhne2021-06-044-15/+65
| | | | | | | | | | | | | | Fix the license metadata in that libjpeg contains parts under three different bsd-like licenses. Also, do include the IJG, zlib license texts in the metadata. [ChangeLog][Third-Party Code] Clarified that libjpeg-turbo is actually covered by three licenses, not only IJG. Change-Id: I6c4e3e8577bdf83e7e73474b34b0553cbe1d9b6d Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 467b39d52c9ab59b1e7518330fbb51d5543ada50) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QtGui/math3d : Fix QQuaternion::getEulerAnglesInho Lee2021-06-011-1/+5
| | | | | | | | | | | | When rotating M_PI_2 based on x-axis, quaternion to euler conversion makes NaN for the x-rotation value. This patch fixes this corner case. Fixes: QTBUG-93600 Change-Id: Ice321a80ad90dba9cf3ee3a14ec7d3d047c21bd3 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 7ea2fbddcf674d49ad7d219cdb8a4b760258360c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QWidgetTextControl: ignore GroupSwitchModifier for BackSpaceIgor Kushnir2021-05-311-1/+1
| | | | | | | | | | | | | | | | | | "The keypad and group switch modifier should not make a difference" when matches a QKeySequence, see QKeyEvent::matches() implementation. Qt(xcb) treats AltGr as GroupSwitchModifier in hard code, which should come from Qt 4 era. Nowadays, with different xkb setups, Mode_switch could be different keys. When it is AltGr, Qt will get AltGr as GroupSwitchModifier. When it is not AltGr, another key like Less/Greaterkey(details in bug report), GroupSwitchModifier will not be set in the case. Fixes: QTBUG-36565 Change-Id: I7251963d41a70d61800d25e43d5012b859693f69 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 4b0b87b5c2173ee70eacfdd7cea08aea8a5164c8) 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>
* qxkbcommon: Map Super/Hyper to Meta early enough to have an effectAndrey Butirsky2021-05-251-6/+6
| | | | | | | | | | | | Super/Hyper keys are detected during a direct mapping phase, but the function returned before the translation to Meta could take place. Task-number: QTBUG-62102 Change-Id: I9f7ccfd757fa86dbc648951306deb1b43ccf4167 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Andrey Butirsky <butirsky@gmail.com> (cherry picked from commit b45b9090c3b66d541f57f8d049c22247f8c115ca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QFileSystemModel fails to locate a host from root's visible childrenDongmei Wang2021-05-221-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)
* Fix QUrl::fromLocalFile with long path prefixKarsten Heimrich2021-05-191-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>
* Windows QPA: Fix dock widget drag&drop failureAndre de la Rocha2021-05-191-1/+1
| | | | | | | | | | | | | | | | | | | | A previous change to fix QTBUG-85431 has caused this issue by emulating the behavior of the non-enhanced mouse event handler in a particular case, where mouse move events that did not change position were ignored. However, some of these events seem to be involved in the dock drag&drop implementation. This issue is also reproduced in pre-5.15 releases, predating the QTBUG-85431 fix, by disabling the enhanced mouse event handler by setting the QT_QPA_DISABLE_ENHANCED_MOUSE env var. However, the ignored events in the current issue seem to be non-client events only, while the QTBUG-85431 issue was related to client mouse events. So we can restrict the test added in the QTBUG-85431 fix and have both issues fixed. Fixes: QTBUG-92182 Change-Id: I98c0c8597912c7f4fe58af375a5a560695a82746 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 92198efbd2c696470711e7f24c5b6507bb664ce9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Cherry-pick upstream patch for non-gcc/clang/msvc compilersAllan Sandfeld Jensen2021-05-183-4/+15
| | | | | | | | | | Fix build w/ non-GCC-compatible Un*x/Arm compilers Fixes: QTBUG-93779 Change-Id: Ib52e9ded6e2814c7998d6cd798e945da0f87f7a1 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> (cherry picked from commit 4341f6763b8a737ebc07bb78ead22bc05a1a515b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QSaveFile and QTemporaryFile issues with windows network sharesKarsten Heimrich2021-05-173-24/+17
| | | | | | | | | | | | | | | | | | | The commit amends commit 3966b571 to take UNC prefix into account as well. Fixes the weird file name output as reported in QTBUG-74291 and QTBUG-83365. Replace manual separator normalizing in qt_cleanPath(), this is another spot where UNC prefix handling needs to be applied. Also make QTemporaryFile operate on '/' as file separators to fix creating both file types with native path separators on network shares. Fixes: QTBUG-74291 Fixes: QTBUG-76228 Fixes: QTBUG-83365 Change-Id: Iff8d26b994bf4194c074cd5c996cda3934297fa5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit ec9e85656339dbc9e6918a1369c981cece7bc97d)
* QPageSize: make PageSizeId ctor non-explicitMarc Mutz2021-05-131-1/+1
| | | | | | | | | | | | | | A QPageSize::PageSizeId is a faithful representation of a QPageSize, so the corresponding QPageSize ctor shouldn't be explicit. [ChangeLog][QtGui][QPageSize] Conversion from a QPageSize::PageSizeId is now implicit. Change-Id: I2d32da370c032949686757400cb7c28583d9d8ac Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit c8f380bd13f077cd797edbdb55723a2524f55c78) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Do not remove non-widget items when removeWidget() called with nullptrPiotr Srebrny2021-05-111-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>
* QFlags::testFlag: clarify the behavior in the docsGiuseppe D'Angelo2021-05-111-0/+8
| | | | | | | | | | | | | | The name made me fall in a trap: I thought that testFlag returned true if *any* of the bits in the argument were set in the QFlags object. In reality, it returns true if *all* the bits are set, and an argument equivalent to 0 is treated specially. Clarify this in the documentation. Change-Id: I9e8088c48038b4e6ba5830fdb7e473c6d7884b29 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 89f55f13fdae3aa52614b063ff6ceb8276340d44) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Check scrollbar visibility when computing QListView marginsChen Bin2021-05-111-1/+1
| | | | | | | | | | | | | | | | | | When the listview setWordWrap is true and ScrollBarPolicy is ScrollBarAsNeeded, if the text needs a newline display and the vbar is not shown, the width of the item was subtracted from the width of the scrollbar. In most cases, the listview needs to reserve the size of the scrollbar. But if the flow is TopToBottom and the vertical scrollbar is not visible, the width of the vertical scrollbar cannot be reserved. Fixes: QTBUG-92366 Change-Id: I73cce691099a253d409019dbb3fe9a16e1830bb1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit aeef92c3c33e4ebcb7e5d8dd955020f4f4600e84) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Update bundled libjpeg-turbo to version 2.1.0Eirik Aavitsland2021-05-0539-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>
* Simplify bundled libjpeg buildEirik Aavitsland2021-05-054-2/+1
| | | | | | | | | | | | | Move the config headers of the bundled libjpeg back into its source directory, where they originally live, to avoid having to trick with the include path to find them. The goal is unification across maintained Qt branches, making version updates simpler. Change-Id: I5b574446bbd264b0a1cb3efceb4c1cb7203cac7d Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 5df88b85c6e61409c5c759e78f32edaac7b2022f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: Keep undo/redo widgets enabled on the undo shortcut bar after undoTamás Martinec2021-05-051-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>
* Update CLDR-derived data to newly-released v39Edward Welbourne2021-05-035-1078/+1075
| | | | | | | | | | | | | | Routine update with minor changes to locale data, no new languages, territories or scripts. Various Spanish locales change m_grouping_top from 1 to 2, reversing a change to a test of Costa Rica's currency formatting made in commit bb6a73260ec8272647265f42180963604ad0f755. Includes updates to time-zone IDs. Fixes: QTBUG-91478 Change-Id: I78ee161275b3c456c5800a7317a96947c932cf8e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 6235893d54b8fbf5c8bd54e33cd82b55042555f1) Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QLocalSocket: fix inclusions in namespaced buildsGiuseppe D'Angelo2021-05-021-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>
* QRandom: drop a usage of std::is_literal_typeGiuseppe D'Angelo2021-05-021-1/+0
| | | | | | | | | | It's deprecated/removed, and indeed doesn't check anything that it's not also already being checked by the previous line. Change-Id: Ic80ca43f390dd989ced69f196efa7313069e7c6d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 6351b5433da083890e47faa62e21fb40fd042c79) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* SQLite: Handle tables and fields with a dot in the name correctlyAndy Shaw2021-05-021-9/+24
| | | | | | | | Fixes: QTBUG-91885 Change-Id: Iba76bb50266dd4fb5f50e4ea1549d1d2bb6e3431 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 66acee69a1563488e5950645c171d6be73dd5f70) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* HTTP/2 authentication requiredMårten Nordheim2021-04-295-29/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | With Qt 6 we made HTTP/2 default, which exposed missing handling of 401 Unauthorized (and 407 Proxy Authentication Required). In HTTP/1.* we would handle this after the response had finished, while handling the status code. For h2 this path isn't used since it is heavily reliant on the structure we have for HTTP/1.* (one request per channel). So we must handle the status code and header directly. Having that part fixed exposed another issue - when resetting/rewinding uploaded data we were not resetting the 'totallyUploadedData' counter in the reply (this, in turn, exposed another small issue). Because of that we did not actually send any data on the retry, only sending the content-length followed by no data. Finally, the small issue mentioned in the previous paragraph was how we check if we have uploaded all our data. It was only checking if the byte-device was atEnd(), which it was. But only because it had not yet prepared any data for us. Fixes: QTBUG-91284 Change-Id: I798d105b02688b18a02897cc476f19f57a47f98f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 52a0eb4791727157a7b385f7e022faad28da4821) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Don't override action set during drop handlingAndy Shaw2021-04-291-1/+3
| | | | | | | | | | | | | | | | | When the drop has been handled, the target might have accepted a specific action by calling QDropEvent::setDropAction. Don't override that with the operation received by the OS if the drag'n'drop operation takes place within the same application. If the operation comes from outside, we have no choice but to trust the OS. This way the drag-site will get the action accepted by the drop-site when QDrag::drag returns. Fixes: QTBUG-77427 Change-Id: I0e4c86adeeea66b345966a03a3251fa62263b3e8 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit a014300898bd3bd574ef19bba7123d4b5a07789b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* fix: The QtStartUpFunction function may be called repeatedlyJiDe Zhang2021-04-281-1/+9
| | | | | | | | | | Don't call pre routine function in qAddPreRoutine if the qt_call_pre_routines is not called Task-number: QTBUG-90341 Change-Id: I0ee70561dc57b857f8b3b1cf42c9dfe0cf45bd49 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 22e967c3049608f82abd32a0beb0b4b36ee134bf)
* Doc: Remove mention of no longer supported formatv6.0.4Paul Wicking2021-04-271-3/+1
| | | | | | | | Fixes: QTBUG-92826 Change-Id: I35950523e41ceaa1ddc59782c4b527707289013b Reviewed-by: Topi Reiniö <topi.reinio@qt.io> (cherry picked from commit 069369d86707c89645d63ff36151065c47e6c0ea) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: Add more debug info for XCB_INPUT eventLiang Qi2021-04-271-1/+44
| | | | | | | Change-Id: I99bba80659a103aa79426ae94cd04db2c5d851d6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 6a91ad7b5b429a9e277a4eedd7161b052b3acf68) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Change QList's insert() and emplace() to always invalidate [pos, end())Andrei Golubev2021-04-271-107/+114
| | | | | | | | | | | | | | | | | Drop the "move left if pos <= size / 2" path in favor of reference stability of insert and emplace operations Leave the insert(0, ...) and emplace(0, ...) as special cases for prepend optimization as invalidating [begin, end()) practically means that we can reallocate behind the scenes Doing this also simplifies the code a bit Task-number: QTBUG-93019 Change-Id: I7c248f96d687e94a6a38f81ade901619ff2b4733 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 5e76c2acff2c70f2893306b16aeba230f3d6114a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Do not shift the data pointer when removing all elements from QListAndrei Golubev2021-04-271-5/+7
| | | | | | | | | | | Because leaving the pointer untouched is a much more expected behavior The tests for this (and not only) logic can be found in the following commit Change-Id: Iec9eec9bbce04c9fd90cb6be9627c135cd989b7f Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 38bba2a87c6c5c2b8100870add6d0d7ad559e669) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Resurrect data moves in QListAndrei Golubev2021-04-276-83/+307
| | | | | | | | | | | | | | | | | | Use the data moves to readjust the free space in the QList, which ultimately fixes the out-of-memory issues caused by cases like: forever { list.prepend(list.back()); list.removeLast(); } Task-number: QTBUG-91801 Task-number: QTBUG-91360 Task-number: QTBUG-93019 Change-Id: Iacff69cbf36b8b5b176bb2663df635ec972c875c Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit a0253f5f0249024580050e4ec22d50cb139ef8d9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add q_points_into_range to container utilitiesAndrei Golubev2021-04-273-18/+19
| | | | | | | | | | We already used it in QString and QBA. And implicitly in QADP (see parent commit). Might as well move to a common location and reuse Change-Id: I694f0f1dbd109f17c134f64b3f3dc28d19556c88 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 10b46e7f0faecc42a94cc2e25ad3edd08ae28083) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix build error on iOS with the configure option -qtnamespaceLars Schmertmann2021-04-272-3/+9
| | | | | | | | | | | | | qtbase/src/corelib/kernel/qsharedmemory_p.h:62:33: error: unknown type name 'QString'; did you mean 'XXXX::QString'? int createUnixKeyFile(const QString &fileName); ^~~~~~~ XXXX::QString Change-Id: I455526503f059efc2f496b159b4cb098385dda00 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit d81a9206ac528ad7b5093305d7fe0037053468b8) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* [Android] Fix select handles misplacement on QDialogPekka Gehör2021-04-261-6/+19
| | | | | | | | | | | Get select handles {Left, Right}Point from a mapToGlobal with a cursorRectangle of anchorRectangle of the selected word/text Change-Id: I3425104c90f0efe6a1e4337328cf06dc93685b6f Task-number: QTBUG-90799 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit 56b54743e001c4af196c1e4786118d88b1d2cd2f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QTreeModel calling beginRemoveRows twiceLuca Beldi2021-04-261-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>
* Fix QAbstractItemModelTester false positiveLuca Beldi2021-04-261-1/+1
| | | | | | | | | | When inserting rows to a branch with no columns the tester should not complain about indexes being invalid Change-Id: I466f4e5140b10f6dcf65a71f109c2d3be7336507 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit fcea8e7aa8a65de9e80136c2d603478831b246d0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Skip adding externally added plugins to the plugin meta-setsAlexey Edelev2021-04-261-3/+0
| | | | | | | | | Plugin meta-sets are not visible outside of the module build tree, so there is no point in adding dependencies for externally added plugins. Change-Id: Ica5b29b57c032f4fc9b128172aaa806392e9e581 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit bbe26a766748c00da5e2241a9c7ec5e714dd76ad)
* Optimize quadratic-time insertion in QSortFilterProxyModelIgor Kushnir2021-04-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Let N = proxy_to_source.size() before the code modified in this commit. Let M = (N - proxy_start). Let K = source_items.size(). The algorithmic complexity of the removed loop is O(N+K+K*M), assuming the number of O(N+K) reallocations is a constant. The complexity of the QList::insert and std::copy implementation is O(N+K). This is much faster in practice when K and M are of the same order of magnitude as N. For example, this quadratic complexity issue results in noticeable slowdown in the following scenario: * a QSortFilterProxyModel is used only for filtering, not sorting; * first set a filter that matches a single item in the middle of a huge number of items (about one million) - this is reasonably fast (takes about a second); * then clear the filter (i.e. set an empty filter so that no item is filtered out) and watch your application's UI freeze for a minute. The "Add QSortFilterProxyModel clear-filter benchmark" commit (with Change-Id I419a5521dd0be7676fbb09b34b4069d4a76423b1) adds a benchmark that runs much faster with this performance fix. Change-Id: Ieaec173e6910f5d21eaee49402087f7711abbedf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit 7d92ef63d7c2d9d017d89905a2ee0d1e9226b15c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QThreadPool: obey the docs that say we always use at least 1 threadThiago Macieira2021-04-242-8/+13
| | | | | | | | | | | | | | | Even if the user (usually accidentally) sets a thread count of zero or negative. The reporter in the bug report did QThread::idealThreadCount() - 1 on a 1 CPU system... Drive-by add to the documentation and the missing #include. Fixes: QTBUG-93007 Change-Id: I6cdea00671e8479b9c50fffd167807d14e030154 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> (cherry picked from commit 885eff053797d56f2e295558d0a71b030fbb1a69) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Do not access internal allThreads data unlockedAllan Sandfeld Jensen2021-04-231-0/+1
| | | | | | | | Change-Id: I54eb67571fff07ffdbf9d2b77c96bb85e3fae5e0 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit ffb5635c1a34d23d85e3cb42310e14a81fa24f6e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix case sensitivity handling QSFPMSamuel Gaist2021-04-221-24/+44
| | | | | | | | | | | | | | | | | | | | | | This patch fixes the breaking of case sensitivity handling. The removal of QRegExp killed the wrong code paths which leads to inconsistencies when changing the regular expression throuh methods like setFilterWildCard or setFilterFixedString. Changing the case sensitivity also nukes the original options that were set on the regular expression if it was set through setFilterRegularExpression. [ChangeLog][QtCore][QSortFilterProxyModel] Case sensitivity as well as regular expression options handling have been fixed. The original value is properly kept when using setFilterWildCard and setFilterFixedString. The regular expression options are now also properly kept when changing the case senstitivity through setFilterCaseSensitivity. Fixes: QTBUG-92260 Change-Id: Ifb4732306f0c7d79ad0b18d3f5437c4523bb40e5 Reviewed-by: Igor Kushnir <igorkuo@gmail.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit bcbbbdb2d640c059c19e9337c7418b83b1b7e4ea) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't own unique name for QDBusTrayIconIlya Fedin2021-04-212-14/+5
| | | | | | | | | | | | | | | | | | | Flatpak doesn't allow to own random name with PID. Even after adding such a permission into manifest, all flatpaked apps have PID 2, so only one Qt application at a time can have tray icon. Even though unique name is a part of the spec, no tray hosts really check it and SNI implementations without unique name run just fine inside and outside of Flatpak. This fixes the inability of Qt applications to have tray icon in Flatpak outside of KDE. Change-Id: Ieea6dc335b7a74537a51929f6e70ca68c84228fb Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> (cherry picked from commit 9db7cc79a26ced4997277b5c206ca15949133240) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Documentation: Fix broken links to QIODeviceBase::OpenModeFriedemann Kleint2021-04-212-9/+9
| | | | | | | | | | | Previously, QIODeviceBase was not visible in the documentation and the links from QIODevice::open() were broken. Fix by fully qualifying the arguments. Change-Id: I43960ac2ff436251cc3bfad862d82f937b9bd4b1 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 1b1844afef81520520ba75146f835a7dbbbb5fd6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Read DPI from X Settings initially as wellIlya Fedin2021-04-202-7/+18
| | | | | | | | | | | | | | | | | | | | | | | Currently, Xft.dpi from X Resources is read initially, while changes are monitored for Xft/DPI from X Settings. These protocols are different and can have different values. E.g. MATE sets X Resources' Xft.dpi to 96.30859375, while X Settings' Xft/DPI is set to 197240 at 2x scale. This results in a very weird bug when Qt can't determine 2x scale initially, but if scale is changed at run time, Qt changes scale to the right value. The difference could be checked via xrdb -query and dump_xsettings (the second is from xsettingsd project). [ChangeLog] Qt now reads Xft/DPI from X settings at startup, and will prefer this value over Xft.dpi from X resources. Change-Id: If6adac0c88198579332ddebc673f1524f324c0e4 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 6560778616b090f8cc73700675ec2ef385953fb6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Draw the cursor considering the descent is 0Tang Haixiang2021-04-201-3/+3
| | | | | | | | | | | | | | | When the descent of the item is 0, ascent is the height of the item, base(base = si.ascent)> sl.base. At this time, sl.descent is not considered. The calculated y value may be <0. Fixes: QTBUG-86823 Fixes: QTBUG-92468 Change-Id: I9cf088dec9162595e52ff72aa90ec3153a30fb72 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit e99a883bd382ca950192bd66cafb2a1de6394ce7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Correct prefix reported for end element in QXmlStreamReaderVincent Baijot2021-04-202-0/+4
| | | | | | | | | | | | | | | | | | | | Before this change, QXmlStreamReader prefix value was always an empty string for EndElement when the documentation state : "Returns the prefix of a StartElement or EndElement." The error was a missing update of the prefix value when parsing EndElement. I updated the tests data which were also wrong because no prefix were reported even for </a:foo>. No new test is necessary, I think, the test data already cover the cases of EndElement with a prefix and without one (unchanged here). Fixes: QTBUG-86847 Change-Id: I0ad38b9741d760f1ce688a36f969ec14e20a928c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 366bdcde97962cf5804c519e9b605eddb543a592) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix get out of bounds index in QSortFilterProxyModel::filterAcceptsRowChunLin Wang2021-04-201-3/+5
| | | | | | | | | Before calling the index function, we need to check the validity of the parameters. Fixes: QTBUG-91878 Change-Id: I9ec7265fff3f81b8a288c4ba8fae606a2ec808a6 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit b8802071ed00689373da5817fc4824a30b5fcf86)
* Fix ARM and MIPS runtime CPU feature flagsAllan Sandfeld Jensen2021-04-201-11/+11
| | | | | | | | | | The set values didn't match tested values, as the enum were already on flag form. Change-Id: I9e8b0d419682122e8d40cd47bd68d840386c2066 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit ccd17fbc57fae0cb2e5c020e00706edc856b13df) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>