summaryrefslogtreecommitdiffstats
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Long live PRI*QdatatypesGiuseppe D'Angelo2021-04-251-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Qt defines some integral datatypes (qsizetype, qintptr, quintptr, qptrdiff) not in terms of the corresponding language datatypes (resp. make_signed_t<size_t>, intptr_t, uintptr_t, ptrdiff_t) but as "integer types with the same bit size of the corresponding language type" (and of course the corret correct signedness for the target type). This makes the Qt datatypes not printable via printf-like formatted output, incl. qDebug, qWarning, QString::asprintf and so on; that's because there isn't a format modifier that would universally work with the Qt definitions. For instance, on a 32 bit platform, ptrdiff_t may be a typedef for long, while qptrdiff is a typedef for _int_ instead. Both long and int would indeed be 32 bits, but they still are different types, and this means that the ptrdiff_t-specific 't' length modifier would be wrong for qptrdiff: qptrdiff p; printf("%td", p); // WARNING: -Wformat: wanted long, got int Similarly, not using 't' breaks on 64 bits, and so on and so forth. There isn't a way out, short of inserting casts on every print statement. So, let's adopt the same solution C/C++ use for their own integer typedefs: the PRIx macros. This allows one to always use the correct formatting specifier without the need of a cast. I'm not adding the macros for the qintXX datatypes, as they already exist in the Standard Library. [ChangeLog][QtCore][QtGlobal] A series of PRIxQTDATATYPE macros have been added. They make it possible to print some Qt type aliases (qsizetype, qintptr, etc.) via a formatted output facility such as printf() or qDebug() without raising formatting warnings and without the need of a type cast. Change-Id: I473226a661868aed9514d793c8e6e4d391ab5055 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Add QSortFilterProxyModel clear-filter benchmarkIgor Kushnir2021-04-254-0/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use QBENCHMARK_ONCE rather than QBENCHMARK to avoid skewing the results: when the QBENCHMARK block is repeated multiple times after the setup code above runs once, only the first setFilterRegularExpression() call unfilters some rows, while the subsequent calls simply check that there is nothing to do. The added benchmark is sensitive to the inefficiency - quadratic rather than linear time complexity - fixed by 7d92ef63d7c2d9d017d89905a2ee0d1e9226b15c. The following two tables contain the benchmark results on my GNU/Linux system. The numbers denote milliseconds per iteration. 1. Qt 5.15.2 without the performance fix: 10K 25K 50K 100K 250K 500K no match 0 1 2 5 14 28 all 0 0 0 1 3 7 first 0 1 2 5 14 28 1000th 2 6 12 25 68 302 middle 3 34 132 518 3300 13665 1000th from end 1 4 9 19 50 103 last 0 1 2 5 14 30 each 10'000th 0 39 211 937 6326 41050 each 100'000th 0 1 2 5 4226 34780 Without the fix the benchmark times out and aborts at 1000K and 2000K data rows. 2. Qt 5.15.2 with the performance fix: 10K 25K 50K 100K 250K 500K 1000K 2000K no match 0 1 2 4 12 26 56 136 all 0 0 0 1 3 7 14 28 first 0 1 2 4 12 26 56 136 1000th 0 1 2 4 13 28 62 145 middle 0 1 2 4 13 27 59 142 1000th from end 0 1 2 4 13 28 60 145 last 0 1 2 4 13 27 59 141 each 10'000th 0 1 2 6 22 69 290 1413 each 100'000th 0 1 2 4 13 30 81 261 Change-Id: I419a5521dd0be7676fbb09b34b4069d4a76423b1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QThreadPool: obey the docs that say we always use at least 1 threadThiago Macieira2021-04-241-1/+1
| | | | | | | | | | | | | | Even if the user (usually accidentally) sets a thread count of zero or negative. The reporter in the bug report did QThread::idealThreadCount() - 1 on a 1 CPU system... Drive-by add to the documentation and the missing #include. Pick-to: 6.1 6.0 Fixes: QTBUG-93007 Change-Id: I6cdea00671e8479b9c50fffd167807d14e030154 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* fix: The QtStartUpFunction function may be called repeatedlyJiDe Zhang2021-04-235-0/+192
| | | | | | | | | | Don't call pre routine function in qAddPreRoutine if the qt_call_pre_routines is not called Pick-to: 6.1 6.0 Task-number: QTBUG-90341 Change-Id: I0ee70561dc57b857f8b3b1cf42c9dfe0cf45bd49 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix QJniObject templates implementationsAssam Boudjelthia2021-04-231-12/+14
| | | | | | | | | | | | | Define the template calls in the header to allow for better type handling and checking with constexpr and avoid overuse of macros. Depending on the type provided in the QJniObject's call, the signatures and the correct JNI function variant is used. If a type is not supported a static_assert throws a compiler error. Pick-to: 6.1 6.1.0 Change-Id: I8a4d3ce85e1ff76ef385633f2a68511fffd12e55 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
* Lowercase system includes and lib names for Windows, fix cross compilingMartin Storsjö2021-04-232-2/+2
| | | | | | | | | | | | | | | When cross compiling from a case sensitive file system, casing matters, and mingw headers and import libraries consistently use lowercase. This was uncovered by d385158d5213ef568b7629e2aa4a818016bbffac; prior to that, the schannel TLS plugin didn't end up built (at least when cross compiling). Fix other similar cases that can be found by grepping the repo. Change-Id: Ia696e17b7aaa979d7b7f5b0801383f338a8b585b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* SQLite: Handle tables and fields with a dot in the name correctlyAndy Shaw2021-04-231-0/+49
| | | | | | | Fixes: QTBUG-91885 Pick-to: 6.1 6.0 5.15 Change-Id: Iba76bb50266dd4fb5f50e4ea1549d1d2bb6e3431 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Mark obsolete QMessageBox members as deprecatedVolker Hilsheimer2021-04-231-0/+9
| | | | | | | | | | | | | | | | Those overloads have been documented as obsolete, but never been deprecated. Add the deprecation macros to trigger warnings as of Qt 6.2. The overloads taking a single StandardButton should not be deprecated until Qt 7, as otherwise porting from old to new API will require an unnecessary cast to StandardButtons for calls with only a single enum value. The unit test explicitly tests the deprecated members, so disable warnings there. Fixes: QTBUG-92483 Change-Id: I283ddce4681eafda2378607f999946e56bbb777e Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Move plugin code from QtNetwork to qtbase/pluginsTimur Pocheptsov2021-04-227-207/+281
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All TLS (and non-TLS) backends that QSsl classes rely on are now in plugins/tls (as openssl, securetransport, schannel and certonly plugins). For now, I have to disable some tests that were using OpenSSL calls - this to be refactored/re-thought. These include: qsslsocket auto-test (test-case where we work with private keys), qsslkey auto-test (similar to qsslsocket - test-case working with keys using OpenSSL calls). qasn1element moved to plugins too, so its auto-test have to be re-thought. Since now we can have more than one working TLS-backend on a given platform, the presence of OpenSSL also means I force this backend as active before running tests, to make sure features implemented only in OpenSSL-backend are tested. OCSP auto test is disabled for now, since it heavily relies on OpenSSL symbols (to be refactored). [ChangeLog][QtNetwork][QSslSocket] QSslSocket by default prefers 'openssl' backend if it is available. [ChangeLog][QtNetwork][QSslSocket] TLS-backends are not mutually exclusive anymore, depending on a platform, more than one TLS backend can be built. E.g., configuring Qt with -openssl does not prevent SecureTransport or Schannel plugin from being built. Fixes: QTBUG-91928 Change-Id: I4c05e32f10179066bee3a518bdfdd6c4b15320c3 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QObjectBindableProperty: Allow signals taking a valueFabian Kosmale2021-04-221-1/+24
| | | | | | | | | | | | | If the signal takes a value, we pass the current value of the property to it. As we now use eager evaluation, accessing the current value is now possible. Change-Id: I5e6947a6575bfa8ca5143f56620c645d4750a686 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Add QObjectBindableProperyt::notifyFabian Kosmale2021-04-221-0/+45
| | | | | | | | | | | This mirrors the functionality of QObjectCompatProperty::notify, and can be useful to delay notifications until a class invariant has been restored. Change-Id: I1c16a0b1537a1b53d144c8abe48e546553edf877 Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix case sensitivity handling QSFPMSamuel Gaist2021-04-221-0/+66
| | | | | | | | | | | | | | | | | | | | | | This patch fixes the breaking of case sensitivity handling. The removal of QRegExp killed the wrong code paths which leads to inconsistencies when changing the regular expression throuh methods like setFilterWildCard or setFilterFixedString. Changing the case sensitivity also nukes the original options that were set on the regular expression if it was set through setFilterRegularExpression. [ChangeLog][QtCore][QSortFilterProxyModel] Case sensitivity as well as regular expression options handling have been fixed. The original value is properly kept when using setFilterWildCard and setFilterFixedString. The regular expression options are now also properly kept when changing the case senstitivity through setFilterCaseSensitivity. Fixes: QTBUG-92260 Pick-to: 6.1 Pick-to: 6.0 Change-Id: Ifb4732306f0c7d79ad0b18d3f5437c4523bb40e5 Reviewed-by: Igor Kushnir <igorkuo@gmail.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* QLayout: mark unsetContentsMargins as the RESET functionGiuseppe D'Angelo2021-04-211-0/+17
| | | | | | | | | | | | | | | | contentsMargins is a Q_PROPERTY on a QLayout. Qt 6.1 introduced QLayout::unsetContentsMargins() to reset the contents margins to the "default" ones (that the user can't know); that's the textbook description of a RESET function for the property. Add some tests also for unsetContentsMargins. [ChangeLog][QtWidgets][QLayout] The unsetContentsMargins() function now acts as the RESET function for the contentsMargins property. Change-Id: I463d88363c11f4a15ad3d6af71401d8698de1d41 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QObject: port to new property systemIvan Solovev2021-04-213-3/+13
| | | | | | | | | | | | | | | Extended QObjectPrivate::ExtraData to store a pointer to its parent, and reimplemented qGetBindingStorage() function for QObjectPrivate::ExtraData. This allows to use Q_OBJECT_COMPAT_PROPERTY macro for a property, stored in QObjectPrivate::ExtraData and solves all the problems with calling a custom setter. Task-number: QTBUG-85520 Change-Id: I40e01c29430846359ef9160fa1ae97c702be9a18 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Update QList benchmark testsAndrei Golubev2021-04-211-101/+68
| | | | | | | | | | | | | | | | | | | Removed 5.15 specific QVector code, which is unlikely usable now when we are at 6.1+ timeline (that was really only a nice-to-have during 5.15 -> 6.0 transition) Added "remove first" benchmark to track the fast (or not so fast) removal path Updated mid insertion and mid emplace to actually trigger both paths (growing at the beginning and at the end), before it was really using just one side, which is not quite the "mid" way it feels. Also changed mid insertion to actually use the insert algorithm. Seems like insert(i, t) calls emplace under the hood at least from the visual introspection Change-Id: I01b82cfa0ae38d481ea7362947f3607d757bf5d0 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix tst_qicon for fractional dprAllan Sandfeld Jensen2021-04-201-2/+5
| | | | | | | | | Add rounding one place, and skip addFile for now since the assumption about rounding dpr up no longer applies. Pick-to: 6.1 Change-Id: I0a84dfabb218acf42cb3816ba50ef899c8762523 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Correct the range of allowed hours for a POSIX rule's transitionEdward Welbourne2021-04-201-1/+1
| | | | | | | | | | | | | | | | | | | | A POSIX rule's transition time is allowed an hour in the range from -137 to 137; in particular, a negative hour is allowed, and used by some Greenland zones using Europe's time-of-transition which, as they are more than two hours west of Greenwich, happens before midnight. This means the time of transition can't be represented by a QTime(), so propagate the int that represents it to the code that consumes it; and treat parsing failure as an error rather than "correcting" it - if the transition time is given, it must be valid. Changed tst_QTimeZone::isTimeZoneIdAvailable()'s verification of validity to report the name of the zone it thought was invalid. (A later change, validating POSIX rules, caued this to fail for America/Nuuk without the present fix.) Change-Id: I5c9127ac34d878554dd0aca1c1c7338c7e0e1c28 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Return early from QTimeZone constructor if alleged IANA ID is invalidEdward Welbourne2021-04-201-0/+3
| | | | | | | | | | | | If the ID isn't even valid, don't waste cycles trying to make sense of it as identifying a time-zone. Add test of an invalid ID that provoked an integer overflow on trying to parse it as a POSIX zone specification. Fixes: QTBUG-92842 Change-Id: Ib80bbb88c11c0484ce0358acabbdc25c5bd8e0b3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_qpromise: build fixGiuseppe D'Angelo2021-04-201-4/+4
| | | | | | | | | | | | | | The test use aggregate initialization on some classes which however are no longer aggregates in C++20 (the rules changed again; in C++20 having a user-*declared* constructor makes a class not an aggregate). Just add a constructor so the code keeps compiling in both 17 and 20. Fixes: QTBUG-92963 Pick-to: 6.0 6.1 Change-Id: I52371c5ee34c84358987b5ae8bee9ab9c49c8eab Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Port QPropertyAnimation::propertyName to the new property systemAndreas Buhr2021-04-202-0/+12
| | | | | | | Task-number: QTBUG-85520 Change-Id: Id439783672b17810a51f867bcb69ee6c3eb5a022 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Correct prefix reported for end element in QXmlStreamReaderVincent Baijot2021-04-208-13/+13
| | | | | | | | | | | | | | | | | | | Before this change, QXmlStreamReader prefix value was always an empty string for EndElement when the documentation state : "Returns the prefix of a StartElement or EndElement." The error was a missing update of the prefix value when parsing EndElement. I updated the tests data which were also wrong because no prefix were reported even for </a:foo>. No new test is necessary, I think, the test data already cover the cases of EndElement with a prefix and without one (unchanged here). Fixes: QTBUG-86847 Pick-to: 5.15 6.0 6.1 Change-Id: I0ad38b9741d760f1ce688a36f969ec14e20a928c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QAbstractItemModelTester false positiveLuca Beldi2021-04-191-2/+5
| | | | | | | | | | When rows are removed from a model with no columns, the test should not report a problem if indexes are invalid Fixes: QTBUG-92886 Pick-to: 6.1 6.0 5.15 Change-Id: I7a042dfdb2575f87208a00cbed13db3869807f84 Reviewed-by: David Faure <david.faure@kdab.com>
* Fix qtbase cmake autotestJuha Vuolle2021-04-191-5/+2
| | | | | | | | | | The testcase relied on having optional packages, and that the last package in that list was found. Otherwise the version numbers of the found modules were not set. Change-Id: I76743fd029d6eed2f4b347280591e6fdaed19053 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add ScreenGadget utilityMorten Johan Sørvig2021-04-193-0/+266
| | | | | | | | | | | | ScreenGadget visualizes virtual desktop screen layout, in device independent and native pixels. This can be used to debug the (sometimes surprising) device independent screen geometry resulting from Qt applying a scale factor. Change-Id: I5b18e0fc9a54ba3e14d648794429b2eeadd25748 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Update DprGadadgetMorten Johan Sørvig2021-04-192-34/+128
| | | | | | | | | | Display active environment variables. Reorder the labels with device independent values to the left and native values to the right. Display the Qt scale factor. Change-Id: If95c252b06eff5abd91a25847777246effe94be2 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Port QSequentialAnimationGroup to new property systemAndreas Buhr2021-04-191-0/+44
| | | | | | | | | | | | There is only one property in QSequentialAnimationGroup, currentAnimation. This patch ports this property to the new property system Task-number: QTBUG-85520 Change-Id: Id528d30f551e88a6165bbb6a3c09d44e89257de5 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Port of QDBusServiceWatcher::watchMode to new property systemAndreas Buhr2021-04-191-0/+41
| | | | | | | | | | | Port watchMode in QDBusServiceWatcher to the new property system. This is the easiest part. Task-number: QTBUG-85520 Change-Id: I588212af205e77765862b8fecdbdcbf871717142 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Re-layout QProgressDialog when setting the cancel buttonQiang Li2021-04-191-0/+24
| | | | | | | | | | | | | | Setting a cancel button on QProgressDialog more than once caused the layout to be invalid. The layout was only applied when the dialog resizes or the style changes, but not when a new cancel button is set. The solution is to update the layout() before showing the dialog when adopting new child widgets. Fixes: QTBUG-19983 Pick-to: 6.0 6.1 Change-Id: Id8fb1ac56e94a9bd97d4559a2e8d4835856fd7d0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Inline test cases in tst_qlistAndrei Golubev2021-04-171-598/+157
| | | | | | | | | | | | QList tests have mostly a scheme of: void opInt() { op<int>(); } void opMovable() { op<Movable>(); } void opCustom() { op<Custom>(); } As a drive by, move the leak checking into a separate struct/macro Change-Id: I7cdda3a6c2aa324968aa26594da9f9eafbd49a0a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge integration refs/builds/qtci/dev/1618599897Qt CI Bot2021-04-163-634/+29
|\
| * QPropertyBinding: Add sticky modeFabian Kosmale2021-04-161-0/+25
| | | | | | | | | | | | | | | | | | | | | | A sticky QPropertyBinding is a binding that does not get removed when a write occurs. This is used in the QML engine to implement support for the QQmlPropertyData::DontRemoveBinding flag. Task-number: QTBUG-91689 Change-Id: Ib575b49abe634215318ccc7ba46212cc21eb4dad Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
| * Unicode: fix the extended grapheme cluster algorithmGiuseppe D'Angelo2021-04-162-634/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | UAX #29 in Unicode 11 changed the EGC algorithm to its current form. Although Qt has upgraded the Unicode tables all the way up to Unicode 13, the algorithm has never been adapted; in other words, it has been working by chance for years. Luckily, MOST of the cases were dealt with correctly, but emoji handling actually manages to break it. This commit: * Adds parsing of emoji-data.txt into the unicode table generator. That is necessary to extract the Extended_Pictographic property, which is used by the EGC algorithm. * Regenerates the tables. * Removes some obsoleted grapheme cluster break properties, and adds the ones added in the meanwhile. * Rewrites the EGC algorithm according to Unicode 13. This is done by simplifying a lot the lookup table. Some rules (GB11, GB12, GB13) can't be done by the table alone so some hand-rolled code is necessary in that case. * Thanks to these fixes, the complete upstream GraphemeBreakTest now passes. Remove the "edited" version that ignored some rows (because they were failing). Change-Id: Iaa07cb2e6d0ab9deac28397f46d9af189d2edf8b Pick-to: 6.1 6.0 5.15 Fixes: QTBUG-92822 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Merge integration refs/builds/qtci/dev/1618592683Qt CI Bot2021-04-161-2/+2
|\ \ | |/ |/|
| * tst_qcborstreamwriter: don't pass char8_t strings to QByteArrayGiuseppe D'Angelo2021-04-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There isn't a QByteArray constructor taking a char8_t*. (I am not sure if there should be one; QByteArray is not going to anything special about that information anyways.) Change such strings to be "ordinary" narrow string literals. There should be no problems at doing so, as by default we build in UTF-8 mode under all compilers. Pick-to: 6.1 6.0 Change-Id: Ia200ec6e3b0453bad033d5d8ff34c013bb27abd1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge integration refs/builds/qtci/dev/1618585460Qt CI Bot2021-04-161-80/+106
|\ \ | |/ |/|
| * Add support for grouped property changesLars Knoll2021-04-161-3/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add Qt::begin/endPropertyUpdateGroup() methods. These methods will group a set of property updates together and delay bindings evaluations or change notifications until the end of the update group. In cases where many properties get updated, this can avoid duplicated recalculations and change notifications. Change-Id: Ia78ae1d46abc6b7e5da5023442e081cb5c5ae67b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
| * Don't emit change notifications more often than requiredLars Knoll2021-04-161-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a property value changes, first update all dependent bindings to their new value. Only once that is done send out all the notifications and changed signals. This way, if a property depends on multiple other properties, which all get changed, there will only be one notification; and (potentially invalid) intermediate values will not be observed. Fixes: QTBUG-89844 Change-Id: I086077934aee6dc940705f08a87bf8448708881f Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
| * Remove lazy binding evaluationLars Knoll2021-04-161-87/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Too much of the existing code in Qt requires eager evaluation without large scale modifications. Combined with the fact that supporting both eager and lazy evaluation has a high maintenance burden, keeping lazy evaluation, at least in its current state, is not worth it. This does not diminish other benefits of the new property system, which include - a C++ API to setup and modify bindings and - faster execution compared to QML's existing bindings and the ability to use them without having a QML engine. We do no longer benefit from doing less work thanks to laziness. A later commit will introduce grouping support to recapture some of this benefit. [ChangeLog][Import Behavior Change][QProperty] QProperty uses always eager evaluation now when a dependency in a binding changes. Change-Id: I34694fd5c7bcb1d31a0052d2e3da8b68d016671b Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andreas Buhr <andreas.buhr@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* | Merge integration refs/builds/qtci/dev/1618564901Qt CI Bot2021-04-161-9/+5
|\ \ | |/ |/|
| * Extend time_t-based handling all the way to the end of time_tEdward Welbourne2021-04-161-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At least some modern 64-bit systems have widened time_t to 64 bits fixing the "Unix time" problem. (This is even the default on MS-Win, although the system functions artificially limit the accepted range to 1970 through 3000.) Even the 32-bit range extends into January 2038 but the code was artificially cutting this off at the end of 2037. This is a preparation for using the same also all the way back to the start of time_t. In the process, simplify and tidy up the logic of the existing code, update the docs (this includes correcting some misinformation) and revise some tests. Fixes: QTBUG-73225 Change-Id: Ib8001b5a982386c747eda3dea2b5a26eedd499ad Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge integration refs/builds/qtci/dev/1618561273Qt CI Bot2021-04-161-2/+2
|\ \
| * | Catch invalid offset returns from QTimeZone backendsEdward Welbourne2021-04-161-2/+2
| |/ | | | | | | | | | | | | | | | | | | If the backends run into an error in computing the offset, they return INT_MIN; but they are valled via the front-end, which returns zero when the zone is invalid. So treat INT_MIN returns from the backend the same as the case of being invalid. Change-Id: Ic3c4dfe964dbfba4030c770213eca8a63e84736d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge integration refs/builds/qtci/dev/1618515869Qt CI Bot2021-04-161-1/+3
|\ \ | |/ |/|
| * QWindowsPipe{Reader|Writer}: restructure signalsAlex Trotsenko2021-04-151-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For QProcess, there is no point in suppressing recursive QWPR::readyRead() emission, as the former manages this logic itself. On top of that, the non-recursive nature of QWPR::readyRead() indirectly disallowed reading from the channels inside QProcess::waitForReadyRead(), if that is called from a slot connected to QProcess::readyRead(). QWPW had two signals, one allowing recursion and one not. This commit allows recursion of QWPR::readyRead() and QWPW::bytesWritten(), and moves recursion suppression to the higher- level classes. This makes the code more uniform and efficient, at the cost of a few duplicated lines. Change-Id: Ib20017fff4d92403d0bf2335f1622de4aa1ddcef Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* | Merge integration refs/builds/qtci/dev/1618512247Qt CI Bot2021-04-1619-204/+25
|\ \
| * | Remove Qt dependency from some test helper executablesJoerg Bornemann2021-04-1519-204/+25
| |/ | | | | | | | | | | | | | | | | | | | | pro2cmake did not take into account the QT -= qt bit of the .pro files. Fixes: QTBUG-91676 Change-Id: If1373ee966312e4246490bd7389d75be9fa739cb Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* / Add the "Territory" enumerated type for QLocaleJiDe Zhang2021-04-1510-141/+141
|/ | | | | | | | | | | | | | | | | | | The use of "Country" is misleading as some entries in the enumeration are not countries (eg, HongKong), for all that most are. The Unicode Consortium's Common Locale Data Repository (CLDR, from which QLocale's data is taken) calls these territories, so introduce territory-based names and prepare to deprecate the country-based ones in due course. [ChangeLog][QtCore][QLocale] QLocale now has Territory as an alias for its Country enumeration, and associated territory-based names to match its country-named methods, to better match the usage in relevant standards. The country-based names shall in due course be deprecated in favor of the territory-based names. Fixes: QTBUG-91686 Change-Id: Ia1ae1ad7323867016186fb775c9600cd5113aa42 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge integration refs/builds/qtci/dev/1618405176Qt CI Bot2021-04-145-55/+55
|\
| * Replace deprecated APIs in metatype/variant benchmarksVolker Hilsheimer2021-04-144-52/+49
| | | | | | | | | | | | | | Fix compiler warnings. Change-Id: Id09b414f530a0d35c1a79e32112ff59185be2bc3 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
| * Replace conversion operator by operator* in QJniEnvironmentAssam Boudjelthia2021-04-141-3/+6
| | | | | | | | | | | | | | | | | | | | | | Since conversion operators do implicit conversion that might bring some potential issues while using the API, let's stick to having an operator* instead. Pick-to: 6.1 6.1.0 Change-Id: Ie7ad5537958944b8d1c11d69fbd30284b4b0344d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Alex Blasche <alexander.blasche@qt.io>