Commit Graph

65548 Commits

Author SHA1 Message Date
Liang Qi f07d8309d6 QGenericUnixServices: make sure the picker returns a color
This amends b646c7b76c .

Pick-to: 6.7 6.6 6.5
Change-Id: Ic7183c06a93085d65b31c86380889b78c714548b
Reviewed-by: David Edmundson <davidedmundson@kde.org>
2024-02-03 21:40:13 +01:00
Thiago Macieira c5f22c54cb qHash: provide the long double overload on Darwin systems
Commit c0791ac76e didn't explain why it
was #ifdef'ed out. It's just an alias for double. Maybe compilers at the
time used to complain if you used it, but I can't make Apple's clang
produce a warning now.

Pick-to: 6.7
Change-Id: I664b9f014ffc48cbb49bfffd17b02293403e9571
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2024-02-03 07:33:00 -08:00
Marc Mutz a327117c0d QBitArray: defend resize() and fromBits() against negative sizes
Use the same technique the constructor already uses: Q_ASSERT followed
by selecting the no-op branch in case assertions are compiled out.

Pick-to: 6.7
Change-Id: I24cbcfd686f67e060134baecfb21044948b6eb98
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-02-03 08:33:28 +01:00
Marc Mutz 6504496c64 QBitArray: use QDataStream::SizeLimitExeeded where applicable
[ChangeLog][QtCore][QBitArray] Uses new
QDataStream::Status::SizeLimitExceeded now, where applicable (was:
WriteFailed, ReadCorruptData).

Pick-to: 6.7
Change-Id: If5a8db9c6b2f104b40266784d88cf7cad0b0ce73
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-02-03 08:33:14 +01:00
Shawn Rutledge 9fa471b72d Fix frontMatter tests: fixed fonts and testdata
When the main font is a fixed-width font, QTextMarkdownWriter generates
backticks around plain text; so QEXPECT_FAIL if we detect that.

tst_QTextMarkdownWriter::frontMatter() Compared values are not the same
   Actual   (output)                  : "---\nfoo\n---\n`bar`\n\n"
   Expected ("---\nfoo\n---\nbar\n\n")

Also, include all test data as resources for platforms that need it
(such as Android).

Task-number: QTBUG-103484
Change-Id: If18ca493c402b128cdc0fb1910b2e822512af6e8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2024-02-02 20:14:45 -07:00
Shawn Rutledge bffddc6a99 Extract and re-write "front matter" in markdown documents
It's increasingly common for YAML to be used as metadata in front of
markdown documents. md4c does not handle this, so we need to remove
it ahead of time, lest md4c misinterpret it as heading text or so.

The --- fences are expected to be consistent regardless of the format of
what's between them, and the yaml (or whatever) parser does not need to
see them. So we remove them while reading, and QTextMarkdownWriter
writes them around the front matter if there is any.

If your application needs to parse this "front matter", just call
qtd->metaInformation(QTextDocument::FrontMatter).toUtf8() and feed that
to some parser that you've linked in, such as yaml-cpp.

Since YAML is used with GitHub Docs, we consider this feature to be part
of the GitHub dialect:
https://docs.github.com/en/contributing/writing-for-github-docs/using-yaml-frontmatter

[ChangeLog][QtGui][Text] Markdown "front matter" (usually YAML) is now
extracted during parsing (GitHub dialect) and can be retrieved from
QTextDocument::metaInformation(FrontMatter). QTextMarkdownWriter also
writes front matter (if any) to the output.

Fixes: QTBUG-120722
Change-Id: I220ddcd2b94c99453853643516ca7a36bb2bcd6f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-02 20:14:28 -07:00
Volker Hilsheimer 216af5d7f9 Fix usage of std::enable_if_t to SFINAE out QProperty APIs
Declare an IfUntypedPropertyData alias and use that consistently.

Amends 311f889632.

Pick-to: 6.7
Change-Id: If36ef8e2f9ce25e0ffe7b4b448c31ea5866acfc3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-02-03 00:48:20 +01:00
Volker Hilsheimer 4b64df5650 Reapply: Remove const/ref debug operator for QDockWidget
QObjects are usually passed by pointer, so we leave the override
taking a pointer.

This amends bbeff2a335, and reverts
the previous revert in b148a362c3.
Now that we have removed the incorrectly added operators from the
6.6 branches entirely, we can remove the unnecessary const/ref
operator from 6.7.

