summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* QVarLengthArray: simplify default ctorMarc Mutz2021-12-011-1/+4
| | | | | | | | | | | | Instead of calling the QVLA(qsizetype) ctor and letting the optimizer and inliner have a field day on them, simply set the trivial values for a, s, and ptr manually. Mark it as noexcept. Task-number: QTBUG-84785 Change-Id: I011826eacdaf63a4c37b21465e5fe4a6e70a1ab7 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Openssl backend: reinsert a missing C in qCDebugMårten Nordheim2021-12-011-1/+1
| | | | | | Pick-to: 6.2 5.15 Change-Id: I2b13d2f88517abea7e015bfba4fe71dcbada86c0 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix the path to the build dir when creating an androiddeployqt depfileAlexey Edelev2021-11-301-1/+14
| | | | | | | | | | According to the CMake documentation any relative paths in DEPFILE should be relative to the CMAKE_CURRENT_BINARY_DIR if the CMP0116 is set to NEW. This also forces CMP0116 to NEW if the policy exists. Pick-to: 6.2 Change-Id: I3d697b008ea06effb2247bc204da9bcc4e9046b4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add _make_aab targetAlexey Edelev2021-11-303-9/+35
| | | | | | | | | | | | | | | | Add target triggering AAB creation. Since the _make_aab target is not added to the ALL set, we may avoid dependency check for it and admit that the target is "always out of date". [ChangeLog][Android][Platform Specific Changes] Add the extra _make_aab targets for each executable target, that can be used to generate android app bundles. Also add aab metatarget to build all _make_aab targets that are created in the project. Pick-to: 6.2 Fixes: QTBUG-96710 Change-Id: I3b0c7fbb5a7dd493ca7a124c4e4b91fd857386bd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QString::arg: deprecate use of arbitrary Unicode digits as replacementsGiuseppe D'Angelo2021-11-302-4/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only documented replacements for Q*String*::arg() are sequences like %1, %2, %3 -- where the n-th number is expressed using a sequence of ASCII digits [1]. The code parsing the replacements however used the QChar::digitValue() function. That function simply checks if a QChar has a *Unicode digit value* (no matter what its block/category is), and if so, returns the corresponding digit value as an int (otherwise returns -1). The result of this is that a sequence like "%¹" or "%१" actually triggered substitutions (both count as "1"). Similarly, QChars with a digit value would be parsed as part of longer sequences like "%1²" (counting as "12" (!)). This behavior is weird, undocumented, and extremely likely the usual backstabbing by Unicode by using "convenience" QChar methods -- that is, never *intended* by the implementation. This commit deprecates (via warnings) such usages, which for the time being are left working as before (in the name of backwards compatibility). At the same time: given it's extremely unlikely that someone would be deliberately relying on this behavior, it implements the desired change of behavior (only accept sequences of ASCII digits) starting from Qt 6.6, that is, after the next LTS. Throughout Qt 6's lifetime users will still be able to control arg()'s behavior by setting an env variable, but that variable (and the support for Unicode digits) will disappear in Qt 7. To summarize: * Qt 6.3->6.5: default is Unicode digits, env var to control * Qt 6.6->6.x: default is ASCII digits, env var to control * Qt 7: only ASCII digits, no env var [1] That's the name Unicode gives to them, cf. https://www.unicode.org/charts/PDF/U0000.pdf [ChangeLog][QtCore][Deprecation Notices] The arg() functions featured in Qt string classes have always been documented to require replacements tokens to be sequences of ASCII digits (like %1, %2, %34, and so on). A coding oversight made it accept sequences of arbitrary characters with a Unicode digit value instead. For instance, "%2੩" is interpreted as the 23rd substitution; and "%1²" is interpreted as the 12th substitution. This behavior is deprecated, and will result in runtime warnings. Starting from Qt 6.6, arg()'s behavior will be changed to accept only ASCII digits by default. That means that "%1²" is going to be interpreted as substitution number 1 followed by the "²" character (which does not get substituted, so it gets left as-is in the result). Users can restore the previous semantics (accept Unicode digits) by setting the QT_USE_UNICODE_DIGIT_VALUES_IN_STRING_ARG environment variable to a non-zero value. In Qt 7, arg() will only support sequences of ASCII digits. Note that from Qt 6.3 users can also set QT_USE_UNICODE_DIGIT_VALUES_IN_STRING_ARG to zero; this will make arg() use ASCII digits only, in preparation for the future change of defaults. Change-Id: I8a044b629bcca6996e76018c9faf7c6748ae04e8 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Don't allocate an OCIDateTime object unless we're going to use itEdward Welbourne2021-11-301-7/+22
| | | | | | | | | | | | | | | | | | | The QOCIDateTime destructor carefully checks that dateTime is non-null before tidying it away, but the constructor allocated it independently of whether it was used, leaving it in a still-not-constructed state if the date-time it was to represent was invalid. Only allocate if the date-time is valid; and check against null when an OCIDateTime is being converted back to QDateTime. Add warnings if either allocation or construction fails. Incidentally use static_cast<> instead of C-casting (and split a long line) in the other place that allocates an OCIDateTime descriptor. Pick-to: 6.2 5.15 Task-number: QTBUG-98471 Change-Id: Idd5531d9f7101878802cb9a3a016d3fd80903543 Reviewed-by: Andy Shaw <andy.shaw@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Conan: Do not write qt.conf to build artifactsIikka Eklund2021-11-301-3/+0
| | | | | | | | | The qt.conf causes issues with CI and building/running tests. Pick-to: 6.2 Task-number: QTBUG-93037 Change-Id: I079e71e64985eb69c37adaacb93c45a4a92ef4fa Reviewed-by: Toni Saario <toni.saario@qt.io>
* Enable warnings-are-errors for Visual Studio 2022Kai Köhne2021-11-301-2/+2
| | | | | Change-Id: Id0b143f668f69481f6037f94aedbfd2e87331497 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* Use config-specific suffix of android deployment settings for multi-config onlyAlexey Edelev2021-11-301-1/+10
| | | | | | | | | | | | QtCreator doesn't expect any config-specific suffixes in the android deployment settings file, when running androiddeployqt. This avoids adding the config-specific suffix in the single-config builds and for the first config in the multi-config builds. Amends a41d9bcac90af5d8f528d6198ea91f25e5189082 Change-Id: I606509c9bfd2e75cac144aca37b4568639aae74f Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* QNX: check and use elf.h from alternative locationJanne Juntunen2021-11-305-16/+23
| | | | | | | | | | | In QNX, instead of #include <elf.h>, we have to use #include <sys/elf.h> since that file is placed in a subdirectory. Also removed the previous workaround. Fixes: QTBUG-97833 Change-Id: Id932a5eeb618a42c8778459cdfd8bb5bf903523c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Verify returns from QXmlTestLogger's xmlQuote() and xmlCdata()Edward Welbourne2021-11-304-95/+113
| | | | | | | | | | | | | | | | | | Using partially-converted text would lead to invalid XML, so don't use the buffer contents if the return is zero. As a result, QTestJUnitStreamer::formatEnd() needs to return some indication of whether *it* succeeded, so change it to forward their int returns; and, as it's in fact only used internally by the streamer, make it private. Make these functions [[nodiscard]] so that further uses of them will be discouraged from ignoring the possibility of failure. Make the public versions return bool so that they can correctly succeed on empty input. Assert various conditions we can infer to save work we don't need to do. Change-Id: I899bad23d1dfbd05fc725de269def4ce213dbc5a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove unused LICENSE.LGPLv3 filesKai Köhne2021-11-301-175/+0
| | | | | | | | It's not referenced anymore in qtbase since a while. Other Qt repositories are cleaned up, too. Change-Id: Ic6fe796b9b08848e41d6bce9d97e19399af05907 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QVarLengthArray: simplify copy ctor implementationMarc Mutz2021-11-301-2/+2
| | | | | | | | | | | | std::tie(a, s, ptr) = {Prealloc, 0, (T*)array} is exactly the effects of the default ctor, so just delegate to it, before calling copyAppend(). Also clean up the copy ctor declaration (superfluous inline keyword, and template arguments). Change-Id: Iefc758a47996382fee10b1e081e44f008b146287 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList::count(T): remove the &* hack on iteratorsThiago Macieira2021-11-301-1/+1
| | | | | | | | | | | | Use data() and data() + size() instead. This solves an UB when the list is in its default-constructed state, for which constData() == nullptr. Pick-to: 6.2 Fixes: QTBUG-98770 Change-Id: I2cffe62afda945079b63fffd16bc165978c769f6 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Teach QOpenGLTextureBlitter about GL_TEXTURE_RECTANGLE texturesTor Arne Vestbø2021-11-302-16/+110
| | | | | Change-Id: Ie577bda046f60ce23dfb8cdd6164bb3de4b54358 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* wasm: add Blob and File typeLorn Potter2021-11-302-0/+12
| | | | | | | Convenience getters for mime type associated with the object. Change-Id: I7e3530459e50ac4740d533db59c46e838c94dbcd Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QRegularExpression: don't detach() a pattern QStringLiteralMarc Mutz2021-11-301-1/+1
| | | | | | | | | | | | | | | | | ... just to pass it to pcre2_compile_16(). The QString::utf16() function guarantees a NUL-terminated result, so it detach()es from QStringLiteral (Qt 6) and/or QString::fromRawData() (Qt 5 + 6). This user doesn't require the NUL-termination, though, since pcre2_compile_16() takes an explicit length, so the detach() is completely unneccesary, yet common, since regex pattern strings are often QStringLiteral()s. Task-number: QTBUG-98763 Change-Id: I1d08ae1a1ec4281ff44a68c5ba5c56584b71d24e Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QNAM: Disable h2c by defaultMårten Nordheim2021-11-304-0/+20
| | | | | | | | | | | | | | | | | | And since it's relatively unlikely to be used, just leave it behind a environment variable for now. [ChangeLog][QtNetwork][Potentially Source-Incompatible] Support for clear-text http/2 was disabled due to incompatibility with certain servers. If you were relying on this feature you must re-enable it by setting the QT_NETWORK_ALLOW_H2C environment variable. For a later version of Qt it will get a dedicated attribute. Pick-to: 6.2 Task-number: QTBUG-98642 Change-Id: Id3e360726e285b3128e3e3f4bce9440404c9ad6e Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Doc build: fix conflicting response file with mocSamuli Piippo2021-11-291-7/+7
| | | | | | | | | | | | | Doc build is using the same variable to define the reponse file as moc build, which can lead to case where moc is using the qdoc's response file instead of its own. Moc needs more include paths than qdoc, this can then lead to weird compilation issues as moc doesn't warn about missing includes. Task-number: QTBUG-98569 Pick-to: 6.2 5.15 Change-Id: Id35da18f664e2032bae96d11b00dbfe55ce37f66 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Check that QStringView::split() w/rvalue QRegularExpression returns valid dataMarc Mutz2021-11-291-0/+29
| | | | | | | | | | | This test currently passes in Qt 6, but fails in Qt 5.15, thus the QT_VERSION check. Pick-to: 6.2 5.15 Task-number: QTBUG-98653 Change-Id: I3c7b9bc7ef74f605ff63768b38c473296274d0de Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH: use unqualified qHash() lookupMarc Mutz2021-11-292-4/+33
| | | | | | | | | | | ... instead of QT_PREPEND_NAMESPACE(qHash), which is qualified (prepends at least '::'), and therefore disables ADL. This is not a problem as long as we wrote our qHash() overloads as free functions (incl. non-hidden friends), but it should™ fail for hidden friends, so use the old using-std::swap() trick to bring QT_PREPEND_NAMESPACE(qHash) into scope, proceeding with an unqualified lookup. Pick-to: 6.2 Change-Id: I00860b2313699849f86bfe3dd9f41db4ce993cd3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* CMake: Fix Android platform detectionJoerg Bornemann2021-11-291-1/+28
| | | | | | | | | | | | | | | ...if an Android platform < 10 is installed. The existing platform detection code preferred android-9 over android-31, because the sorting did not use natural comparison. Natural comparison was added to CMake in version 3.18. We simulate this feature for older CMake versions. Pick-to: 6.2 Fixes: QTBUG-98726 Change-Id: Ib2eb87bd47220feb672275fa5203df4f2b6d7ca7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix gaps between lines of selectionEskil Abrahamsen Blomfeldt2021-11-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | When a font has fractional metrics, we could get visible gaps between lines in a multi-line selection, if the bottom of the rect was not aligned to the pixel grid. In Qt 5, this was primarily an issue on macOS, but since making vertical metrics consistent in f761ad3cd9ad1252f24b76ae413298dc7bed8af3, we could also get this on other platforms, causing a regression on these platforms. The fix is to align the rect to the pixel grid. [ChangeLog][Text] Fixed an issue where there would sometimes be visible gaps in selections spanning multiple lines. Pick-to: 6.2 Fixes: QTBUG-98372 Change-Id: I03cb1465602b6d78c60a0c764d920f7f092418a8 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Never handle scrollbars styled with box or border changes as transientVolker Hilsheimer2021-11-294-0/+102
| | | | | | | | | | | | | | | | If scrollbars are styled with a style sheet that includes a box or removes off the native border, then we never treat them as transient or overlapping. Otherwise, the layout logic in QAbstractScrollArea will show them on top of the viewport, overlapping the content. Add case to the style sheet test baseline test. It's a test for scrollbars in a scroll area, rather than a test for the styling of the scrollbars themselves. Fixes: QTBUG-98289 Pick-to: 6.2 Change-Id: Ic53ad248b3eedd54722ac7b2fe5256a27092dbc1 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* QTextDocument: fix an off-by-one in the changed signal for listsEirik Aavitsland2021-11-292-1/+64
| | | | | | | | | | | | | | | | | When blocks are added or removed in block groups, i.e. items added or removed from text lists, the whole group is marked as changed, but the calculation of the before/after group length would be one off. That was reflected in the contentsChange signal. Add unit test. Since the whole group changes when list items are added, text is removed and the change-begin is not where the cursor was when the change was made. Fixes: QTBUG-82455 Pick-to: 6.2 5.15 Change-Id: I99ee2cfef4944fcac8aca492741fd0f3b0de4920 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Shorten target name for qsortfilterproxymodel auto testsOliver Wolff2021-11-292-2/+2
| | | | | | | | | These long target names can quickly lead to exceeding Windows' max path length. Pick-to: 6.2 Change-Id: Ibd77e53464a71221f9302d490afbe9c41c16646d Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* gui: add QInputDevice::seatNames()Liang Qi2021-11-282-0/+20
| | | | | Change-Id: Ie6cedd62dcd684a8fd9adbc2409e5aa1f3490ede Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QObject: Q_ASSERT the object type before calling a PMFThiago Macieira2021-11-275-9/+108
| | | | | | | | | | | | | | | | | | | | | | | | The old-syle signal-slot syntax had the advantage of not delivering signals to slots in derived classes after that derived class's destructor had finished running (because we called via the virtual qt_metacall). The new syntax made no checks, so a conversion from the old to the new syntax may introduce crashes or other data corruptions at runtime if the destructor had completed. This commit introduces a Q_ASSERT to print the class name that the object is not any more. Since this is in inline code, this should get enabled for users' debug modes and does not therefore depend on Qt being built in debug mode. It required some Private classes to be adapted to the new form, by exposing the public q_func() in the public: part. Pick-to: 6.2 Fixes: QTBUG-33908 Change-Id: Iccb47e5527544b6fbd75fffd16b874cdc08c1f3e Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QLocale: suppress annoying GCC warning in the bootstrap libThiago Macieira2021-11-271-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Happens on line: return QList<QLocale>() << QLocale(QLocale::C); QLocale's constructor taking the C "language" calls findLocalePrivate() that returns indeed the non-heap object c_locale in the c_private() function. But it also sets the refcount to 1, meaning it can never drop to 0 under proper refcounting and will thus never be deleted. Therefore, the compiler is wrong. I don't have time to figure out how to teach it that the deletion can never happen. I just want the warning to go away. It wsa probably introduced by commit d4242b8af3e6eb5e9f68e5ff2efee97de11da892. In destructor ‘QSharedDataPointer<T>::~QSharedDataPointer() [with T = QLocalePrivate]’, inlined from ‘QLocale::~QLocale()’ at /home/tjmaciei/src/qt/qt6/qtbase/src/corelib/text/qlocale.cpp:1035:1, inlined from ‘void QtPrivate::QMovableArrayOps<T>::emplace(qsizetype, Args&& ...) [with Args = {QLocale}; T = QLocale]’ at /home/tjmaciei/obj/qt/qt6/qtbase/include/QtCore/../../../../../../src/qt/qt6/qtbase/src/corelib/tools/qarraydataops.h:829:5, inlined from ‘T& QList<T>::emplaceBack(Args&& ...) [with Args = {QLocale}; T = QLocale]’ at /home/tjmaciei/obj/qt/qt6/qtbase/include/QtCore/../../../../../../src/qt/qt6/qtbase/src/corelib/tools/qlist.h:891:15, inlined from ‘void QList<T>::append(QList<T>::rvalue_ref) [with T = QLocale]’ at /home/tjmaciei/obj/qt/qt6/qtbase/include/QtCore/../../../../../../src/qt/qt6/qtbase/src/corelib/tools/qlist.h:479:24, inlined from ‘QList<T>& QList<T>::operator<<(QList<T>::rvalue_ref) [with T = QLocale]’ at /home/tjmaciei/obj/qt/qt6/qtbase/include/QtCore/../../../../../../src/qt/qt6/qtbase/src/corelib/tools/qlist.h:726:13, inlined from ‘static QList<QLocale> QLocale::matchingLocales(QLocale::Language, QLocale::Script, QLocale::Territory)’ at /home/tjmaciei/src/qt/qt6/qtbase/src/corelib/text/qlocale.cpp:2684:54: /home/tjmaciei/obj/qt/qt6/qtbase/include/QtCore/../../../../../../src/qt/qt6/qtbase/src/corelib/tools/qshareddata.h:91:55: warning: ‘void operator delete(void*, std::size_t)’ called on unallocated object ‘c_locale’ [-Wfree-nonheap-object] 91 | ~QSharedDataPointer() { if (d && !d->ref.deref()) delete d; } | ^~~~~~~~ Pick-to: 6.2 Change-Id: Iccb47e5527544b6fbd75fffd16b8d078987b812b Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QLayoutPolicy: un-export the classMarc Mutz2021-11-271-5/+5
| | | | | | | | | | | | The class is almost completely inline. Don't export it wholesale, only export the few out-of-line members. Also acts as a test-case for the new Q_GADGET_EXPORT feature. Task-number: QTBUG-55458 Change-Id: I699a774614183960d7ac4e0afcdb57cfef76db15 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Drop Qt3 supportIvan Tkachenko2021-11-271-3/+1
| | | | | | | | | QDoc does not need those defines anymore because there is no Qt3Support library anymore; they are simply not #ifdef guarding any code anymore. Task-number: QTBUG-98650 Change-Id: I42b9c3ce025f639ce6282102b5eadb52fea7fa8e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* wasm: fix mouse move and right clickLorn Potter2021-11-271-4/+8
| | | | | | | | | | | | Emscripten has no concept of 'no mouse button', so when there is no button down, it was sending left mouse. Also we were hiding mousepress for only leftmouse downs. Fixes: QTBUG-97431 Pick-to: 6.2 Change-Id: Ibf078705c343944e45551830b7fee94ed5aa7333 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* QGraphicsItem: Update input context after InputMethod eventJarkko Koivikko2021-11-271-0/+1
| | | | | | | | | | | | Without updating the input context, the input method goes out of sync with the text control. Fix by updating the input context after InputMethod event. Fixes: QTBUG-98544 Pick-to: 6.2 5.15 Change-Id: Idfb99bb0f886249cdab923b8dbed96277800c064 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QSharedPointer: fix counter-productive QT_PREPEND_NAMESPACE use in qHash() implMarc Mutz2021-11-271-1/+1
| | | | | | | | | | | | | | | | | | The qHash(QSharedPointer) implementation is already in QT_NAMESPACE, if any, so explicitly qualifying the call adds no functions to the overload set, but actually removes functions that would be found by ADL (which is only enabled for unqualified calls). Fix by using an unqualified call. [ChangeLog][QtCore][QSharedPointer] The qHash(QSharedPointer<X>) overload can now use qHash(X*) overloads found (only) through ADL (was: ADL was disabled due to qualified lookup of qHash(X*)). Pick-to: 6.2 5.15 Change-Id: Ic6cc47103142d48b6cdefa2cd6552a65cf1cb222 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* wasm: Move Blob creation code to qstdwebMorten Johan Sørvig2021-11-273-21/+56
| | | | | | | | | | | | | | Add Uint8Array::copyFrom() and Blob::copyFrom(), which constructs JS data containers with content copied from the C heap. These should not be confused with e.g. the Uint8Array(buffer, size) constructor, which creates a Uint8Array which references content on the heap, without making a copy. Change-Id: Id7d25d8044ee3914d74698e5a15c93226568eaf3 Reviewed-by: David Skoland <david.skoland@qt.io> Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* Long live Q_GADGET_EXPORT!Marc Mutz2021-11-2711-192/+269
| | | | | | | | | | | | | | | | | | | | | | Like Q_NAMESPACE_EXPORT for Q_NAMESPACE, this variant of Q_GADGET allows passing an export macro. This is useful to avoid exporting the whole class just to get the staticMetaObject hidden therein exported. Before anyone asks: No, we don't need Q_OBJECT_EXPORT, because QObject subclasses, being polymorphic, always need to have a class-level export macro (to export their vtable), but while that technique also works for value classes (the Q_GADGET audience), it is not desirable for them, because it makes inline functions exported in Windows debug builds, which is not what we want, because it needlessly restricts what you can to with the inline functions (e.g. remove). [ChangeLog][QtCore] Added the Q_GADGET_EXPORT macro, which is like Q_GADGET, but allows passing an export macro (like Q_NAMESPACE_EXPORT for Q_NAMESPACE). Fixes: QTBUG-55458 Change-Id: I546297de1e8aa45d83381991bcd3fbca61e1eef0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QTest: fix grammar in static_assert()Marc Mutz2021-11-271-2/+2
| | | | | | Change-Id: I6fd408702bb43e37434b382cb6cb9057ca192064 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QThread::wait: Clarify documentation for unsigned long overloadFabian Kosmale2021-11-271-0/+3
| | | | | | | | | | It is not immediately clear from the signature that the time parameter's unit is miliseconds. Pick-to: 6.2 Change-Id: Ifee3c6410b6b2352e75571cc53578a660aabb32d Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* rhi: Add a more sophisticated resource update autotest caseLaszlo Agocs2021-11-271-0/+214
| | | | | | | | | | | | This time exercising series of buffer updates and texture uploads within proper, on-screen frames. (particularly interesting for dynamic buffers in case the double (or more) buffering and having multiple frames in flight involves special bookkeeping for these - using 'offscreen' frames like in other test cases does not necessarily exercise all of this) Change-Id: Id470919d27037359a1f0346a50a2a0e3966f5cd2 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Remove leftovers for supporting SAX-based implenentation of QDomDocumentSona Kurazyan2021-11-263-66/+14
| | | | | | | | | | | | | | | | QXmlDocumentLocator was introduced, so that QDomBuilder can work with both QXmlStreamReader and QXmlInputSource. It had two subclasses - QDomDocumentLocator and QSAXDocumentLocator, to allow getting line and column numbers while parsing, depending on the implementation. QSAXDocumentLocator was removed when removing SAX-based implementation (79e0374143ab385cb12a17443e91c8eb9d2f3a4b), and now it doesn't make sense to keep QXmlDocumentLocator/QDomDocumentLocator, we can get line and column numbers form QXmlStreamReader directly. Change-Id: I75f4a776472ee31ddc3685a999f356be9bf47ac5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* tst_qhashfunctions: check qHashRange{,Commutative}() find hidden friend qHash()Marc Mutz2021-11-261-9/+27
| | | | | | | | | ... extending the existing check for ADL-found qHash() implementations. Pick-to: 6.2 5.15 Change-Id: Iac6ed2721db9e95ee921bd1d5170fa8c8d43475d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Share common code for baseline-testing widget UIsVolker Hilsheimer2021-11-267-251/+270
| | | | | | | | | | | Setting up the baseline tests, creating an appearance identifier, and basic image-grabbing functionality doesn't need to be reinvented for each test case that wants to use baseline testing of widget UIs. As a drive-by, remove unneeded Qt 5 meta tags from .pri file. Change-Id: I1562e1b377946305cac018e0f0f0175c2c07cd31 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
* Mention QtFuture::when* functions in QFuture's docsSona Kurazyan2021-11-261-4/+7
| | | | | | | | | Also fix an unrelated minor issue in QtFuture::whenAll docs. Task-number: QTBUG-86714 Change-Id: I45f06b17db0508be10215e6d260ef76ede3077fb Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QVarLengthArray: fix insert() type/alias mismatch between decl and implMarc Mutz2021-11-261-1/+1
| | | | | | | | | | | | | | | | | The declaration of insert(it, n, t) used qsizetype for n, while the definition used size_type. That works by chance, because the size_type typedef comes only after the insert(it, n, t) declaration. It was detected when size_type became a typedef in a base class of QVarLengthArray in my local branch. Just use the same type name in the implementation as in the declaration. In 5.15, the same issue exists (with s/qsizetype/int/). Pick-to: 6.2 5.15 Change-Id: I64235eeaeaed3d43f4c070ca536474fae94c1b5d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* uic: Refactor CustomWidgetsInfo::extends() to use QAnyStringViewFriedemann Kleint2021-11-265-41/+41
| | | | | | | Task-number: PYSIDE-1720 Pick-to: 6.2 Change-Id: I2db4ee9586a87c70db08298e311d692e20a93af0 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Simplify apk build procedure when using DEPFILEAlexey Edelev2021-11-261-21/+17
| | | | | | | | | | | In qt6_android_add_apk_target we require that ${target} is already defined. So to add custom command that runs androiddeployqt we may simply read BINARY_DIR property of the target and use it as path to generated apk file as OUTPUT argument. This avoids the use any intermediate paths when producing apk and related artifacts. Change-Id: I8bb4174f6f9696e7a2a6b5d6399bb410419495fc Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add missing dependency of ${target}_check to ${target}_make_apkAlexey Edelev2021-11-261-0/+3
| | | | | | | | | | When building for and running the '_check' target in Android we need to make sure that target apk is assembled and ready for deployment. Pick-to: 6.2 Change-Id: Ifc63aac230f0bb8375d319ec443174c5a436485e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* qmake: use even fewer magic numbersMarc Mutz2021-11-261-28/+29
| | | | | | | | | | | | | De-unroll the loop over the "interesting" keyword ignore comments by using the existing array of their names. Replace magic numbers by strlen() calls. Use local starts_with() instead of strncmp() when comparing with fixed-size constant string literals, to avoid repeating the fixed string's lengths for the third argument of strncmp(). Task-number: QTBUG-55458 Change-Id: If458aced382948fb719d984702857fb2171c87ee Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Long live QVERIFY_THROWS_NO_EXCEPTION!Marc Mutz2021-11-269-15/+121
| | | | | | | | | Counter-part to QVERIFY_THROWS_EXCEPTION. [ChangeLog][QTest] Added QVERIFY_THROWS_NO_EXCEPTION macro. Change-Id: Ib6a80c8e810d5e2298ff00d608dae04e7a0c3e8f Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QWaitCondition: also benchmark std::condition_variable{,_any}Marc Mutz2021-11-261-13/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Results on my machine (only forever results): ********* Start testing of tst_QWaitCondition ********* Config: Using QtTest library 6.3.0, Qt 6.3.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 11.2.1 20211115), ubuntu 20.04 PASS : tst_QWaitCondition::oscillate_QWaitCondition_QMutex(forever) RESULT : tst_QWaitCondition::oscillate_QWaitCondition_QMutex():"forever": 637 msecs per iteration (total: 637, iterations: 1) PASS : tst_QWaitCondition::oscillate_QWaitCondition_QReadWriteLock(forever) RESULT : tst_QWaitCondition::oscillate_QWaitCondition_QReadWriteLock():"forever": 909 msecs per iteration (total: 909, iterations: 1) PASS : tst_QWaitCondition::oscillate_std_condition_variable_std_mutex(forever) RESULT : tst_QWaitCondition::oscillate_std_condition_variable_std_mutex():"forever": 331 msecs per iteration (total: 331, iterations: 1) PASS : tst_QWaitCondition::oscillate_std_condition_variable_any_QMutex(forever) RESULT : tst_QWaitCondition::oscillate_std_condition_variable_any_QMutex():"forever": 627 msecs per iteration (total: 627, iterations: 1) PASS : tst_QWaitCondition::oscillate_std_condition_variable_any_QReadWriteLock(forever) RESULT : tst_QWaitCondition::oscillate_std_condition_variable_any_QReadWriteLock():"forever": 913 msecs per iteration (total: 913, iterations: 1) ~331 vs. ~630ms. A pretty significant win (2x). Mårten noticed that on Windows, condition_variable::wait_for(x, 0ms) will not unlock the mutex, which, however, the program requires, so use a 1ns timeout instead. Drive-by fixes: - add override to run() reimplementations - fix type of timeout member variable (was int, should be unsigned long) - fix naming of test functions to distinguish better between QMutex and std::mutex Change-Id: Ib92310f15fbd58258b2043504642be5f0b860f39 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>