summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel
Commit message (Collapse)AuthorAgeFilesLines
* QMetaType: use modern comparisonsTatiana Borisova12 hours3-11/+16
| | | | | | | | | | | | | Internal QPropertyBindingPrivatePtr, QArgumentType classes also have been updated; Replace class operators operator==(), operator!=() of QRegularExpression to friend method comparesEqual() and Q_DECLARE_EQUALITY_COMPARABLE macro. Task-number: QTBUG-120304 Change-Id: I010617cbcb8bd6afb7c21ee4345398648821f72c Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* tst_QMetaProperty: expand testing around enums and flagsMårten Nordheim5 days1-0/+120
| | | | | | | | | | Test more scenarios, like separate namespaces, free enums, etc. And test that the enumerator() function returns a valid QMetaEnum when expected. Change-Id: Ie4fa816ffb66d6b6e1b4c7c50674c31eddbd642e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix test compilation issues with QtLite configurationJari Helaakoski5 days1-0/+8
| | | | | | | | | | Now developer build tests compile, but some are not working. Functional fix will come later via separate tasks. Task-number: QTBUG-122999 Change-Id: I70487b46c1b32ba4279cb02a4978e4f55ac0d310 Reviewed-by: Alexey Edelev <alexey.edelev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMetaMethod: use new comparison helper macrosTatiana Borisova11 days2-11/+18
| | | | | | | | | | Replace public friend operators operator==(), operator!=() of QMetaMethod to friend method comparesEqual() and Q_DECLARE_EQUALITY_COMPARABLE macro. Task-number: QTBUG-120304 Change-Id: Idb3f880a1db4850d73a58ed37f8cbd3454dd5ea2 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QThread: Reuse isMainThread()Jarek Kobus11 days1-4/+4
| | | | | | | Internally, reuse threadId and theMainThreadId. Change-Id: Iea6e7d8fcbcaf7e2f4dbf8ab33890d0f7954edc0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMetaSequence and QMetaAssociation: use new comparison helper macrosTatiana Borisova11 days2-1/+15
| | | | | | | | | | | Replace public friend operators operator==(), operator!=() of QMetaSequence and QMetaAssociation classes to friend methods comparesEqual() and Q_DECLARE_EQUALITY_COMPARABLE macroses. Task-number: QTBUG-120304 Change-Id: I88e9b228220d36092437bfb71ae2f053d2e99fdf Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QMimeData: fix setData on URI list without ending CRLFThiago Macieira2024-04-221-0/+8
| | | | | | | | | | | | | Commit 8d127c57376e48dd49afe62cfb8e714d26759a69 refactored this code from QByteArray::split to manually iterate over the list (and QStringTokenizer doesn't work for QByteArray), so we missed the last element in the iteration. Pick-to: 6.7 Fixes: QTBUG-124580 Change-Id: I455fe22ef4ad4b2f9b01fffd17c867f6ed350af7 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> Reviewed-by: David Faure <david.faure@kdab.com>
* QDeadlineTimer: use new comparison helper macrosTatiana Borisova2024-04-182-0/+32
| | | | | | | | | | | Replace public friend operators operator==() and operator!=() of QDeadlineTimer to friend method comparesEqual(). Replace public friends operator<(),<=(),>(), etc of QDeadlineTimer to friend method compareThreeWay(). Task-number: QTBUG-120304 Change-Id: Ib855ccac9b31b54fe28b822f2985154608fefa27 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* tst_QVariant: fix stringification of char16_t and char32_tThiago Macieira2024-04-151-1/+3
| | | | | | | | | | QVariant::toUInt() cannot convert from those two, so we always ended up with 0, producing lots of duplicated test rows. Pick-to: 6.7 Fixes: QTBUG-124349 Change-Id: Ie28eadac333c4bcd8c08fffd17c5a3e39a2cc3f6 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* tst_QVariant: remove duplicate rows from compareNumericsThiago Macieira2024-04-151-2/+1
| | | | | | | Task-number: QTBUG-124349 Pick-to: 6.7 Change-Id: Ie28eadac333c4bcd8c08fffd17c5a3d824fe76ec Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* tst_QVariant: fix copy & paste error in double-float comparisonsThiago Macieira2024-04-151-1/+1
| | | | | | | | | | | We wanted to test the (min,max) of each of the two types, but one of the four combinations wasn't correctly done. Task-number: QTBUG-124349 Pick-to: 6.7 Change-Id: Ie28eadac333c4bcd8c08fffd17c5a3ccb4205139 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* JNI: check for pending exception first in getCleanJniObject()Assam Boudjelthia2024-04-042-0/+28
| | | | | | | | | | | | | returning early if the object is null will not clear pending exceptions from the previous failed JNI call, and that will crash the app on the next jni call if an explicit exception clearing is not done, wish mostly the case. Checking and clearing for exceptions has to always be done under this call. Pick-to: 6.7 Fixes: QTBUG-122135 Change-Id: I0d42d012a4d1305fa07147fd22860d7c005f9b83 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Fix Qt::AA_DontUseNativeMenuWindows being unsettable on 32 bit systemsMitch Curtis2024-04-042-0/+54
| | | | | | | | | | | | | | | | f1bb9cfbf65ab56b67b5a52fa736071e0e534261 added this value, but it was only when a test in qtdeclarative tried to use it that it was discovered that it couldn't be set on 32 bit operating systems (armv7, AKA imx7) due to overflow as a result of the bit shifting that is done. Fix it by using an old, deprecated value. If any old codebase using that older flag tries to build against a newer Qt with this change, it shouldn't affect it, as setting the flag does nothing in Widgets, and native menus didn't exist in earlier versions. Task-number: QTBUG-69558 Change-Id: I520154d02e9ccf007ebd73807685212a19fbee1b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Tests: check the output of QFile::openGiuseppe D'Angelo2024-03-272-3/+3
| | | | | | | | | | Wrap the call in QVERIFY. tst_QTextStream::read0d0d0a was also faulty as it *never* opened the file because of a broken path. Fix it with QFINDTESTDATA. Change-Id: I61a8f83beddf098d37fda13cb3bfb4aaa4913fc5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMetaMethod: document that fromSignal(nullptr) is okMarc Mutz2024-03-211-0/+7
| | | | | | | | | ... and add a test. Pick-to: 6.7 6.6 6.5 6.2 5.15 Change-Id: I907899d7c54349d2fc23ea5ab58a1e67826b622b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QProperty: Destroy binding when refcount is 0Ulf Hermann2024-03-181-0/+44
| | | | | | | | | | This has to be done from all places where we deref it. Otherwise we leak memory. Pick-to: 6.7 6.6 6.5 Fixes: QTBUG-116086 Change-Id: I57307ac746205578a920d2bb1e159b66ebd9b2cc Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QAbstractEventDispatcher: port timer uses to the V2 APIThiago Macieira2024-03-131-40/+65
| | | | | | Change-Id: I83dda2d36c904517b3c0fffd17b52b71739928dc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* QVariant: use comparison helper macrosIvan Solovev2024-03-122-34/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | The relational operators were removed in 8652c79df0a47264a2d525424484e15744e2462b with the argument that they do not have a total order. Back than it was a valid argument, because Qt did not support any of the C++20 ordering types. Now Qt has its own implementation for all three ordering types, so we could technically add relational operators and claim that QVariant provides partial ordering. However, that could potentially lead to many bugs and/or unexpected results, if people start using QVariant as a key in std::map/QMap containers. We do not want that to happen, so we only use the helper macros to implement (in)equality operators. This commit also extends the unit tests, providing more extensive testing of (in)equality operators and the pre-existing QVariant::compare() method. Fixes: QTBUG-113234 Change-Id: I783f3b5df552da782627f4ed0a5bb1b577753a23 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* JNI: Fix error with overload resolution when passing string typesVolker Hilsheimer2024-03-063-0/+69
| | | | | | | | | | | | | | | | | | | | The variadic templates are supposed to be removed from the overload set when any of the parameters is a literal string type, as otherwise we get conflicts with the legacy overload taking class names and signatures as const char *. The detection of a literal string types was missing a few specializations, so that we ended up with the wrong overload being called, and class names getting interpreted as method names instead. Add the missing specializations, and add more test coverage for using the old overloads. Task-number: QTBUG-122235 Pick-to: 6.7 Change-Id: I5488f2009c8f62d74fac6754844f57cf64011414 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Rami Potinkara <rami.potinkara@qt.io> Reviewed-by: Lauri Pohjanheimo <lauri.pohjanheimo@qt.io>
* Correct license for filesLucie Gérard2024-03-051-1/+1
| | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Task-number: QTBUG-121787 Change-Id: Iee9f4fca676e77ab9d8ed485a28ce5ea8803be15 Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* Timers: add Qt::TimerId enum classAhmad Samir2024-03-032-7/+27
| | | | | | | | | | | | | | | | | | | | | | | | Which will be used to represent timer IDs. Thanks to Marc for the idea to use "a strongly typed int". QTimer got a new id() method that returns Qt::TimerId (can't overload timerId()). Various classes in qtbase have a member named timerId(), but a new method is needed anyway in QTimer so id() it is (this is the reason QChronoTimer only has id() and no timerId()). Besides timer.timerId() has an extra "timer". This commit fixes the inconsistency between QObject using `0` timer id to indicate "failed to start", while QTimer::timerId() returned `-1` to indicate "timer is inactive". QTimer::id(), being a new method and all, now returns Qt::TimerId::Invalid, which has value `0`, so that the values match between the two classes. Extend the unittests to ensure QTimer::timerId()'s behavior is preserved. [ChangeLog][Core][QObject] Added Qt::TimerId enum class, that is used to represent timer IDs. Change-Id: I0e8564c1461884106d8a797cc980a669035d480a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add QChronoTimer, a timer with nanoseconds precisionAhmad Samir2024-03-034-665/+388
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The interval in QTimer is a QProperty of type int, which means it's limited to the number of milliseconds that would fit in an int (~24 days), this could cause overflow if a user constructs a QTimer with an interval > INT_MAX milliseconds. And it can't be easily changed to use qint64/std::chrono::nanoseconds: - changing the getters to return qint64 means user code would have narrowing conversions - the bindable QProperty interval can't be changed to qint64 during Qt6's lifetime without the risk of breaking user code - adding a new bindable QProperty that is qint64/nanoseconds is an option, but it has the complication of what to do with the int interval; set it when setInterval(milliseconds) is used by using saturation arithmetic? and what about notifying observers of the changed interval? Thus the idea of creating a new stop-gap class, QChronoTimer, as a cleaner solution. Both classes use QTimerPrivate. During the lifetime of Qt6, QTimer's interval range is about 24 days, whereas QChronoTimer's interval range is about 292 years (duration_cast<years>nanoseconds::max()). Currently the plan is to fold QChronotTimer back into QTimer in Qt7. Mark all QPropertyS in the new class as FINAL since they aren't intended to be overridden; this offers a performance boost for QML[1]. [1] https://lists.qt-project.org/pipermail/development/2024-February/044977.html [ChangeLog][QtCore] Added QChronoTimer, which uses a std::chrono::nanoseconds intervals, as a replacement for QTimer. Fixes: QTBUG-113544 Change-Id: I71697f4a8b35452c6b5604b1322ee7f0b4453f04 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Copy QTimer source files to QChronoTimerAhmad Samir2024-03-033-0/+1574
| | | | | | | Ultimately this is the best way to keep the log history of the code. Change-Id: I3413deffdb093a3239d65b6ca939e744224e722a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* JNI: support construction of QJniArray from std::initializer_listVolker Hilsheimer2024-02-262-13/+29
| | | | | | | | | | | Add implict constructor, treat the list like any other container. Simplify the test code, and explicitly constructor-initialize when we want an array and might have an array, so that we don't end up with constructing arrays of arrays. Change-Id: I14615f897cf8a2188510cfe1085ffc70a2396d5d Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* JNI: Support QStringList as a parameter of native functionsVolker Hilsheimer2024-02-233-0/+37
| | | | | | | | | | | | | | | Since we support QString and QList specializations, we should also support QStringList directly. That's a bit more involved as we need to specialize the code path for QString, which is not convertible to or from jobject. But once we have mapped the type to jstring it follows the implementation for lists of objects. We now need to generate temporary local references when converting a QString to a jstring, so manage a local frame. We do so explicitly in chunks of 100 local references. Change-Id: I7ae5cf7d0ba0099992c36f3677980c346526804b Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* JNI: implement support for native functions taking a listVolker Hilsheimer2024-02-232-1/+51
| | | | | | | | | | | | | This didn't work yet because the partial specialization of the JNITypeForArgImpl factory was missing. Add a test case for QJniArray<double> and QList<double>. What doesn't work (yet) is QStringList for a native Java function taking a String[]. That will be added in a follow-up commit. Change-Id: I4d3fa0ecc04b98b9749f8358792f86c02ddbbc14 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QTimer: use QTest::ingoreMessage() for negative internvals testsAhmad Samir2024-02-151-0/+15
| | | | | | Pick-to: 6.7 6.6 6.5 Change-Id: I87d095b748a7488a71b22710ab7ed72d9451c769 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QTimer: do not set active state when setting a negative intervalIvan Solovev2024-02-121-1/+37
| | | | | | | | | | | | | | | | | | | | | | | QObject::startTimer() returns 0 in case of failure, for example when someone tries to register a timer with a negative interval. However, QTimer internally uses -1 as an invalid timer id. This could lead to a situation when the timer was not really started, but QTimer::isActive() returned true. This patch fixes it in two ways: - check the return value of QObject::startTimer() and treat 0 as an error. - do not treat 0 as a valid timer id when calculating the active state. As a drive-by: move the `using namespace std::chrono_literals;` declaration to the top of tst_qtimer.cpp, so that we do not need to repeat it in each test case. Fixes: QTBUG-122087 Pick-to: 6.7 6.6 6.5 Change-Id: I0e21152b2173ebb5fb0dada1b99a903a321ca9c4 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* QObject: fix installEventFilterOrder() test flakinessJarek Kobus2024-02-041-45/+40
| | | | | | | | | | Don't rely on timer precision and use int counter instead. Amends 1fe88bf4cd919d4b5cadb4be2cf0193525c54673 Pick-to: 6.7 6.6 6.5 6.2 5.15 Change-Id: I057b4dd51014784ec9b244301b43583f3de6ddd1 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
* Change license for tests filesLucie Gérard2024-02-0446-46/+46
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* QObject: add unittest to check the order of eventFilter() callsAhmad Samir2024-02-011-0/+75
| | | | | | | | | | | | | | | | | installEventFilter() prepends new objects to the eventList, so that events that are posted while processing events are left to the next round of event processing. This is a baseline test to check that subsequent commits preserve the current behavior. QCOMPARE_GT is available since Qt6.4, so make the check backportable to older releases too. Pick-to: 6.7 6.6 6.5 6.2 5.15 Task-number: QTBUG-120779 Change-Id: I5ed5e9c2917a9be62de4af19c3b72889399b4fe6 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* JNI: Fix QJniObject::callback test caseVolker Hilsheimer2024-02-011-4/+4
| | | | | | | | | Don't call the native function directly, call the Java function that calls the native function. Pick-to: 6.7 Change-Id: Icdcf250313a38f6e4bc2b90fb7b0adbfa5a890fb Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
* QJniArray: make reverse-iterableVolker Hilsheimer2024-01-291-0/+11
| | | | | | | | | | | | Add rbeing/rend overload, relevant typedefs, and decrement operators. As a drive-by, add noexcept to begin/end functions. Found during header review. Pick-to: 6.7 Task-number: QTBUG-119952 Change-Id: I32d9a7d50a1f03550944c2247516c455d4822fe7 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QJniArray: add missing post-increment operatorVolker Hilsheimer2024-01-291-0/+11
| | | | | | | | | Augment test case. Found during header review. Pick-to: 6.7 Task-number: QTBUG-119952 Change-Id: I326395397167edb05ff1f45f7151614c02b7e7eb Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QJniArray: add missing typedefsVolker Hilsheimer2024-01-291-0/+8
| | | | | | | | | | | | | | Add missing nested typedefs for both the QJniArray container and the QJniArrayIterator. Expand test case to make sure that some standard algorithms (such as std::distance and ranged for) work with those types. Found during header review. Pick-to: 6.7 Task-number: QTBUG-119952 Change-Id: I96f348215c6f1e0e1ce777d9bdd2f172d7e52974 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* moc/QMetaProperty: Remove limitation on non-own-class notify signalsFabian Kosmale2024-01-261-1/+27
| | | | | | | | | | | | | | | | | | | | | | | | | The moc generated code does a sanity check that NOTIFY signals actually exist in the parent class when they cannot be found in the class moc currently runs on. The logic there was however too simplistic, and couldn't deal with signals taking a parameter. Fix this, and take the opportunity to use a proper static_assert instead of generating a "normal" compile error. We do not do any checks for the presence of QPrivateSignal, as the whole point of QPrivateSignal is that it should be private (and not e.g. protected). Moreover, we adjust QMetaProperty::notifySignalIndex to take single-argument notify methods into consideration as well when encontering an unresolved notify index. Fixes: QTBUG-115989 Pick-to: 6.7 Change-Id: I8a056a15777f3132691e207b4b9ab6c2c9b2126d Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QObject: Let moveToThread return succcess stateChristian Ehrlicher2024-01-241-3/+5
| | | | | | | | | | | | | | | Add bool QObjectPrivate::moveToThread() which returns the success state of the attempt to move the object to the new thread. For Qt7 the public signature of QObject::moveToThread() should be changed to directly return this value. [ChangeLog][QtCore][QObject] QObject::moveToThread() now returns a boolean success state. Pick-to: 6.7 Change-Id: I8441c8155a76b804b473ab9c45c2be6840ef1677 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QJniArray: fix const_iterator declaration, make it default-constructibleVolker Hilsheimer2024-01-241-0/+17
| | | | | | | | | | | | | | | Iterators are required to be default-constructible and value-initialized iterators must compare equal. In a const_iterator, the pointee should be const, not the iterator itself. Found during header review. Pick-to: 6.7 Task-number: QTBUG-119952 Change-Id: I036c0a62ade8c59dc5d62c0823b375223719af3f Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QJniArray: add test case for QJniArray::sizeVolker Hilsheimer2024-01-231-0/+15
| | | | | | | | | Fix build of the test by removing the reference from the container type before accessing the nested typedef. Pick-to: 6.7 Change-Id: Ic35f312bac70b8f8f80149a3432329070c8c8c7d Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QObject: assert connection type isn't UniqueConnection for lambdasAhmad Samir2023-12-221-1/+36
| | | | | | | | | | | | | | | An assert is harder to miss than a warning, which makes it more likely to get fixed. Thanks to Mårten Nordheim for the idea. Add the assert in inline code so that users compiling their code in debug mode (or with -DQT_FORCE_ASSERTS) can hit the assert even when built agaist a release build of Qt (not everyone compile their code with a debug build of Qt). Thanks to Giuseppe D'Angelo for the idea. Pick-to: 6.7 6.6 6.5 Task-number: QTBUG-115125 Change-Id: I2935d32ea5a2c288d7a836abbae66ac53cb5ab2f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Blacklist QEventLoop test on QNXVolker Hilsheimer2023-12-181-1/+1
| | | | | | | | | Both the GUI and core version of that test is flaky on QNX. Pick-to: 6.7 6.6 Task-number: QTBUG-119359 Change-Id: Ied7013e04bdd12270a84ab32d2bd4e45c52136c3 Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
* JNI API review: minor API and implementation cleanupsVolker Hilsheimer2023-12-151-32/+32
| | | | | | | | | | | | | | | | - prefix ValidField/SignatureTypes predicates with "If" - make QJniArray SMF constexpr and noexcept - remove const from return-by-value QJniArray functions - rename QJniArray::asContainer to toContainer - constrain QJniEnvironment::registerNativeMethods to valid class types - don't home-grow std::forward - make default QtJniTypes::Object constructor implicit - don't include copy/move constructors in QtJniTypes::Object variadic constructor Pick-to: 6.7 Change-Id: Ied02993d32d8b0f3ef1e571b75ada15ede1f8389 Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
* QProperty: clean up unnecessary sentinel classPo-Hao Su2023-12-091-0/+54
| | | | | | | | | | Instead of introducing the nested class InheritsQUntypedPropertyData as a sentinel class for inheritance check, we can use BinaryTypeTrait to handle the check. By doing this, we no longer need to maintain the nested class. Change-Id: Ie3aae976015d5fae6b6d072cad6ee52cd30b769d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QMetaType: fix typenameHelper() for types in the QtPrivate namespaceThiago Macieira2023-12-082-0/+16
| | | | | | | | | | | | | | | | | | GCC at some point decided that it wouldn't include the full namespace expansion in __PRETTY_FUNCTION__ for any type that is in the same namespace as the template function being expanded (that is, the QtPrivate) namespace. I don't know how long this behavior has been in place, but it can be seen with GCC 13, where the expansion of that macro inside QtPrivate::typenameHelper<QtPrivate::ModelIndex>() is: constexpr auto QtPrivate::typenameHelper() [with T = ModelIndex] This can be easily worked around by using a different namespace. Fixes: QTBUG-119650 Pick-to: 6.6 6.5 6.2 Change-Id: Ica7a43f6147b49c187ccfffd179df309e43a70cb Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QMetaEnum: let key(s)ToValue match fully-qualified unscoped enumeratorsAhmad Samir2023-11-261-2/+15
| | | | | | | | | | | | | | | | | | | | For an unscoped enumerator, e.g.: namespace N { class C { enum E { F }; }; }; N::C::F and N::C::E::F are equivalent and key(s)ToValue should match both. This already works for scoped enums because the name of the enum can't be dropped. Fixes: QTBUG-118240 Pick-to: 6.6 Change-Id: I84d7bbb7aa8f82b2a7c2bc7e4edd5d77d37335c4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Purge empty BLACKLIST files from testsEdward Welbourne2023-11-241-0/+0
| | | | | | | There's no point to the file if it has no content. Change-Id: Ie0deb59a63d5f7a654fcab1218e0a814710072ff Reviewed-by: Jason McDonald <macadder1@gmail.com>
* Add a comment to tst_qtimer.cpp to point out its reuse by QtGuiEdward Welbourne2023-11-241-0/+10
| | | | | | | | | | The same test code is compiled by two different modules' tests, which won't be obvious to the reader of the code unless it's pointed out explicitly. Change-Id: I99dba6eb186939c372636c5c1fc29799003d32a7 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Blacklist tst_QGuiEventLoop::processEvents on QNXVolker Hilsheimer2023-11-222-0/+16
| | | | | | | | | | | | | The test log shows flaky failures of this test several times a day on QNX, so blacklist it. To do that, we need to be able to isolate the "GUI" mode of this test. To do that, add a single data tag that depends on whether the test project is built for GUI or Core, and blacklist only the "gui" data tag. Task-number: QTBUG-119359 Pick-to: 6.6 Change-Id: I91c2380de0a3febedcf781f27fed4a1fa6aa5515 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QObject: allow calling findChild() without a nameRym Bouabid2023-11-221-0/+19
| | | | | | | | | | | Add an overload of findChild() without a name argument to be able to call the function with options value only. [ChangeLog][QtCore][QObject] Added findChild() overload taking no name. Task-number: QTBUG-103986 Change-Id: Id06b6041408fcf4cc1eeba975afce03f3a28f858 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* tst_QTimer: refactor CMake codeAhmad Samir2023-11-222-19/+14
| | | | | | | | | It's used to build different variations of the unittest, linking against QtCore-only/QtGui, with/without GLib, that's four individual tests. Change-Id: Iaf0f37041dbb148134631f86be99feaa881a8ce8 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>