summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* 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-203-20/+43
| | | | | | | | | | | | | | 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>
* 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>
* Fix metatype declaration for QHash/QMultiHash with no operator==Sona Kurazyan2021-10-201-6/+14
| | | | | | | | | | | | | | | | | | | | | | | 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-203-11/+31
| | | | | | | | | | 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-201-0/+2
| | | | | | | | | | 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-201-1/+1
| | | | | | | | | | | | 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-201-1/+1
| | | | | | | | | | | | | | | | | | | | | - 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>
* 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>
* 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>
* Update UCD to Revision 28Ievgenii Meshcheriakov2021-10-185-6594/+7031
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* 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>
* Decouple quitOnLastWindowClosed from quitLockEnabledTor Arne Vestbø2021-10-182-13/+30
| | | | | | | | | | | | | | | | | | | 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 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>
* Q_GLOBAL_STATIC: suppress warning about expressions in noexcept()Thiago Macieira2021-10-181-1/+4
| | | | | | | | | | | | | | We use a simple statement to try and mark the holder as noexcept and that works for most cases (but not all). It triggers a warning when the expression is complex, though, like this in qlocale.cpp: Q_GLOBAL_STATIC_WITH_ARGS(QSharedDataPointer<QLocalePrivate>, defaultLocalePrivate, (new QLocalePrivate(defaultData(), defaultIndex()))) Pick-to: 6.2 Change-Id: Iea05060bc2c046928536fffd16adf4be6126d039 Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QPlugin: Move the plugin metadata to a note in ELF platformsThiago Macieira2021-10-182-17/+249
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few systems, like OpenWRT, may strip the section table off the resulting binaries (see [1]), making it impossible for us to pinpoint the exact location of the Qt plugin metadata. This commit moves the meta data to a location that is identifiable even in fully stripped binaries: an ELF note. By naming our section ".note.qt.metadata", we instruct the linker to place it along the other notes and to mark it in the program header section. Another advantage is that the notes are usually in the very beginning of the file, as they are used by the dynamic linker itself, so we'll need to read much less of the full contents. The unit test is modified not to attempt to strip the plugin of debugging data. In fact, we add something to the end that would, otherwise, be matched as (invalid) metadata. The following was produced with GCC 11 and GNU binutils ld 2.36.1. Section Headers: [Nr] Name Type Addr Off Size ES Flags Lk Inf Al [ 0] NULL 0000000000000000 00000000 00000000 0 0 0 0 [ 1] .note.gnu.property NOTE 00000000000002a8 000002a8 00000030 0 A 0 0 8 [ 2] .note.gnu.build-id NOTE 00000000000002d8 000002d8 00000024 0 A 0 0 4 [ 3] .note.qt.metadata NOTE 00000000000002fc 000002fc 000001ac 0 A 0 0 4 Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align ... NOTE 0x0002a8 0x00000000000002a8 0x00000000000002a8 0x000030 0x000030 R 0x8 NOTE 0x0002d8 0x00000000000002d8 0x00000000000002d8 0x0001d0 0x0001d0 R 0x4 The Qt metadata note is 4-byte aligned and can thus be found in the second note section, which spans from 0x02d8 to 0x02d8+0xac=0x0384. GNU readelf -n can even show it: Displaying notes found in: .note.qt.metadata Owner Data size Description qt-project! 0x0000018f Unknown note type: (0x74510001) description data: 01 06 03 81 bf ...... ff I chose 0x7451 as the prefix for our notes, even though they're already namespaced by the owner in the first place, because eu-readelf mistakenly tries to interpret note 1 as a GNU ABI tag regardless of owner. The owner name was chosen to be 12 bytes long, so the ELF note header is 24 bytes in total. There's no space wasted because the payload needs to be aligned to 32-bit anyway and I didn't want to use only 4 characters (header total size 16 bytes) so we'd skip the "GNU" note on size, without string comparison. And I couldn't think of a 4-character representative string ("QtP" ?). [1] https://github.com/openwrt/video/issues/1 Fixes: QTBUG-96327 Change-Id: I2de1b4dfacd443148279fffd16a3987729346567 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QUtf32: remove set-but-not-used variableThiago Macieira2021-10-181-4/+0
| | | | | | | | | | | Found by clang 13: qstringconverter.cpp:1039:15: warning: variable 'length' set but not used [-Wunused-but-set-variable] Pick-to: 6.2 Change-Id: Iea05060bc2c046928536fffd16adf46d4934c37c Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Deduplicate lastWindowClosed handlingTor Arne Vestbø2021-10-161-4/+4
| | | | | | | | | | | | | | | | | | | | | | | Whenever a window was closed, we had logic to check if it was the last window, and if so emitted lastWindowClosed and then tried to quit the application. But the automatic quit process also checked if there were any remaining windows, as this process could be triggered as a result of a QEventLoopLocker going out of scope. The two paths now share the same logic for determining if there are any remaining windows. The docs have been updated to reflect the original intent of the logic, dealing only with primary windows (top levels without a transient parent). This was how both the original code paths implemented their logic. For historical reasons the Qt::WA_QuitOnClose attribute is closely tied to the lastWindowClosed signal, and isn't merely limited to controlling whether we try an automatic quit when the last window closes. For now this behavior has been kept, but the docs have been updated to clarify how the attribute is handled in practice. Change-Id: If3d06b065236aad2e59e9091cac3146bc4cf79f6 Reviewed-by: Doris Verria <doris.verria@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove zlib from bootstrap libraryJoerg Bornemann2021-10-161-0/+2
| | | | | | | | | None of the bootstrapped tools use zlib anymore. Change-Id: I2cd7cb855ed671916a21c23449d9b6c4506f8546 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList: deprecate iterator<->pointer implicit conversions (3/3)Giuseppe D'Angelo2021-10-161-2/+14
| | | | | | | | | | Follow-up of the previous commit: in case the implicit conversions between iterator and pointers are disabled, then reintroduce the non-template arithmetic operators for the iterator classes. Change-Id: I8cee60fe77ee3a47e189b4b53a08e39408f9db18 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList: deprecate iterator<->pointer implicit conversions (2/3)Giuseppe D'Angelo2021-10-161-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The constructor from a raw pointer should be 1) constexpr, 2) explicit, and 3) *private*. We can do 1) without too much trouble. 2) is a (easy to fix) SIC in case of implicit conversions accidentally relied upon from somewhere. 3) cannot be "easily" fixed by user code (they have to refactor), and also, it's a BIC on Windows which encodes class members' access in symbols. Someone may have been exporting some QList subclass, in turn exporting the iterator classes, and therefore that someone now has the constructors' symbols with a given access. So, don't do 2+3 _just yet_ for user code, but set a deadline: Qt 6.5 is the last that will support this. On Qt 6.6, we switch. All of this on non-Windows, againt to avoid an ABI break. One can opt-in at any time via a suitable define. Given we have this define, use it to guard the other way around as well: conversions from an iterator to a raw pointer should never be explicit (there's std::to_address for this). [ChangeLog][QtCore][QList] Converting a QList's iterator from and to a raw pointer is deprecated, and will get removed in Qt 6.6. User code can prepare for the change by defining QT_STRICT_QLIST_ITERATORS. Change-Id: I0f34bfa3ac055c02af5a3ca159180304660dfc11 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList: deprecate iterator<->pointer implicit conversions (1/3)Giuseppe D'Angelo2021-10-161-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | QList<T>::(const_)iterator both feature an implicit operator T*. This operator exists in order to keep compatibility with Qt 5 code, where QVector<T>::iterator _was_ indeed a T*. However, iterators are not proxy objects and should not convert to T* (at least, not implictly). In fact we've already seen compilers complain about ambiguous calls when e.g. moving an iterator through an arithmetic operation (say, operator+). For instance, if one does it + number and the numeric argument of that call is not precisely qsizetype (but, say, int), then the call is ambiguous between operator+(iterator, int promoted to qsizetype) operator+(pointer (converted from iterator), int) One can imagine similar failures in generic code. In short: let's deprecate (not remove) the implicit conversion, and let people use iterators for what they are. Task-number: QTBUG-96128 Change-Id: I008348beefe00e4449b2d95c21c842d676390a26 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList: add mixed comparison operators between (const_)iteratorsGiuseppe D'Angelo2021-10-151-2/+15
| | | | | | | | | | | | | It is currently possible to compare a QList iterator with a const_iterator and viceversa, even though these operations aren't defined, because they are actually routed through the relational operators between iterators and raw pointers after a conversion (!). With the deprecation of iterator->pointer implicit conversions, this is going to break, so add the missig mixed comparison operators. Change-Id: Ic645ab0246f79f64b04334ecd02e9fe8fa46f0fa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Optimize mime type matchingJarek Kobus2021-10-143-36/+92
| | | | | | | | | | | | | | | | | | Don't count "*", don't search for "[" and for "?" inside m_pattern on every call to matchFileName(). Do it once, when constructing the MimeGlobPattern. Fix matching the pattern for names without any wildcard: index of question mark should be -1, not just different from 0. This shortens loading a Qt6 project in Creator by about 500 ms. Pick-to: 6.2 5.15 Change-Id: Ifa40c2cec4aba07a0312ef36877e571a8c8fb151 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: David Faure <david.faure@kdab.com>
* Convert Latin1 to UTF-16 before passing to ICU APIEdward Welbourne2021-10-141-5/+5
| | | | | | | | | | The ICU UChar type is a UTF-16 type, not a single-byte type, so passing it the data() of a QByteArray representing an ID is misguided. Fixes: QTBUG-97486 Pick-to: 6.2 6.2.1 Change-Id: I6789f491674b1d913eb8655d788b497e2fc06f7a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix segfault in QItemSelectionModel::hasSelectionAndreas Buhr2021-10-141-2/+5
| | | | | | | | | | | Amends 0c2125458a9fdddaf3385b257ba4350da872a1d1. The code assumed that a QItemSelectionModel always has a model. But during initialization from QML, it hasn't. Fixes: QTBUG-97475 Pick-to: 6.2 6.2.1 Change-Id: Ie9c680f8989a23ef732faaf5da7ef7ae273126aa Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* qtlogging: Document QT_MESSAGELOGCONTEXT defineKevin Funk2021-10-141-1/+5
| | | | | | | | | | Document it here to let people know about the pitfalls with some placeholder values. Link the QMessageLogContext class doc for more information. Pick-to: 6.2 Change-Id: I8e7b4c0dcb8bceeeee645664c98e63ae7ca7e854 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QTimer: Add \note in documentationFan RuiJie2021-10-141-0/+2
| | | | | | | | | | Keeping the event loop busy with a zero-timer like that is bound to cause trouble and highly erratic behavior of the UI. Fixes: QTBUG-96869 Pick-to: 6.1 6.0 5.15 Change-Id: Idf02a7a7e0689c59e1223610a6525262ead56d8d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Make LTO build workThiago Macieira2021-10-132-2/+1
| | | | | | | | We don't need to check FEATURE_ltcg, just add -fno-lto unconditionally. That makes QtCore compile with -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON. Change-Id: Icb2516126f674e7b8bb3fffd16ada2c71d7334aa Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* qfloat16: re-merge the F16C content into qfloat16.cppThiago Macieira2021-10-133-133/+29
| | | | | | | | | The bugs we had noticed previously are believed to be fixed. MSVC will do per-function updating of AVX content where necessary and the ICC issue is no longer relevant. Change-Id: I2bbf422288924c198645fffd16a9235f2d73cc19 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: remove support for building Qt with the old Intel compilerThiago Macieira2021-10-131-7/+1
| | | | | | | | | | | | | | | | | | This hasn't worked for some time. It's not in our CI and I don't think it was working at all. When I tried to build it, I ran into several problems with C++17 and an Internal Compiler Error I did not have any interest in working around. After discussing with the Intel compiler team, it was decided that fixing those issues in the old compiler is not going to happen. Instead, their recommendation is to adopt the new LLVM-based compiler, which the last commit added support for. This commit does not remove qmake support for the old ICC. It's possible someone is using qmake with a non-Qt6 project and ICC. Change-Id: Icb2516126f674e7b8bb3fffd16ad6350ddbd49e5 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QList: remove yet another iterator->pointer implicit conversionGiuseppe D'Angelo2021-10-131-1/+5
| | | | | | | | | | | | | | The ranged constructor for QList has an optimization when the iterators are QList's own iterators. In that case, it uses a "contiguous append" shortcut by converting the iterators to pointers. Avoid that conversion by extracting the pointers from the iterators. Note that this is an optimization for C++17 only; in C++20 appendIteratorRange will deal with this case as well. Leave a note. Change-Id: I761c36ff500dee95b4ae1b0a4479d22db0c8e3de Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QArrayDataOps: improve appendIteratorRangeGiuseppe D'Angelo2021-10-131-4/+14
| | | | | | | | Handle contiguous iterators in there directly. Change-Id: I3b6d45f993f82d0de5edbfcd75856f43a7f1263b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QList: code tidiesGiuseppe D'Angelo2021-10-131-19/+19
| | | | | | | | Do not rely on implicit pointer->QList::(const_)iterator conversions. Amend QList's own code so to avoid them. Change-Id: Ia3e7a83631943e636831217cdad28b73c98c1dc7 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Document QFutureWatcher::isFinished behavior changeMårten Nordheim2021-10-131-0/+4
| | | | | | | | | | in the Qt6 changes documentation Pick-to: 6.2 Change-Id: Ief45c145cbb9353455af39060a3fb444afe3f1b9 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Doc: Fix \notes in QObjectIvan Tkachenko2021-10-131-3/+3
| | | | | | Pick-to: 5.15 6.2 Change-Id: Ic442f56d3fb0c3e073c3cd69f193829958550296 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Add suffixes to loop variables for Q_FOREACHIevgenii Meshcheriakov2021-10-131-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently using nested Q_FOREACH loops produces warnings about shadowing local variables (if enabled). For example, this code: QList<int> aList; QList<int> bList; foreach (int a, aList) { Q_UNUSED(a); foreach (int b, bList) Q_UNUSED(b); } produces the following warning with MSVC: warning C4456: declaration of '_container_' hides previous local declaration This is due to using variable _container_ as loop variable for both loops. This patch appends current line number to the name of the loop variables so that most of the uses of Q_FOREACH will not result in shadowing. The patch originally by Benoit Regrain. Fixes: QTBUG-79081 Pick-to: 5.15 6.2 Change-Id: I55235e917e920171b138c8b3239a95dfe2ac7988 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Guard WinRT API code for clang-clPeter Varga2021-10-122-5/+6
| | | | | | | | | | | | | | It is unsupported with clang-cl and breaks the build. This is a fixup for: 51e8d3592a Let QLocale::uiLanguages() use WinRT API when possible Task-number: QTBUG-94341 Pick-to: 6.2 Change-Id: Icf32339e81d67d4c119b7fb8d8d834c744b9ead0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix handling of time-zone gap in QTimeZonePrivate::dataForLocalTime()Edward Welbourne2021-10-121-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | This was handled correctly when the backend supplies transitions bracketing the time in question, but the fallback code tried to use the DST offset at the time with larger offset from UTC; this did not work when the gap was due to a change in standard time. Discovered by ANS1 parsing of a date-time with two-digit year, for which the date-time parser tried to use 1921-05-01T00:00 local time when filling in the fields it had parsed; but, when run in Europe/Helsinki, there is no such time due to the 20m 11s skipped when joining EET from the prior local solar mean time. Correct the calculation to use the actual change in offset from UTC, as used in the (far better tested) between-transitions branch of the code, rather than the DST offset after the transition. Add a test-case based on the ASN.1 certificate date whose parsing revealed the issue. Although it seems nothing in Coin can reproduce the issue, the reporter has verified that the test does indeed fail on the system where the bug was found and the fix does fix it. Fixes: QTBUG-96861 Pick-to: 6.2 Change-Id: I12b02bad01daca2073d1a356452cd573684aa688 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* CMake: Fix adding generated resources on iOS with CMake and XcodeMike Achtelik2021-10-121-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When adding resources generated via a custom command, the project fails to configure when targeting iOS with CMake and Xcode with the error: CMake Error in src/CMakeLists.txt: The custom command generating src/.qsb/TestShader.frag.qsb is attached to multiple targets: TestApp_other_files TestApp but none of these is a common dependency of the other(s). This is not allowed by the Xcode "new build system". This happens e.g. when using qt6_add_shaders, which adds a custom command to generate the qsb files. Or by simply adding resources via qt6_add_resources, which depend on a custom command. The problem is that qt6_add_resources also adds the resource to a second "fake" target ${target}_other_files via _qt_internal_process_resource and _qt_internal_expose_source_file_to_ide. See c7d1874cd16ce86dfbab319e44fe3a387378fdff. Since these targets do not have a common dependency CMake fails to configure the project. So lets fix it similar to change 1bd0a5ce02352a600367beb5a5421c8f8332e1fe and let the ${target}_other_files depend in the main ${target}. Pick-to: 6.2 Task-number: QTBUG-95763 Change-Id: Iecdb40993a91da8bfbf6553892f9b0722d2e886c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QList::iterator: use templates for advancing operatorsThiago Macieira2021-10-121-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | Because of the addition of the operator T*(), the expression "it + N" where N was not exactly qsizetype but any other integer type was a compilation failure because of ambiguous overload resolution. With GCC it's apparently a warning: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second: note: candidate 1: ‘QList<T>::iterator QList<T>::iterator::operator+(qsizetype) const [with T = char; qsizetype = long long int]’ note: candidate 2: ‘operator+(char*, ptrdiff_t {aka long int})’ (built-in) With Clang, it's an error: error: use of overloaded operator '+' is ambiguous (with operand types 'QList<int>::const_iterator' and 'ptrdiff_t' (aka 'long')) note: candidate function inline const_iterator operator+(qsizetype j) const { return const_iterator(i+j); } note: built-in candidate operator+(const int *, long) Pick-to: 6.2 Fixes: QTBUG-96128 Change-Id: Ie72b0dd0fbe84d2caae0fffd16a06f23dd56b060 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Doc: Fix usage of \summary macroTopi Reinio2021-10-1219-35/+35
| | | | | | | | | The macro takes only one parameter, sentences must be wrapped in {}. Pick-to: 6.2 Fixes: QTBUG-97441 Change-Id: I7177548a32a67d720c2b551d16c09d898b0fda51 Reviewed-by: Paul Wicking <paul.wicking@qt.io>