LibraryMapping.components is a list that holds the sub-components of a
CMake package. Before, we held this information in
LibraryMapping.extra as find_package argument.
A subsequent patch will make use of LibraryMapping.components and
doesn't have to do find_package argument parsing.
Change-Id: Ie0d317245fb6ec1511e06b2e14c364292fced63a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We prefer it when the CMakeLists.txt project files for examples use
qt_add_qml_module() when adding resource files, rather than
qt6_add_resource().
A bit of refactoring was needed to re-use the code that extracts
resource information from the .pro file.
The new function write_qml_module is now responsible for writing
qt_add_qml_module calls.
Task-number: QTBUG-96799
Change-Id: I74dc2d681dcf4fc848e1147b3232ce9a9e0946c9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Without this change, the test fails when run twice in a row. Also, skip
the test if we can't move the cursor.
Pick-to: 6.3
Change-Id: Ic45c073007d114fbd7825cedef6761c1e410b4af
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The data is guaranteed to be in US-ASCII (result of toHex()), so
there's no need to jump through ASCII → UTF-16 → UTF-8 hoops.
Found by Clang and QT_ASCII_CAST_WARN.
Amends 16b614f2e1.
Change-Id: Ib6789af9fb90952ecbe805e182b0639e1d0704b1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Remove compilation workarounds to get rid of warnings as those QPA
plugins are not supported by QNX.
warning: cast from 'void*' to 'EGLNativeDisplayType' {aka 'int'}
loses precision [-fpermissive]
warning: invalid conversion from 'EGLNativeDisplayType' {aka 'int'}
to 'void*' [-fpermissive]
Pick-to: 6.2 6.3
Task-number: QTBUG-101382
Change-Id: I515708a8869498eb91df4fcba85a7b751d13a25c
Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Also include the comprehensive tests for bool cast compilation which I
originally wrote to confirm that the QTEST_ASSERT() change should be™
correct.
Pick-to: 6.3
Task-number: QTBUG-101406
Change-Id: I9a2871bfd4be9999b7a720bec775bba7aeffbe24
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
This got lost in commit b852584556 .
Also augment util/x86simdgen/header so that the header is
automatically included when qsimd_x86_p.h is re-generated.
Change-Id: I3e59b983f78b8c1aced3757e1aa5dceb6d653d97
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In preparation for adding it to headersclean.
Some remarks:
* QStandardItemModel builds just fine (QFlags has comparison operators
against literal zero); the warning we however get is about 0 converted
to a null pointer constant. There's nothing we can do about that one
(even <compare> gives such a warning).
* Several code was depending on flags->int conversions. Add toInt(),
but also cast again to the expected type to avoid warnings in case
toInt() returns unsigned int.
* Ported to explicit casts to bool rather than test(Any)Flag to minimize
confusion for people unfamiliar with the test*Flag methods.
Change-Id: I5be280ac33a0b38e2680096f0e79129fd55ba241
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The deprecated Carbon function FSIsAliasFile() returned isAlias only for
actual aliases, whereas the replacement CFURLCopyResourcePropertyForKey
with kCFURLIsAliasFileKey returns true for both aliases and symbolic
links.
Since we didn't explicitly check for AliasType in any of our internal
code, or or any of the public API, the distinction did not cause any
issues, but if we want to expose QFileInfo::isAlias() we need to fix
this.
Pick-to: 6.2 6.3 5.15
Change-Id: I29f795d55fe40898de319aa1cb0a4a1b5646bbd6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fixes also similar warnings from other Qt modules:
warning: offsetof within non-standard-layout type
is conditionally-supported [-Winvalid-offsetof]
Pick-to: 6.2 6.3
Fixes: QTBUG-101411
Fixes: QTBUG-101381
Fixes: QTBUG-101415
Task-number: QTBUG-101384
Task-number: QTBUG-101382
Change-Id: I23158c6ef90c7b4aeeaeeced32214a31acf8f6b1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Document the tag for more clarity on why it's needed, and for what
platforms.
Pick-to: 6.2 6.3
Task-number: QTBUG-97009
Task-number: QTBUG-91150
Change-Id: Ie4522fb582583be07270d3cdbf83992897b51669
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
The network reply needs to send the finished() signal after
any error.
Change-Id: Iafc42d26f91241293042b72201eef2e88613e468
Fixes: QTBUG-101286
Pick-to: 6.3 6.2
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Apple added iPhonePlatform to navigator properties and so use that
Fixes: QTBUG-101441
Change-Id: I5a0f27fc18dfa224b6373c5d809cf884d51c880a
Pick-to: 6.3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
When we use a native view controller for selecting documents, we have
two methods to implement from UIDocumentPickerDelegate (a file was selected
or the selection was cancelled). Unfortunately, swiping a view away
was not handled, so neither 'accept' nor 'reject' was called. Depending
on the classes using QIOSFileDialog, this may leave them in some incorrect
state, not knowing that they are 'closed' anyway.
As suggested by Tor Arne, the solution is to implement
UIAdaptivePresentationControllerDelegate's method, namely
-presentationControllerDidDismiss:, which never gets called if the
controller was dismissed programatically (the case of accept/reject).
Pick-to: 6.3 6.2 5.15
Fixes: QTBUG-93505
Change-Id: I28404aa280465ef8eb0f5c26c8c2e4e4a6c66641
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
It's just a proxy-setter so we cannot really avoid the call
Pick-to: 6.3 6.2
Change-Id: I4230075a906c100ddb9722160859e7a2c8e26ebc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The code didn't make much sense:
- QHighDpi::fromNativeLocalPosition should not take global positions
- QPlatformWindow::mapFromGlobal() should not take local positions
Tested with a basic MFC window that has a QMainWindow as child
(parented with QWinWidget from QtWinMigrate). Menus would be off
when on a secondary screen with dpi factor > 1
Change-Id: Ib5cbf5d29ed97c786f7f7ba4e868b70cb5435239
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
the char array of argv passed to the app's main() function
need to be null terminated [*] and argv to be **char.
[*] http://eel.is/c++draft/basic.start.main#2
Fixes: QTBUG-101028
Pick-to: 6.2 6.3 5.15
Change-Id: I6e3a685f092a92a94f60d166357b75d2538af74c
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
QDateTimeEdit's default constructor instantiates the start of
1752-09-14 as its default earliest time; however Friedeman has seen
this triggering an assertion. The QDTE tests should be picking that up
anyway, but let's overtly test it in QDate's startOfDay testing, too.
Change-Id: Ifae87f2695ac3a7993c173a7c21809c87d5daa71
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
A recent change introduced a cut-off in believing MS's claims that a
zone has always had a yearly cycle of DST, to stop believing it before
1900, as no actual zone adopted DST that early. However, this was only
applied to the data() method to get the data for a specified time;
failure to do the same for {next,previous}Transition lead to
inconsistent results and tripped up an assertion. The change to data()
also failed to consider the situation of a southern hemisphere zone,
for which the rule will claim the early part of the year was in DST;
and init() should also mark an initial DST-recurrence rule as starting
no earlier than 1900.
Add corresponding FIRST_DST_YEAR checks to {next,previous}Transition()
to be consistent with the one in data(), refine data()'s checking and
amend init().
This amends commit 9a83706046
Pick-to: 6.3
Fixes: QTBUG-100873
Change-Id: Ic9822b87caa01561bc0b7d0355963e4c80ef047c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The first transition in a year with DST is *to* DST precisely if the
year *doesn't* start in DST, not if it does.
Also fix the startsInDst() check it's using there, which neglected the
possibility that the year's DST transition might be faked.
This amends commit d98b43005e
Pick-to: 6.3
Change-Id: I17422fa9972f826b5bf7e325f5e579f41300fd97
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In nextTransition() it wasn't being carried over from one rule to the
next, as intended. It needs to be defined at function level, set for
the first rule and updated for each new year tried. Also assert that
it does faithfully reflect the standard time in rules without
transitions.
In the process of fixing that, since it's computed from the
yearEndOffset() of a prior year, test whether that year is less than
the rule start rather than whether the present year is less than or
equal to it. As the prior year is immediately before the present year,
this makes no difference, but it clarifies the reasoning. Apply this
clarification also in data() and previousTransition() for consistency.
Pick-to: 6.3
Change-Id: I29c41e67784eaae13b83f6ae1ad16509e636c187
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In QWinTimeZonePrivate::previousTransition(), an initial no-transition
first rule was interpreted as implying a transition to its standard
time at "the start of time". Do the same for times before the start of
the first rule even if it is a DST recurrence; and, in data(), treat
times before the first rule as being in its standard time.
In the process, restructure data() to do that early return first,
instead of in an else clause, so as to dedent the other branch of its
code and make clearer how it fits into its outer loop.
Pick-to: 6.3
Change-Id: I21482d904c33542bf04f6510b974c01817d7aa5f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A transition outside the range of qint64 would be mapped to
invalidMSecs(), the same as the fake-detection sets a fake transition
to. This would have lead to a year at the boundary of qint64's range
being mistaken for a fake-DST year. So replace the fakesDst() method,
that compared transition times to invalidMSecs(), with an actual
boolean member that gets set when detecting fake DST, so that the
detection is correctly done.
Pick-to: 6.3
Change-Id: Iadc80973bc033915733c4a4f4ccfdd3863025fb4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The end-of-year checks previously presumed they would accompany a zero
daylight-savings change there; however, this misunderstands what a
fake transition is doing. A fake at the end of the year means that the
transition during the year is out of the time the fake claims it goes
into, so the offset nominally in effect after the fake should match
the offset the year started in, the same as for a year-start fake.
However, implementing that exposed the fact that Bangladesh's brief
flirtation with DST in 2009 ended at the end of the year, and MS's
data has no other instance (aside from entirely bogusly claiming that
Bhutan did the same in 2009) of an end-of-year transition, in
particular no fake transitions. So the end-of-year case for faking
does not arise and I've eliminated it from the code here. This
greatly simplifies the code to detect fake DST rules.
At the same time, in the ruleToData() wrapper, use the transition
implied by isDst only if it isn't the fake one; the other is the only
real transition in the year anyway, however described. Also, extract
the detection of start-of-year transition times to a function and make
it more exact.
Pick-to: 6.3
Change-Id: Ide160d28e7cca37c224f40164ebe7f9a17f028e7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The minMSecs() itself is one more than the type's min(), which is used
as invalidMSecs(). As (at least) the Windows back-end uses minMSecs()
as the time of a start-of-time transition (that we'd like to find as
our current transition), use one more than it as lower-bound for where
to search from for a previous transition, so that we do find that
first ever transition.
Pick-to: 6.3
Change-Id: Iae861e740e02bd38ffb2af77aff625d3b48182d2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The methods give them more appropriate names. This revealed one place
where the min() that's actually invalidMSecs() was being used for a
time that should have been in the supported range, so amend that to
use minMSecs(). Replaced a use of invalidMSecs() + 1 with minMSecs(),
to which it is equal, as that was the meaning it was used for.
At the same time, make those methods constexpr (because they are) and
[[nodiscard]], since their values should be used, while dropping their
fatuous inline (the bodies are inline in the declarations).
Pick-to: 6.3
Change-Id: Idcd51c55850573372b44e6fcf08d5d2665b8a60e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The test crashed for some reason, so other testcases are also not
executed. Skip the test for now to enable more tests in the CI
Task-number: QTBUG-89402
Pick-to: 6.3 6.2
Change-Id: I5ad38645d1b8f86c64da7208c0ae4f66d126c7d9
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Most of the blacklisted tests were already fixed earlier.
The tst_QPlainTextEdit::adjustScrollbars() test needed a small fix
to show the window non-fullscreen, so that the scrollbar could appear.
Task-number: QTBUG-87423
Task-number: QTBUG-89402
Pick-to: 6.3
Change-Id: I849f411a5798053742323fc4db3fe30f2b690a8b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This reverts commit 293b7fab55.
Reason for revert: Since Qt 6.2 MinGW 8.1 is not anymore supported
Pick-to: 6.2 6.3
Change-Id: I9b2e5e08bee663d5289a69218493911544671e79
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Remove the unholy bool out parameter and make QtPrivate::to{Double,
Float,{Signed,Unsigned}Integer}() return a struct instead.
The struct contains what we'll most likely need for a full
QParsedNumber in the future: the value, an error code (always zero
atm), and a pointer to the first character that wasn't parsed (always
nullptr atm), so we don't need to change the ABI when QParsedNumber
eventually lands.
As an immediate positive contribution, even without the backend ported
away from bool out parameters, the functions can now be marked as PURE
and, in case of the FP versions, also noexcept (the int versions have
a narrow contract d/t the base argument, which, unlike the return
value, can be fixed later, by overloading).
Pick-to: 6.3
Change-Id: I67945af80a9b53d6f170502a6df3384895e82d3e
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This overload set may come in handy to cushion some of the concerns
regarding replacing QString functions with QAnyStringView ones.
Overloading with a Q_WEAK_OVERLOAD QAnyStringView function requires
users to jump through hoops in order to avoid the QString overload,
but with the Q_WEAK_OVERLOAD roles reversed, the QAnyStringView
overload becomes the preferred version, relegating the QString
overload to a fall-back to facilitate sharing where it makes sense
(e.g. for QObject::setObjectName()).
Pick-to: 6.3
Change-Id: Ic65ead505beee627976a306e2d430e800540a600
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Rename the resize() function of its internal buffer into the possibly
better resizeForOverwrite(). The point is that unlike an ordinary resize
the data in the buffer is NOT initialized, and therefore must be
overwritten by the caller, "or else".
Change-Id: I7d82821e92f59f7eeab18c51d98003826ffe164b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Use two template parameters for the haystack and needle types, to test
all possible combinations of all argument types.
Note that the tests for QByteArray::count() are removed: it doesn't
make sense to have them in tst_qstringapisymmetry, and we already have
the symmetry tests for QByteArray in tst_qbytearrayapisymmetry.
Change-Id: I33901fd135eb7433f0d45300a7248aef4d40324a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Don't use the haystack as needle when testing count() for QLatin1String.
This wasn't caught earlier, since QLatin1String has no count() yet, and
the codepath was never tested.
Pick-to: 6.3 6.2
Change-Id: I2764070894ddce047eceaea52456e5a521252dab
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
We have a few lambdas now. However, GCC probably inlines everything
anyway in release mode, so this is likely moot.
Change-Id: Ic15405335d804bdea761fffd16d50573621446ab
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
They usually come in groups, so this avoids extra work.
Change-Id: Ic15405335d804bdea761fffd16d4fb5c41e122f0
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Also removed the Qt::CaseInsensitive searching, which was slow.
Change-Id: Ic15405335d804bdea761fffd16d4f863847c360b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>