Commit Graph

55793 Commits

Author SHA1 Message Date
Marc Mutz
5235b1bdc8 tst_qstringapisymmetry: check expected overloads are selected
Check that the expected overloads are selected in
QString/QAnyStringView overload sets.

Pick-to: 6.3
Change-Id: I38148c20a72eb60cf86844a39fe0ed419d2fa562
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-08 06:51:11 +01:00
Marc Mutz
ed5978effe QColor: port string-parsing from out parameters to optional<>
Makes for easier reading of code, and allows qt_get_hex_rgb(), which is
called from different TUs, to be marked as PURE.

Change-Id: Ie7d4e5a164ca1daf521e18ff47f17885bc1443c1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-08 05:51:11 +00:00
Marc Mutz
a992f4b4c0 QColor: remove setColorFromString()
This private method doubled as the implementation of both fromString()
and isValidColorName(). By reformulating isValidColorName() as
fromString().isValid(), we can then turn setColorFromString() into
fromString(), by returning the data, instead of setting it on *this
through use of exported functions.

Since we need to touch the if's anyway, to remove braces, use C++17
if-with-initializer to turn the second if into an else-of, saving one
return {}.

Change-Id: If3f8182a40c0c6d6ad514431b5870e69d0e95769
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-03-08 06:51:11 +01:00
Marc Mutz
78b6876974 Long live QColor::fromString()!
It is customary for Qt types that can be constructed from string-ish
to provide a fromString() named constructor. QColor didn't, relying
instead on a set of overloaded implicit and explicit constructors.

Add the named constructor, with the intent to deprecate the string-ish
QColor constructors after a grace period.

To prevent new users from using known-to-become-deprecated API, mark
the old functions as \obsolete.

Also rename isValidColor() to isValidColorName(). The only reason why
these are lumped together in single commit is so that their docs can
refer to each other instead of having to temporarily refer to obsolete
API.

[ChangeLog][QtGui][QColor] Added fromString() and isValidColorName(),
both taking QAnyStringView.

Task-number: QTBUG-101389
Change-Id: I2857c728257ad2f14c7c968b45547bdf07c44b63
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-08 06:51:10 +01:00
Joerg Bornemann
bac56fd4d0 pro2cmake: Introduce qmake2cmake convenience scripts
Add qmake2cmake[.bat] wrapper scripts that can be used to convert user
projects to CMake.  For now, user projects are internally handled as Qt
examples with one difference: the generation of example-specific
installation code is suppressed.

Fixes: QTBUG-98655
Change-Id: I1a57f6d12efe0bdf383592ab33682a611692db80
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-08 03:45:30 +01:00
Joerg Bornemann
928828b549 pro2cmake: Handle QT_(MAJOR_|MINOR_|PATCH_)VERSION conditions
Task-number: QTBUG-98852
Change-Id: I4c86fff7bbcc6c42cd04094f2409c3d04779597c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-08 03:45:30 +01:00
Joerg Bornemann
0dc374c9d8 pro2cmake: Remove INSTALL_LOCATION from qt_add_qml_module calls
This function does not handle installation.

Change-Id: I02fdc244f49b5935aa1ac51bff8a25970ad3a335
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-08 03:45:30 +01:00
Joerg Bornemann
3954b7385e pro2cmake: Generate find_package call for Qt5/Qt6 for examples
This makes the QT_VERSION_(MAJOR|MINOR|PATH) variables available.

Task-number: QTBUG-98852
Change-Id: I7e40f2a7ac09975ce21e45cda384af928e1fa629
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-08 03:45:30 +01:00
Joerg Bornemann
eab2a57b37 pro2cmake: Handle optional Qt modules
...and write a separate find_package(Qt6 OPTIONAL_COMPONENTS Foo Bar)
call for those.

Task-number: QTBUG-96799
Change-Id: I3386487774c386edde6767dca92ce433bfed906e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-08 03:45:30 +01:00
Joerg Bornemann
50f3b1c519 pro2cmake: Add a blackbox test for converting from qmake to CMake
If you can set the environment variable DEBUG_PRO2CMAKE_TEST_CONVERSION
to 1, the output of pro2cmake is written to the temp directory.  This
helps analysing test failures.

