summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Avoid overflow in text layoutEirik Aavitsland2021-06-212-1/+16
| | | | | | | | | | | Fixes oss-fuzz issue 34597. Fixes: QTBUG-94197 Change-Id: Icabcd5a87b809b6a5ae0f1a696ec3b5dd906886b Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> (cherry picked from commit e473d96e65e7cf3190c6c16acace6359964d0bee) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Porting Guide: Mention that also QSet is affected by stability of referencesKai Köhne2021-06-211-2/+2
| | | | | | | | | | QSet is internally implemented by a QHash. Therefore the change in reference stability affects QSet, too. Change-Id: If1879d5a027211bca0beeff16ffbc77f2f4fce26 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit c2c15666b76516e5edfbe2a51226740b5a0bb4d3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix right-to-left text with DirectWrite engine + QPainterPathEskil Abrahamsen Blomfeldt2021-06-211-1/+2
| | | | | | | | | | | | | | | | | | When QPainterPath was used for RTL text, either directly or because the target text size exceeds 64 pixels, we would pass true for "isRightToLeft" to DirectWrite, causing it to do adaptation internally for this. But the RTL layout had already been handled by Qt, so we would essentially reverse the layout twice and also move the text to negative X coordinates. Passing false instead fixes this, as it will then just use the positions we pass in blindly. Fixes: QTBUG-94175 Change-Id: Ie9a47e56e97fc867ede10ab21ac5e3f003ddcacb Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 30399fb95cf8b528ac4b45766ac55c6f0a16e2f4) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add missing limits includeNicolas Fella2021-06-201-0/+1
| | | | | | | | | The code uses std::numeric_limits but is lacking the appropriate include Change-Id: I41fa5ac4d8c4e06f35b5b1551ef2ad8417df80bd Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> (cherry picked from commit 2b2b3155d9f6ba1e4f859741468fbc47db09292b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Apple: Use POSIX IPC instead of System V in sandboxed applicationsTor Arne Vestbø2021-06-199-17/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | System V semaphores are not supported in sandboxed applications, so when Qt is configured with App Store compliance, or the user requests POSIX IPC explicitly, we use that instead. https://developer.apple.com/library/archive/documentation/Security/Conceptual/AppSandboxDesignGuide/AppSandboxInDepth/AppSandboxInDepth.html#//apple_ref/doc/uid/TP40011183-CH3-SW24 As the shared memory name limit on Apple platforms is very low, we have to skip the existing logic for naming, and instead use a truncated hash of the key. This should still be fine for avoiding any collisions in practice. An explicit check for the ENAMETOOLONG error has been added to catch any cases where they key goes beyond the allowed length. Sandboxed applications also have an extra requirement that the key must include an application group identifier. This requirement has been pushed up to the user and documented, as we don't have enough information in Qt to know which identifier to use. Both tst_QSystemSemaphore and tst_QSharedMemory work as before with both sandboxed and non-sandboxed applications, after removing some assumptions in tst_QSharedMemory about System V behavior. Fixes: QTBUG-91130 Change-Id: Iaf1edb36a5d84d69e42ec31471a48d112faa8c6a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 9661cde1615e21f5b6bbffe3e687cacba247f514) Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move dependency lookup functionality to the common macroAlexey Edelev2021-06-196-51/+35
| | | | | | | | | | | Dependency lookup mechanism is the same for modules and plugins. It makes sense to wrap it using macro. Change-Id: I73727743b0f5f40b2d94624f65ebfcf85e8dcc59 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit ff4244b540e38c31a474ac23dc1b1696f35730ea) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Disable finalizers by default for the non-ld linkersAlexey Edelev2021-06-192-3/+19
| | | | | | | | | | | Check if link order matters before use the object library finalizer. Amends 5fb99e3860eb43f4bacacec7f4a4626cb0159b14 Change-Id: Ie996bc175ebea36ccda1bb2fe388ae3b7fcde395 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit cdbb390c4a9b8d53cfcfd0884e6720423ce5e126) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix the precompile_header configure testJoerg Bornemann2021-06-184-13/+94
| | | | | | | | | This configure test always failed, and its result was never used. Change-Id: I5112464b247efb5327ef5c23c96ef27168c11afc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 95de42212405aea45b17f2d9c500b6af097dee3e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix the naming of the config header files for private modulesAlexey Edelev2021-06-181-4/+11
| | | | | | | | | | | | | | | | | | Perform a file name of the config header before adding a '_private' suffix. TODO: It makes sense to revisit the use of the CONFIG_MODULE_NAME variable since the variable is used for different purposes and mutate with use. Amends 8aee7c6b29be5a0ee7d5e7cfcb5f2db762b2e28b Fixes: QTBUG-94568 Change-Id: Id5aaf8d423ec8b94afffe4641b54dab94b5453fb Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit ed92cb30e465c1dad704bd268646a4a69b1d448c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QEventDispatcherWin32: suppress old {FD_CLOSE|FD_CONNECT} notificationsAlex Trotsenko2021-06-181-3/+10
| | | | | | | | | | | As with other network events, we must also ignore these notifications until WM_QT_ACTIVATENOTIFIERS message is received. Fixes: QTBUG-82835 Change-Id: I0740bf22e8d1cb0e8b4eba7fc1a27ffe669973ff Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit fe6d84d96e67113846801803c3ba1f20b26e123f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Move the linking logic of the object libraries to a common functionAlexey Edelev2021-06-183-114/+154
| | | | | | | | | | | | | | | | | | | | The linking logic of object libraries should be reusable outside of the resource context. This introduces a __qt_internal_propagate_object_library function that prepares all the necessary genexes to link and propagate the object library to the end-point executable. Rename resource object finalizer API to make the naming more generic to object libraries of any kind. Amends 5fb99e3860eb43f4bacacec7f4a4626cb0159b14 Task-number: QTBUG-93002 Task-number: QTBUG-94528 Change-Id: I69d0f34c0dadbd67232de91035aaa53af93d1fa1 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 3329212815777e33dfb4697b748d10927d73f44c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS 11: Fix positioning of focus frame around comboboxVolker Hilsheimer2021-06-181-4/+8
| | | | | | | | Fixes: QTBUG-94069 Change-Id: I09079726c96a41f628ae55724cfe53dbc225d358 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit df316963213e765de5b94469622df48b0c9a9e6e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Do not alter a widget's backing window's format once createdLaszlo Agocs2021-06-182-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changing anything on a QWindow's QSurfaceFormat has zero and null effects once the underlying native window has been created. Letting QWidget update the format is wrong in this case, because we always expect that the value returned from QWindow::format() reflects reality. (reality being the settings with which the underlying native resource was created, which is typically frozen after QWindow::create(), not the state of some QWidget attribute. There are certain exceptions to this, such as when preparing to recreate the underlying native window, in which case one will want to update all relevant fields of the format based on the current values of the widget attributes, which is exactly what QWidgetPrivate::create() implements, and that's good.) Such a mismatch can have fatal consequences when OpenGL and friends are involved, but this always depends heavily on the platform and windowing system. For example, claiming that the alpha buffer size is 0 when the native window was created with 8, or vice versa, can break OpenGL-related code (both in Qt itself and in applications), that tries to create a QOpengGLContext configured based on what QWindow::format() returns. If that format describes settings that are incompatible with the actual underlying native window, we end up with the classic Invalid pixel format, EGL_BAD_MATCH, and alike errors. This is exactly what is happening when a QOpenGLWidget (or QQuickWidget) is placed in a QDockWidget where one of the ancestors is forced to native (winId() was called or WA_NativeWindow was set). When undocking, various code paths in QWidget will try to update the opaque flag of the widget, which in turn calls updateIsTranslucent. Now, if this function unconditionally changes the alphaBufferSize in the QWindow's QSurfaceFormat (even though this is completely futile to do, it has no visible effect in practice), we get the problem described above: rendering breaking down due to OpenGL contexts created with a pixel format incompatible with the native window. Prevent all this by not touching the format once the QWindow has a QPlatformWindow. This is the right thing to do, regardless of the bug in question: a window's (or context's or any other native resource wrapping class's) format must describe the underlying native resource and must never deviate, unless we are preparing to create a new native resource underneath. When it comes to the autotest, this changes the test added in 555661b625c40f21a6a3e4c73e928a6e8a46db20: the autotest logic is inverted because what we should test for is that the QSurfaceFormat stays untouched once the application makes a - futile - attribute change on the widget. Fixes: QTBUG-85714 Change-Id: I7bf90711867e8a0fd474895625bf9530a7821fd5 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit e6a969954a9e6865e5f662acd1d949561f8ef3be) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add GCC 11 and C++20 workaroundsGiuseppe D'Angelo2021-06-181-0/+11
| | | | | | | | | | | | | | | | | | | | | | GCC 11.1 has a bug [1] in the preprocessor that leads to -Wsuggest-override warnings being raised in random places, even under pragmas that are supposed to suppress it. For some reason, NOT using the integrated preprocessor fixes it, so add that flag as a workaround. Also, GCC 11 introduces a family of warnings for C++20's deprecations of mixed enum arithmetic, which we use all over the place. Avoid a hard error for those warnings. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100796 Change-Id: I3b2aefa385f191f207e7eb876bc1ed0b18fb342b Task-number: QTBUG-93360 Task-number: QTBUG-94059 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit f29ff5dffb7f9321d2bfb6071813d2d8d88186b3) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Use target OUTPUT_NAME as a module identifier in .pri filesAlexey Edelev2021-06-181-3/+1
| | | | | | | | | | | | | | | QtPriHelpers copies the logic related to the module OUTPUT_NAME to produce a module identifier. Since the module identifier should be equal to OUTPUT_NAME it makes sense to reuse the property and deduplicate logic. Amends 8aee7c6b29be5a0ee7d5e7cfcb5f2db762b2e28b Fixes: QTBUG-94568 Change-Id: I8d9c04273e4cdb1a2e6a3b0db3ddf52e008c0cf7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 29789ff0eabc2ea91a21526c475e5a8c0126a7af) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Move overrideCursor() from QApplication to QGuiApplicationSze Howe Koh2021-06-181-3/+3
| | | | | | | | | The transfer occurred in Qt 5 Change-Id: Id3428809d89c804112d9dc02f2a476cb03bd2c98 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit d254af915241c6ed5a6b590bfa8d27c7488f8a77) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Enable glyph cache workaround for Apple M-family of GPUsTor Arne Vestbø2021-06-181-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Without the workaround, and when using a Core GL profile, we hit a code path in QSGOpenGLDistanceFieldGlyphCache::resizeTexture() that produced corrupt glyphs on M1 hardware. We fix this by enabling the workaround, so that the user doesn't have to set QT_ENABLE_GLYPH_CACHE_WORKAROUND themselves. None-Core contexts do not have this problem, but the logic in QOpenGLContext does not account for recreated contexts with different formats, so we can't limit the workaround to Core formats only. With the unified memory architecture of the M1 hardware, the workaround should have limited negative effects. In Qt 6 this is not a problem, since Qt Declarative effectively always uses the workaround code-path, but it's worth recording the fact that we need the workaround. Fixes: QTBUG-89379 Change-Id: Icfd8b8b23c0dcda3fea8663d81d0e225134eec5e Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit aeeaa7d253239b4b45e419bcad5cfde5c5714080) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove old configure-related filesJoerg Bornemann2021-06-1816-10047/+0
| | | | | | | | | | | | | Remove the configure.json and configure.pri files that were used for the qmake-based configure. Remove the .prev_*.cmake files that were a by-product of configurejson2cmake.py. Task-number: QTBUG-89536 Change-Id: Ie827562f7fd2513d59f69234d77b8b93124ea78e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 7155e4f62060c3d9f36e748135bd57776f40b4b2)
* CMake: Handle OPTIONAL_COMPONENTS in qt_find_packageAlexandru Croitor2021-06-185-3/+37
| | | | | | | | | | | | | | | | | | | The optional components arguments were not handled before which caused the recorded package information for static builds to be incorrect, it only recorded the package name without the component. Remove REQUIRED_COMPONENTS TODO, there is no such find_package option, it's already handled by the regular COMPONENTS code path. Amends 07b6d3367debd8f15974abf0f5cdf48f0fe3a536 Fixes: QTBUG-94501 Change-Id: Ib48a7befcb70e20c3f21315897d51d3064b48134 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Dominik Holland <dominik.holland@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit b6c5e0667696c1d4abaf37f2224b2121b72cdebd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QHash: Fix erase() edge-caseMårten Nordheim2021-06-182-1/+23
| | | | | | | | | | | | | | | | | | | | | | When the element you want to erase is the last element AND the next element (element 0), when rehashed, would be relocated to the last element, this leads to the state below. Which is similar to a test in tst_qhash for some seeds. auto it = hash.begin + (hash.size - 1) it = hash.erase(it) it != hash.end By forcing the iterator to increment if we were erasing the last element we always end up with a pointer which is equal to hash.end Befriend the tst_qhash class so we can set the seed to a known-bad one Change-Id: Ie0b175003a2acb175ef5e3ab5a984e010f65d986 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit ea7d87b5b59ded22b145ecbb4dd648ecfd1abbdd) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Porting Guide: Mention deprecation of QLibraryInfo::locationKai Köhne2021-06-181-0/+2
| | | | | | | Change-Id: I998a4575ce7fb56ab51d49715071e682a440360b Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit b26988d0b51ac26867258ced00c465324032b855) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Porting Guide: Mention changed behavior of QCApplication::quit()Kai Köhne2021-06-181-0/+12
| | | | | | | | | Mention change of behavior introduced by 89f7a2759c6b in the porting documentation. Change-Id: I3c282362f5852cc7768e6655fc7b3901d68f2b10 Reviewed-by: Paul Wicking <paul.wicking@qt.io> (cherry picked from commit 3cbe11f93475a845e4e7849e1315570ea782e595)
* Fix recursion crash when calling setStyleSheet with `qproperty-styleSheet`Zhang Yu2021-06-182-0/+21
| | | | | | | | | | | | When calling `setStyleSheet` with property `qproperty-styleSheet`, `QStyleSheetStyle::polish` will call`QStyleSheetStyle::setProperties`, and then`QStyleSheetStyle::setProperties` goes on to call `setProperty`.Because there is property `qproperty-styleSheet`, it will update stylesheet by calling QStyleSheetStyle::polish`. This causes the recursive call to crash. Fixes: QTBUG-94448 Change-Id: I79c51192a939b0b62e5b1d0dcc90d38f79e28222 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> (cherry picked from commit e9cdcc7cb314586aec76b8b9979435f0af963443) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QBindable: Use setter in setValue for QObjectCompatPropertyFabian Kosmale2021-06-172-0/+42
| | | | | | | | | | | | | Directly writing to the underlying property storage has the potential of breaking all kinds of internal invariants. As we return QBindable in the public interface, we should not grant callers access to the internals of the object. Change-Id: I737ff293b9d921b7de861da5ae23356c17690b78 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> (cherry picked from commit 6b36e783521993df8de6477c789aa26c38803656) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix internal module naming in qmake .pri filesAlexey Edelev2021-06-172-1/+3
| | | | | | | | | | | | | | Set the correct value to the _qt_config_module_name property at the internal module creating step instead of appending _private suffix when generating .pri files. Amends 425ff34aa10a02524f2d52f544dc00b539ef9a26 Fixes: QTBUG-94568 Change-Id: I6fa8089358bc638668e313c98c3aee680bf7ec2a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 8aee7c6b29be5a0ee7d5e7cfcb5f2db762b2e28b) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Export info if an object lib target is a plugin initializerAlexandru Croitor2021-06-171-0/+5
| | | | | | | | | | | | | Needed for qtdeclarative so we can filter out which object library should go into which export set, because qt_internal_add_qml_module can create both a backing library export set and a plugin export set. The plugin initializer object lib should go to the plugin export set. Task-number: QTBUG-92933 Change-Id: I0fce131eff75a0b3090ac0fbb2a12ecfcba5e38d Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 5ec937115bc677a75525dfa9147c1763adbea50e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Add TODO to apply generalized object library linking approachAlexandru Croitor2021-06-171-0/+3
| | | | | | | Change-Id: I1ea368e81d8b055ef353a0f021f188b45588c937 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit a37957df5c1d3d8624fae2222734a127ec340a72) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Set the plugin class name for qml pluginsAlexandru Croitor2021-06-172-3/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | This is needed for a change in qtdeclarative to allow building the Q_IMPORT_PLUGIN-containing object library initializer of a qml plugin. Show an error if the qml plugin has no class name, it's needed for plugin initialization so it's mandatory to have a class name. Show an error if a class name is not found when computing the import macro for a plugin (both for a regular qt plugin and a qml plugin). When querying for the class name of a target, query both a Qt6:: prefixed target as well as a non-prefixed one, with the Qt one taking precedence. This is to allow querying the class name of user project created qml plugins. Currently regular qt user plugins don't use the object library initializer approach. This will likely be revisited in the future. Task-number: QTBUG-92933 Change-Id: I46417471a7d8b49651e6821f7b28e7a9d44c2557 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 602d26c38f3767be9bec25302c93fc155c4dce59) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Rename qt6_finalize_ios_app to be internalAlexandru Croitor2021-06-171-3/+2
| | | | | | | | | | | | | For now, it's not meant to be called manually. It's called in qt_add_executable automatically for iOS. Amends 4d838dae5a821e9e5f013ba1d5a494ece1b5180e Task-number: QTBUG-88763 Change-Id: I90dfcf86f53a3c8e48a813435f7400db232b21f4 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 51b8c81c84136d5e80a803b2248ed1d17ab43ef0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Remove old add_qt_gui_executable APIAlexandru Croitor2021-06-171-6/+0
| | | | | | | | | | | Repos should have migrated by now and the function should not be advertised as a public one. Task-number: QTBUG-88763 Change-Id: Ica5bc55670a17a28c0022f78c126a3a8a8ffdeb5 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 15c5f905072c28537586a070a5320201edeee316) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Don't generate .pri files for qml pluginsAlexandru Croitor2021-06-171-1/+5
| | | | | | | | | | | | | | | | | | We didn't do it in Qt 5 times and it was accidentally done for Qt 6. There's no reason to generate them, the .pri files are only meant to be used for regular plugins so a project can do QTPLUGINS += foo. That mechanism is not needed for qml plugins which use qmlimportscanner instead. Furthermore the pri contents didn't contain a class name, so they couldn't be used anyway. Change-Id: I6299fda21ece0f693a817ab558b45aa46b97e5ee Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 103c1bc7baf29dbc93fdffc81586c83225eeef1c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QList: more explicitly document capacity() shenanigansAndrei Golubev2021-06-171-3/+4
| | | | | | | | | | | | Due to capacity() reporting the size of all allocated space, this is somewhat inconsistent with what QVector::capacity() in Qt5 provided, due to Q6List being double-ended. So let's document this better Task-number: QTBUG-92941 Change-Id: Iba46389121e721a8d21f0344b154f41c2c245867 Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 976cf0152b52be5e30abf3b40cd80e072f0cbfd6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix SSE4.1, RDSEED requirement for clang-cl buildsAllan Sandfeld Jensen2021-06-173-30/+5
| | | | | | | | | | | | | | | A misunderstanding seems to have caused several files to be compiled with extra runtime arch options. We need to disable multi-target functions though, because it doesn't work with clang-cl headers. Task-number: QTBUG-88081 Task-number: QTBUG-88434 Change-Id: Ic5829540f9007428c80f9a7bd46af35540745ccd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit ada29a19cd4b995dfd3e3059ccdf360ba13de08c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Remove target specific flags from the linker capabilities checkAlexey Edelev2021-06-179-35/+20
| | | | | | | | | | | | | Remove target specific flags from static_link_order. Move the check to the common config.tests folder. Amends 5fb99e3860eb43f4bacacec7f4a4626cb0159b14 Task-number: QTBUG-93002 Task-number: QTBUG-94528 Change-Id: I1368075ec6bd1e743b2b89fd93143df38a278ec2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 13a4de6bf65d29a808ecd94b382ac0c1add9e0b3)
* Check the impact of static link order for user projectsAlexey Edelev2021-06-177-51/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For user projects we run the static link order check once 'find_package(Qt6 ...)' is called. If linker can resolve circular dependencies between static libraries and object files we set the _qt_link_order_matters property of the Qt::Platform target. This indicates the use of finalizers is not required and we may rely on CMake-base propagation of resource libraries and resource object files. If linker could not resolve circular dependencies depending on the _qt_resource_objects_finalizer_mode value: - Finalizer will be called and collected resource objects will be linked to the target directly. - Finalizer will be omitted and resource objects will be linked using the target_sources function implicitly. This only propagates resource one level up if consumer links the static library PUBLICly, but all symbols will be resolved correctly since object files are placed in the beginning of the linker line. In the CMake version 3.21 we expect that CMake will take care about the order of the resource object files in a linker line, it's expected that all object files are located at the beginning of the linker line. TODO: Need to confirm that the CMake 3.21 meets the expectations. Amends 4e901a2f99cbfda3b479253ea54b16f02e1c3aa5 Task-number: QTBUG-93002 Task-number: QTBUG-94528 Change-Id: Ia68976df8182d3d3007b90c475c1e3928a305339 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 5fb99e3860eb43f4bacacec7f4a4626cb0159b14)
* Doc: Remove mentioning of Qt::MidButtonKai Köhne2021-06-171-1/+1
| | | | | | | | | It's only Qt::MiddleButton in Qt 6. Change-Id: Ia68bad910c617993e30e3ed1e117192469ec50eb Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit 88b92f76ee977a8d0043134451c55cd28c041d8d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix crash in concurrent disconnectLars Knoll2021-06-173-21/+91
| | | | | | | | | | | | | | | This does not fix all data races that we have in the system yet. One major issue is the virtual disconnectNotify(), that can be called from any thread and thus is inherently problematic, as it can collide with the object getting destroyed at the same time in another thread. Task-number: QTBUG-88248 Change-Id: I9d841eb363b7e4f0de1657aeb8f5340d0fd55190 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 71b4d4f150bc3c904a5aceec37513ddc3cd1c150) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* cleanOrphanedConnectionsImpl: Allow to skip lockingFabian Kosmale2021-06-172-6/+26
| | | | | | | | | | | | This function is/will be used in a few places where we already have a lock. Temporarily unlocking and relocking invites all kinds of troubles. By adding a flag we can instead tell the function that we already hold the lock. Change-Id: Ibca089de61133661d5cd75290f2a55c22c5d013c Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> (cherry picked from commit 556fc646cfac4dca43a34f5c4a4f7e6e3ef9104d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QOrderedMutexLocker: Disable copy and provide explicit dismiss functionFabian Kosmale2021-06-171-0/+37
| | | | | | | | | | | | | | | | Copying a QOrderedMutexLocker is questionable, and would currenly easily lead to UB. Therefore we delete the copy ctor and copy assignment operator, and implement well-behaving move operators. In addition, provide an explicit dismiss method for cases where we don't want the locker to unlock the mutexes, as they have been manually unlocked (this could have been implemented previoulsy by using the copy assignment operator). Change-Id: If2a888710e1c74277b28fd3e2939ab26fff0c7ae Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 7fefce73284de4204d64c7e4129f39004a13cdad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Windows: Read page size and orientation from setup dialogVolker Hilsheimer2021-06-161-3/+28
| | | | | | | | | | | | | | | | | | | PAGESETUPDLG's hDevMode reports the page size and orientation selection of the user, so read that data to get accurate results. Otherwise, the page size of a landscape page wouldn't match any known page format, and we'd end up with a custom size that would not be valid for the preview, breaking the preview UI's orientation state. Reuse the helper from QPageSize to map Windows page size ID to our own enum. Fixes: QTBUG-93764 Change-Id: Ib9a848619e3ba8780264ad76ed43c4fffae6b07f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io> (cherry picked from commit 6ce44c53c7aa802b817b72d49de88e4da0181488) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Don't make example external projects depend on testsAlexandru Croitor2021-06-161-2/+12
| | | | | | | | | | | | | | | | | | | Only depend on the ${project}_src and ${project}_tools targets. This might exclude some non-obivous target dependencies, but we can adjust that if needed. This reduces the build.ninja file of qtbase + qtsvg form 341MB to 41MB when configuring with tests and examples, as well as reduces the processing time of calling ninja. Amends d97fd7af2bc5c89a0ad9e5fac080041b78d01179 Change-Id: I2860d8ae89728f33f6b73fede1335cd6d6290f78 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 335123f240c0b59cc62ad151dcf185160ef33696) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Mention resource name on which rcc is runAlexandru Croitor2021-06-161-1/+1
| | | | | | | Change-Id: I12189d7bf3fbe8544ae4c3478166515ea2759bec Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 906c84a9a3f71d333e8b0772f41aab5280ab5682) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Change some custom commands to mention the target nameAlexandru Croitor2021-06-161-3/+3
| | | | | | | Change-Id: I3a198c87ba2d71306478809095083694b65c7086 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 9297459900e5a44d4a9021e65f38345e04524566) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Fix rendering of text checkboxes when text is selectedShawn Rutledge2021-06-161-4/+8
| | | | | | | | Fixes: QTBUG-94532 Change-Id: I4343558dcec6149dcdcc0f7ca32c49fdc67452af Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit bc30d5624d59d523c4c31473cb64621ee5c43f9d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* macOS: Detect sandboxed state for command line appsTor Arne Vestbø2021-06-161-2/+2
| | | | | | | | | | | | | The documentation says that if we "pass a URL to the main executable of a bundle, the bundle as a whole is generally recognized.". By passing the executable instead of the bundle we include command line applications that don't have a app bundle folder (but have an embedded Info.plist). Change-Id: I3a2f145c1ec6e16607e9c04baf08678d5dea0b81 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 20f835329a35651c720b73a8d217e3b48ebd2fcf) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Promote all targets to global within a scope when possibleAlexandru Croitor2021-06-163-3/+39
| | | | | | | | | | | | | | | | | | | | | | | | | CMake 3.21 introduced a new IMPORTED_TARGETS directory property which we can use to promote all imported targets within a scope to be global. This would cover transitive non-Qt imported targets which the Qt build system does not know about and is thus a more complete solution compared to promoting only Qt targets. Run a finalizer at the end of the directory scope where find_package(Qt6) is called to promote all imported targets within that scope to global (when requested). The old promotion method is disabled when the CMake version is new enough. Task-number: QTBUG-92878 Task-number: QTBUG-94528 Change-Id: I533a3bd4186eba652f878ddd72c76118c2fd8bae Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 7f0f44f014c3ae211516fb2736401b8497dd426a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* CMake: Allow promoting the Qt libraries to be global targetsAlexandru Croitor2021-06-1612-17/+197
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | User projects can set the QT_PROMOTE_TO_GLOBAL_TARGETS variable to true so that the various imported targets created by find_package(Qt6) are promoted to global targets. This would allow a project to find Qt packages in a subdirectory scope while using those Qt targets from a different scope. E.g. it fixes errors like CMake Error at CMakeLists.txt:5 (target_link_libraries): Error evaluating generator expression: $<TARGET_OBJECTS:Qt6::Widgets_resources_1> Objects of target "Qt6::Widgets_resources_1" referenced but no such target exists. when trying to use a static Qt from a sibling scope. Various 3rd party dependency targets (like Atomic or ZLIB) are not made global due to limitations in CMake, but as long as those targets are not mentioned directly, it shouldn't cause issues. The targets are made global in the generated QtFooAdditionalTargetInfo.cmake file. To ensure that resource object libraries promoted, the generation of the file has to be done at the end of the defining scope where qt_internal_export_additional_targets_file is called, which is achieved with a deferred finalizer. Replaced all occurrences of target promotion with a helper function which allows tracing of all promoted targets by specifying --log-level=debug to CMake. Fixes: QTBUG-92878 Change-Id: Ic4ec03b0bc383d7e591a58c520c3974fbea746d2 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> (cherry picked from commit 561fc8107f38b93808343e35c62d7d06704f8eb6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Expose the "debug" build feature privatelyJoerg Bornemann2021-06-163-4/+4
| | | | | | | | | | | Consumers can now check the "debug" feature to determine whether Qt was built in the "Debug" configuration. Change-Id: I225125d38ded508e9792a730ce421b33bceacddf Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> (cherry picked from commit 3ca5b46e5da04672ed0eaeaa6a5b30673705e4c9) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Add missing qHash overload for INTEGRITYKimmo Ollila2021-06-162-0/+12
| | | | | | | | | | Fixes build issue "no instance of overloaded function "qHash" matches the argument list" on INTEGRITY Change-Id: Ia1273587840d55199846dc64d487d194f9a4d565 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> (cherry picked from commit 56ed35bd02e7c99f0d61f02013beefb32ad59b8e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Revert "Remove old Android code that have now has alternative public APIs"Jani Heikkinen2021-06-165-3/+2901
| | | | | | | | | This reverts commit ff7daa1c33b79d92837c1dca2f55089d8e5dbc80. Reason for revert: Breaks dependency update round now Change-Id: Ie52e9ac189e9516b27df389d6f624b22f939affb Reviewed-by: Antti Kokko <antti.kokko@qt.io>