summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* qmetatype.h: add QT_FOR_EACH_STATIC_PRIMITIVE_NON_VOID_TYPEThiago Macieira2022-06-241-7/+7
| | | | | | | | | | This allows us to simplify the explicit specialization of the QMetaTypeInterface<void> explicit specialization, dropping the warning push/pop, and remove an unnecessary explicit instantiation. Pick-to: 6.3 6.4 Change-Id: Id0fb9ab0089845ee8843fffd16f9bdccf1965b95 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmetatype.h: remove unnecessary EXPORT macroThiago Macieira2022-06-241-9/+2
| | | | | | | | | | | | | | | | | | | It was introduced in commit d9f9bc9bada91e3ec2b6c496d3b2242506ca56bc for Qt 6.0 to avoid extern __declspec(dllexport), which MSVC doesn't like, but was made obsolete by commit 77b99e8111cdd06b4fe12f2e18950a1e40ee2b76 that removed the extern templates altogether for MSVC. This change is NOT a no-op because Q_CORE_EXPORT expands to Q_DECL_IMPORT which is __attribute__((visibility("default"))) on ELF platforms. That's actually a good thing, because the symbol is not defined in any library that is not called QtCore anyway. GCC and Linux are also going towards properly requiring imported symbols to be explicitly marked, which this is. Task-number: QTBUG-93471 Pick-to: 6.3 6.4 Change-Id: Id0fb9ab0089845ee8843fffd16f99616883281e3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* moc: put the qt_meta_stringdata_XXXX_t type in an unnamed namespaceThiago Macieira2022-06-241-1/+6
| | | | | | | | | | | Not all user code is compiled with hidden visibility, so make sure one of the types in the template parameters (the one that is supposed to be unique anyway) is local and therefore causes the full symbol for the inline variable not to be exported outside of the translation unit. Pick-to: 6.4 Change-Id: I6d3880c7d99d4fc494c8fffd16fb262a59b81283 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* moc: remove the attempt to create one large string literalThiago Macieira2022-06-241-58/+30
| | | | | | | | | | | | | | | | | | | | | | | Commit dda9c9e2bc4fd2efe9e3fb0e451a8c3512f9a4d2 fixed some outstanding issues with moc's calculation of the maximum string length, but it missed one. This commit instead opts to remove the calculation entirely and instead have multiple char array members in the qt_meta_stringdata. We needed a single string back in Qt 4.0 when the stringdata *was* a single char array. Since 5.0, we've used a structure with multiple members and pointer arithmetic going past the end of the arrays, from the top of the object. That's UB, but since it's always been UB and can't be fixed until Qt 7 anyway, let's go full monty on it and have one char array per meta object string. The struct qt_meta_stringdata_Qt_t for namespace Qt now has 1217 stringdataXXX members. Pick-to: 6.2 6.3 6.4 Change-Id: I6d3880c7d99d4fc494c8fffd16fb0d1573e387dc Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* moc: properly indent the output for the metatype arrayThiago Macieira2022-06-241-34/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 7ff7d73f6ac68227500fa95731ce0f04626e600b added the indentation, but there were a few mistakes and it was off by 4 spaces anyway. So re-do it and take the opportunity to add some comments to explain what we're seeing. Before: qt_incomplete_metaTypeArray<qt_meta_stringdata_QTimer_t, QtPrivate::TypeAndForceComplete<bool, std::true_type>, QtPrivate::TypeAndForceComplete<int, std::true_type>, QtPrivate::TypeAndForceComplete<int, std::true_type>, QtPrivate::TypeAndForceComplete<Qt::TimerType, std::true_type>, QtPrivate::TypeAndForceComplete<bool, std::true_type>, QtPrivate::TypeAndForceComplete<QTimer, std::true_type>, QtPrivate::TypeAndForceComplete<void, std::false_type> , QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<int, std::false_type>, QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<void, std::false_type> >, After: qt_incomplete_metaTypeArray<qt_meta_stringdata_QTimer_t, // property 'singleShot' QtPrivate::TypeAndForceComplete<bool, std::true_type>, // property 'interval' QtPrivate::TypeAndForceComplete<int, std::true_type>, // property 'remainingTime' QtPrivate::TypeAndForceComplete<int, std::true_type>, // property 'timerType' QtPrivate::TypeAndForceComplete<Qt::TimerType, std::true_type>, // property 'active' QtPrivate::TypeAndForceComplete<bool, std::true_type>, // Q_OBJECT / Q_GADGET QtPrivate::TypeAndForceComplete<QTimer, std::true_type>, // method 'timeout' QtPrivate::TypeAndForceComplete<void, std::false_type>, // method 'start' QtPrivate::TypeAndForceComplete<void, std::false_type>, QtPrivate::TypeAndForceComplete<int, std::false_type>, // method 'start' QtPrivate::TypeAndForceComplete<void, std::false_type>, // method 'stop' QtPrivate::TypeAndForceComplete<void, std::false_type> >, Pick-to: 6.4 Change-Id: Id0fb9ab0089845ee8843fffd16fa152d040ef922 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* tst_moc: fix build with GCC 12Thiago Macieira2022-06-241-3/+3
| | | | | | | | | | | | | You can't mismatch the export macros. The QT_MOC_EXPORT_PLUGIN_V2 macro defines these functions as Q_DECL_EXPORT so they can be found by QPluginLoader. We must match the macro here, otherwise GCC 12 complains (tst_moc.cpp is compiled with -fvisibility=hidden): tst_moc.cpp.o: non-canonical reference to canonical protected function `qt_plugin_instance' in moc_plugin_metadata.cpp.o Pick-to: 6.4 Change-Id: Id0fb9ab0089845ee8843fffd16f99893d5730da5 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Emit autolinks in QTextMarkdownWriterShawn Rutledge2022-06-243-8/+16
| | | | | | | | | | | | | | | | | | | When a markdown document contains a "naked" URL, or an angle-bracketed <URL>, md4c recognizes it, and we set the AnchorHref charfmt property. There's no need to expand it into the [text](url) form if the text is the same as the url, there is no tooltip, and the url is valid. QTextMarkdownWriter now writes a CommonMark "autolink" in that case: https://spec.commonmark.org/0.30/#autolinks [ChangeLog][QtGui][Text] QTextMarkdownWriter now writes an autolink whenever a hyperlink has no custom text and no tooltip, including when the document was parsed from Markdown containing a naked URL. Pick-to: 6.4 Fixes: QTBUG-94713 Change-Id: I432db8499c62e1e0b1e913bfd8ef2147e3c2bb2a Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Support markdown in QTextEditMimeData; fix pasting trailing newlinesShawn Rutledge2022-06-243-5/+123
| | | | | | | | | | | | | | | | | | | - Since 4edcea762d9ce334c4c1a78234c90c118b81da87 the dropsite example shows markdown if available; and now it shows that when we do DnD of a selection from the richtext example, text/markdown is available. - If we artificially make html unavailable, copying and pasting between widget-based rich text editors uses markdown. In case markdown writer output contains unnecessary backticks due to monospace fonts getting used, the workaround from 1ad456c908467212bc30223a69eb7524b64b86e1 is applied. Pick-to: 6.4 Task-number: QTBUG-76105 Task-number: QTBUG-103484 Change-Id: Ie6ca4dbb450dbc36b3d09fd0df1ae5909aaebca7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Blacklist qtcpsocket bind on arm macOSToni Saario2022-06-241-0/+2
| | | | | | | | This was unblacklisted in b885820c395a0bbfb0ff55ab0ee47a4703aa6b59 however it is still very flaky. Change-Id: If9796231c584c894387106dfeb262c9eb4ce73f5 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
* Network: Update expired certMårten Nordheim2022-06-242-30/+30
| | | | | | Pick-to: 6.4 6.3 6.2 5.15 Change-Id: I233ffee5b720c0554071c1d49d4fb861736b2e2a Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QAbstractItemModel: Add revisions to new methodsUlf Hermann2022-06-241-13/+13
| | | | | | | | | | | These methods show up in QML-exposed types. They should be revisioned in order to keep those types backwards-compatible. Pick-to: 6.4 Change-Id: I8e826dc2e7db49d8abe69f67605dfb1991855b96 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Fix typo in codeDuan Ting2022-06-231-1/+1
| | | | | | | | | Found by codespell Pick-to: 6.4 6.3 6.2 5.15 Change-Id: I75f4b14f3eded035a0c904d8a7174cb6f5b7d9ef Reviewed-by: Wang Bo <wangbo@uniontech.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* unblacklist passing tests 2022Anna Wojciechowska2022-06-2310-55/+31
| | | | | Change-Id: Ifb09a997d39fc2c92503e77cf372d443c13c4c2b Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
* Doc: Skip 'qt5/' part in 3rd party documentationKai Köhne2022-06-231-0/+1
| | | | | | | | Pick-to: 6.4 Fixes: QTBUG-104463 Change-Id: I7596118e147c9b5b12b49c4cf2692626697f309e Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Use [[noreturn]] attributeKai Köhne2022-06-231-1/+5
| | | | | | | | | | | Use __has_cpp_attribute mechanism to check availability of [[noreturn]]. For MSVC 2019 and 2022, this is always the case, so we can also remove the (now dead) __declpsec(noreturn) definition. Pick-to: 6.4 Change-Id: Ie7b39bd93bc5e1a173e245a3a5d5ff7e9067a59f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* MSVC: Remove dead Q_DECL_DEPRECATED* definitionsKai Köhne2022-06-231-4/+0
| | | | | | | | | | | | | | | | Later on we redefine them to [[deprecated]], [[deprecated("")]], if the attribute is available. Since both MSVC 2019 and 2022 support the attribute, the __declspec() definition was never used. https://docs.microsoft.com/en-us/cpp/cpp/attributes Pick-to: 6.4 Fixes: QTBUG-93748 Change-Id: I3e12f2ace414e316a811f2ceb44e6f312803439a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* moc: add Q_CONSTINIT to the static const variables we emitThiago Macieira2022-06-222-5/+13
| | | | | | | | | | | The macro was added to Qt 6.4, so we define it in each moc output to empty if it wasn't previously defined. Thus, moc retains compatibility with older Qt versions. Pick-to: 6.4 Change-Id: Id0fb9ab0089845ee8843fffd16f9c1539fa0368f Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
* moc: replace offsetof with sizeofThiago Macieira2022-06-221-1/+1
| | | | | | | | | | It's the same thing since we have exactly one field in this structure before stringdata0. But there's a far smaller chance of producing a warning in user code. Pick-to: 6.2 6.3 6.4 Change-Id: Id0fb9ab0089845ee8843fffd16f9cdceec33017d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* moc: fix use of escape sequence of more than one characterThiago Macieira2022-06-222-39/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had the code to calculate the length, but were improperly using it only for the offset, not the length of the string or its containing array. That resulted in the generated moc output containing: QT_MOC_LITERAL(111, 5), // "\xffz" QT_MOC_LITERAL(114, 5), // "\0012" QT_MOC_LITERAL(117, 23), // "slotWithAReallyLongName" The two strings are described as occupying 5 bytes (length 4 + null terminator), which is incorrect. The offset was correct: 114 - 111 = 3 and 117 - 114 = 3. The new output is: QT_MOC_LITERAL(111, 2), // "\xffz" QT_MOC_LITERAL(114, 2), // "\0012" QT_MOC_LITERAL(117, 23), // "slotWithAReallyLongName" The effect of the array size calculation would only be felt if moc decided it needed a second string array (for strings over 65535 bytes), which would cause the offsets in the second array to be all wrong. There was no such test until now. Drive-by fixing of the newline, indentation, and the stale comment referring to QByteArrayData (Qt 5). Pick-to: 6.2 6.3 6.4 Change-Id: Id0fb9ab0089845ee8843fffd16f9cd01b3e0709a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* CMake: fix build with FreeBSD 13.1Thiago Macieira2022-06-221-0/+1
| | | | | | | | | | | | | | | | | | | I don't know if they've just added the libs and therefore the GSSAPI content wasn't enabled before, but libgssapi_krb5.so does not have the symbols we need. ld: error: undefined symbol: gss_acquire_cred >>> referenced by qauthenticator.cpp:1803 (/usr/home/tjmaciei/src/qt/qt6/qtbase/src/network/kernel/qauthenticator.cpp:1803) >>> src/network/CMakeFiles/Network.dir/kernel/qauthenticator.cpp.o:(qGssapiTestGetCredentials(QStringView)) ld: error: undefined symbol: gss_release_name >>> referenced by qauthenticator.cpp:1808 (/usr/home/tjmaciei/src/qt/qt6/qtbase/src/network/kernel/qauthenticator.cpp:1808) >>> src/network/CMakeFiles/Network.dir/kernel/qauthenticator.cpp.o:(qGssapiTestGetCredentials(QStringView)) [...] Pick-to: 6.2 6.3 6.4 Change-Id: I6d3880c7d99d4fc494c8fffd16fabf70bbd272f5 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix prl files not to contain hard-coded library pathsAlexandru Croitor2022-06-222-1/+29
| | | | | | | | | | | | | | | | | | | | | | | Make sure to convert absolute paths generated using the $<TARGET_LINKER_FILE> generator expressions into relative paths. Because prl files are generated for both modules and plugins, we need to pass both a list of qt module locations and qt plugin locations to QtFinishPrl.cmake, and then try to make the absolute path relative to each passed directory. A warning assertion is shown if we no relative path could be made, which will cause an absolute path to be embedded. This should not happen though. Amends f4e998125981038e5e50dab8cc56039faaa0b750 Pick-to: 6.2 6.3 6.4 Fixes: QTBUG-104396 Change-Id: Id68395c0dbb20aad5c510d77835cc931b9396556 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Add QDom internalSubset implementationYe ShanShan2022-06-233-0/+100
| | | | | | | | | | | | QDom's internalSubset() always returned empty because nothing actually set the internal data member it returns. When parsing the DECLTYPE, extract the internal subset and save it to the doctype()'s member when present. Pick-to: 5.15 6.2 6.3 6.4 Fixes: QTBUG-53661 Change-Id: I6e41ff8b914381168246073b3289d82205b1c255 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Conan: Do not force 'qt_host_path' usage in cross-build contextIikka Eklund2022-06-221-9/+20
| | | | | | | | | | | | | | | If the user does not pass: -o qtbase:qt_host_path=/foo then log a warning but allow to continue. For example Boot2Qt integration resolves the 'QT_HOST_PATH' by other means thus making it a mandatory option to be passed by the user should not be needed. Pick-to: 6.3 6.4 Change-Id: I4c1d8b5253e33466ccdf463f89473966e90c0e0c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Toni Saario <toni.saario@qt.io>
* moc: Allow reading property values through bindablesUlf Hermann2022-06-224-1/+55
| | | | | | | | | | | | | The behavior is similar to MEMBER: If the READ accessor is "default", synthesize it using the bindable. [ChangeLog][QtCore] You can now specify "READ default" in a Q_PROPERTY if you also specify a BINDABLE. moc will synthesize a READ accessor in that case. Task-number: QTBUG-97249 Change-Id: I4a275adabaed12df95dac505095f847c4be65dfe Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qmake/msbuild: Turn off "use full paths in diagnostics" by defaultJoerg Bornemann2022-06-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The default setting for "Full Path of Source Code File in Diagnostics" changed with VS 2017: it's now turned on by default. It can also be enabled with the compiler flag /FC, but there is no flag for turning it off. Users might want to disable /FC to obtain reproducable binaries. Change qmake's default from "use Visual Studio's default" to "off" for this feature. Users can enable it manually by putting the following into their project files: QMAKE_CXXFLAGS += /FC CMake faced the same problem. See CMake upstream issue #18261 for comparison. Pick-to: 5.15 6.2 6.3 6.4 Task-number: QTBUG-104450 Change-Id: Ibe636a0ac5d18aefb44f2b7179b59fcec2ad8353 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* qmake/msbuild: Support all /DEBUG:xxx linker optionsJoerg Bornemann2022-06-223-5/+20
| | | | | | | | | | | /DEBUG:OFF now turns debug info generation off. /DEBUG:FULL maps to DebugFull. Unknown /DEBUG:xxx options are added to AdditionalOptions. Pick-to: 5.15 6.2 6.3 6.4 Task-number: QTBUG-104450 Change-Id: Ibd072145e51551b29370e809b880c0d7f1a00c03 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* qmake/msbuild: Support all /LTCG:xxx optionsJoerg Bornemann2022-06-223-17/+24
| | | | | | | | | | | /LTCG:OFF now turns off LTCG. /LTCG:INCREMENTAL maps to UseFastLinkTimeCodeGeneration. Unknown /LTCG:xxx values are passed to AdditionalOptions. Pick-to: 5.15 6.2 6.3 6.4 Task-number: QTBUG-104450 Change-Id: If85942dbeec204dc2571a861a43201cb3d5993ae Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move QFutureInterfaceBase::cleanContinuation() to removed_apiSona Kurazyan2022-06-223-12/+19
| | | | | | | | | | This method isn't used anymore, but we can't remove it entirely for BC reasons, because it was called from inline code. Pick-to: 6.4 Change-Id: I9183c666c466030787ac7c2386706b50abf23eaa Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* wasm: do not allow blocked windows to be resizedLorn Potter2022-06-221-5/+10
| | | | | | | Fixes: QTBUG-102869 Pick-to: 6.3 6.4 Change-Id: I69a4afbb67618dce7bcc499208e7e608e9adf212 Reviewed-by: David Skoland <david.skoland@qt.io>
* QJsonValue: fix incorrect to{Array,Object} when the value is emptyThiago Macieira2022-06-214-12/+30
| | | | | | | | | | | | This is a repeat of commit de6ced66920600e659dbaa2509526a3bcb0b3360 "QCborValue: fix incorrect to{Array,Map} when the value is empty" (6.4), which fixed the same thing for QCborValue. I've just copied the exact same implementation onto the QJsonValue functions. Pick-to: 6.2 6.3 6.4 5.15 Fixes: QTBUG-104085 Change-Id: I175efddd75f24ae59057fffd16f6b257bf7ed36d Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* wasm: improve the specialHtmlTargets testMorten Sørvig2022-06-221-4/+8
| | | | | | | | | | | | It can actually be undefined, so test for that before checking the object type. This fixes the asyncify build. Pick-to: 6.4 Change-Id: I5a6a0bc60c153290c35c20242400c59cd1312403 Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* QThread:idealThreadCount: fix build with FreeBSD 13.1Thiago Macieira2022-06-211-1/+1
| | | | | | | | They added the CPU_COUNT_S macro. Pick-to: 6.4 Change-Id: I6d3880c7d99d4fc494c8fffd16fabe9f8226ecda Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* moc: remove unnecessary emission of "#include <qbytearray.h>"Thiago Macieira2022-06-211-1/+0
| | | | | | | | | | | | | | | | We don't need QByteArrayData any more (since 6.0). [ChangeLog][Potentially Source-Incompatible Changes] moc no longer emits an #include for QByteArray in the output file. None of the content that moc generates needed that header, so this should not cause changes for most people. However, codebases that #include'd the moc output (something that is recommended) could be depending on this indirect include. Pick-to: 6.4 Change-Id: Id0fb9ab0089845ee8843fffd16f9cf13dc8d61b5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* moc: rename the "offsetsAndSize" member to "offsetsAndSizes"Thiago Macieira2022-06-221-2/+2
| | | | | | | | | | | | | It contains more than one size. Drive-by drop the const from the structure, so it becomes properly trivial (though there's disagreement, see[1]). [1] https://conformance.godbolt.org/z/rK1xW669K Pick-to: 6.2 6.3 6.4 Change-Id: Id0fb9ab0089845ee8843fffd16f9cc69ffd90aa4 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* wasm: Optimize use of openglesLorn Potter2022-06-222-14/+2
| | | | | | | | | | | | | | - USE_WEBGL2 is depreciated, Emscripten now uses MAX_WEBGL_VERSION - Optimize and remove use of emulated ES2 and ES3, which means only use WebGL friendly subset. Users can add USE_ES3=1 and USE_ES2=1 to the final linker arguments for those respective versions in order to enable using glDrawArrays and glDrawElements with unbound buffers. See https://emscripten.org/docs/porting/multimedia_and_graphics/OpenGL-support.html Pick-to: 6.4 Change-Id: I11ae359966964b3e7aa6e61ccc714c2bfbf61f96 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Doc: Add qthelp dependency to gui and widgetsLuca Di Sera2022-06-222-2/+3
| | | | | | | | | | | | | | | | The documentation for both gui and widgets defines members of the "helpsystem" group, which definition is given in qthelp. Due to recent changes in QDoc that automatically link a class page to its owning group, it is now required for those project to be dependent on qthelp, so that it is possible to retrieve the necessary linking information for the group definition. Hence, such a dependency was added. Change-Id: Id9399e76bbe10fb9ae0c05d637006b5cdc0b742b Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* tst_tostring: add benchmarks for QCOMPARE vs. QCOMPARE_EQMarc Mutz2022-06-221-0/+55
| | | | | | | | | | | | | | There's currently no statistically-significant difference between the two, due to a huge pessimistion in QTestLib where every QCOMPARE* and QVERIFY writes 1KiB of data onto the stack before doing anything else, so I'm not reporting numbers in this commit message. Pick-to: 6.4 Task-number: QTBUG-98873 Task-number: QTBUG-98874 Change-Id: I233878596f0a8fe6b96360adb839fecd72c398a2 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* headerclean: remove dead codeMarc Mutz2022-06-221-4/+0
| | | | | | | | | The variable was misspelt, so we obviously don't need these exceptions. Pick-to: 6.4 6.3 6.2 Change-Id: I691c9315bcde3aad72410ce01ae6dc6a013ee6fd Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Long live QT_INLINE_SINCE!Marc Mutz2022-06-224-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have now had several requests for inlining previously-exported member functions, but no standard mechanism to effect it. As QT_REMOVED_SINCE has shown, there is great value in having such a standard mechanism, so here is one. With this change, to inline a previously exported (member) function, simply - mark the declaration with QT_<MODULE>_INLINE_SINCE - move the definition into the header file (outside the class), - wrap it in QT_<MODULE>_INLINE_IMPL_SINCE - #include the header into the module's removed_api.cpp Just including the header into removed_api.cpp is enough, so you may want to add a comment: #include "header.h" // uses QT_<MODULE>_INLINE_SINCE The effect is as follows: - A TU in a _different_ library will see an inline declaration, followed by the definition, and so it will see a normal inline function. - A TU in the same library will, however, see a non-inline declaration, to avoid the ODR violation that at least GCC/ld are able to detect. - When QT_<MODULE>_BUILD_REMOVED_API is in effect, the TU will also see the definition, which is the same setup as before the change, except in a different TU, and therefore export the member. - When, OTOH, QT_<MODULE>_BUILD_REMOVED_API is _not_ in effect, the TU will see no declaration, assuming (correctly), that the definition will be supplied by a different TU. This is, of course, an ODR violation, but not worse than what we do elsewhere, as the definitions differ only between library and user. The function is inline only for the users of the library, not the library itself, which will still see the function as non-inline. If inlining is critical within the library, too, the existing function should call a new inline function, and calls in the same library should be changed to call the new inline function instead. Use the new mechanism to inline the QLocale ctor we intended to inline for 6.3, but couldn't, because we hadn't found the magic incantation, yet. Thiago found it a few weeks later, and this is what this patch is based on. Fixes: QTBUG-100452 Pick-to: 6.4 Change-Id: Ia0030cddc64b6b92edfed860170d5204aa74b953 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QPostEventList: de-inline addEvent()Marc Mutz2022-06-222-17/+24
| | | | | | | | | | | While in a private header, it did manage to place QList<QPostEvent> operations near the top spots of all Qt template instantiations in a QtWidgets build. Task-number: QTBUG-97601 Pick-to: 6.4 Change-Id: I4fa1972b8764b71ad0559633131e7e44b3d4ae6a Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_bench_shared_ptr: fix build with BOOST_NO_EXCEPTIONSMarc Mutz2022-06-221-0/+13
| | | | | | | | | | | | | | | | | If, for whatever reason, BOOST_NO_EXCEPTIONS is defined, the user of the Boost libraries is supposed to provide a definition of boost::throw_exception, which we didn't. We used to run into this only on ubsan builds, but it seems we now have the problem on a regular Ubuntu 22.04 build, too (cf. bugreport). Fix by adding the necessary definitions. Fixes: QTBUG-104083 Pick-to: 6.4 6.3 Change-Id: I9b061a158a5b77e8d286bd7b40312e5bc63ee8de Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* QPromise: run continuation(s) on destructionSona Kurazyan2022-06-222-1/+21
| | | | | | | | | | | | | | | | | | If the QFuture is canceled because the associated QPromise has been destroyed, we still need to run its continuations (i.e. onCanceled handler, if it's attached), so replaced the cleanContinuation() call inside ~QPromise() with runContinuation(), which will also take care of cleaning the continuation. [ChangeLog][QtCore][Important Behavior Changes] QFuture now runs its continuations when its associated QPromise has been destroyed. Previously, if a QFuture was canceled because the associated QPromise has been destroyed, its continuations were skipped. Fixes: QTBUG-103992 Pick-to: 6.4 6.3 6.2 Change-Id: Ie05bc760c96c349aade8adb8d2fe5263aff8efac Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Isolate http2protocol_p.h includeAlexey Edelev2022-06-221-1/+1
| | | | | | | | | | http2protocol_p.h is not supposed to be used without the http feature is enabled. Move its include under QT_CONFIG(http) guard. Change-Id: I374dd84d3330de2b4c340b9803d0c3d2c13bc8e3 Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Add the qt_class pragma to file listed in sync.profile classnames mapAlexey Edelev2022-06-2217-0/+69
| | | | | | | | | This makes header files self-contained and reduces the number of 'sources of truth' for syncqt procedure. Change-Id: I7f5865abc69934603139d23e1b5452da46ccb110 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move ssl header files to the general QtNetwork sourcesAlexey Edelev2022-06-221-5/+10
| | | | | | | | | | | Move public ssl headers to the general QtNetwork sources since they supposed to be used across the project without corresponding checks for the FEATURE_ssl presence. The content in these header files has a conditional implementation guarded by corresponding macros. Change-Id: I43168469da27321c2d8064ec2e5d7fe31126ebec Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Move threads header files out of the FEATURE_threadAlexey Edelev2022-06-221-9/+9
| | | | | | | | | | | Threads header files are used across the project without the check for FEATURE_thread enabled. So moving them out of the FEATURE_thread condition in CMake file to make them part of the CMake source tree even if FEATURE_thread is disabled. Change-Id: I8ee4ee5ffa16054b9af0df0aa5704b0f87678e1a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDom: Clean-up warnings about old-style cast usesSona Kurazyan2022-06-221-62/+66
| | | | | Change-Id: I7cf2089f34e46a901f8b03987feed24773a72c00 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Replace a few more QString::fromLatin1() with _s literalsShawn Rutledge2022-06-221-2/+2
| | | | | | | | | Wasn't done in 7d79b94db7debdd1896d1912e3052d5950b05df5 Pick-to: 6.4 Task-number: QTBUG-98434 Change-Id: Id9c26f6b58e2c96a1c5f72154b735b136c57debc Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Add ExpandCollapse UI Automation pattern to combo boxesAndré de la Rocha2022-06-224-7/+26
| | | | | | | | | | | Also add support to expandable/expanded states to QAccessibleComboBox in widgets. QtDeclarative will still require updates so that QML combo boxes report the expanded/collapsed state and react to UIA actions. Task-number: QTBUG-103591 Pick-to: 6.4 6.3 Change-Id: Iff8ba5e3143778ce17998dbe7f5f76cae658dc19 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Disable useless-cast warning for moc generated codeMate Barany2022-06-221-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | The useless-cast gcc warning is disabled in the files generated by the moc. A typical warning is like using_t = void(Counter::*)(int ); if (*reinterpret_cast<_t*>(_a[1]) == static_cast<_t>(&Counter::valueChanged)) { *result = 0; return; } Removing the static cast results in a compilation error "address of overloaded function with no contextual type-of information" in moc_myobject.cpp files. Checking whether we have an overload set or a single function might be too much effort for too little benefit and may not worth it. Fixes: QTBUG-71938 Change-Id: I6f67e163a3493b51fb95f54218ce6bf9a302f824 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>