Change-Id: Ida42c5b76a67172d00ce0d2488adc7fb376c6b11
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-08 03:45:30 +01:00
Joerg Bornemann
e60c41ac0a pro2cmake: Enable AUTOUIC only if the project has FORMS
Change-Id: I1bf232fa3c389eb86707d3af04de6cf9eb09451a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-08 03:45:29 +01:00
Joerg Bornemann
1c2f6d2ace pro2cmake: Write only one find_package call for Qt packages
Task-number: QTBUG-96799
Change-Id: I1eb8ac05f360b74e5ae1217b5535a33227b5084b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-03-08 03:45:29 +01:00
Joerg Bornemann
f5a8d70dee pro2cmake: Add LibraryMapping.components
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>
2022-03-08 03:45:29 +01:00
Joerg Bornemann
b28f436cd4 pro2cmake: Make generated examples use qt_add_qml_module()
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>
2022-03-08 03:45:29 +01:00
Volker Hilsheimer
3f5a424264 Move cursor out of the way before running test
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>
2022-03-08 01:52:32 +01:00
Volker Hilsheimer
e27e3ad546 Un-blacklist test that's always skipped on macOS
Pick-to: 6.3
Change-Id: I045e1923b471f6bb1d482f32924f190a94b21d2a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-03-08 01:52:32 +01:00
CI Insignificant Platforms Monitor Bot
d60e29cab7 Blacklist: test cases blacklisted in tst_QTouchEvent:
- multiPointRawEventTranslationOnTouchPad on windows-11

Pick-to: 6.2
Pick-to: 6.3
Task-number: QTBUG-101519
Change-Id: Idbba677893f559ee239739d8c78aa820d974e120
Reviewed-by: CI Insignificant Platforms Monitor Bot <ci_insignificant_platforms_monitor_bot@qt.io>
2022-03-07 22:14:10 +00:00
Marc Mutz
4b768b9f34 QPublicSuffixDatabase: don't go thru QString for debug output
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>
2022-03-07 20:58:06 +01:00
Pasi Petäjäjärvi
fc1487878b eglfs: QNX uses own QPA plugin and not eglfs
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>
2022-03-07 21:58:06 +02:00
Marc Mutz
53890b5d3c qtestmouse.h: compile with QT_TYPESAFE_FLAGS
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>
2022-03-07 18:25:35 +01:00
Mårten Nordheim
944b5a8e3e Win: Fix use of deprecated isTopLevel()
By using the suggested isWindow()

Change-Id: Ic9eb8f3e422a966f1ecbc0ba3d852bdf95928778
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-03-07 18:25:35 +01:00
Kai Köhne
71af0d7059 Re-add missing 'we mean it' header
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>
2022-03-07 14:04:25 +01:00
Giuseppe D'Angelo
5e91f142aa Miscellanea fixes for QT_TYPESAFE_FLAGS in our headers
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>
2022-03-07 02:13:14 +01:00
Tor Arne Vestbø
9e01827193 Add QFileInfo::isAlias() to reflect whether the file is a macOS alias
Change-Id: I772066d0d8e69893f7c4aee1cd2305d46d5834c4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-06 18:46:54 +01:00
Tor Arne Vestbø
34b5e38f20 Distinguish macOS aliases from normal symbolic links
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>
2022-03-06 18:46:48 +01:00
Pasi Petäjäjärvi
55136998b3 Workaround QCC not handling error suppression macro correctly
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>
2022-03-05 22:02:22 +02:00
Assam Boudjelthia
1956ca7d70 Document use of android:allowNativeHeapPointerTagging in the manifest
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>
2022-03-05 17:37:33 +02:00
Lorn Potter
42aa0028b7 wasm: fix network reply error finished() signaling
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>
2022-03-05 15:59:51 +10:00
Lorn Potter
f3150368c3 wasm: fix native keyboard on iOS
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>
2022-03-05 15:59:47 +10:00
Thiago Macieira
49722de995 QWeakPointer: befriend other QWeakPointers
Commit c677b3b8af added move constructors,
which introduced the issue.