Task-number: QTBUG-119952
Pick-to: 6.7
Change-Id: Id196367ddf3ffb443db44194002f850dcfec5d79
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-03 00:48:19 +01:00
Giuseppe D'Angelo 1aa16094c0 QPrintEngine: emit CMYK colors as CMYK when printing in PDF
When printing in PDF, QPrintEngine used to convert every color to
RGB. Stop doing that -- if the user paints with a CMYK color, emit
it in CMYK.

Change-Id: I2714d243103501e4602dec9f225f5379ed8f7dec
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2024-02-03 00:04:38 +01:00
Giuseppe D'Angelo 97ca5f6161 QPdfWriter: use DeviceGray when in Grayscale mode
QPdfWriter has "always" supported a grayscale mode in order to
support grayscale printing from QPrinter. When in this mode,
colors were still emitted as RGB, just with equal quantities for
each channel.

But the PDF format itself supports grayscale colors, so
avoid the conversions and emit colors directly in that.

Change-Id: Id5ec3bc42b710909f32986c59d8fbd6f748e02f9
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2024-02-03 00:04:38 +01:00
Giuseppe D'Angelo 3a7cda715a QPdfWriter: switch the default color model to Auto
If a user specifies a color in CMYK, save it in CMYK by default
(instead of converting it to RGB).

[ChangeLog][QtGui][QPdfWriter] QPdfWriter by default will now
save CMYK colors in CMYK, instead of converting them to RGB.
You can use the setColorModel() function to restore the previous
behavior.

Change-Id: I2a699f99d44c106d59bf0e32c11f9cf9999d16e8
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2024-02-03 00:04:37 +01:00
Giuseppe D'Angelo e35dcba5bb QLineEdit: disable cursor blinking on hide
QLineEdit activates the blinking cursor timer when it's shown,
but never deactivates it, resulting in constant wakeups even for
hidden line edits.

Note that this is a workaround. Qt is supposed to send a focus out
event to line edits that get hidden. In some corner cases, it
doesn't, and only a hide event is sent.

Change-Id: Ic0645512051466ca9b1e84c54cef34c22287338b
Task-number: QTBUG-52021
Pick-to: 6.7 6.6 6.5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-02-02 23:12:00 +01:00
Ahmad Samir e26fbd59d5 QFileSystemIterator: simplify the constructor
Neither implementation (Unix and Windows) uses the QStringList
or the QDir::Filters args.

Change-Id: I6a552e41eb37e4b76246e35d43ac4d34a4ae9d12
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-03 00:12:00 +02:00
Ahmad Samir 0516d48ae9 QFileSystemIterator: set errno to 0 before calling readdir()
So that errno can be used to distinguish between "reached end of dir
stream" state and an error.

Set errno to something more useful (EILSEQ) when we fail to decode an
entry's name, requested by Thiago in code review.

Change-Id: I8091144d25e5e5aa875cf40eaf6ee13c9e409ee7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-03 00:12:00 +02:00
Ahmad Samir 3758829162 QFileSystemIterator: manage dirstream with unique_ptr
Less manual resource clean-ups.

Drive-by changes, initialize members in-class. Also remove an unused
include.

Change-Id: I03cd12e1c6c12338d09daba916cd34cb36f04260
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-03 00:12:00 +02:00
Ghenady Kuznetsov 3aa9388056 Fusion style: add right side indent to groupbox title
Add right side indent to the title if groupbox alignment is set to
Qt::AlignRight | Qt::AlignVCenter.

Fixes: QTBUG-121049
Pick-to: 6.7 6.6
Change-Id: I9aac295c824ad774410efd679f59075e4251b611
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-02-03 00:12:00 +02:00
Tasuku Suzuki 2b8a604c40 Fix build with -no-feature-animation
This amends 8eaf01ef81

Pick-to: 6.7
Change-Id: I8e30f232b732b0acb0b6c7070ecfa216fabd64da
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-02-02 22:12:00 +00:00
Wladimir Leuschner a1f12273b2 QWindows11Style: Draw MDI SubWindows in Windows 11 style
Fixes: QTBUG-120633
Pick-to: 6.7
Change-Id: I6ad4052ca45f7c90cd52a9d2440b508730d3685d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2024-02-02 22:07:08 +01:00
Eskil Abrahamsen Blomfeldt 0916415ef7 Implement missing features in DirectWrite font backend
The DirectWrite font backend is an optional backend which
is planned to take over as the default on Windows. In order
to do this, though, a few gaps need to be filled in order
for it to pass all autotests.

