summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* QComboBox/Fusion style: elide text when it's too longChristian Ehrlicher2021-01-231-1/+2
| | | | | | | | | | The fusion style did not elide a very long text in a QComboBox as it's done in other styles / non-popup mode. Fixes: QTBUG-86632 Pick-to: 6.0 5.15 Change-Id: I356a61809220d41717a9039d2b33dd706d034941 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove the QT_CMAKE_BUILD preprocessor defineJoerg Bornemann2021-01-222-5/+0
| | | | | | | | | | | | Qt is now always built with CMake. The "cmake" keyword for QtTest blacklists remains for now. Removal is tracked in QTBUG-90545. Change-Id: I0011d56176a07c82698b2eb9aa330e77efa6cd34 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* QProcess/Win: move pipe draining into QWindowsPipeReaderAlex Trotsenko2021-01-224-32/+89
| | | | | | | | | | | | | | | | | | ... where it belongs. To avoid the loop, introduce the drainAndStop() function, which allows QWindowsPipeReader to flush the pipe itself. It determines the number of bytes pending and blocks until the remainder of the process output is received. Note that the loop in drainOutputPipes() didn't actually have to interleave the two pipes (because we're presuming that the operations will finish instantly), so we don't do it now. Also, the code violated the API contract: 'true' was returned when the 'wrong' channel received data; this is now fixed as a side effect. Change-Id: I38ed4861a238e39e793c3716e856e5bfdeed3d74 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* QTestlib: Speed up comparison of qsizetypeFriedemann Kleint2021-01-224-0/+36
| | | | | | | | | | | | | Add a qCompare() overload for qsizetype, preventing it falling back to the slow code path pre-formatting expected/actual. toString() should use the correct format from the already present int-types (see macro TO_STRING_IMPL). Complements 94aa350621e8a5c4ad3b438c10fc1c0a9ed3bc8a. Task-number: QTBUG-38890 Change-Id: Ieb8cea7de086141a2c80f93b4c1be01572be96df Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Update TinyCBORThiago Macieira2021-01-2211-48/+114
| | | | | | | | | | | Updated to commit e6a4fa4862bcc3a6f6b07cf9d9b784d0ab6068b4. Pick-to: 6.0 Fixes: QTBUG-89650 Task-number: QTBUG-90214 Change-Id: I6edce5101800424a8093fffd15cdf6591cbf809d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* rhi: Pipeline cache load/saveLaszlo Agocs2021-01-2213-54/+574
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add QRhi APIs to retrieve and reload the contents of the "pipeline cache". The only API where there is a true pipeline cache is object is Vulkan (VkPipelineCache). For OpenGL, the other backend where we support this, it is simulated with program binaries. The Qt 5 style OpenGL program binary disk cache continues to work like before, but one has now the option to do things in a more modern, graphics API agnostic way, that leads to generating a single blob instead of a large set of files in some system location, allowing easier "pre-baking" of the cache content. It is expected that Qt Quick exposes the two new functions in form if QSG_RHI_ environment variables, thus allowing easy testing and cache file generation. As an example for the performance improvements this can give, consider Vulkan, where we do not have any existing persistent caching mechanism in place: Running BenchmarkDemoQt6.exe --scene flythrough --mode demo creates 18 QRhiGraphicsPipeline objects from Qt Quick and Qt Quick 3D. The total time spent in QRhiGraphicsPipeline::create() during application startup for these 18 pipelines is 35-40 ms on a given Windows (NVIDIA) system. When exporting the pipeline cache contents to a file, and then, in a subsequent run, reloading the cache contents, this is reduced to 5-7 ms on the same system, meaning we get a 6-7x improvement. The generated data is always specific to a given Qt version, RHI backend, graphics device, and driver version. Much of the implementation consists of adding and verifying the appropriate header to the blobs retrieved from the driver, to allow gracefully ignoring data that was generated with a device or driver that differs from the one used at run time. This should provide robustness, even if the Vulkan or OpenGL implementation is for some reason not prepared to identity and reject incompatible cache/program blobs. Fixes: QTBUG-90398 Change-Id: I67b197f393562434f372c7b7377f638abab85cb3 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QSsl: add a new private APITimur Pocheptsov2021-01-229-320/+767
| | | | | | | | | This is an abstraction for TLS backend and its factory, preparing to transition to plugin-based design. Task-number: QTBUG-65922 Change-Id: Ibe810e77fd1b715a6bea66cd3f44312b015ac274 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QSslSocket - introduce the API providing information about backendsTimur Pocheptsov2021-01-218-7/+516
| | | | | | | | | | | | | | This API gives the names of available backends and provides a basic information about features/protocols supported by those backends. Also, it has the 'loadBackend' functions which allow to select a particular backend (which are becoming plugins). At the moment, the implementation is still 'hardcoded', the follow-up patch will allow to select different backends in runtime. Task-number: QTBUG-65922 Change-Id: I05877de9c02857594e76b24d52e7578bdb01df69 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Add face support to texture fileJonas Karlsson2021-01-215-39/+85
| | | | | | Task-Id: QTBUG-76970 Change-Id: I3bbd43357c7fcce8949522b089a4572b948f08f4 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Fix separately building SQL plugins with CMake 3.16Joerg Bornemann2021-01-211-1/+3
| | | | | | | | | | | | | Also move the cmake_minimum_required call to the top of the file, because the line before already requires some policy settings, which is what cmake_minimum_required() is establishing. For the standard Qt build, we make sure to get appropriate policy settings by calling qt_internal_upgrade_cmake_policies(). Pick-to: 6.0 Change-Id: If97556a9dd00646e83957959d0f9f16916625160 Reviewed-by: Cristian Adam <cristian.adam@qt.io>
* SQLite: Update to 3.34.0Andy Shaw2021-01-213-730/+2030
| | | | | | | | | [ChangeLog][QtSQL][SQLite] Updated to 3.34.0 Fixes: QTBUG-90226 Pick-to: 6.0 5.15 Change-Id: I2a489bec1fee2bdee7ea474094ca3db308699753 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Hold references to zone IDs alive during useEdward Welbourne2021-01-211-2/+8
| | | | | | | | | | | | Restore holding of a getID() call's return in a QJNIObjectPrivate eliminated in commit 78cde1bfd94521bbe4972f31a79c959d0990ea77; this keeps the Java internal object alive for its lifetime, where it might otherwise be garbage-collected before we're done with it. Fixes: QTBUG-88610 Pick-to: 5.15 6.0 Change-Id: Id65b059012f7bd3377a6562c1b647feb75a13679 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* QProperty: Add private isAnyBindingEvaluating functionFabian Kosmale2021-01-212-0/+19
| | | | | | | | | | | | | | | | | To optimize certain operations, it can be useful to know whether we are currently evaluating a binding. For instance, we have properties whose storage is only alloctaed on-demand when they are set. However, we would also allocate them if they are used in a binding context, as we would otherwise not properly track the dependency. Using isAnyBindingEvaluating in the getter, we can detect this situation, and avoid the allocation if it returns false. This API is private for now, as it exposes some internals of the property system and should be used with care. As it needs to access the TLS variable, it also has a non-negligible cost. Change-Id: I373aabee644fe7020b2ffba7d6a0ad9a1e1b4ec0 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Gracefully reject requests for absurd font sizesEirik Aavitsland2021-01-211-0/+6
| | | | | | | | | Avoid overflows. Fixes: QTBUG-89899 Pick-to: 6.0 5.15 5.12 Change-Id: Ic1a83c1704fe20be3d032358dc91ee8e751f2281 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* QPushButton: fix drawing pushbutton with a menuChristian Ehrlicher2021-01-201-8/+9
| | | | | | | | | | | | | | | | | Drawing a QPushButton with a menu results in a clipped label text and a wrong aligned decoration and menu button. The position of the menu button was calculated wrong (spacing has to be subtracted since the start position is the right side). Also the text label alignment was done before it was adjusted for the menu button which results in an unaligned (in constrast to a pushbutton without a menu) label and decoration. Fixes: QTBUG-89619 Change-Id: I872d39ff2d8eb685fe6843e38c7f727868e1ee9a Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Funning <huangyub@uniontech.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* iOS: ensure we close the edit menu when the user taps outside the input areaRichard Moe Gustavsen2021-01-201-32/+50
| | | | | | | | | | | | | | | | | | | | | | | iOS used to close the edit menu automatically when the user tapped on the screen (even for menus shown explicitly using the UIMenuController API). Apperently this has now changed (probably as a part of [UIMenuController setMenuVisible:] being deprecated in iOS 13). So we now need to hide it explicitly. Because of this, we no longer close the edit menu if the user taps outside the input area. This patch will fix this by updating the logic in QIOSTapRecognizer to close the menu explicitly. There are some more details around when to show or hide the menu, which is commented on at the relevant places directly in the patch. Pick-to: 6.0 5.15 Fixes: QTBUG-90332 Change-Id: I336e3f4003817b39c7abf63f963fde1f3ef87c20 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* iOS: ensure we hide the edit menu while dragging on the selection handlesRichard Moe Gustavsen2021-01-201-0/+9
| | | | | | | | | | | | | | | | | | | | iOS used to close the edit menu automatically when the user tapped on the screen (even for menus shown explicitly using the UIMenuController API). Apperently this has now changed (probably as a part of [UIMenuController setMenuVisible:] being deprecated in iOS 13). So we now need to hide it explicitly instead. Because of this, the edit menu would be showing together with the magnifier class while the user was dragging on any of the handles. This patch will fix this, so that we close the edit menu explicitly whenever the user starts dragging on a handle. Pick-to: 6.0 5.15 Fixes: QTBUG-80298 Change-Id: Iff2032d64db1b582fa7f048c6a1f37ec8a1528af Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Make QStyle::proxy() always return the leaf proxySergio Martins2021-01-201-2/+4
| | | | | | | | | | | | | For example: fusion -> proxy1 -> proxy2 Now returns proxy2. Fixes: QTBUG-85556 Pick-to: 6.0 5.15 Change-Id: I2a60329f948b59ef7d0752d273bee3854a200547 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Long live QNetworkInformationMårten Nordheim2021-01-204-1/+759
| | | | | | | | | | | The plugins are meant to indicate what they do support, meaning users of QNetworkInformation can choose to not care about which plugin is used and rather just request what they want. Task-number: QTBUG-86966 Change-Id: Ie130e1791250ec2a4470e3ba7081d982654af06c Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Rasterizer: compute intersection factors only when neededEirik Aavitsland2021-01-201-7/+12
| | | | | | | | | Fixes oss-fuzz issue 29285 Pick-to: 6.0 Change-Id: I8f7e0bc898b119d153a36cef5a74371249ed7686 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> Reviewed-by: Robert Loehning <robert.loehning@qt.io>
* Fix QTzTimeZonePrivate::displayName()'s fallbackEdward Welbourne2021-01-201-1/+2
| | | | | | | | | It previously fell back on abbreviation, a very poor choice. The base class does better than that, so use its implementation instead. Pick-to: 6.0 Change-Id: I47cbfce815cd8b2b533d9c6aeebcf398e5852d02 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Generate Qt6EntryPointAdditionalTargetInfo independent of platformAlexey Edelev2021-01-201-7/+10
| | | | | | | | | | | Move AdditionalTargetInfo generation for EntryPoint target out of WIN32 specific block Fixes: QTBUG-90414 Change-Id: I8dc34c939f12ef2073de630d4440a0892d8be909 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 32734f351b076b8774c490c27ef18ddd2243dcaf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* iOS: Handle keyboard events when using an external keyboardAndy Shaw2021-01-2019-48/+274
| | | | | | | | | | | | | | | | | | This enables the two possible approaches for handling external keyboard events. While support still exists for before 13.4 then both approaches are needed. This ensures that all external keyboard events are handled as key events and passed on accordingly. Additionally, this accounts for possible shortcuts too, therefore a new function is added to QShortcutMap to aid that. As a result, code has now moved from QCocoaKeyMapper to be part of the gui/platforms/darwin part to make it easier to reuse this code elsewhere. Fixes: QTBUG-85727 Change-Id: I349af43468b03fd8dcb16adba02669974affe154 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* [Android] Fix Text select handle misplaced on fields inside QDialog issuesPekka Gehör2021-01-201-2/+2
| | | | | | | | | | | Get cursorPoint from a mapToGlobal with a cursorRectangle of the selected inputMethod Fixes: QTBUG-65229 Fixes: QTBUG-58503 Pick-to: 6.0 5.15 Change-Id: I89b056fa91c59d260f02164c9bd6672b5ada64d6 Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* QLocale: add a Q_CHECK_PTRGiuseppe D'Angelo2021-01-201-0/+1
| | | | | | | | | Avoid complaints from static analyzers that the pointer returned by malloc might be null. Change-Id: I3ec3ba03d0b5283dd569200a3040a5fe5990f763 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QVLA: add a Q_ASSERTGiuseppe D'Angelo2021-01-201-0/+1
| | | | | | | | | | GCC's -fanalyzer complains that `ptr` might be null. It's actually never null (by class invariant). Change-Id: I5660b1e766b2cfde3f042b8e87168987e7618591 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove debug outputEskil Abrahamsen Blomfeldt2021-01-202-3/+0
| | | | | | | Accidentally committed in d8602ce58b6ef268be84b9aa0166b0c3fa6a96e8. Change-Id: I553503720eace59a7bd510a7b9b2aba44c2242a1 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Correct item indent in checkable menus in stylesheet styleEirik Aavitsland2021-01-201-2/+2
| | | | | | | | | | Not only the checkable items need to be indented, but all items in the same menu, so that they line up. Pick-to: 6.0 5.15 Fixes: QTBUG-90242 Change-Id: I559005f753b5cd19eaeeeb6658178d62de93b4ef Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QSsl: fix OpenSSL DLL names for Windows on ARMCameron Gutman2021-01-191-5/+9
| | | | | | | | | | | OpenSSL adds an '-arm'/'-arm64' suffix to the DLL names when building for VC-WIN32-ARM or VC-WIN64-ARM. This needs to be accounted for in Qt to find the OpenSSL DLLs correctly. Fixes: QTBUG-89647 Pick-to: 5.15 Change-Id: Ibc9b81e06f8e64c0676f335e13024fa7fe3a4fa3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* macOS: Remove DontConfirmOverwrite workaroundMorten Johan Sørvig2021-01-191-9/+2
| | | | | | | | | | | | Does not work any more on recent macOS versions. As a bonus, Qt now handles file names which contain “___qt_very_unlikely_prefix_” correctly. Pick-to: 5.15 6.0 Task-number: QTBUG-39791 Change-Id: I944a68efa18edc72939d953ab32ecb53d8f8e1c4 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Fix build with GCC 11: include <limits>Thiago Macieira2021-01-192-2/+5
| | | | | | | Fixes: QTBUG-90395 Pick-to: 6.0 Change-Id: Iecc74d2000eb40dfbe7bfffd165b5dd3708b7a40 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Mark qBadAlloc as [[noreturn]]Giuseppe D'Angelo2021-01-192-1/+5
| | | | | | | | | | | | So that static analyzers don't get confused by its semantics. In builds with exceptions disabled, it's not actually called by client code (e.g. Q_CHECK_PTR will just terminate in that case), but we still need to make it not return -- add another path that callss std::terminate(), otherwise we'd have a noreturn function returning. Change-Id: Ia8c4ce3e9d971f1757e9c273051cb3dedf23c61f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Build fixes for GCC 11Ville Voutilainen2021-01-194-4/+4
| | | | | | | Task-number: QTBUG-89977 Change-Id: Ic1b7ddbffb8a0a00f8c621d09a868f1d94a52c21 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Android: Finish composing text before Key handlingBartlomiej Moskal2021-01-191-0/+11
| | | | | | | | | | | | If the sendKeyEvent was invoked, it means that the button not related with composing text was used. In such case composing text (if it exists) should be immediately finished. Fixes: QTBUG-85715 Pick-to: 5.15 6.0 Change-Id: Ifbca067805b8d20f6a90f95b27210595abed964a Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* Update QOperatingSystemVersion version names for AndroidAssam Boudjelthia2021-01-192-0/+40
| | | | | Change-Id: I88c7713cd75f84d11b303e0dad2093c7d5568bc4 Reviewed-by: Andy Shaw <andy.shaw@qt.io>
* Add missing since to QEvent::copy docsNicolas Fella2021-01-191-0/+1
| | | | | | Pick-to: 6.0 Change-Id: Idfadc1801b0e97a5030d2784a65ae658900efd12 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* control scrolling of QTabBar using StyleHintSophie Kums2021-01-195-9/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Mouse wheel/touchpad scroll signals sent to the tab bar trigger cycling through the tabs. In applications where the tab bar is close to "mouse click hotspots", the cursor may accidentally be left over the tab bar instead of the main content of the window. When the user wants to scroll up/down the main conten, the scroll signals are thus sent to the tab bar and instead of scrolling, the focus switches to another tab. This is confusing to the user, because not only does the application not carry out the desired action (scrolling through the main content), it jumps to a different tab. Two common examples of applications affected by this nuisance are Konsole and any kind of browser (file browser or web browser), where the address bar is right below the tab bar. Moreover, on macOS, scroll events do not have an effect on the tab bar widget of the native UI. Currently, the code makes use of preprocessor directives to achieve consistent behavior on macOS (`#ifndef Q_OS_MAC`). This patch implements the check of a StyleHint in order to determine if scroll events on the tabbar should have an effect. This approach is more consistent with Qt coding style than OS-dependent preprocessor directives and, in addition, makes the behavior configurable according to the user's preferences. [ChangeLog][QtWidgets][QStyle] Added SH_TabBar_AllowWheelScrolling as a style hint to enable/disable cycling through tabs using the scroll wheel. This defaults to true in all styles except the macOS one so there is no change in existing behavior. Change-Id: I99eeb5a1aab03cbc574fac7187d85a8a2d60cf34 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Adjust sql drivers documentation to cmakeAlexey Edelev2021-01-192-163/+195
| | | | | | | | Update sql drivers build procedure description. Fixes: QTBUG-89782 Change-Id: I152fad108e24d394c8d21adf95ce6dbd6e7d80bc Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Windows QPA: Fix blurry title icons with fractional scale factorFriedemann Kleint2021-01-191-1/+2
| | | | | | | | Request the icon pixmaps with DPR=1. Fixes: QTBUG-90363 Change-Id: I789a72e2ed3379c81c68e1074069823bf633cf2f Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Fix qt_add_big_resources with namespace buildsAlexey Edelev2021-01-191-0/+1
| | | | | | | | | | | | Add INTERFACE_COMPILE_DEFINITIONS of Qt6::Core to generated rcc object libraries. This propagates QT_NAMESPACE definition to the object library. Fixes: QTBUG-85620 Change-Id: I252d1aaee7b19a49bc321fdd271a5d85a34bf67f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* vkmemalloc: Silence clang warning about unused member varLaszlo Agocs2021-01-192-3/+43
| | | | | Change-Id: Id968fd2302e3ff7b4d1a20cd8dd1f4d789588511 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Update QVulkan(Device)Functions to Vulkan 1.2Laszlo Agocs2021-01-197-1903/+11933
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also needs improvements to qvkgen. What we get with this patch are the Vulkan 1.1 and 1.2 core API's additional 11 instance-level and 30 device-level commands present in QVulkanFunctions and QVulkanDeviceFunctions. All of these are attempted to be resolved upon construction. When the implementation does not return a valid function pointer for some of them (e.g. because it is a Vulkan 1.0 instance or physical device), calling the corresponding wrapper functions will lead to unspecified behavior. This is in line with how QOpenGLExtraFunctions works. The simple autotest added to exercise some Vulkan 1.1 APIs demonstrates this in action. The member functions in the generated qvulkan(device)functions header and source files are ifdefed by VK_VERSION_1_{0,1,2}. This is essential because otherwise a Qt build made on a system with Vulkan 1.2 headers would cause compilation breaks in application build environments with Vulkan 1.0/1.1 headers when including qvulkanfunctions.h (due to missing the 1.1/1.2 types and constants, some of which are used in the function prototypes). In practice this should be alright - the only caveat to keep in mind is that the Qt builds meant to be distributed to a wide variety of systems need to be made with a sufficiently new version of the Vulkan headers installed, just to ensure that the 1.1 and 1.2 wrapper functions are compiled into the Qt libraries. Task-number: QTBUG-90219 Change-Id: I48360a8a2e915d2709fe82993f65e99b2ccd5d53 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* ItemViews: Don't remove items on internal moveChristian Ehrlicher2021-01-182-4/+8
| | | | | | | | | | | | | | When an itemview only allows internal moving of items it can happen that the target accepts the drag'n'drop operation since it's out of the control of Qt (e.g. Recycle Bin or an other application). Due to the nature of a move, the original item is deleted. Therefore check if the internal move target is the same as the source and don't delete it otherwse. Fixes: QTBUG-86020 Pick-to: 6.0 Change-Id: I69de4b8d76d1b0f57338b402aee87580226cd6cb Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Correct string comparison in Android's IANA ID matching codeEdward Welbourne2021-01-181-1/+1
| | | | | | | | | | | | | | | | | | | | | It used QString.compare() and assumed it was returning a bool true on equality, when it actually returns an int that compares to 0 as the given strings compare. So it should use compare() == 0. This fixes several of QTimeZone's blacklisted tests on Android and a crasher, which we dodged with a QSKIP. Added an id-comparison to a test. Gave two local variables more informative names, made an early return into a QSKIP so it explains itself. Fixes: QTBUG-89905 Fixes: QTBUG-69122 Fixes: QTBUG-69132 Fixes: QTBUG-87435 Pick-to: 6.0 5.15 Change-Id: Icf18ed5a810143d6e65d36e34a70e82faac10b8e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Fix problems with offset-derived ids for QTimeZoneEdward Welbourne2021-01-182-15/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When creating a time-zone from a UTC+offset name that isn't known to the system, QTimeZone (since the fix to QTBUG-77738 in 5.15.0) falls back to constructing a suitable UTC-offset backend; however, the id of this is not guaranteed to match the id passed in to the constructor. In all other cases, the id of a QTimeZone does match the id passed to its constructor. Some utcOffsetId testcases had different id() than the id passed to the constructor, due to mismatches where a zone was constructed using the fall-back but the generated id included its minutes (as :00) or omitted its seconds. The omission of seconds is clearly a bug, but we also don't want to include :00 for seconds when it's not needed. So change QTimeZonePrivate::isoOffsetFormat() to accept a QTimeZone::NameType to configure how much we include in an id. Its callers other than the relevant constructor (from offset) still get minutes, even when :00, but will also get seconds added if that isn't zero; and the constructor from offset now gets the short form obtained by omitting all trailing zeros. Since all valid whole-hour offset names that do include :00 for the minutes field are in fact known standard offset names, the elision of minutes will only affect zones created by ID in the case of a whole-hour offset given without :00 minutes specifier, so these shall necessarily in fact get the ID passed to the constructor. Creating by UTC-offset with a name that specifies zero seconds will result in a QTimeZone instance whose id() differs from what was passed to its constructor (eliding the :00 seconds and potentially also minutes, if also zero) but this should be the only case where a QTimeZone's id doesn't match the one passed to the constructor, when constructed by id. Fixed inconsistency between the offset-constructor's declaration (taking offset as int) and definition (taking qint32) in the process. Added an id check to the utcOffsetId() testcase. Amended two tests of offset-derived time-zones' IDs, added comments to make clear how one of those differs from a matching standard name test and converted two uses of QCOMPARE(, true) to QVERIFY(). [ChangeLog][QtCore][QTimeZone] QTimeZone instances created by offset from UTC (in seconds) shall now only include minutes in their ID when the offset is not a whole number of hours. They shall also include the seconds in their ID when the offset is not a whole number of minutes. Pick-to: 6.0 5.15 Task-number: QTBUG-87435 Change-Id: I610e0a78e2aca51e12bfe003497434a998e93dc7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add new special QObjectPrivate::{connect, disconnect} for QMLAndrei Golubev2021-01-182-3/+52
| | | | | | | | | | | | | | | | Original QML-specific connection mechanism ignores the receiver argument and uses sender as receiver. This causes uncontrollable memory growth in certain cases as connections on receiver persist even after receiver is destroyed New connect() with receiver parameter uses underlying API correctly, disconnect is provided for the symmetry (not sure it's really needed) Task-number: QTBUG-86368 Pick-to: 5.15 6.0 Change-Id: I4580d75b617cb2c4dfb971a4dfb8e943e325572b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QVectorND: make some constructors explicitGiuseppe D'Angelo2021-01-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QVector2D has implicit conversions towards QVector3D/4D, and QVector3D has an implicit conversion towards QVector4D. Although in principle this is fine because it's not a data loss, it's still sketchy; for instance, it allows mixed operations to compile: vector2d + vector3d; vector4d - vector3d; vector3d * vector4d; // ! (Random observation: the conversion from QPoint(F) to QVectorND are actually already marked as explicit.) This is a leftover not done for Qt 6.0. I am not making these opt-out: having an implicit conversion here is outright *dangerous*, and any usage that fails to compile needs to be inspected to make sure it was the intended behavior. [ChangeLog][Potentially Source-Incompatible Changes] The QVector2D/3D/4D converting constructors from another QVectorND now explicit. This was done to prevent a category of bugs resulting from operations accidentally mixing QVectorND objects. Fixes: QTBUG-90327 Change-Id: Ifcd873f6a0d3fc10b9e68c935fe1f69f86a2340b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QLocale: Allow direct conversion to language, country, and script codesKai Köhne2021-01-182-2/+49
| | | | | | | | | | | | | | | | | | | | Currently the codes are only exposed in aggregated form, i.e. through name(), bcp47Name(). There are use cases though where you are only interested in either language, country, or script codes. One example is in Qt Linguist. This patch therefore exposes the static languageToCode(), countryToCode(), scriptToCode() methods that were so far only available in the private API also in the public API. [ChangeLog][QtCore][QLocale] Added static languageToCode(), countryToCode() scriptToCode() methods that convert enum values to the respective ISO code strings. Fixes: QTBUG-39542 Fixes: QTBUG-64942 Change-Id: Ib1d5c3293e2f53245ba4c1fc8159275bcb290080 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QVariant::fromValue<T>: require T to be copy constructibleFabian Kosmale2021-01-181-0/+5
| | | | | | | | | | | | | In Qt 5, QVariant::fromValue<T> would not compile unless Q_DECLARE_METATYPE(T) was used, and Q_DECLARE_METATYPE(T) would lead to a compile error if T were not copy constructible. In Qt 6, we do not require Q_DECLARE_METATYPE before using fromValue, and QMetaType itself works with non-copy constructible types just fine. However, QVariant still requires it, thus we need to now enforce this in fromValue itself. Change-Id: Ib6964a438d8c46033dd3a037b9d871de2b42e175 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QUntypedBindable: Add documentationFabian Kosmale2021-01-181-0/+113
| | | | | | | Task-number: QTBUG-89505 Change-Id: I4428c3c0eb723e996195f6f6f5ac736757cea33e Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>