Pick-to: 6.2 6.3
Fixes: QTBUG-100795
Change-Id: I74249c52dc02478ba93cfffd16d2c879b923e352
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2022-03-04 19:00:45 -08:00
Mårten Nordheim
e09dd6b124 QAbstractSocket: remove note about WinRT
It's no longer supported

Pick-to: 6.3 6.2
Change-Id: I751ed0904f17e11c65bd60b55e11db9066d01ab2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-05 03:31:58 +01:00
Sona Kurazyan
f39f539858 Add numeric conversion methods to QLatin1String
[ChangeLog][QtCore][QLatin1String] Added numeric conversion
methods.

Task-number: QTBUG-98433
Change-Id: I414577ae715debe3d5ba9c6a160859aca790e017
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-05 02:03:17 +01:00
Timur Pocheptsov
bb30beb726 QIOSFileDialog/QIOSDocumentPickerController - handle dismissed view controller
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>
2022-03-05 01:01:34 +01:00
Mårten Nordheim
bf6d313ec8 QErrorMessage: fix deprecated warning about standardIcon
Change-Id: Idf50c1b74fddfccded2003528181f81a7a0ca8ac
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-03-05 00:30:58 +01:00
Mårten Nordheim
148d52e04d QMessageBox: fix deprecated warning about using old ctor
Change-Id: Ib53962e3527e2703af5ff36ce2fd4bd5ea987d85
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-03-05 00:30:58 +01:00
Mårten Nordheim
76016d9948 QPrintDialog/win: Fix use of deprecated QMessageBox::warning
by using the new one

Pick-to: 6.3 6.2
Change-Id: I8779107079c4e3d4b1d48c05b6fbfef1b6e98b99
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-03-05 00:30:58 +01:00
Mårten Nordheim
fd72c0d26c QSqlTableModel: suppress deprecation warning
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>
2022-03-05 00:30:58 +01:00
Sergio Martins
006aa6c2ee Fix QWindow::mapTo|FromGlobal() for the embedded case
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>
2022-03-04 22:53:44 +00:00
Assam Boudjelthia
daf7f07c1b Android: terminate argv passed to main() with nullptr
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>
2022-03-05 00:36:40 +02:00
Edward Welbourne
f0333355dd Add tests for an assertion seen on Windows
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>
2022-03-04 23:26:13 +01:00
Edward Welbourne
93526430a5 Correct handling of {next,previous}Transition before FIRST_DST_YEAR
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>
2022-03-04 23:26:12 +01:00
Edward Welbourne
be79443b68 Fix inverted condition on year starting in DST
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>
2022-03-04 23:26:12 +01:00
Edward Welbourne
fe4c93652c Improve handling of newYearOffset in qtimezoneprivate_win.cpp
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>
2022-03-04 23:26:12 +01:00
Edward Welbourne
8bf0fbca70 Consistently treat times before first rule as in its standard time
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>
2022-03-04 23:26:12 +01:00
Edward Welbourne
8a52555d3f Fix handling of out-of-range years in QTZP_win
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>
2022-03-04 23:26:12 +01:00
Edward Welbourne
0efebf168d Correct fake-DST detection and handling in QTZP_win
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>
2022-03-04 23:26:12 +01:00
Edward Welbourne
4959f8a34b Clip dataForLocalTime()'s bracketing window's start to minMSecs() + 1
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>
2022-03-04 23:26:12 +01:00
Edward Welbourne
8024498a36 Use QDateTimePrivate's methods in preference to std::numeric_limits
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>
2022-03-04 23:26:12 +01:00
Ivan Solovev
5133ed072a Android: skip crashing tst_QPlainTextEdit::ensureCursorVisibleOnInitialShow
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>
2022-03-04 22:20:18 +01:00
Ivan Solovev
79dcb2657c Android: unblacklist tst_QPlainTextEdit tests
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>
2022-03-04 22:20:18 +01:00