We don't use W suffix for most of the Windows API so there is no
need to use it here either. Also remove W suffix for variables of
type TRUSTEE (was TRUSTEE_W).
Change-Id: Id67b772ba5d3232f882841a1e581fb1bbd392fa4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Replace occurrences of NULL and 0 when used for pointers.
Change-Id: I485e73d22a1a85d1303f3e0967cd4e8f10ff5d33
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Wrap lines at column 101 so that it is easier to edit the
file and review the changes in Gerrit. Move comments when
they cannot be easily wrapped. Add curly braces to `if`
statements if they became multiline. Run `git clang-format`
on the file afterwards.
Change-Id: Ib21afd65147a7b202e031d4a865b5f615e5ad6d8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This amends commit c5409964b0.
When detecting a variable assignment, we must ignore arguments that
start with a dash. Otherwise, arguments like --prefix=~/Qt are ignored.
Change-Id: I3b143113b94ca0d8af92679c1f567fbcec298349
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
There is a github action configuration in qtbase, which is,
however, hardly maintained. In its current form it is broken.
This patch repairs it.
Change-Id: I075fa79157c4240cd550a90a86977e8ecf808cc8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
The function is needed in multiple files to implement QDir::mkdir()
and QFile::open() methods that accept a permission argument on Unix.
Task-number: QTBUG-79750
Change-Id: Ib0853f7d12bcb5d6f1116b43ec1aa07b6554bb93
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Explain why QSystemLocale needs to be an export. Unexport
QLocaleId::fromName() now that qttools no longer uses it.
QLocalePrivate was only Q_CORE_EXPORT for the sake of one use in
tst_QLocale, that can now be replaced by a call to a public QLocale
method.
Change-Id: I1efe8ee03488acfc6e1c36661f6e956a86e191c3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
After special processing for hover, QPushButton::mouseMoveEvent()
needs to call the base class function, like every virtual override
should, to continue processing other logic. Amends
3310e13a17
Fixes: QTBUG-97937
Pick-to: 6.0 6.2
Change-Id: Ic2e111d6c38371e0aa04423f5fb26c52717bf5fb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Don't put the code inside two blocks for no reason.
Change-Id: I54b8d6fbfab50a26ddcd8ec07ba689e5094bcad3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The Qt bluetooth module uses ${FWCoreBluetooth} when building for iOS,
but that evaluated to empty.
Pick-to: 6.2
Change-Id: I93ff2c30697a912bed454087ae260fae9cc41b0f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Since e05e3c7762, the advance test in
tst_QFontDatabase::condensedFontMatching() passes with the bundled
freetype engine, so the XFAIL causes a failure when running with this
configuration.
Pick-to: 6.2
Change-Id: Ie6fbccfa0d9c79654563e9e3f19694f252e32fc6
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
We can technically build without Xcode, as long as the command line
tools are installed. We reflect that by an empty QT_MAC_XCODE_VERSION
variable.
Pick-to: 6.2
Change-Id: I40ffa28a628157e0a2c63656065ea7c41a680e01
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
...which represents the version of the MSVC platform toolset.
This variable is used to set the platform toolset version in .vcxproj
files. Before, the platform toolset version was determined in qmake's
C++ code. Now, it's set next to where MSVC_VER is set in common mkspecs
.conf files. This will simplify supporting new Visual Studio versions
in the future.
Change-Id: If78c921f93c6378829746d617c7e7d312174257e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Extend the detection of the MSCV_VER variable and make VS 2022 known to
the vcxproj generator.
[ChangeLog][qmake] Added support for Visual Studio 2022.
Pick-to: 6.2 5.15
Fixes: QTBUG-97975
Change-Id: Id2c0a0b7800f721e9e34189f0a40ba4830283578
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When fixing up problems on system APIs with limited date ranges, we
need a year, inside the supported date range, in which Gregorian dates
fell on the same days of the week as a given year outside the range.
A year with the same last two digits makes handling of two-digit year
formats easier.
Change-Id: If64ee27e829f9dcfd5504ed8ba51f72c36297242
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
I'd typo'd the Suzhou one-digit. Record that our CLDR scanner verifies
this is the only number system with non-contiguous digits, rather than
merely recording a (now old) CLDR version in which that was true.
Change-Id: I6f5b5d1f0a5aa1cd0557f62f296777b90b603087
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Tests of QTimeZone::dispayName() were burying most of what was
interesting in the variations among them by repetition of a large
amount of boilerplate. Package the repetition in a macro so that
the differences between checks are more evident.
Change-Id: I23bcafab641b7d3bed50248ba5313250c150d30c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
MSVC 2022 (17.0.0) complains about "'QString::replace':
12 overloads have no legal conversion for 'this' pointer".
This is a compiler bug. It is reported to MS. Still we workaround
it here so that qtbase can be built with MSVC 2022.
Pick-to: 6.2
Task-number: QTBUG-96975
Change-Id: I0180e2e6760d2809ca61e3cd8f02b04f970172a7
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
And bump NTDDI_VERSION to 0x0A00000B (NTDDI_WIN10_CO) at the same time,
to unblock the developers from accessing the latest Windows APIs.
Pick-to: 6.2
Change-Id: Ifbc28c8f8b073866871685c020301f5f20dc9591
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This macro expands to the major version of Qt, complementing the
already existing \QtMinorVersion macro.
Pick-to: 6.2 5.15
Change-Id: I64861f8cc50d73f34369311a19b5e554645a4127
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Stop turning THAI CHARACTER SARA AM into a grapheme boundary because it
breaks a test and chromium does not consider it to be a separate
grapheme.
Fixes: QTBUG-88545
Change-Id: Ib1aea8dbb66ac42b2129cf9fe04c39f5f76eeb36
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Amends c0a8cfe167. The StaticPluginLoader
needs it, too, and that one is available in non-library configurations.
Change-Id: I5d396e78abe7358a5df5ef816cfe92137d3ae4b5
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Update the locale generation script to support Kaingang and
Nheengatu languages. These are new in CLDR v40. Regenerate
the locale data.
Task-number: QTBUG-94358
Change-Id: I5195d5161d8c4d9f17129bbcfde39dfd3fcf1cd5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Update tst_qlocale to take into account "narrow" day representation
change for Russian locales. This version of CLDR changes narrow forms
to one letter. Previously those forms were identical to short forms
(two letter). The new representation is consistent with other languages
and so does not appear to be a bug.
Fixes: QTBUG-94358
Pick-to: 6.2
Change-Id: I9724c281a250685da8232e5c05c9c375a8c79253
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Previously, when running unit tests on Android, the log presented
to the user was the log as known to the Qt logging system. This
does not include log messages generated by Java code using e.g.
Log.d("message"). Neither does it include log messages by system
libs. This patch changes androidtestrunner to capture the full
logcat output for the unit test. This improves the developer
experience when working with unit tests.
Fixes: QTBUG-93438
Change-Id: I580f728349041eb8a84a32d187754b7b5448f512
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Previously, the loggers would leak if the application failed to call
stopLogging(). Now they are owned by the global static which will delete
them in that case.
Also, since we have to adapt loggerCount() to the fact that std::vector
uses size_t, recognize that we only ever want to know whether the number
of loggers is 0. Change the method to only provide that information
rather than the actual number.
Change-Id: Ieb2e185048d573ec7f36373ad49bb2a0ca391ce3
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This restores the Qt 5 behavior in Qt 6, but prepares for disabling it
in Qt 7. We want to deprecate the current behavior, as it makes it
unclear who is responsible for calling close.
Fixes: QTBUG-97747
Pick-to: 6.2
Change-Id: I2c99eb96667e784576d8850085068ca334d75b16
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
We have those on QSharedPointer, so adding them for consistency.
Change-Id: Iab5eddc79206605a4bcce46f63e0fb685aed40ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Ensure to use binary encoding when handling the output of the
compression tool.
With out this change \r are dropped and the compressed file is corrupted.
Change-Id: Iaf9b1fc015a376682f793aff079f45d03b201aec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Implement clipping to widget geometry when rendering to other
paintdevices.
Fixes: QTBUG-98026
Pick-to: 6.2 5.15
Change-Id: I5652bdb8cc052ae34f05ea7963943d2b5b28e220
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The documentation states that the function will not have any effect
before control enters the main event loop. Prior to 0c02f133f3
this was incidentally true due to QCoreApplication::exit just setting
quitNow to true and exiting all the event loops (which before exec
were none), and exec() setting quitNow to false explicitly. But
now that we plumb the quit down to the platform we can't rely
on this incidental behavior, and need to check explicitly.
Fixes: QTBUG-98088
Pick-to: 6.2
Change-Id: I54cece3630e39e4456abc3b372839c0b5c4c4713
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
A top-level non-developer build is supposed to default to a prefix like
"/usr/local/Qt-6.3.0". That wasn't the case.
In QtSetup.cmake we check CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT,
set CMAKE_INSTALL_PREFIX and did the same thing later in
QtBuildInternalsExtra.cmake, with a different value. Make sure we run
the latter code only in per-repo builds.
Pick-to: 6.2
Fixes: QTBUG-98087
Change-Id: I4a1291dfd126aa11c21d69809f2cf7b075c98d2e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
If two threads call the function at the same time before the static is initialized
one of them may end up with a half-written object.
Amends 3fe89eec61
Pick-to: 6.2
Change-Id: Ie08970f9ee283fd75292a8b44a1fca89de4b04eb
Reviewed-by: Yuhang Zhao <2546789017@qq.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
We were reserving space between table cells corresponding to one logical
pixel, which on retina screen results in two device pixels. By drawing
the grid line with a cosmetic pen, we were only filling one of these
pixels, leaving space for leftover pixel dust from earlier blits.
By drawing with a non-cosmetic pen of size 1, and ensuring that the grid
line is drawn at the center of the grid, we end up filling the entire
grid line, without overdrawing the table cells.
Pick-to: 6.2
Change-Id: I7f4d2b27380e5a3d221e265a25f7531fdc4a02b3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
As a drive-by: fix some improper indentation
Task-number: QTBUG-91024
Change-Id: I29e04aff3638dfb2aab9d40650c55a48baba7222
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The need to finalize the back buffer isn't limited to flushing.
Pick-to: 6.2
Change-Id: I98b04ab49ec27ea536e99462deab8d48a8e40e82
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
When introducing support for scrolling the backingstore it doesn't make
sense to track the painted region explicitly.
Pick-to: 6.2
Change-Id: I370932f02490ac526fb049908f99af678884e807
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
CoreAnimation doesn't immediately mark a surface as in use the moment
we assign it to a layer, but defers it until the surface has bee picked
up by the window server. In theory this would allow us to defer the swap
until the next beginPaint(), which would allow painting to the back buffer
again before Core Animation has time to flush the transaction and persist
the layer changes to the window server, and would also automatically deal
with requests to flush without painting anything.
But, since a client may do several rounds of beginPaint/endPaint before
flushing, we might end up in a situation where we detect that a surface
is in use in the middle of several paint rounds, and end up swapping in
a new back buffer without copying over the previously painted content,
like we do in prepareForFlush. To be on the safe side we swap the back
and front buffer straight away.
We also need to mark the surface in use, to prevent the same problem
from appearing when the window server doesn't pick up the surface in
between two rounds of flushes.
Pick-to: 6.2
Change-Id: Ib418852424773c399df710da33a388e8d2c2e92c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
Use the Q_INT64_C() macro and qint64()-as-function instead of C-style
casts.
Change-Id: I9d169715da96a49898e9c9e2a6d3ee5182e1d91c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Where std::numeric_limits<...>::min() is used used as invalid value
for an API return, save it as a named constant so that the comparisons
are against an informative name, rather than leaving the reader to
guess the significance of the min-value.
Change-Id: Ia99c75e21856f65cb4494120d05eed36f5fc2d50
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The MS-Windows back-end neglected to check for overflow when mapping
date and time to milliseconds from the epoch. Add the checks for that
and take care not to return qint64-min as a transition time - that's
the invalidMSecs() value used as a special marker.
QTimeZonePrivate::dataForLocalTime() neglected to handle the case of
the backend being unable to answer offsetFromUtc() for one of the
times requested, which the MS backend might.
Change-Id: I6d7ee2cbf9aaf6678abb24a20e18b5cdac7f5a23
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The qtpaths tool is supposed to replace "qmake -query", and it must be
available for cross-builds as a wrapper script like qmake.
Re-use the existing facility for creating the qmake wrapper script for
creating the qtpaths wrapper script.
Pick-to: 6.2
Fixes: QTBUG-97821
Change-Id: I460bae61a531994422e1c0fba09c79e4aa65713f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
In Qt 5, QStyleOptionProgressBar::orientation was Qt::Horizontal by default.
In Qt 6, we need to init state with QStyle::State_Horizontal so that code
setting up a style option doesn't need to do so explicitly.
Amends add8262f72
Pick-to: 6.2
Fixes: QTBUG-93412
Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io>
Change-Id: Iaa311cf0f4bab72c0bacbd8e698ba24660bca6b8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Further simplifies the definition of the macros.
The class is placed in an unnamed namespace so two translation units can
still have different settings.
A difference is that the expanded no-output code is now using QDebug,
not QNoDebug, but it should get dead-code-eliminated either way.
Change-Id: I3eb1bd30e0124f89a052fffd16a7564f4450ec8a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>