Although undocumented (which is weird, as other docs refer to it),
fix the spelling and the formatting.
Change-Id: Ief8b04e3b9272386c663c463c3659e8b837260f5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Andreas Eliasson <andreas.eliasson@qt.io>
Fixes compiler warnings about narrowing conversions.
Found by compiling with clang and -Wshorten-64-to-32.
Drive-by changes:
- use range-for instead of an iterator based loop
- use strlen("*.") instead of magic number 2
Pick-to: 6.5
Task-number: QTBUG-102461
Change-Id: I0bf2299049c0411ed496468238ca30b69946ffc2
Reviewed-by: David Faure <david.faure@kdab.com>
The previous patch for QTBUG-112019 could lead to an uneven length which
in results in an incorrect center. Fix it by making sure that the length
(and width) of the two rectangles are even so we always get a proper
center without fiddling around with float values. Also honor
PM_ButtonShiftHorizontal/Vertical now (was forgotten in the last patch).
Pick-to: 6.5
Fixes: QTBUG-112019
Fixes: QTBUG-112861
Change-Id: Ifc19b863c761ae545208b996ba60d1f33bceb2b3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Similar to TableScope - create a helper class to make sure the
procedures are cleaned up on exit so they don't affect the result during
the next test run.
Change-Id: Ic5b02ca63e03f330392797ed22313767557fc548
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Accessibility actually works when running applications as root, but we
would never properly connect, since the enabledChanged signal would be
emitted from the constructor in this case. So after connecting the
signal, check the value by hand to make sure not to miss the
notification.
Only applications running as root would be affected, because all other
applications would go through the asynchronous pattern of getting the
bus address from dbus instead.
[ChangeLog][QtGui][Accessibility] On XCB applications running as root are
now accessible.
Pick-to: 6.5
Fixes: QTBUG-43674
Change-Id: I82cdc35f00693a8366dfcdab2f2c3c6dc5f5b783
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Some Windows SDKs seem to throw an exception from winrt::check_hresult()
We need to handle this accordingly. Catch the exception and print relevant warning.
Fixes: QTBUG-110408
Pick-to: 6.5
Change-Id: I1434ec425f0d0e597308b53f25f4f15049640060
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Equivalent to the test added to the QWidget test case, but since QtWidgets
code contains logic to both synthesize and compress/filter enter/leave
events, we can only verify that the QWindow does get the events.
The test is very flaky on Windows, so blacklisting it right away.
Change-Id: Ic1da9439f60f619a76a3653a23fef8e9ebc0e75d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Avoid some code duplication and enhance the documentation about
thread-safeness of QSQLDatabase::cloneDatabase()
Fixes: QTBUG-60505
Change-Id: I6ca6b9f47d818d49ca51395da14051e40317cef6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Temporary exclude `qwaitcondition_unix.cpp` from the unity build, until
either of the mentioned change sets get merged.
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Iaacd090647ba007e0ab714dc674e67552f85c350
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Like qt-configure-module.bat, when building with unity build, CMake
needs to know the full path of the source directory to be able to
correctly generate its `*_cxx.cxx` files. So far, this seems to only
affect Windows' LLVM/MinGW builds. By this patch, I make sure that we
pass the full path to CMake.
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ida2da127ecba95856b6e0091936c471c2a116936
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Otherwise, it could break the unity build.
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ic1b3ac51b8a9e8bb93a3b1a4d6717fa45099e91b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Previously it only got the answer correct to the minute. That's good
enough for most transitions, but those involving local solar mean time
(LMT) may have second deviations. So check the second before or after,
that'll usually be the other side of the transition; if it isn't, do a
further binary chop on seconds to hit the correct value.
Most zones' canonical locations are only specified to the size of a
city, so second precision is all anyone cares about; a few hundred
metres difference in location would change that. The one exception is
Europe/Amsterdam, which had its own Royal Observatory and time
standard, hence had an offset known to greater precision; but the IANA
DB duly approximates that, too, so we won't have data with millisecond
precision even in that case, so don't try to refine beyond second.
Change-Id: I20fb355f8113c32387ed8a84fbf5a41004273978
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
The classification of local time as ahead of UTC, behind it or equal
to it gets complicated by zones near the prime meridian - some of
which have varied which side of it they nominally are - or the
international date line, which a few zones have crossed.
So, instead of having one classifying variable, split to having three,
one for the distant past (when using local solar mean time), one for
the epoch and one for the distant future.
Change-Id: I7c0da376e1625372086dc51afa815756f0bde442
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This makes it possible, on a system with /usr/{lib,share}/zoneinfo/,
to systematically run a command with TZ set to each system-supported
zone. For example, it can be used to verify that a corelib/time/ test
passes regardless of the valid setting of TZ.
Change-Id: I6ea9a64d8bcb745aea80ab9ae431602d3e3265a1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The stepIntoDSTGap() hour cases were already conditioned on hour > 0,
explain why. The month and year tests need similar checks for kindred
reasons; add and document those checks.
Pick-to: 6.5
Change-Id: Ibcb69449fcd572ee94306a805fd680e9b5155322
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The zone had a transition at the start of 1900, so QDTP's default date
ends up being 1900-01-01 at 00:02:20 instead of at 00:00:00; and any
parsing of date-time strings that doesn't set the minutes and seconds
consequently ends up "wrong" (about a field that wasn't specified).
Change-Id: If4b9864616fa08bc023a6974dae255f96ca90f83
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The zone had a transition at the start of 1900, used as default date
by the parser. This leads to the default minutes and seconds being 2
and 20, rather than 0. Since this test is parsing a date-only string,
only check the date of the result, to avoid failing in Cocos.
Pick-to: 6.5
Change-Id: Ifb307eadb747097988bcf0afc6f307835ff2c8ec
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
America/Sao_Paulo was not alone in starting 2008-10-19 with a spring
forward. Include the other affected zones in the check to tune the
expected start-of-day time. See [0] for details.
[0] https://github.com/eggert/tz/blob/main/southamerica
Pick-to: 6.5
Change-Id: If251d8b715090319441790696983273637765d2e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Some QDateTime tests get tripped up by a transition at the epoch in
Baja Mexico. For the operator_eq() and time-difference test, simply
using startOfDay() instead of QTime(0, 0) - which was skipped - solves
the problem. For addDays() and fromStringDateFormat(), skip the
affected tests.
Change-Id: I3620f0d1e4b05d9f799662eea96a40c8284de331
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The zones in Baja Mexico had a transition at the epoch.
Change-Id: Ic70e23bcc980bf371e925fcb8fb83ca5ef000c9f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Given that QDTE only supports local time and UTC, using Europe/Oslo as
zone was disconnected from reality, especially as various QDateTime()s
were constructed using local time. Use the system zone.
Pick-to: 6.5 6.2
Change-Id: I95b3a6a6acf9ffc2b8c7f05d3dd9440ff173abfe
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The test wants to start shortly after the transition, then step an
hour backwards, into it, to check we land safely on the other side.
However, it assumed the gap witdh was an hour, which is not reliable.
Use the gapWidth already used in computing springGap instead.
The -3590 seconds in the result time is correct, as it's the ten extra
seconds we started beyond the gap, minus the hour we step backwards.
Pick-to: 6.5
Change-Id: I4399af7e54a60bd55ea51d054d3cd2ecfcb0e354
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The "{forward,back} to %s, correct to nearest" tests were reporting
the time of the transition as %s but, like the jump test, were using
the middle of the gap as the time to set. So compute that mid-time's
string once and use it in all three test names. Also renamed some
local variables to accommodate the new one for this text.
Pick-to: 6.5
Change-Id: Ic6c40c470fc74ae8bcfc0dc9d1596af06318a883
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Although the zone's daylight time offset is usually the width of the
gap, it's possible the transition is (or includes) a change to
standard time; so determine the actual gap width by comparing the
difference between time a day earlier and later to the usual duration
of two days. Also skip the test if the transition isn't really a gap.
Pick-to: 6.5
Change-Id: I56e381c9f74cfa1806d43b3ed5e4637436ebdf57
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The function is passed a zone to work in, so setting the transition to
local time made no sense; set to the given zone's time, instead.
Pick-to: 6.5
Change-Id: Icaa0955fe5fcd5bc257322afcb7e25e932dedd1b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
We check three sample dates, in different years, so don't compare
their year() to 1970, but to their respective actual years. In the
process, package the arrays iterated for these checks into a constexpr
struct array and reverse them so that, instead of reverse-iterating
and indexing, we can use a ranged-for loop.
Change-Id: I214685346c637875a4ea31125c324851eb4308db
Reviewed-by: Øystein Heskestad <oystein.heskestad@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The name final is suboptimal, given that it's also a keyword.
Rename initial at the same time.
The local-time parts of the test are apt to fail if local time
coincides with the zone being tested, as previously noted. Document
known cases of such coincidences, to help someone studying a failure
to know why it happened.
Change-Id: I1f1f302f161373a154066df210e03725b9a5f9ed
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When the test failed, it did so in triplicate.
Pick-to: 6.5
Change-Id: Ia871aed0a5960120a2659a6778c10dccd4b2953a
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Taking the size() of a list before append()ing to it saves the need to
subtract 1. Add some missing assertions.
We can now use sliced(), rather than mid(), to trim a string or byte
array. We can do such trimming on a view, rather than allocating for
the trimmed part.
Change-Id: I8eff46ea6545a66c765c2d79aa1162c3044ca1cf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
This reverts commit c0b0c7bebb.
QPlatformTheme::MouseCursorTheme and MouseCursorSize was added in
qtbase a823366f77 and qtwayland client
supports it in 1c25db5e3f23d48e330170f41b94fbd532932b02.
Pick-to: 6.5
Change-Id: Icef2f50d495ac802e3a591d92c222523972b2066
Reviewed-by: Liang Qi <liang.qi@qt.io>
In case FEATURE_timezone=OFF auto-tests should still be built successfully
Change-Id: I0226a7d7781a412bf9e9935c2cf1a48b1ce427b5
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This reverts commit d42cfeb84f.
Trying to help AppKit by adding the dictation and emoji edit menu items
ourselves resulted in sometimes adding the entries twice, when we failed
to detect the existing entries, or AppKit failed to detect our entries
as a reason to not add its own.
In addition, even if the entries we added were detected by AppKit and
AppKit was smart enough to not add its own, our entries were relying
on the developer to provide translation, instead of building on the
translations that AppKit already provides. And the keyboard shortcut
we set for our entries were not following system and user preferences
for which keyboard combination should trigger the entries.
Fixes: QTBUG-104709
Task-number: QTBUG-79565
Pick-to: 6.5
Change-Id: I3fabc41f85df917dbb669253ad441bccea8a5e35
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Noticed the warnings when building the manual tests.
Pick-to: 6.5
Change-Id: I7f927f42f11d234ec3c980f36d8e12c0c49be712
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Removed the two identical functions and directly call the `static_cast`
in their place. This is to resolve a build issue when doing unity build.
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I174b601e06c4acdea45cc66495c09aafba6f48f6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Xcode 14's Clang will emit objc_msgSend stubs by default, which ld from
earlier Xcode versions will fail to understand. Disable these stubs
explicitly for static libs, for as long as we support Xcode < 14.
See https://github.com/llvm/llvm-project/issues/56034
Pick-to: 6.5
Fixes: QTBUG-112820
Change-Id: Id762873d61b9d147bf3eb6292297e7b80b7393e1
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
It's unlikely we will ever use pro2cmake at this project stage,
so it doesn't make any sense to keep the 'special case' markers
in the CMake scripts. Remove them and replace with TODO where
needed.
Change-Id: I84290c20679dabbfdec3c5937ce0428fecb3e5a7
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We sometimes use Objective-C++ code in files with a .cpp extension,
to avoid the churn of adding a foo_mac.mm file. Instead of manually
telling the compiler to build these files in Objective-C++ mode, we
use CMake's intended mechanism, which means genex constructs such as
$<$<COMPILE_LANGUAGE:OBJCXX> will work for these files as well.
Pick-to: 6.5 6.2
Change-Id: If295c3f34f6bee9f4d9f877f519c9c7770665fee
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
A QPointer is used as a guard for calling setChecked on a stale object.
The guard is not checked on accessibility updates.
This patch wraps the accessibility update in a guard check.
Fixes: QTBUG-112759
Pick-to: 6.5
Change-Id: Ida47c181b7968911c1805dc244b86347e7afe81b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Make QSqlError implicitly shared and adjust the ctors / assignment
operators to be consistent with other implicitly shared Qt classes.
Fixes: QTBUG-91912
Change-Id: Ie73292817fd4e7b274a3033a74d62e712a01c2b0
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
In unity build, when calling qt-configure-module.bat, if we don't pass
an absolute path, CMake will not be able to resolve the header paths in
`*_cxx.cxx` unity headers. So far, this only happens on Windows/LLVM,
and it is probably an oversight on CMake side, as passing a path without
drive letter is perfectly fine in most cases, and CMake can handle it.
We don't need the TO_CMAKE_PATH, as `get_filename_component` also does
the transformation.
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I474750af13291cbf1a46a12be5fc4a0f6e88accf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Found some documentation saying NVidia provided desktop GL for
development purposes only, and recommmended against using it. Not sure
if that applied to all NVidia drivers, or only that one embedded
platform, but since we have multiple bugs about EGL not working on
NVidia, default to using GLES2 like it suggested.
Change-Id: If8ac8dd61c4ceb88162360f1eaa2a096acefa9c6
Pick-to: 6.5 6.2
Fixes: QTBUG-105921
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
When the DPI of a window changes due to being moved to another screen,
or the current screen reconfiguring, the mask we've set earlier is no
longer correct, as the mask was set based on the original screen's
scale factor and in relation to the former platform geometry of the
window, which now has changed.
Like the geometry of a QWindow, the mask is expressed by the user in
the QtGui coordinate system, so it's the platform's job to transform
this into the platform coordinate system and update it when needed.
Add a manual test that users a QWidget and a Q(Raster)Window side by
side.
There's still an issue with the screen change being triggered to
early, via QWindow::setGeometry, instead of when the window has
actually moved to the new screen, resulting in the paint event
flushing to a window and backingstore that is in the wrong state,
but this requires further research to fix.
Task-number: QTBUG-97642
Pick-to: 6.5 6.2
Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io>
Change-Id: I7ab2d267fbaf6ac32b507d05a418eb025b354a0b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
virtualkeyboard is a qt module and thus covered by the "no-<module"
switch. The special handling is no longer needed with the more dynamic
approach of handling Qt modules.
Pick-to: 6.5
Change-Id: Ice6e30261e60b484669748411e019764bbdeaa55
Reviewed-by: Yuhang Zhao <yuhangzhao@deepin.org>
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>