summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Pick up *Tools components also from host QtKai Köhne2021-08-181-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | Let find_package(Qt6 COMPONENTS LinguistTools) for a cross-compiled Qt fall back to search LinguistTools in the host Qt. Use the same trick as in QtModuleDependencies.cmake: Prepend both CMAKE_PREFIX_PATH and CMAKE_FIND_ROOT_PATH with the QT_HOST_PATH (respective ${QT_HOST_PATH}/lib/cmake). Furthermore adding ${QT_HOST_PATH}/lib/cmake to PATHS argument makes sure that find_package will work even with NO_DEFAULT_PATH. Make sure not to match ShaderTools and Tools packages. ShaderTools is the cross-compiled package, the host package name is ShaderToolsTools. Tools is the cross-compiled module from qttools. Allow an opt out via a QT_NO_FIND_HOST_TOOLS_PATH_MANIPULATION variable in case that we accidentally match more packages ending in Tools that are actually cross-compiled packages. Fixes: QTBUG-95602 Change-Id: Ib0a787716fa529e36f22356da069e705d9eed5fa Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit d2359b2d4e5db6c42158d536d6e2a2af5ea1e59c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QVarLengthArray: add missing default-ctor documentationMarc Mutz2021-08-181-0/+5
| | | | | | | | | | Was lost when we un-explicit'ed the default ctor in c34242c679aaea6ee1badf6c1e5f274f925f5f50. Change-Id: Ifb4943b9e9647ae59c1cc6d5fc5076e8620b73ce Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 874c8c56a4883383e49a1e59262113f8eb29486f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Don't wipe NSWindowStyleMaskFullSizeContentView if set manuallyTor Arne Vestbø2021-08-171-1/+3
| | | | | | | | | | | The NSWindow may have style masks set by the user via winId(). We don't want to wipe those just because we're recomputing the style mask. Fixes: QTBUG-69975 Change-Id: Ibca8388d45b623f4cdfaff4b256c4eb012e2ffac Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit d627d351bedb96c727aa6e3b7cb2cc2d678c5606) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix Style java code format and warningsAssam Boudjelthia2021-08-173-536/+346
| | | | | | | | | | | The code had many bad formating and syntax or API usage warnings, as well as some unused methods or classes which are fixed with this patch. Task-number: QTBUG-71590 Change-Id: Ib113a0dc05703afb5190ec880b27daf75274cb1e Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit dc9075554135160bb07aa54708aba69d127160e2)
* CMake: Replace usage of WIN32 with CMAKE_HOST_WIN32 in qconfig.cppAlexandru Croitor2021-08-171-1/+1
| | | | | | | | | | | | | | The workaround of adding a drive letter to QT_CONFIGURE_PREFIX_PATH_STR should be done when running on any Windows host, not only when targeting Windows. Amends 59c3be711728ab0aa644bfdf50e91a1b020f95bb Task-number: QTBUG-87580 Change-Id: Ic6ca50aa58a4a54fb483e90fe61a907fe86cb002 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 6ef3d070a8bad0cfba98fa241a8676401f21371f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't crash in high-precision wheel scrolls on a QGraphicsProxyWidgetVolker Hilsheimer2021-08-173-4/+157
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For high-precision wheel scrolling sequences, the widget that gets the first (typically ScrollBegin) event grabs the wheel. Qt directs all future wheel events within the same sequence (i.e. until ScrollEnd) to that widget. QGraphicsView passes wheel events through to the item under the mouse, and QGraphicsProxyWidget implements wheelEvent to forward a synthesized QWheelEvent to the embedded widget. Since QGraphicsView's viewport has already grabbed the wheel, any forwarded event would end up back in QGraphicsView, resulting in infinite recursion (if the assert doesn't fail first in debug builds). The correct fix requires that QGraphicsProxyWidget knows that this is a high-precision wheel event, allowing it to adjust the wheel grabber temporarily to the embedded widget. However, QGraphicsSceneWheelEvent doesn't provide this information. To fix the infinite recursion, mark the generated event as synthesized by Qt (but still send it spontaneously to enable propagarion within the proxy widget hierarchy). In QApplication's notification routine, interpret such events then to override the wheel grabber. Add a test case for the various scenarios. This 6.1 compatible fix does not pass all situations. A follow up commit that introduces the missing APIs to QGraphicsSceneWheelEvent then fixes those as well. Task-number: QTBUG-95552 Change-Id: I78400ceae8da7a4e22a988c06ed58f99f1a979f4 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 4982c872efef7ce8673ed257dce24b971e456a08) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Accept the QWheelEvent before each propagation stepVolker Hilsheimer2021-08-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | Input events in Qt are accepted when constructed, and ignored by the default event handler (so overriding the event handler is enough to accept an event). Since we use the same QWheelEvent instance for each propagation step, we need to reset the event to be accepted before each delivery so that an earlier child ignoring the event doesn't result in the event being ignored without explicit acceptance. Amends the refactoring of wheel event delivery in 92df790f46b3a8b17aec2f385d6472fd3f8647f6. Task-number: QTBUG-95552 Task-number: QTBUG-79102 Task-number: QTBUG-67032 Change-Id: Ib3f99792518364cf6e635cf4c6fda088051a7848 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> (cherry picked from commit 1653ae13db69a2e703a1b44d3e67b55e927a5eca) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Don't treat null-key as potential shortcut keyTor Arne Vestbø2021-08-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When mapping virtual keys and modifiers to their corresponding characters via a keyboard layout we may hit combinations that do not produce any characters. This can happen if there's no <key> element defined for the virtual key, or if the output attribute of the element is empty (despite the spec saying there should always be one UTF-16 code point in the output). https://developer.apple.com/library/archive/technotes/tn2056/_index.html When that happens QAppleKeyMapper::keyMapForKey() will map the combination to a null-QChar, resulting in the "key" being 0. We do not want to propagate this back to the QShortcutMap machinery, as QShortcutMap does not validate the keys coming out of QKeyMapper::possibleKeys(). In particular, it doesn't check the isEmpty() or count() of the QKeySequences it creates. And even if it did, QKeySequence itself seems to treat Qt::Key(0) + Qt::SomeModifier as a non-empty sequence, so passing on 0-keys would still give weird bugs. The user-visible result of passing back 0-keys is that QShortcutMap will treat it as a partial match for any incoming key combination (as long as some modifier is pressed that triggers the QShortcutMap machinery), which resulting in eating the key press. This compounded the issue in QTBUG-95471. Regression after fab3dfff7d53d496a31c5d2df972ddacfe861a4d. Task-number: QTBUG-95471 Change-Id: I2e51ec86f4df2a708e1757be827ab74859be3c8b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 99a4419647df14bf81d1837d22c9636957fd6257) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Map dead keys directly to their terminator when building key mapTor Arne Vestbø2021-08-162-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a key press comes in we may end up in QAppleKeyMapper::possibleKeys() as part of checking whether the key press should trigger a QShortcut. The function builds on QAppleKeyMapper::keyMapForKey(), which provides a map from the given virtual key to all the possible Qt::Keys that can be produced by applying different modifier key combinations. The map is built using the Carbon function UCKeyTranslate, that takes the current keyboard layout, virtual key, and modifiers, and produces the resulting characters. The function also maintains a running dead key state via one of the arguments. When mapping a dead key, the state variable will be updated to the current dead key state, which then affects the next call to the function (for the next key press). The problem is that we're not calling UCKeyTranslate for each key press. We are calling it in a loop, for a single key press, to build up a map of all the possible characters produced by varying the modifier keys. And in doing so, we are passing on the dead key state from one call to the next, even if these are for different modifiers. The result is that the first call, for the dead key, results in mapping to \0, as UCKeyTranslate produces no output, it only modifies the dead key state. And then the next call, for the next modifier key combination, results in mapping to a character that incorrectly incorporates the dead key state (resetting it in the process). What we really want is to directly map the initial modifier combination to the dead key terminator character, if one is defined. This is the character produced if the dead key state is cancelled, for example by pressing a key that's not defined in the dead key state. To achieve this we pass kUCKeyTranslateNoDeadKeysMask as the translate options to UCKeyTranslate, and always reset the dead key state before every call. Another common way to achieve the same result would be to call UCKeyTranslate a second time when detecting that the first call produced a dead key state, for example with a synthetic space key, to trigger the terminator output. But this can potentially fail if the space key actually has a defined output in the dead key state. Fixes: QTBUG-95471 Change-Id: Icdae7639fd9a641a86c9d6615679bd93d380ff5c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 853c350cca4e00d2f890672ad8144a55ad75541e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix button type to update coordinates when draggingCathy Park2021-08-161-1/+4
| | | | | | | | | | | | | A move position (x,y) can be delivered to the MouseArea only if button is Qt::NoButton during mouse move (dragging). Otherwise mouse move does not cause positionChanged in MouseArea. Task-number: QTBUG-95453 Change-Id: I298943dc4f6f30714e940f4029c62dd52c176b93 Reviewed-by: Jaeyoon Jung <jaeyoon.jung@lge.com> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 3727683bd5f57666926603b84bccdf24d3839c98) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix hidden API access for Android styleAssam Boudjelthia2021-08-132-833/+787
| | | | | | | | | | | | | | | | | | | | Use public API and attributes to retrieve part of the Android style values instead of using reflection to access hidden or private fields. This latter method, was throwing lots of warnings or exceptions at the start of apps making it big annoyance to deal with. This patch doesn't handle drawables though, so the "full" and "default" Android style will be somehow broken still for now. For that reason, the default style extraction method is set to minimal to avoid getting warnings about it, and Fusion style could be used for Widgets apps, and for QML apps, it's recommended to use the Material style from Quick Controls 2. Task-number: QTBUG-71590 Change-Id: If87895dc66751e23c9f4ea840e9f3e611aaa8833 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> (cherry picked from commit b5b9c264ddff6c6eebb08038d9d3f2282df5c0ec)
* Doc: Ensure deprecated APIs in Qt Sql are documented as suchNico Vertriest2021-08-131-18/+18
| | | | | | | | | Added \deprecated where needed Fixes: QTBUG-94585 Change-Id: Id6d1fee1bbb6f8194e90a494673edef34530482b (cherry picked from commit fbf836657f06f2f302aaaf6bb6416f19d979f2aa) Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* StyleSheet: Use rule for ComboBox in embedded QLineEditVolker Hilsheimer2021-08-121-6/+5
| | | | | | | | | | | | | | | | | | An editable combobox uses an embedded QLineEdit as an implementation detail. That lineedit should use the rules that are set for the combobox to render itself, similar to what was already implemented for the lineedit used in a QAbstractSpinBox. The containerWidget helper function provides the logic for identifying the container of the rendered widget, returning the QAbstractSpinBox or the QComboBox for an embedded QLineEdit. Use that method rather than duplicating the logic. Fixes: QTBUG-95631 Change-Id: I50bc92a62715608b11c2c923f8f9215f56bfd15e Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit adafa5ee1f37739f33f6417f27c8ee7308aaad9c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Ensure deprecated APIs in Gui are documented as suchNico Vertriest2021-08-1210-44/+70
| | | | | | | | Fixes: QTBUG-94521 Fixes: QTBUG-95310 Change-Id: I3d0418a3f7dca191a9068cc22627fe4deb7c53c5 (cherry picked from commit 111115bf8862b7cd1197c2ef8a4b475c882776d4) Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* CMake: Warn when using CMake 3.21.0 due to issue in AUTOMOC/AUTOUICAlexandru Croitor2021-08-111-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There can be cases where trying to incrementally rebuild an already built Qt will cause a ninja dependency cycle error due to incorrect dependency information created by AUTOMOC and AUTOUIC. Example error when building qtscxml tests ninja: error: dependency cycle: auto/scxmlcoutput/default/tst_scxmlcoutput_default_autogen/timestamp -> auto/scxmlcoutput/default/ids1.h -> auto/scxmlcoutput/default/tst_scxmlcoutput_default_autogen -> auto/scxmlcoutput/default/CMakeFiles/tst_scxmlcoutput_default_autogen -> auto/scxmlcoutput/default/tst_scxmlcoutput_default_autogen/timestamp Example error when building Qt Creator ninja: error: dependency cycle: src/shared/help/shared_help_autogen/include/ui_filternamedialog.h -> src/shared/help/shared_help_autogen/timestamp -> src/shared/help/shared_help_autogen/include/ui_filternamedialog.h Warn and advise to use a different CMake version instead. Change-Id: I6f529ba6a526663bc6ed699b1bfe8a9094129887 Reviewed-by: Craig Scott <craig.scott@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 06c2400f5d439ce1f1945833d9b1895eff843855) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix memory leak if eXIf has incorrect crcRobert Löhning2021-08-102-4/+19
| | | | | | | | | | | | | | Change eb6767 from upstream repo. Fixes oss-fuzz issue 23376. [ChangeLog][Third-Party Code][libpng] Fix for possible memory leak in libpng was backported. Change-Id: Id0c2f8b8bd60438ae8b5a61c83b6e50d55c6eb65 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 76e2409cc908d1fa6ee6c7ff61b699594244bf6c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_QSslSocket - replace an old certificateTimur Pocheptsov2021-08-102-88/+84
| | | | | | | | | | | Helped quite a lot with OpenSSL 3 not accepting some old algorithms. Task-number: QTBUG-95123 Change-Id: If4894fa86eba7b002465fa661d436ae6ea751989 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 33de5f6502254ffe51960714404b6330dab224d5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* xcb: add a timeout control when reading INCR propertyLiang Qi2021-08-101-2/+6
| | | | | | | | | | | | | | | | | | | | For the first call of QXcbClipboard::clipboardReadProperty() inside of clipboardReadIncrementalProperty() in getSelection(), it will get a XCB_NONE reply before the contents arrived via property change. Then we give a chance to read more. Manually tested with following setups: * examples/widgets/mainwindows/application with gvim(gtk3) * examples/widgets/widgets/imageviewer with GIMP 2.10.18(based on gtk2) and GIMP 2.99.6(based on gtk3 via flatpak) Fixes: QTBUG-56595 Done-With: JiDe Zhang <zhangjide@uniontech.com> Change-Id: Ib45f08464d39ad79137b1da99808c89b7dca2d08 Reviewed-by: JiDe Zhang <zhangjide@uniontech.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 02248eea5562c1df39ee23f195011afacc6759b0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QCompleter: QCompleter unexpectedly changes QLineEdit textTianlu Shao2021-08-101-0/+1
| | | | | | | | | | | | | | | | When qcompleter and qlineedit are used together, the currentcompletion() of qcompleter is its first item by default. Therefore, when qlineedit makes the initial value, then selects the text and enters, qcompleter will modify the default first item to qlineedit text. The judgment that completionprefix() of the completer is not empty is modified and added here, because completionprefix() is always empty when there is no match. Fixes: QTBUG-20894 Change-Id: Id47f7f4da0a93d03a4e7b056ec731615b0803d13 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Tianlu Shao <shaotianlu@uniontech.com> (cherry picked from commit 0ef190fcc429405200d9f6063851726fcfb75637) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Fix build with CMake master / 3.22Alexandru Croitor2021-08-101-1/+1
| | | | | | | | | | | | | | | | | CMake master / 3.22 introduced a behavior change in how conditions are evaluated in the while command. It is now consistent with how if() evaluates conditions. This caused an issue in Qt code where a "(" opening parenthesis was evaluated as part of the condition rather than as a string. Fix this by wrapping the evaluation of the variable in quotes. Change-Id: I70c26dc91394f4a14f7a26419df264a069dc7dc5 Reviewed-by: Kai Koehne <kai.koehne@qt.io> Reviewed-by: Craig Scott <craig.scott@qt.io> (cherry picked from commit eb2282605734152440e840777d1f8a0576e3c7a6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve docs for QFuture continuationsSona Kurazyan2021-08-102-49/+53
| | | | | | | | | | | | Replace phrases like "future has been running", "parent" with more precise descriptions. Fixes: QTBUG-95273 Change-Id: Ibd5a464007d41cc437da49ba250b9ea0a46078c6 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit d61820e5ab3176818b8a2326fa25d05a9f135244) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Refix for avoiding huge number of tiny dashesEirik Aavitsland2021-08-102-4/+35
| | | | | | | | | | | | Previous fix hit too widely so some valid horizontal and vertical lines were affected; the root problem being that such lines have an empty control point rect (width or height is 0). Fix by caculating in the pen width. Change-Id: I7a436e873f6d485028f6759d0e2c6456f07eebdc Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 84aba80944a2e1c3058d7a1372e0e66676411884) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Fix leaked NSMutableArray in applicationActivationChangedTor Arne Vestbø2021-08-081-1/+1
| | | | | | | | | | The +[NSObject new] method is a combination of alloc and init. Fixes: QTBUG-95619 Change-Id: I341f8a3958fb7a016cf4c346750ea6d46eeebe9f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit ab70aa362ee5dd5b1375b198dcd6d6445ab2daeb) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_QSslCertificate::verify - remove QSKIPTimur Pocheptsov2021-08-067-254/+121
| | | | | | | | | And re-generate certificates. Fixes: QTBUG-95429 Change-Id: Id970a0a9315d146d6dd1e66c9cff9b7d75657e2d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit e7ab17ade170a8fbc5061fffe5334b26cdc54ed3)
* QXpmHandler: actually limit characters-per-pixel to fourMarc Mutz2021-08-061-2/+5
| | | | | | | | | | | | | | | | | | | | The following code assumed, and all comments indicated, that the cpp variable was limited to a max of 4. Yet, as coded, cpp could be five, in which case the XPM would be corrupt, as the header suggested five characters-per-pixel while the data was formatted in only four. Add a warning and error out when we encounter this situation. [ChangeLog][QtGui][QImage] Instead of writing a corrupt file, rejects to write XPM files with more than 64^4 colors (more than four characters per pixel) now. Change-Id: I458873cf7d179ab2e2dacd4c17dc837d640591a9 Reviewed-by: Mårten Nordheim <marten.nordheim@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 71334c324e702c434d446e5fc329294c97b8516d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QXpmHandler: fix re-entrancy bug in xpm_color_nameMarc Mutz2021-08-051-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The xpm_color_name() function returned a pointer to a function-static buffer. This is infamously non-reentrant, and an actual problem, because we explicitly allow QImage operations (incl. saving to an .xpm) from non-GUI-threads. Fix by using the CSS pattern (Caller-Supplied Storage; also used in the QAnyStringView(char32_t) and QAnyStringView(QStringBuilder) ctors) to force the caller to allocate storage in its own stack frame. As a consequence, we re-gain re-entrancy, but the returned pointer is now only valid until the end of the full-expression, which necessitated simplifying one caller (sorry!). To see why said simplification is valid, observe that xpm_color_name() writes a (now-explicit) NUL into returnable[cpp] and the old code read max(cpp, 4) characters from xpm_color_name()'s result. NB: cpp can be 5, even though the code comments say otherwise! :( [ChangeLog][QtGui][QImage] Fixed a race condition when concurrently writing .xpm files. Change-Id: I36d7173d53839a52f5cdf58324474c1b32c71f33 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 73fabadcee71af858388fb245fccf4e96d4ead4e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QLibraryInfo: Add MSVC 2022Mårten Nordheim2021-08-041-1/+3
| | | | | | | | Change-Id: Ie66effde6832152ee2903c467269a2822ded6653 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 11476e5403c0f0ed997f0ecc9e5a82501441a667) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QFileSystemModel: cache the name filters regexpsGiuseppe D'Angelo2021-08-042-12/+33
| | | | | | | | | | | | | | | | | | | | | | In order to filter out file names based on the user's settings, QFileSystemModel used to have a loop that tested if a given file name matched one of the filters. The problem is that each filter (a wildcard) was converted to a QRegularExpression _inside_ the loop. This causes a quadratic behavior (number of files * number of filters). Instead, build the regexps once when the filters are set (or the case sensitivity is changed, as that affects the filtering), and simply _use_ them in the loop. Simplify and correct some related code as a drive by. Done-with: Jean-Michaël Celerier Fixes: QTBUG-95383 Change-Id: I6bc336364c145bb05793a8f867545d7715d35832 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> (cherry picked from commit 07057188e3e42246cf006b43963d0bdcdaa159f5) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* doCrypt() - check the error codesTimur Pocheptsov2021-08-031-1/+5
| | | | | | | | | Disabled (moved into the legacy provider) DES-CBC results in a crash, when setting key length. Change-Id: Ie0b49424f11d8042ebecebfd3b6346263f730551 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit b4942f7f0c56f2c5dcd783760a8c915463e8e744)
* Allow dragging of a floating dockwidget on macOS with a custom titlebarAndy Shaw2021-08-021-1/+1
| | | | | | | | | | | This amends 3224c6d7d150164241c13ccf7d47377a39c0a6bb to account for the case when the dockwidget is already floating. Task-number: QTBUG-70137 Change-Id: If8b345565b11b44beb3fb4b697cfe812c29c6396 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit ba3e1fe09b7d921985e21d857a1d566465095e69) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Stop relying on balanced CGDisplay reconfiguration callbacksTor Arne Vestbø2021-08-023-84/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We were using CGDisplay callbacks to determine when a screen reconfiguration had happened, and when it had propagated to changes in NSScreen.screens, so that we could update our QScreen view of the world. Unfortunately the CGDisplay callbacks were not deterministic enough to use as a signal for when a reconfigure had completed. Since we can't rely on NSApplicationDidChangeScreenParametersNotification either (it comes in too late), we're now resorting to updating our QScreens at every chance we get: - On every CGDisplay reconfiguration ending - On QCocoaWindow::windowDidChangeScreen() as a result of AppKit moving the window. - On NSApplicationDidChangeScreenParametersNotification - On QCocoaScreen::get() as a last resort Since the result of these updates are only reflected as QScreen property updates or QGuiApplication signals if a change actually occurred, it should be safe to update early and often. Task-number: QTBUG-77656 Fixes: QTBUG-80193 Change-Id: I98334a66767736d94ad2fcb169e65f0d8bc71a30 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> (cherry picked from commit 6e250179229ebe7e2a056ba0e363592f4d1f6972) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Bump versionJani Heikkinen2021-08-023-3/+3
| | | | Change-Id: I2ba0fdc4eb1259c623eeaf6014a71fa9dcc46439
* QLocalSocket: do not emit aboutToClose() twiceAlex Trotsenko2021-08-013-2/+3
| | | | | | | | | | This signal is emitted by the QIODevice itself, so we don't have to forward it from the internal socket. Change-Id: I85745f36d7a27d92f339a9184de3b6e5d46f6f34 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> (cherry picked from commit 21f3ff65b8df777b5726a68b09bbee39f1a893ec) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QIODevice: fix converting OpenMode flag in debug outputAlex Trotsenko2021-07-311-3/+3
| | | | | | | | | | | | | | Suppress error: src\corelib\io\qiodevice.cpp(791): error C2440: '<function-style-cast>': cannot convert from 'QIODeviceBase::OpenMode' to 'quint32' Change-Id: I6b6e94790942d3af62bc2f38afad97c0b3c80817 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> (cherry picked from commit 6e3897b9fa0e03c8fbb1e97341fd4109c5a31658) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix QString test compilation without QRegularExpressionIvan Solovev2021-07-301-4/+113
| | | | | | | | | | | | The QString itself can be compiled without QRegularExpression, but the tests do not check if they are supported or not. This patch fixes the issue by introducing the proper #ifdef guards. Task-number: QTBUG-91736 Change-Id: I797691f78a34d4f78a86af99c78bf06e26e846d1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 59df5dacd55b607ec1b59864cfcc8ab86d38d537) Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* QByteArray: extend unit testsIvan Solovev2021-07-292-27/+687
| | | | | | | | | | | | This patch introduces some test improvements to check the calls of different methods on an empty default-constructed string. Apart from that, many other tests are added to extend code coverage. Task-number: QTBUG-91736 Change-Id: If86ef3d8611a678798b1bcc60a1a4f5598fd2179 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 08a1bcfa9b6672d0b71f5b3de0d6c58a8f549ea1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QByteArray: fix indexOf/lastIndexOfIvan Solovev2021-07-292-9/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixed two bugs in indexOf/lastIndexOf: 1. The lastIndexOf(char, qsizetype) overload was crashing with an empty QByteArray. It was unconditionally calling lastIndexOfCharHelper() which assumes that this QBA is not empty. An explicit check for the empty case is added. 2. The indexOf(QByteArray, qsizetype) overload was behaving incorrectly while searching for an empty QByteArray. In this case it unconditionally returned its second parameter (from). However, from can be negative, or even exceed the size of this QByteArray. This patch handles this cases properly. As a drive-by: this patch adjusts the QByteArray::indexOf(char, qsizetype) and QByteArray::lastIndexOf(char, qsizetype) overloads to match with the QByteArrayView implementation. This is done to have similar code paths in both cases and avoid tricky bugs in future. Ideally we had to adjust the QByteArrayView implementation, but it's fully inline, so can't be changed without breaking BC. Task-number: QTBUG-91736 Change-Id: Iaef2fdc5b99cce6aa342cca2d17544a1ad7ca677 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit e150bcfe4d5514b2a2960234049c514bc558adee) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* tst_QSslCertificate::verify - skip auto-testTimur Pocheptsov2021-07-291-0/+2
| | | | | | | | | | | as a temporary fix for suddenly expired certificates situation (to be regenerated). Task-number: QTBUG-95429 Change-Id: I00ad11cfd8824eeeffa2991dfcda6a7899726953 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 8d0e4a2e5c3627e2fd88f14ccc8b349668012685) Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Doc: Fix typo Ctr -> CtrlAlexander Volkov2021-07-281-1/+1
| | | | | | | Change-Id: I89c9526aa74b312dd67a6d194395b3298bbc31fe Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 0a8aa8c23e84ef5918dda15a9af9d582d5bfd9a1) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* [qgenericunixservices] Consider kde-open5 for opening URLsNicolas Fella2021-07-281-0/+2
| | | | | | | | | | | | | | When xdg-open is not found the KDE-specific kfmclient is considered. That however is part of Konqueror and may not be present as well. Plasma offers another option, kde-open5, which should be considered before falling back to webbrowsers. This is particularly for non-http URLs like tel: where opening in a webbrowser is not wanted. Change-Id: I2b606562e21568fbe43f4593de67a1d467918cc4 Reviewed-by: David Faure <david.faure@kdab.com> (cherry picked from commit 74a91773afa395ee0cefcdcd25bb3947b60a0b63) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QHash/QSet: fix squeeze() for default-constructed containerIvan Solovev2021-07-273-5/+11
| | | | | | | | | | | | | | | | | | | | | | QHash::squeeze() was unconditionally calling reserve(0), which is always allocating memory (even for 0 size). This was leading to a confusing situation when calling squeeze() on a default-constructed container with 0 capacity() actually allocated memory. This is very misleading, as squeeze() is supposed to free unneeded memory, not to allocate more. This patch adds a check for non-zero capacity. As a result, nothing is done for default-constructed container. Note that this patch also affects the QSet::squeeze() behavior, because QSet uses QHash as its underlying data type. Task-number: QTBUG-91736 Change-Id: Ib1c3c8b7b3de6ddeefea0e70b1ec71803e8fd3b3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> (cherry picked from commit b095d268788343b67a3995db7148dcc3af9bde1a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Don't report results when the results list is emptySona Kurazyan2021-07-274-0/+44
| | | | | | | | | | | | | | | | | | | When inserting items into the result store, a ResultItem is created, which stores a pointer to the results list and their size. If the size of the ResultItem is set to 0, it means that a single result is stored. In case of trying to report results via an empty list, the size is 0, so result store treats it as a single result. Added checks before storing the results to make sure that the result list isn't empty. Note that empty lists are allowed in some cases for the filter mode, because ResultStoreBase::addResults() knows how to handle those cases correctly. Task-number: QTBUG-80957 Change-Id: I399af4c3eef6adf82fea5df031fe9a9075006b1f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 08de1fb28153d8170b592796a84032897afa4206) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve fix for avoiding huge number of tiny dashesEirik Aavitsland2021-07-271-1/+1
| | | | | | | | | | Some pathological cases were not caught by the previous fix. Fixes: QTBUG-95239 Change-Id: I0337ee3923ff93ccb36c4d7b810a9c0667354cc5 Reviewed-by: Robert Löhning <robert.loehning@qt.io> (cherry picked from commit 6b400e3147dcfd8cc3a393ace1bd118c93762e0c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QCryptographicHash test: remove the moreThan4GiBOfData(SHA512) check from the CIMarc Mutz2021-07-271-2/+5
| | | | | | | | | | | It timed out the other day on the CI. Even the SHA-1 check took 137s (with a 300s timeout). Skip the SHA-512 test on the CI, but keep it for manual runs. Change-Id: I49792ac9bcab6512e1803f66cd986b2830e634c0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit c6e092a5f84b7fc72556897b50c7697152967925) Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Windows QPA: Fix coordinates reported through UI AutomationAndré de la Rocha2021-07-271-10/+7
| | | | | | | | | | | | | | | Conversion to/from native screen coordinates was incorrect and could fail for non-primary screens. This could cause a control's bounding rectangle to be incorrectly reported, or a search for a control based on its position within the window to fail, causing incorrect behavior with accessibility tools and other software interacting with the application using UI Automation. Fixes: QTBUG-91459 Change-Id: I5d56584ff26d977cdd34d35af46644e32aa11e7c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 0235c0217883bc9d0ca83c7533e9c0286901bb3c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QVarLengthArray: extend unit testsIvan Solovev2021-07-271-3/+341
| | | | | | | | | | | | This patch introduces some test improvements to check the calls of different methods on an empty default-constructed container. Apart from that, many other tests are added to extend code coverage. Task-number: QTBUG-91736 Change-Id: Icc1f1342738603c9bed065b2a36c72ea60b48962 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 7d49dc2222ddfd442face88c2243e28f5d26165f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QCryptographicHash: don't present the same data over and over againMarc Mutz2021-07-272-3/+85
| | | | | | | | | | | | | | | | | | | Need to decrement 'remaining' (check), but also increment data (meep). Testing is a bit complicated, as most algorithms are just too slow to fit into the 5min QTestLib timeout. Picked the fast ones and Sha512 (which completes here in < 17s, with threads), at least. Amends e12577b56396cca0df05f88f8787706a3a12c82d. [ChangeLog][QtCore][QCryptographicHash] Fixed a bug where presenting more than 4GiB in a single addData() call would calculate the wrong result(). Change-Id: Ic72916ebc33ba087d58225af6d8240e46e41f434 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 35453446a511366e1250858b249e36c80b6ad044) Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake: Keep public include header locations for internal module priJaeyoon Jung2021-07-261-1/+1
| | | | | | | | | | Amends f254d62cb1807d5bd9ee2e23ef64d4ca2d1b6809. Task-number: QTBUG-95303 Change-Id: Ica8d2850fe427b780d62cd9a9528f387a7ea1b79 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit c89a9ccbccdd7d6ceec669e7effec5786eb3f642) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Use namespaced variables in Qt6*Dependencies.cmakeLi Xinwei2021-07-264-96/+95
| | | | | | | Change-Id: I166988020cfd9750a4d58e519742215d0c03ad3e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit bd594f945773f713ca493fd7b040fde8a12bdf87)
* QLocalSocket/Unix: fix aborting the socketAlex Trotsenko2021-07-243-0/+8
| | | | | | | | | | | | | | | | | | | According to the documentation, calling abort() should immediately reset the socket to its initial state. This includes: - closing the file descriptor; - closing the QLocalSocket as an I/O device; - canceling a pending outgoing connection, if it exist; - reseting 'serverName' string. So, adding a call to close() resets the state entirely. Change-Id: I9c604b5187c6300b437d7aa4c2d06db03edacf21 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> (cherry picked from commit d9c0af92bd893e1f6a0b4c627300ea96a73aba55) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>