summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove the unnecessary compile-time check for recursive QSetSona Kurazyan2021-10-211-2/+0
| | | | | | | | | | | | It doesn't make sense to have a recursive QSet with deleted operator==, since it's not possible to add elements to it. Consequently declaring a metatype for it also doesn't make sense. Remove the commented compile-time check for it. Task-number: QTBUG-96257 Change-Id: I74ebefb38adcbe36d5c2f317188743e1f37fe16d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* TLS plugin (OpenSSL): don't use the deprecated functionsTimur Pocheptsov2021-10-214-26/+58
| | | | | | | | | | | If we have OPENSSL_NO_DEPRECATED_3_0 defined. This includes RSA, DSA, EC and DH-related APIs. As of now, we only make sure the code still compiles. Pick-to: 6.2 5.15 Fixes: QTBUG-83733 Change-Id: Id455b851421ce0dcdfb0229fa515ba2b2ed690b1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Fix inconsistencies between advanceWidth and bounding rectsAllan Sandfeld Jensen2021-10-214-117/+75
| | | | | | | | | | | | | | | | Unify the logic in QTextEngine Ensure tightBoundingRect, and the FreeType boundingRect, calculates from the shaped x offset when calculating the max x coordinate for a glyph. Fixes: QTBUG-7768 Task-number: QTBUG-70184 Task-number: QTBUG-85936 Task-number: QTBUG-94023 Change-Id: I6daafb25c79158dc7e777529abb5e8d3a284dac0 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* androidtestrunner: make sure that system-user is usedBartlomiej Moskal2021-10-211-1/+10
| | | | | | | | | | | | | | | | | | | | | | | It happens on Android Automotive emulator, that output file is in other directory. According android spec [1]: "If a default user isn't specified, each adb subcommand has a different user. The best practice is to retrieve the user ID with am get-current-user and then explicitly use --user <userId> for any command that supports it." That is the reason why output file can be found in /data/user/USER_ID/PACKAGE_NAME directory. Checking path related to current user was added as backup solution. [1]https://source.android.com/devices/tech/admin/multi-user-testing Pick-to: 6.2 Change-Id: Id7e6ddef74f4f20b7469a07bba6a71d3622c4e20 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Move the ABI tag from minimum-linux.S to qlibraryinfo.cppThiago Macieira2021-10-214-111/+44
| | | | | | | | | | | | | | | We don't need the assembly file any more. According to a comment to patchsets 2 in the Gerrit code review for commit bb8a61866ec6a6de2426012f8c4219d41b3a414a, the section ended up as SHT_PROGBITS instead of SHT_NOTE. I didn't know then that the section type is not actually important, only whether it's present in the segment pointed by a PT_NOTE is. That isn't recorded in the review. Since we now depend on the linker properly placing the .note.* sections for Qt plugins, we can rely on this working. Change-Id: Icb2516126f674e7b8bb3fffd16ad659149e34a23 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Doc: QByteArrayMatcher: add note that the pattern must remain on scopeThiago Macieira2021-10-211-4/+9
| | | | | | | | This issue bit me. The API is surprising and very un-Qt-like... Pick-to: 6.2 Change-Id: I2bbf422288924c198645fffd16aa1c58d921bd7e Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QFactoryLoader: continue the port from JSON to CBORThiago Macieira2021-10-206-28/+52
| | | | | | | | | | | | | | This continues the effort from the previous commit, by not passing through the JSON conversion at all, and simply using CBOR directly. The port in qtbase is complete, but in order to support the conversion in other modules without introducing breakages, there's a temporary class used for converting to QPluginParsedMetaData from QJsonObject. It'll be removed once all other modules have finished converting. Change-Id: I2de1b4dfacd443148279fffd16a3ed4ddaf34afc Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QPlugin: keep the CBOR data as CBORThiago Macieira2021-10-206-78/+110
| | | | | | | | | | Since QJsonValue and QCborValue use the same backend, we may as well use the CBOR frontend classes, which means we avoid an unnecessary conversion until later. Change-Id: I2de1b4dfacd443148279fffd16a3e2f56cd74c0b Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Remove WIN32 and MACOSX_BUNDLE arguments when building Android binaryAlexey Edelev2021-10-201-1/+1
| | | | | | | | | | This fixes the regression introduced in Android multiabi changes. Amends 0a02d845559e4fd9d1bd72942c5118f3bb1307bf Task-number: QTBUG-88841 Change-Id: I09e129361eb760cdc14c2302e821ce4fcbf117c3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* macOS: Wake up event dispatcher after running modal dialog helpersTor Arne Vestbø2021-10-203-0/+14
| | | | | | | | | | | | | The root event loop may have been exited, so we need to ensure the event dispatcher is woken up so it can evaluate whether it should continue or not. For most applications this happens automatically when e.g. the user moves their mouse or press a key, but for tests this may not be the case, and the test will stall and never exit its event loop. Pick-to: 6.2 Change-Id: Ic241e3f1045481c34150289ff711b921addb18e4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Centralize maybeLastWindowClosed checking in QWindowTor Arne Vestbø2021-10-208-41/+59
| | | | | | | | | | | | | | | | | Instead of plumbing QWidgetWindow close events via handleCloseEvent, we just implement closeEvent directly. This allows QWindow do save the state of the window/widget before the close event, so that we know whether we should trigger lastWindowClosed handling, even if the window was deleted as a result of the close event. This also relieves QGuiApplication and QApplication from dealing with the close logic in their notify functions, so that these functions can focus on the propagation of events -- not how the event is handled. Change-Id: I8b586b53a53b1df1d8630c1acb635c60f191bb4b Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make QMainWindow::restoreStateSizeChanged test less time sensitiveVolker Hilsheimer2021-10-201-2/+29
| | | | | | | | | | | | | | | | | Amends 32edae5e268b968aff82f0713612eff2feffb4e1, which introduced a timeout after which the restored state is discarded. If this timeout hits during a CI run, then the test is expected to fail. Implement a lambda that watches for the restored state to disappear. This happens primarily when restoring a fullscreen state, where some desktop environments scroll in a new virtual desktop. It should not happen for other data tags. Change-Id: I5ff43a4e1857eca17a5d4fe2b47add1f70636e8d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
* QDateTime: Limit string processing to known boundariesMårten Nordheim2021-10-201-6/+18
| | | | | | | | | | | We were treating the input as if it was always reasonably good. Since we know the max boundaries anyway lets just stop processing when those are reached Fixes: QTBUG-97489 Change-Id: Ibb78d6d51ad58454b2007ab46d54116ca0be5448 Reviewed-by: Robert Löhning <robert.loehning@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* SSL: Update documentation wrt backendsMårten Nordheim2021-10-201-8/+31
| | | | | | | | | Mention the platform-specific backends and add a section on packaging Pick-to: 6.2 Fixes: QTBUG-97532 Change-Id: Ice78e32e81a719ccf237625e542d620662d3073e Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QNI: Windows: support transportMediumMårten Nordheim2021-10-204-1/+102
| | | | | | | | | | | | | Brings support for transportMedium to NetworkListManager backend. Which, with this patch, also uses winrt API because there is no equivalent API available in NLM. This API is so much nicer than NLM... Task-number: QTBUG-91023 Change-Id: I360a3a197caa2aa4848c8f768aea6a09a68b0ed5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Fix metatype declaration for QHash/QMultiHash with no operator==Sona Kurazyan2021-10-202-12/+18
| | | | | | | | | | | | | | | | | | | | | | | When declaring metatypes, the metatype system tries to detect if the comparison operators for the given type exist and automatically register them. In case of QHash, the equality operator was enabled if the value type provides one. But the implementation needs equality operator of the key type as well. As a result, when the key type has no equality operator, the metatype system detects that the equality operator is available for the QHash itself, but the compilation for metatype registration fails when trying to instantiate the code that uses equality operator for the key. This is fixed by enabling equality operators for the QHash only when both the key and value types provide one. The same issue existed also for QMultiHash, with the difference, that QMultiHash didn't have the constraints even on the value type. So added checks for both. Fixes: QTBUG-96256 Pick-to: 6.2 Change-Id: Ib8b6d365223f2b3515cbcb1843524cd6f867a6ac Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Help the compiler avoid duplicate TLS lookupsUlf Hermann2021-10-201-2/+4
| | | | | | | | | Most compilers are clever enough to optimize this out. Yet, even with optimizations disabled, we don't want to do two TLS lookups here. Change-Id: I822954c7cec591084d6c27c916818dab7e000ea9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Optimize QObjectCompatProperty::notifyUlf Hermann2021-10-203-25/+44
| | | | | | | | Do the check for inBindingWrapper() last. Change-Id: I3d589c9fba524f465e35cd4cc0e65e3af376b419 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QObjectCompatProperty: Add support for custom gettersIevgenii Meshcheriakov2021-10-204-12/+87
| | | | | | | | | | Add additional template argument to QObjectCompatProperty to specify a custom getter. This may be useful for classes like QAbstractProxyModelPrivate the need to customize property getters. Task-number: QTBUG-89655 Change-Id: I34fe4bdebbbf1446aff60bd20a946454607f52d5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Make QDir::mkpath() return true when given an existing root pathKarsten Heimrich2021-10-202-4/+6
| | | | | | | | | | On macOs with APFS mkdir sets errno to EISDIR, so take the error code into account. Pick-to: 6.2 Fixes: QTBUG-97110 Change-Id: I8e7d10c95430a2802bdbfbf94dd65219bd9071a7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make QDir::mkpath() return true when given an existing drive nameKarsten Heimrich2021-10-202-1/+6
| | | | | | | | | | | | Commit ed48391c592e8ba68c723e3017ac384f0c7a7c23 removed the check for ERROR_ACCESS_DENIED reported by the Windows CreateDirectory(...) function in case an existing windows drive name was passed as argument. This restores the behavior of the function which broke after 5.15. Pick-to: 6.2 Fixes: QTBUG-85997 Change-Id: Ie86188100766f7364acee57b15a250f4a2720b9f Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Compile Private API autotests for INTEGRITYTatiana Borisova2021-10-202-4/+2
| | | | | | | | | | | | | | | | | | | | | - GHS's __PRETTY_FUNCTION__ (used by QT as Q_FUNC_INFO) doesn't have spaces round the = operator when indicating the type of the template parameter. The compilation error: qt5/qtbase/src/corelib/kernel/qmetatype.h", line 2104: note #3316-D: cannot access position 53 in array of 49 elements constexpr const char *begin = func + prefix; ^ detected during: instantiation of "auto QtPrivate::typenameHelper<T>() [with T=void]" at line 2186 Task-number: QTBUG-97087 Pick-to: 6.2 Change-Id: I33e61f5d54a61944a5aecf07d149a8dee0ef1e5d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add missing LIBRARY DESTINATION for examplesAlexey Edelev2021-10-203-0/+3
| | | | | | | Pick-to: 6.2 Fixes: QTBUG-97629 Change-Id: I5b32824693206926de9b4ee6637749a1814fdde7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* uic: Fix missing Python import when setting tab ordersFriedemann Kleint2021-10-202-2/+3
| | | | | | | | | Add QWidget as default import so that QWidget.setTabOrder() is found. Pick-to: 6.2 Change-Id: I7593008d1395e3fddacf7124d271a0eaf4c345d9 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
* CMake: Fix rpath-link dependencies when cross-compilingAlexandru Croitor2021-10-201-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Private Qt module dependencies of a Qt module are recorded in the IMPORTED_LINK_DEPENDENT_LIBRARIES property of a Qt module. This property is used to compute the runtime dependency dir path to be passed to the linker via the -rpath-link option. If the referenced target does not exist in the scope where it's used, no -rpath-link will be generated (or at least that specific dir path won't be passed). The linking operation will either fail saying the library is not found, or a different version of the library might be silently picked up in the sysroot or other implicit lib dir. Make sure that QtFooModuleDependencies.cmake calls find_package() for all Qt module private dependencies (or other Qt provided 3rd party libs in the Qt6:: namespace) so that the targets are in scope and IMPORTED_LINK_DEPENDENT_LIBRARIES does its job. qmake also records the INTERFACE_LINK_LIBRARIES of a private Qt module as the runtime dependencies of the module. It's not clear why it does that. A private Qt module is an INTERFACE_LIBRARY so it shouldn't add any new runtime dependencies. Nevertheless, the find_package part of that has been recently addressed in 2b6500cd15c0a41cf3e5eea8178e2044012dbd97 for a different reason. This change is basically the CMake equivalent of 326b91ea788b013512ae911c51cc19497d88916d Pick-to: 6.2 Fixes: QTBUG-86533 Change-Id: Iaf514a14acaded4e8752149cca0c159a271be188 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* RHI: use the flags we've just calculatedThiago Macieira2021-10-191-1/+1
| | | | | | | Caught by clang 13 detecting we set a variable but never used it. Change-Id: I8c6a0ff3ec184205a544fffd16af3d52b6f172a2 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Fix correspondence between QFileDialog::Option and ↵Alexander Volkov2021-10-193-4/+13
| | | | | | | | | | QFileDialogOption::FileDialogOptions It was broken by fe4a5a27e09b8109381e52aa1b71135a916dff1a. Pick-to: 6.2 Change-Id: I77da7ec9cdedc80a72b7f11980950a8bebfdaf3b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QtGui & its plugins: remove set-but-unused variablesThiago Macieira2021-10-192-6/+0
| | | | | | | | | Found by clang 13: qfontsubset.cpp:1211:10: warning: variable 'sumAdvances' set but not used [-Wunused-but-set-variable] Change-Id: Iea05060bc2c046928536fffd16adf500fb9bc8e5 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* MySQL: only set the charset if the connection has succeededThiago Macieira2021-10-191-13/+14
| | | | | | | | | | No point otherwise. But do it before trying to select the database, in case the database name has non-US-ASCII characters. Task-number: QTBUG-97054 Pick-to: 6.2 6.2.1 Change-Id: Iea05060bc2c046928536fffd16adf036367b07bb Reviewed-by: Liang Qi <liang.qi@qt.io>
* MySQL: fix the check for the return value of mysql_set_character_set()Thiago Macieira2021-10-191-2/+2
| | | | | | | | | It returns zero on success and non-zero on failure. Fixes: QTBUG-97054 Pick-to: 6.2 6.2.1 Change-Id: Iea05060bc2c046928536fffd16adf0177aadb082 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Rhi: Document expectation for setGraphicsPipeline's pipeline argumentChristian Strømme2021-10-191-0/+3
| | | | | | | | | The backed expect the pipeline to be valid, so document it and assert if the set pipeline is a null pointer. Pick-to: 6.2 Change-Id: I72b3d0d11b8dc98240d17e13adf2b6ccbd71891d Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Disable copy and move for QPropertyObserverNodeProtectorUlf Hermann2021-10-191-1/+4
| | | | | | | It's not intended to be copied or moved and static analysis complains. Change-Id: I2ac2eccadb66ea572cf297f16af693b15553a1b9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Don't render widget to backing store if its parent has graphics effectAntti Määttä2021-10-191-1/+14
| | | | | | | | | | | | If widget parent has graphics effect, it can't render directly to the backing store, because the backing store needs to be updated from the parents effect drawing instead of the widget drawing. Pick-to: 6.2 5.15 Fixes: QTBUG-96240 Change-Id: Ib9b55547f9e5538f32837ec9df45d29fa68d7c1b Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* RHI: suppress annoying warning about deprecated copy constructorsThiago Macieira2021-10-181-0/+1
| | | | | | | | | | | | With clang 13: vk_mem_alloc.h:4360:22: warning: definition of implicit copy constructor for 'VmaStlAllocator<VmaDefragmentationAlgorithm::AllocationInfo>' is deprecated because it has a user-declared copy assignment operator [-Wdeprecated-copy] vk_mem_alloc.h:4391:9: note: in implicit copy constructor for 'VmaStlAllocator<VmaDefragmentationAlgorithm::AllocationInfo>' first required here Repeats ad nauseam Change-Id: Iea05060bc2c046928536fffd16adf5181ede7abe Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QPluginLoader: use constexpr variables for detecting debug pluginsThiago Macieira2021-10-181-10/+14
| | | | | | | | | | | For MSVC it's clear that the plugin and Qt must match, since they would be linking to different runtime assemblies otherwise. For all other systems, including MinGW on Windows, there's no such thing. But we insist on MinGW debug-and-release builds matching. Change-Id: I3eb1bd30e0124f89a052fffd16a6aa52c7f8b9c0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Inline a few methods of QPropertyObserverPointerUlf Hermann2021-10-182-99/+111
| | | | | | | | This is necessary to optimize QObjectCompatProperty::notify in a second step. Change-Id: I89aaf51d39e04f17285f7db27f9b40d145fd846d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Allow negative delta for designer animation driverAntti Määttä2021-10-182-2/+6
| | | | | | | | | | | | The designer animation driver needs the ability to drive the animation both forwards and backwards. Pick-to: 6.2 6.2.1 Task-number: QDS-4910 Change-Id: Ie2b1855d062bb254b28b216328cb618d90ee8454 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io> Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Prevent recursive calls to QWindow::closeTor Arne Vestbø2021-10-182-0/+29
| | | | | | | | | QWidget will call close() in its destructor, which we might end up in if a user deletes the widget in the closeEvent. Pick-to: 6.2 Change-Id: I39684aec0ca130033dad60f2bbf823364a5edcec Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Update UCD to Revision 28Ievgenii Meshcheriakov2021-10-1833-7174/+9312
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This corresponds to Unicode version 14.0.0. Added the following scripts: * CyproMinoan * OldUyghur * Tangsa * Toto * Vithkuqi Full support of these scripts requires harfbuzz version 3.0.0, this version adds support for Unicode 14.0: https://github.com/harfbuzz/harfbuzz/releases/tag/3.0.0 With this release 10 test cases in tst_qurluts46 were fixed, one additional test case is failing in tst_qtextboundaryfinder and is commented out. In total 62 line break test cases and 44 word break test cases are failing. A comment in src/corelib/text/qt_attribution.json was updated to include the URL of the page containing UCD version number. Fixes: QTBUG-94359 Change-Id: Iefc9ff13f3df279f91cbdb1246d56f75b20ecb35 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* coin: Add instructions to generate docs during testingTopi Reinio2021-10-183-0/+76
| | | | | | | | | | | | | | | | | | | | A single configuration provides qdoc and qtattributionsscanner via provisioning. The environment variables instruct QDoc to run in testing mode; it ignores linking warnings (since we don't have .index files for external documentation modules) and terminates with non-zero exit code if documentation warnings exceed the limit set in the documentation config. The provisioned binaries are portable, packaged together with their dependencies. As they are installed under /opt, the instructions create symlinks to the binaries in the install directory before building the 'generate_docs' target. Pick-to: 6.2 Task-number: QTBUG-78069 Fixes: QTBUG-95554 Change-Id: I4a4765250247e2fc6eddd153c36cf8126ddd10ae Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* QProperty: Eliminate further unnecessary TLS operationsUlf Hermann2021-10-182-6/+13
| | | | | | | | | If we don't have a binding, we don't need to remove it. We can figure this out without TLS lookup. Pick-to: 6.2 Change-Id: I0cb20f2a68a119df7742631e307002e3813eac03 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QProperty: Don't needlessly calculate inBindingWrapper()Ulf Hermann2021-10-181-14/+14
| | | | | | | | | If there is no binding data, we don't need it. inBindingWrapper() involves a TLS lookup. Pick-to: 6.2 Change-Id: I829f314d708b80821e907124eef4aec758bbbc6a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Don't hide dialogs before closing themTor Arne Vestbø2021-10-181-1/+7
| | | | | | | | | | | | | | | | | | | When a dialog was accepted or rejected via done(), we used to only hide it, but as of 0246bfd40a2cc5ea9cfc035146e6dd865b334c68 we now close it. Closing a widget results in hiding it as part of handleClose, so we do not need to explicitly hide it before calling close(). In fact doing so prevents the lastWindowClosed logic from checking whether the window was visible before handling the close event, which is documented to be a requirement for a window triggering lastWindowClosed. We still need to hide the widget in case we don't end up closing it ourselves, to ensure QDialog::closeEvent accepts the close. The reason for the code in closeEvent seems a bit dubious, but that's left for future adventures. Change-Id: Ic32b965d495c08996c3a199bbee798df0206216c Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Decouple quitOnLastWindowClosed from quitLockEnabledTor Arne Vestbø2021-10-185-20/+159
| | | | | | | | | | | | | | | | | | | In a512e210ac5b032c5fc2edf1ddf72e5a414485fda512e21 quitOnLastWindowClosed was changed to be implemented in terms of quitLockEnabled, but without any documentation to that end. Although the two features are similar (automatic quit under certain conditions), and interact, it doesn't make sense to overlap them until we actually expose them as a single property (automaticQuit e.g.) The logic for determining whether we can can quit automatically has been refactored to take both properties into account, on both a Core and Gui level. The call sites still need to check the individual properties to determine whether to activate automatic quit for that particular code path. Change-Id: I38c3e8cb30db373ea73dd45f150e5048c0db2f4d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix indentation in inputMethodQuery implementationsTor Arne Vestbø2021-10-182-4/+4
| | | | | | Change-Id: I406194e084f62f16d432eae63845bcc3da148ac0 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Fix docs for comparison/debug/data stream operators of Qt containersSona Kurazyan2021-10-188-0/+161
| | | | | | | | | | | | | | Because of the constraints on comparison, debug and data stream operators, the return types for them look weird in docs. Conditionally use the actual return types, in case if Q_CLANG_QDOC is defined. Also add the docs of debug stream operators for types for which they were misssing. Task-number: QTBUG-97247 Pick-to: 6.2 Change-Id: I57f2c52bd3af805c7eeebb602c47de1e95ee09bd Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* sqldrivers: Fix typo in error messageJonas Kvinge2021-10-181-1/+1
| | | | | | Pick-to: 5.15 6.2 Change-Id: I6354275d04ee9474d4baeaaf0b14a52aca3dd70c Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Make sure Qt::Popup is treated like a dialogDavid Skoland2021-10-182-3/+2
| | | | | | | | | | | According to the documentation, Qt::Popup should have a proper frame with a title bar. To honor this, two functions had to be slightly altered. Change-Id: I4bbc18e6b7fbec5702fad6e22ef2226c09dea15a Fixes: QTBUG-94768 Pick-to: 5.15 6.2 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Fix cursor positioning on bidi boundariesVolker Hilsheimer2021-10-182-43/+132
| | | | | | | | | | | | | | | | | When the cursor is positioned between to script items that have different writing directions, prioritise the script item that has the same direction as the paragraph (i.e. the QTextEngine) when deciding where and how to display the cursor. If visual cursor movement is enabled, the behavior is unchanged. As a drive-by, clean up coding style and avoid shadowing of function- local variables. Task-number: QTBUG-88529 Pick-to: 6.2 Change-Id: I15227b10b1469d9caf1235b00e4d6f9f64a8b510 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix cursor placement at left and right ends of bidi textVolker Hilsheimer2021-10-182-26/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a text line that has a change of direction at either end of the text, the cursor needs to be positioned where the next character is inserted, or where backspace deletes the previous character. In bidi text, this is ambiguous as illustrated by this example: abcشزذ Depending on whether this string was typed in a left-to-right document or in a right-to-left document, it could be first latin, then arabic; or it could be first arabic, then latin. If a general left-to-right context, cursor position 0 should be in front of the 'a', and cursor position 6 should be at the end of the arabic text, in the visual middle of the line. Cursor position 3 can be either after the 'c' if the next character typed would be latin, or at the visual end of the line if the next character will be arabic. Qt calculated the cursor position past the right end of the text as 3 (which is not wrong, but 3 has two visual positions), and placed the cursor at the visual end of the line (favoring the right-to-left alternative). Backspace would then delete the 'c', writing a new latin character would insert a 'd' next to the 'c', writing a new arabic character would insert it also in the middle - none of these operations happen at the visual end of the line, where the cursor was blinking. To fix this, we take into account the general layout of the text, which is typically based on the document, or the user's locale setting and UI translation, and calculate the cursor position accordingly: if we are past the visual end of the document on either side, then the cursor position is either 0 or the last character of the text, depending on the direction of the QTextEngine used. This way, the cursor ends up in the middle of the document when we click beyond the end of the line, which is where characters are removed and inserted. Typing a 'd' at this point will make the cursor jump to the end, where the d is added. There are still corner cases: clicking on the right-most arabic character calculates the cursor position as 3, which is then ambiguous, as it can be either at the visual end of the string, or next to the 'c'. َQt makes the inconsistent choice to place the cursor at the visual end, showing the left-to-right indicator, but pressing a 'd' adds the 'd' after the 'c' in the middle of the text. Fixes: QTBUG-88529 Pick-to: 6.2 Change-Id: Idccd4c4deead2bce0e858189f9aef414857eb8af Reviewed-by: Lars Knoll <lars.knoll@qt.io>