The following things are covered by this:

1. Bitmap fonts are unsupported in DirectWrite. We enumerate
   these using GDI and fall back to the GDI font engine when
   loading them. As part of this, we introduce a new handle
   type for fonts on Windows which can represent both
   the DirectWrite and GDI engines.
2. "Legacy font names" where sub-family is embedded in the
   family name is now enumerated together with the
   typographic font name.
3. The DirectWrite font engine was not loading kerning pairs
   from the font, like the other engines (omission which was
   detected by the test)
4. Turning off antialiasing does not work with DirectWrite, so
   we fall back to GDI for this.
5. Loading supported writing systems from application fonts
   was not supported.

Task-number: QTBUG-119420
Change-Id: Icf6c351afb0d7487b2f4634199088d701a324aae
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-02-02 18:01:52 +01:00
Shawn Rutledge 16bcdba8e7 Update md4c to 0.5.2
Followup to c29a235833

[ChangeLog][Third-Party Code] md4c was updated to 0.5.2.

Task-number: QTBUG-121442
Pick-to: 6.2 6.5 6.6 6.6.2 6.7
Change-Id: I097d9aa5f54c59c301a91fb824adf949daae3af2
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-02-02 10:00:13 -07:00
Shawn Rutledge 7c313f1865 QMovie non-anim: use QImageReader::imageCount but not nextImageDelay
Since 3f4d6279c4b0d04422efff478a5e2fb36259dbaa (khansen 2005) QMovie
calls QImageReader::read() until QImageReader::canRead() returns false.
That's apparently to support animated image formats in which the
frame count is not known at the beginnning (i.e. not specified in
the image format's metadata). But non-animated multi-frame formats
are expected to return valid values from QImageReader::imageCount();
and those also tend to keep returning true from canRead() regardless
of how many frames have been read (the interpretation of canRead()
is "does the file have the expected format?" rather than "are we
about to read too many frames?"). So, when a multi-frame image is abused
as an animation, QMovie was able to keep reading the same frame
repeatedly and pretend that the frame sequence goes on forever.
It also tended to read frames as fast as they could be decoded,
because nextImageDelay() is not usually provided, because multi-frame
image formats don't specify a frame rate in their metadata.

So now we change QMovie's behavior for image formats where
QImageIOHandler::supportsOption(Animation) returns false:
trust imageCount(), but not do not trust nextImageDelay().

But to actually jump to the next frame in this case, we also need to
call QImageReader::jumpToNextImage().

Altogether, this makes QMovie support "flipbook" animation for
multi-frame image formats, such as tiff and pdf.

Added "read frame x of c" logging in qt.gui.imageio category.

For testing, we use a pre-existing multi-frame Obj_N2_Internal_Mem.ico
file, to avoid depending on the tiff plugin.

[ChangeLog][QtGui][QMovie] QMovie now handles non-animated multi-frame
image formats (such as tiff): QImageIOHandler::imageCount() is observed,
and the default frame rate is 1 FPS.

Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-117429
Change-Id: I6dad2a684e12c78a68288402e223a59427bf649e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-02 09:57:00 -07:00
Alexandru Croitor cec2e42052 CMake: Fix configuring a standalone test on Apple platforms
Configuring a test as standalone would fail with the following error:
 Invalid max SDK version: It should be a major version number,
 without minor

This happened because _qt_internal_check_apple_sdk_and_xcode_versions
expects QT_SUPPORTED_MAX_MACOS_SDK_VERSION to be available, but it is
not yet set due to Qt6 package not being found yet.

Avoid the issue by exporting the version requirements into both
Qt6ConfigExtras.cmake and Qt6BuildInternalsConfigExtra.cmake.

Make sure to assign the variables only once.

Amends a29bff3d80
Amends a0bdd2195f

Pick-to: 6.6 6.7
Task-number: QTBUG-119490
Change-Id: Ic297eeaabf22c8c42ded1a766906f88fdb91fd3d
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-02-02 17:53:56 +01:00
Lucie Gérard 60889fcf72 Change license of .qdoc files
According to QUIP-18 [1], all .qdoc files should be
LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I7c4d8a1957db6f6d7ad18cbc1928499724e9305f
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-02-02 16:52:11 +00:00
Lucie Gérard 1dbc57ad0c Change doc snippet license
According to QUIP-18 [1], all doc snippet files should be
LicenseRef-Qt-Commercial OR BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I6e5bc9d05a5d510cc07a15abafe2257034562510
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2024-02-02 16:52:11 +00:00
Andy Nichols b38002518e Fix -Wdeprecated-anon-enum-enum-conversion issue in cocoa plugin
Noticed when building with -c++std c++20 for macOS. Lots more warnings
in general but this one was an error.

Change-Id: I8dd9ae33f23dd77b2ec619b7357f50b97e3ed8ef
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2024-02-02 17:25:40 +01:00
Volker Hilsheimer 9f0dc59cd6 JNI: Don't use forwarding reference in ranged for
The elements we iterate over are always jobjects, i.e. POD, so iterating
over values is at least as efficient, and less unnecessarily clever.

Pick-to: 6.7
Change-Id: I6142dab84f3d37d82613ecf27cc03dde7810e541
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-02-02 16:23:02 +01:00
Lucie Gérard 35fbb65610 Change configure license
According to QUIP-18 [1], all build system files should be
BSD-3-Clause

[1]: https://contribute.qt-project.org/quips/18

Pick-to: 6.7
Task-number: QTBUG-121787
Change-Id: I88e3640b32e6b4bd83c49c14df6aecd7c824aef7
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-02-02 15:23:02 +00:00
Frédéric Lefebvre 4b60b6d845 tst_QWidget::scroll() remove QApplicationPrivate::setActiveWindow()
2f6fe3a268 has made calls to
QApplicationPrivate::setActiveWindow() redundant.

Remove redundant calls.

Task-number: QTBUG-121488
Change-Id: I13ea8c0994eaeb764462af23ef66ea1a37659b77
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-02 16:23:02 +01:00
Giuseppe D'Angelo 0092f06a64 Add CMYK support for pens/fills in the PDF engine
Insofar, painting with a CMYK color (pen/brush) was completely ignored
by QPdfWriter, although the PDF format can faithfully represent CMYK
colors.

This commit adds support for CMYK colors in the PDF engine. The support
is opt-in, in the name of backwards compatibility; an enumeration on
QPdfWriter controls the output.

QPrinter was using a hidden hook in QPdfEngine in order to do grayscale
printing; this hook can now be made public API through the same
enumeration.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

[ChangeLog][QtGui][QPdfWriter] QPdfWriter can now use CMYK colors
directly, without converting them into RGB colors.

Change-Id: Ia27c19ec81a58ab68ddc8b9c89c4e57d7d637301
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2024-02-02 16:06:45 +01:00
Marc Mutz efc579145e QBitArray: simplify resize()
Use the new (in Qt 6.4) QByteArray::resize(n, ch) to avoid the manual
memset() unpleasentness.

Pick-to: 6.7
Change-Id: I786988125f52b1bc1f733c30ab2b95eda569481d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-02-02 15:35:51 +01:00
Marc Mutz 0d6ca27517 QBitArray: simplify (size, value) ctor
Don't do the memset() manually just to save re-writing the single
leading byte. Pass the initial values to the QByteArray constructor
directly.

Pick-to: 6.7
Change-Id: I67daf446bebb8c8c6b05d235746ee43604f42445
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-02 15:35:51 +01:00
Marc Mutz 9219e8ff1d QBitArray: don't create invalid Qt 5 streams
Qt 5 streams cannot handle QBitArrays with more than INT_MAX bits,
even on 64-bit platforms, because of interface constraints (size_type
int).

Qt 6 can, so make sure to refuse serialization of oversized QBitArrays
to Qt-5-compatible streams.

[ChangeLog][QtCore][QBitArray] Now refuses to stream a QBitArray with
size() > INT_MAX to a Qt-5-compatible QDataStream.

Pick-to: 6.7 6.6 6.5 6.2
Change-Id: I263e27bd366757c8e0360dfd337948c44d00647a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-02-02 15:35:51 +01:00
Marc Mutz 1b3c8d6e95 StreamStateSaver: disable copy/move
The class has a user-defined destructor, so it mustn't be copied or
moved (which here is the same as copying).

Amends 3c93286f08.

Pick-to: 6.7 6.6 6.5
Change-Id: I1b23588309654f34aedc0269e1d1c9511ddda2bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-02-02 15:35:51 +01:00
Joerg Bornemann 654f3c5634 CMake: Fix *-metatypes.json creation, take III
Use the work-around for CMake issue #19005 for Makefile generators
and Visual Studio projects.

Pick-to: 6.7 6.6 6.5
Fixes: QTBUG-120317
Change-Id: I3d15f23937133a5dd4d1c2a88af0fc34d5608a77
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-02-02 15:35:51 +01:00
Tor Arne Vestbø 97c02b80ae Harden WidgetAttributes debug stream operator
The call site may pass in a null-widget, so guard for that.

Pick-to: 6.7
Change-Id: I631cb2fc105bad69faf3daaeac4b893457d27cc1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-02-02 15:04:14 +01:00
Laszlo Agocs 90a94527d2 rhi: vulkan: Query and enable multiview features when API is 1.1
Meaning a Vulkan implementation that is not 1.0, not 1.2, not 1.3,
but 1.1. This does not have the 1.2+ versioning mechanisms.

Change-Id: I9d9346d505162adc0e03aa04217930d41c72027f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2024-02-02 12:59:35 +01:00
Edward Welbourne 8c178a540f Documentation tweaks in QDate(Time)?::toString()
Include the \since markers they need, plus changes in past versions.
Purge a stray blank line.

Pick-to: 6.7 6.6 6.5 6.2
Change-Id: I4edaa0ffaf59323e0af6412727f2a85866813ab8
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2024-02-02 08:30:49 +01:00
Tim Blechmann 6fc93f9765 kernel: silence `-Wextra-semi`
silencing gcc's `-Wextra-semi`

Pick-to: 6.5 6.6 6.7
Change-Id: I0e70465585be5ba4d90c691cd0fbd43e1288e694
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2024-02-02 07:29:18 +00:00
Tasuku Suzuki 8f26ff0dee Fix build with -no-feature-menu
Change-Id: I29a230d70a96c3037f4e07dbe23fce13aa869089
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-02-02 16:26:30 +09:00
Edward Welbourne b0cb4a80e5 Modernize comparisons in tst_QLocale
QCOMPARE() can report enum values by name just fine, no need to
laboriously convert them to strings. While comparing all tags in one
go did allow a more comprehensive report, it's enough to know we
failed; this is testing cross-platform code, so a debugger can tell us
all those extra details if we get a failure.

Testing qHash() doesn't distinguish equal things is fairly low value;
at least avoid duplicating the construction of the reference value.

Replace a bunch of other QVERIFY()s with the new cousins of QCOMPARE()
for ordered and different comparisons.

In the process, mark some of the QLocale objects as const.

Change-Id: Ic93b8ed60c6f2cc846fbba428983778896d61291
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-02-02 08:26:14 +01:00
Edward Welbourne 5d451d514c Make TEST_CTOR macros use the "do { ... } while (false)" pattern
They were expanding as simple blocks, so their uses didn't end in
semicolon, which looks wrong when reading the code.

Pick-to: 6.7 6.6 6.5
Change-Id: Ibea7b01ac165045604b6eb7a838765b2061c368a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-02-02 08:26:09 +01:00
Edward Welbourne 063026cc50 Update QLocale and calendar data to CLDR v44.1
(This turns out to be identical to v44, for our purposes.)

The CLDR license has been revised at v44 to "UNICODE LICENSE V3",
which is now included (as LICENSES/UNICODE-3.0.txt) in addition to the
old license (still in use, presumably, by UCD - at least until its
next update). Some new QLocale::Language entries are needed. There is
no change to the time-zone data.

Some tests needed changes:
* Various Arabic locales now use U+0623 (Arabic letter aleph with
  hamza above) in exponent separator, replacing plain U+0627 (Arabic
  letter aleph); it is still followed by U+0633 (Arabic letter seen).
* Where likely sub-tags used to fill in world, 001, as territory for a
  language, they now (e.g. for Prussian and Yiddish) give specific
  countries.
* Tamil locales now have something of a mix of inherited and localized
  forms for AM/PM, which looks a lot like a mistake in CLDR.
* New likely sub-tag rules fix ctor(und_US) and ctor(und_GB), which
  previously failed.

[ChangeLog][Third-Party Code] Updated QLocale's data extracted from
the Unicode Common Locale Data Repository (CLDR) to v44.1. The license
changed to Unicode License V3.

Pick-to: 6.7 6.6 6.5
Fixes: QTBUG-121485
Task-number: QTBUG-121325
Change-Id: Ide1a68016129526d7a5aa3fc67f1a674858696bc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-02-02 08:26:03 +01:00
Ahmad Samir 2a8b27bf6c QFileSystemModel: don't crash with setIconProvider(nullptr)
The method takes a pointer, so the code shouldn't crash when passed a
nullptr.

QFileInfoGatherer::getInfo() still needs to generate a descriptive
string for the file, so we refactor QAbstractFileIconProvider::type()
to put the implementation into a reusable static function
QAbstractFileIconProviderPrivate::getFileType(const QFileInfo &info).
This unfortunately involves constructing a QMimeDatabase on the fly,
but the docs say that is fine.

Drive-by change: use nullptr instead of `0` for pointers.

Pick-to: 6.5 6.6 6.7
Fixes: QTBUG-99178
Change-Id: Ia32ea0a26701d593e74fbecced7be8d9e0aa0f52
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2024-02-01 22:06:12 +00:00
Ahmad Samir 0211dfd92b QFileInfo: clarify the docs with respect to "file" == file system entry
The word "file" could be slightly misleading in this context, because it
refers to an entry on the file system, which could be a regular file, a
dir, a special character device. Clarify the meaning by using "file
system entry" instead of just "file".

Fixes: QTBUG-120688
Pick-to: 6.7 6.6 6.5
Change-Id: Ic2a91cc74336a6718c13ad1ffd9f2c4001e5d63f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-02 00:05:51 +02:00
Ahmad Samir 1fe88bf4cd QObject: add unittest to check the order of eventFilter() calls
installEventFilter() prepends new objects to the eventList, so that
events that are posted while processing events are left to the next
round of event processing.

This is a baseline test to check that subsequent commits preserve the
current behavior.

QCOMPARE_GT is available since Qt6.4, so make the check backportable to
older releases too.

Pick-to: 6.7 6.6 6.5 6.2 5.15
Task-number: QTBUG-120779
Change-Id: I5ed5e9c2917a9be62de4af19c3b72889399b4fe6
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2024-02-01 23:42:56 +02:00
Ahmad Samir 28db390ce6 QMetaObject: clean up includes
Remove duplicate ones and regroup them.

Add a comment explaining why qthread(_p).h isn't guarded by an
`#if QT_CONFIG(thread)`; thanks to Fabian Kosmale for the explanation.

Pick-to: 6.7
Change-Id: I9b13fd62ab92fa6d2ffc4d004d77e95e95f5fb08
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2024-02-01 23:42:56 +02:00
Ahmad Samir 6d9185c0e6 QFileSystemEngine: use nativeFilePath()
Instead of filePath() then converting to QByteArray.

Change-Id: I6f656774979bedde5c657613303518750ab06855
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-01 23:42:56 +02:00
Edward Welbourne 5e0475f88a Rewrite a comment on measurement systems
CLDR does supply information on measurement system, which may be
richer than what we're currently working with, but

* I don't see any hint to which measurement system to use for each
  locale by default;
* there is some support for selecting combinations of locale and
  measurement system, suggesting it doesn't believe in such a default
  in any case; and
* even if it were there, adding it to locale_data[] would take up more
  memory than special-casing the few locales that use anything but SI.

Revise the comment to reflect this.

Change-Id: Idfa603fc9a5a55d0bd0da122ac66c76b0edf9f57
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-01 21:50:50 +01:00
Edward Welbourne 0e8a8c3aa2 QTZP: use binary search more on timezone ID tables
The zone and Windows data tables are sorted on Windows ID and its key
(which are monotonic functions of one another) so we can use binary
chop to find the first matching entry in each, when searching on
these. Furthermore, the search for ID from key can be shortcut as the
keys should normally be consecutive integers starting with 1.

Change-Id: I53f7ff8c93fd6d3d9e48c7bb86060746b68fab3d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-01 21:50:50 +01:00
Edward Welbourne 4b2eb26bf9 Fix ordering of Windows timezones
The list is meant to be sorted in increasing order, requiring
"<anything> (Mexico)" to appear after "<anything>" but in two out of
four cases such pairs were in the wrong order. China sorts after
Chatham Island and lexical sorting of numbers doesn't match sorting by
numeric value.

Assert the expected ordering. (The more important check needs a
QBAV::compare(), which isn't constexpr, so we can't static_assert.)
Later commits shall use binary chop exploiting this ordering. The
assertion failed without the rest of this change.

Also improve the comments describing the data tables these searches
check and the types of their entries. Some were inaccurate, others
merely unclear. Likewise, comment the sorting expectations in the
python code that generates the tables.

Change-Id: I640a3cca8f820c5fd5939a2fe5feb96b04407335
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-01 21:50:50 +01:00