Commit Graph

17094 Commits (7229cc75a4afa6d4cd367398f0da0cf73f8a80a2)

Author SHA1 Message Date
Laszlo Agocs 9d26d58eba rhi: manual test: Do not blindly enable qt.rhi.* logging
Now that qt.rhi.general is not the only category, this is
not ideal.

Change-Id: Ied3533327dc310cee5fce75fe5760454167161b7
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
(cherry picked from commit a537703a4df516da9b7f9126c719a1ccb9271647)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 17:02:10 +00:00
Kaloyan Chehlarski 5c94c5a4ef QAbstractItemView: Fix shift-select after changing index through model
When setting the current index through the related model's
QItemSelectionModel::setCurrentIndex(), the selection can also change.
However, attempting to shift-select after doing so would produce
an unexpected selection, because the internal variable that keeps
track of the start index of the current selection would still have
its old value.

This change moves where said variable is set: instead of doing that
in QAbstractItemView::setCurrentIndex(), it is now done inside the
currentChanged() slot instead. This slot will get called both when
the selection is modified through the QAbstractItemView class itself,
as well as when it's modified from the outside (e.g. from the model).

Pick-to: 6.7 6.5 6.2
Fixes: QTBUG-127381
Change-Id: I6d38320e656aa5a102ce079604590672c88ecad1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit fb2d64bc57aadf5bf140c72cf7eb2a5f391b7d55)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-21 13:34:23 +00:00
Mårten Nordheim 5caa31cb21 QByteArray: fix lastIndexOf for char values with set sign bit
lastIndexOf will convert the `needle` to unsigned char, which is then
'upcast' to int, before we search. But the string itself was searched
using signed char, meaning any values with the signed bit set would
mismatch.

Add tests for indexOf and lastIndexOf.

Amends 4c12ae7e67

Fixes: QTBUG-128199
Change-Id: I0ce7d7d9741f21650ef6f0f012a94e00d84a0f02
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7b1f3bdc503ea7aceacc9fa8d388d843f1d7b131)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 11:40:56 +00:00
Ulf Hermann 833c0040cb moc: Print method index to JSON output
We want to be able to index into the metaobject from code generated by
qmltyperegistrar. And we don't want to rely on some implicit promise
that certain methods are in the "right" order in the output. This is
similar to what we've done with properties.

Change-Id: I8d97b65598338fcff57c6b0866708232066c94cb
Task-number: QTBUG-127442
Reviewed-by: Olivier De Cannière <olivier.decanniere@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 484e72a1074279dca1253ae07515461ad231de3c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 08:51:01 +00:00
Soheil Armin 9af91d6eca Android: Add Java QtAbstractItemModel auto test
QtAbstractItemModel used to be a part of QtDeclarative
and is being moved to QtCore based on API reviews.

Task-number: QTBUG-126976
Task-number: QTBUG-127089
Change-Id: I28a921a113ec4f3ad298bf55b40aea334e7721cf
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit baed8a24d07de87da61e9d5e3dbffc8d8ca92918)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:03 +00:00
Thiago Macieira f6d69a7575 QHash: adapt to C++20 ranges not offering operator->()
Iterators no longer provide it, because they may need to return a
temporary in some occasions.

Fixes: QTBUG-128102
Change-Id: Ide0a7a84f612fff73afffffd49889321cb70505f
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit cb40a1fa7f4b06acced1d17e8333742084092f9e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:02 +00:00
Jøger Hansegård 471debef07 Test QFileInfo::isWritable when it should return false
Extend existing tests to verify that QFileInfo::isWritable returns
false when file is read-only or non-existent.

Task-number: QTBUG-124011
Pick-to: 6.7 6.5
Change-Id: If41241b500aa76036b39a53590b5e0b6ab2f20ea
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 42004d245e2bf4846520e5e186a5c86aa87a6019)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-20 01:28:02 +00:00
Eskil Abrahamsen Blomfeldt aa9a991169 Respect QTextDocument::defaultFont() in ODF writer
The ODF writer would ignore the default font set on the document
and just output default values according to spec, such as "Sans"
for the font family.

With this patch, any settings set explicitly on the default font
will be taken into account, granted that they are not overridden
by any properties in the QTextCharFormat.

[ChangeLog][Text] The ODF backend to QTextDocumentWriter will now
respect the default font set on the QTextDocument.

Fixes: QTBUG-124570
Change-Id: Ia937420f7f721bbf3264661160cb0a593907358c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 77a9a208227ecf750d620b3048053fd4fc4299a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 19:42:55 +00:00
Edward Welbourne 389aca9b71 Correct Arabic exponent separator in QLocale benchmarks
The separator was changed at CLDR v44 to use a plain aleph, U+0623,
rather than the U+0627 aleph with hamza above previously used. This
is, in both cases, followed by U+0633, "seen".

Task-number: QTBUG-121325
Task-number: QTBUG-126060
Pick-to: 6.7 6.5
Change-Id: I013525e0876c4c47111846135c9311e7b3442dd3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 45ec096672a67db01d29f78e7e910bebab36e31b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 11:27:06 +00:00
Edward Welbourne 6cc95e1d92 Add QTZ::displayName() benchmarks
Task-number: QTBUG-115158
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I7465a19f6003cfae7507d798fadeab22bf1b118d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 01acb888e0f9f06cac07d69d8c934eac9d32daf3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 11:26:52 +00:00
Edward Welbourne c8d7f1a5ec tst_QLocale: remove duplicate fromScriptLand_data() data rows
Pick-to: 6.7 6.5 6.2
Change-Id: I78ceb053d73fcf22deff7258a349a8ec22e7ad3d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9dab0aecc078224e807fa0625a08fb92c9a7b58e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 11:26:33 +00:00
Wang Yu 04f3381f11 Fix the crash of test case authentication required
Empty transfer is caused by using its password,
resulting in a crash

Pick-to: 6.5
Change-Id: I2b208ce48b5abc2adea3278d875f3005cda77a8b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 8143e85bb4706799f9275c25b2caf72b22b457a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-19 04:04:18 +00:00
Marc Mutz 7805b3c32f Only define QT_SUPPORTS_INT128 if type_traits work for them
It turns out that libstdc++ in -ansi mode defines __SIZEOF_INT128__,
but not the corresponding specializations of <type_traits> and
<limits>. This has caused numerous pain points over time, esp. since
is_signed doesn't work, so qt_saturate e.g. can't be used on qint128
inputs e.g.

After another such issue (cmp_equal()), we decided to require
<type_traits> and <limits> support for extended integer types in the
stdlib, or we will disable Qt's support for it, too.

So check that if QT_SUPPORTS_INT128 is defined, is_signed_v,
is_integral_v and numeric_limits work, too. Disable QT_SUPPORTS_INT128
when compiling with libstdc++ in __STRICT_ANSI__ mode (-ansi or
-std=c++NN instead of (the default) -std=gnu++NN).

[ChangeLog][Potentially Source-Incompatible Changes] Qt's support for
128-bit integers (qint128/quint128) is now conditional on support for
these types from the Standard Library, in particular <type_traits> and
<limits>. Qt no longer tries to work around missing Standard Library
support. As a consequence, e.g. GCC -ansi and GCC -std=c++NN (instead
of -std=gnu++NN, the default) builds will now no longer support these
types.

Task-number: QTBUG-119901
Change-Id: I8529e72a52a2f5da0f469bae543688e18220255f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9bb2ab5978625eee96f703871d5eca8e54b31386)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-16 17:34:29 +00:00
Marc Mutz caf57f0ca3 tst_QGlobal: add a build of this test in strict mode
This is in preparation of adding some static assertions here that we
need to have evaluated in both "normal" and "strict" mode, namely
<type_traits> and <limits> support for qint128.

But this change is more general, so making it a separate change.

Turns out we already have (non-static) assertions here about <limits>
support for qint128. These force us to define precisely when
GCC/libstdc++ has gained <limits> support for __int128_t: the
timestamp of the __GLIBCXX__ macro is the Daily Bump immediately
preceding the gcc commit that fixed <limits>
(gcc/8eb9a45e87bdb81cb44948c651edee846c622a0f).

Let's hope no-one is running the prerelease version of GCC 10.3 from
that particular day, otherwise these might become XPASSes. But just
not testing is also wrong; we want to be informed about True Positives
and Negatives here.

Task-number: QTBUG-119901
Pick-to: 6.7 6.5
Change-Id: I6f9be047f846fff74133c466c5bed40d0039d60f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e7c54248987d474cff9f49cad502822eb9dcb114)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-16 17:34:29 +00:00
Eirik Aavitsland 12bca46996 Remove inline downscaling in png reader
In Qt 5.0 timeframe, support for downscaled reading was added to the
png handler, as a help for devices with very limited memory. Instead
of decoding the whole image into memory and then scaling it down (as
happens for most image formats if scaled reading is requested), a
separate reading function was added that would perform line-by-line
decoding and downscaling.

Although this provides a transient memory saving during decoding, it
has a number of drawbacks:

- The scaling routine is simplistic and can create artifacts for
  images with transparency, ref. the linked bug report

- The scaled result from the png handler is in general different from
  the result of using the common QImage smoothscaling function

- The line-by-line scaling function is generally slower than the
  common smoothscaling function, since the latter is optimized using
  SSE/NEON extensions

- It adds a redundant implementation of image scaling to the code base

Hence we drop this functionalty going forward. This effectively
reverts 44a9c08eff0647f398863de55e2b62dbd6541e27.

[ChangeLog][QtGui][Image I/O] The PNG handler no longer implements
progressive downscaling during decoding when scaled image reading is
requested.

Fixes: QTBUG-121724
Change-Id: I7b524b12c174c64201b98945ee2fa062ed127f87
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit a2a315eaa28edf9c649e13c951fdb1154e3ddf48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-16 06:49:53 +00:00
Tor Arne Vestbø 71e77398bb tst_qhighdpi: Write screen config to temporary directory
Instead of build dir, where it can clash when multiple tests runs
are being done from the same build dir in parallel.

Due to the way platform plugin argument parsing works we can't
pass the full file name of the config, as on Windows this would
include C:, which QGuiApplication will split into two, thinking
they are two different platform plugin arguments.

Instead we chdir into the temp dir, and create the file there,
passing the file name as a relative path as before.

Change-Id: Ia4ea82280e35f4f52b7de74bbf53b2a48ecbaecd
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit fd68f894b969b016201e032ba23dac431c19b90a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-15 08:37:32 +00:00
Lena Biliaieva 88ae8785ef QHttp2Connection test: silence conversion warning
Follow-Up to: 6aa1cb05e357cf4221aaedd4cf742c45983af446

Change-Id: Ie355c2813f38aa6097fe3bbcdd1f021fd1f0d791
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
(cherry picked from commit 4a44a8a8a5768b3ffaa3cb00f995bfee792ca5c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-14 12:20:34 +00:00
Tim Blechmann 606f7af1d2 Tests: rename stenciloutline to tst_stenciloutline
`stenciloutline` clashes with the example of the same name in
qtquick3d/examples/quick3d/extensions/stenciloutline.

Prefixing the test target with tst_ to fix the name clash.

Fixes: QTBUG-127981
Change-Id: I23026523d34abeb09f083e3186273120551bc6c4
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 70b431345e00f78fe0f77b92ca86c859c818eceb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-14 11:20:48 +00:00
Ivan Solovev c197fefb22 Qt::totally_ordered_wrapper: do not allow operator*() for void*
Disable operator*() for void* type, because it otherwise causes
a compiler error:

  qcomparehelpers.h:1103:18: error: forming reference to void
     constexpr T& operator*() const noexcept { return *get(); }
                  ^~~~~~~~

Use this as an opportunity to add more tests for operator*().

Amends ece36a7394.

Change-Id: I205b9989bd142ca9aa49f8f4d15854e591e3042b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 053b8ff7fedfe5aed29a91a82569c00cac466e9a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-13 12:56:19 +00:00
Lucie Gérard 74e50e224f Correct tests license
According to QUIP-18 [1], all test files should be
LicenseRef-Qt-Commercial OR GPL-3.0-only

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

Task-number: QTBUG-121787
Change-Id: I0a35709284c4b6e7d080f41f361a9adea1415ca0
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 334a92ecb86fb89a65091bb4c230431eeb0fa587)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-13 12:56:14 +00:00
Tor Arne Vestbø eeb0740f2e QTextHtmlParser: Handle fractional font-size pixel values
The CSS spec defines the font-size as being a length, which is a
combination of a real number and a unit. This applies to the 'px'
unit as well, so by treating px values as integers when parsing
we were failing to parse not only '12.5px' but also '12.0px'.

The code now uses QMetaType::fromType<qreal> but then sets the
resulting pixel type on the QFont as an integer, as QFont does
not support fractional pixel sizes.

Other code paths in the CSS parsing machinery use QString::toInt(),
either directly or via intValueHelper() or lengthValue(). The font
code path can potentially be ported over to these other APIs for
consistency, but to keep the patch simple this is left for a
follow-up.

Pick-to: 6.5 6.2 5.15
Change-Id: I972cfe0f3fa3c785efa18c7593d6a497ff28911c
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
(cherry picked from commit 5731e3e185d3a69502b2bc4f1fee48c156b34c3c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-13 12:08:27 +00:00
David Faure 2b50551923 QIdentityProxyModel: add setHandleSourceDataChanges(bool)
Some sub-classes have special handling of source model data changes,
they relied on disconnecting the connections to the _q_*layout* slots
in the private class using the SLOT macro. This isn't possible any more
after the recent port to PMF connects.

Sub-classes resorting to using private API is a clear sign some
functionality is missing from the public API, so a cleaner solution for
this issue is adding this setter which enables sub-classes to tell
QIdentityProxyModel to leave handling of the dataChanged signal to them.

Similar to commit 675b4f63fe (but
this should be the last one needed).

[ChangeLog][QtCore][QIdentityProxyModel] Added
setHandleSourceDataChanges(bool) method to allow sub-classes to
indicate to QIdentityProxyModel that they will handle source model
data changes on their own. Also added a getter,
isHandleSourceDataChanges().

Task-number: QTBUG-127959
Change-Id: Id8f567c330e4ee834940a62b6497d8cbb8ba4a46
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 5a31800d41273a14436c543438a142562f74f857)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 20:18:41 +00:00
Ivan Solovev a83d113f66 Fix partial_ordering::unordered != 0 comparison
The standard does not provide any details on implementing operator!=(),
because it relies on the fact that it will be synthesized by the
compiler.

Our C++17 implementation, however, has to provide operator!=(), and we
made the mistake of copy-pasting the implementation from other
operators.
However, the isOrdered() check does not make sense for operator!=(),
because an unordered value is never equal to literal zero.

Fix the implementation for both Qt::partial_ordering and legacy
QPartialOrdering.

Amends 405244fe30 (for QPartialOrdering)
and bdd41f491c (for Qt::partial_ordering).

[ChangeLog][QtCore][QtCompare] Fixed a bug where
partial_ordering::unordered != 0 comparison produced an incorrect
result.

Fixes: QTBUG-127759
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I5008f72831c17dc7fa4ae181bfc8115198a691f0
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit d39441a2eb5658f3d4a01046c592adb827525118)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 20:18:41 +00:00
Ivan Solovev 247ec89cc5 Test partial_ordering::unordered != 0 comparison
... and figure out that it does not match the std implementation.
Fix will be provided in a follow-up commit.

Task-number: QTBUG-127759
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I51c4f086af531a81a6aae03f3462972437d41f97
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit fed1099ad2909cb8e75477e60e0a8b41db3f58d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 20:18:41 +00:00
Tor Arne Vestbø 79be5fa986 Make QWidgetPrivate::setVisible virtual
Initially the function was used as a helper function for QWidget,
implemented in da55a1b041. But with
e0bb9e81ab we started overriding it
e.g. QDialog. This "worked" because QDialog itself would call the
private helper, but left a footgun when called via a plain QWidget
pointer, as we did in 5ba0982b28.

That specific instance of the problem was solved by the change in
fc4c6fb5f6bd6bd63b13f1f8b5b7a7289a5fd230, but the trap still exists.

To ensure we can use the function in a polymorphic context in the
future we make it virtual.

Task-number: QTBUG-127806
Change-Id: Ic0810c5439b1e696cfbf199e701f41217acc5742
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 1a0f056f318417ba5e54c8110257b75cf5537acb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 17:26:50 +00:00
Orkun Tokdemir c7a9c813fe CMake: qt_add_ui: Add sources to target_sources
* Add a new test combining with qt_add_resources
* Remove redundant ADDITIONAL_ARGS string modification
* Correct comments

Change-Id: I9b76a4d01705be3d80cc6386fbadb0b6f706a537
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 442cac6dd412559fa25d1782bda4ad60ee99dc81)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 17:26:49 +00:00
Edward Welbourne e7db7a68f6 Remove an unfounded assertion, add the test-case that tripped it
The date-time parser, unless it hits a fixed-width numeric field
that's unfilled, leaves checking the date against its configured range
until it's parsed all fields. This means it can be out of range due to
a full-width field when it hits an unfilled one and tries to take the
range into account when deciding whether to zero-pad or expect more
input into the field. So asserting the current partially-parsed
datetime is in range at that point is not justified.

Thanks to Albert Astals Cid for reporting this fiendish corner case,
found by oss-fuzzing of KDE's image plugins, in IRC.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: Id7db7409a0b5afadafb6920a0785a4cec4c80b62
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Albert Astals Cid <aacid@kde.org>
(cherry picked from commit e0a4de17ddb924d9bf222fb3ea2d0526813edea6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 11:26:20 +00:00
Liang Qi c237b57983 tests: blacklist tst_QGraphicsItem::cursor()
on Ubuntu 24.04 GNOME Wayland.

There is a bug in GNOME 46.0 on Ubuntu 24.04 Wayland when showing
a maximized or fullscreen window.

Task-number: QTBUG-127920
Change-Id: I15e1f6b9bbf27d92cd106318ac44c33fdabfa3a0
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f31bce32cdb50eb02bffc690e3ba7cc6b986915e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:39 +00:00
Liang Qi 6d8261a68b tests: blacklist tst_QPrinter::testPrintPreviewDialog()
on Ubuntu 24.04 GNOME Wayland.

There is a bug in GNOME 46.0 on Ubuntu 24.04 Wayland when showing
a maximized or fullscreen window.

Task-number: QTBUG-127920
Change-Id: I1500ec1dcf93005b358b7411dcd40ae79f7494fe
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit f54ab49fb8cee4611a040ef40c883b8158bfa2d9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:38 +00:00
Liang Qi cf32e1697e tests: extend tst_QBackingStore::flush()
There is a bug in GNOME 46.0 on Ubuntu 24.04 Wayland when showing
a maximized or fullscreen window.

Task-number: QTBUG-127920
Change-Id: I49c0f53b16f501072cbbe92ddd79ff21fb9adb27
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 66591b658f4270252f8bf342dac7e2a9bcad34a0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:38 +00:00
Axel Spoerl a94b3deb49 Add missing break in tst_QWidget::reparentWindowHandles()
6c036012b5f2304a05af29f29daa7582603f79ae added a case branch to a
switch before the break of the previous case.

Amend the commit and add the missing break.

Task-number: QTBUG-127641
Task-number: QTBUG-125149
Task-number: QTBUG-122747
Pick-to: 6.7 6.5
Change-Id: I3f2b3e07db463b72fa99af493f40cbc1a783f1ed
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 1d409c0854d664bafc2a35b33cb73129a51c947a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:38 +00:00
Thiago Macieira 68c9ea8888 tst_moc: check the enum's own metatype, not its underlying metatype
Checking the underlying type's metatype is checking through a QMetaType
feature, not moc's functionality. And QMetaType currently always returns
the metatype for int for all QFlags types.

Change-Id: I8a96935cf6c742259c9dfffd17e9791608e38b6e
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 46b73b1ef37e22af23bfce992f41498c6409df3a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:38 +00:00
Thiago Macieira 46ef4c8b86 tst_moc: fix the order of arguments in QCOMPARE in checkEnum
QCOMPARE is (actual, expected).

Take the opportunity to test out-of-range returns from QMetaEnum too.

Change-Id: I8a96935cf6c742259c9dfffd17e9575a6d4cf90a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit e3e44e2294c06f243838dfa28ec4f350c5e6ffbb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:38 +00:00
Thiago Macieira 3d90aa1771 QDebug: cast the QFlags value to the right-sized unsigned type (2/2)
This applies to the Q_ENUM/Q_FLAGS overload of the debugging functions.
This prevents the sign-extension of a signed QFlags field when
converting to quint64, which would have resulted in 0x8000'0000 becoming
0xffff'ffff'8000'0000.

Right now, this is a no-op change because the implementation in
qt_QMetaEnum_flagDebugOperator() calls QMetaEnum::valueToKey(), which is
limited to int (32 bits).

Change-Id: I8a96935cf6c742259c9dfffd17e998c3a0538146
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 232ad339ab14965b6207d04a45d8d37ec3139558)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:38 +00:00
Thiago Macieira 9883f88850 QDebug: cast the QFlags value to the right-sized unsigned type (1/2)
This change fixes three problems in the non-Q_ENUM overload. First, the
printing of the sign bit for a signed flag. This is correct, but
unexpected:
  QFlags(0x1|0x2|-0x80000000)
By using unsigned types, we'll print instead:
  QFlags(0x1|0x2|0x80000000)

Second, shifting into the sign bit is UB, so we remove the problem by
not having a sign bit at all.

Third, this provides an out-of-line non-template overload of the
implementation for unsigned QFlags, thereby avoiding an unnecessary
instantiation of the template function qt_QMetaEnum_flagDebugOperator()
in user code.

Change-Id: I8a96935cf6c742259c9dfffd17e992caa315e1d3
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 91a27c1a516068b69ab62778a07c566ad22f3576)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:38 +00:00
Marc Mutz a9f26089ed Enable QT_NO_QSNPRINTF globally
The qsnprintf() function introduces even more platform variability
than std::snprintf(), so from now on, we're using only std::snprintf().

Task-number: QTBUG-127110
Change-Id: Ic81b2a760521d77442cc328d2cfa7659bba8b7e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b8a956c2d3f9c158594265eca89185bd2bc671e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-12 09:43:38 +00:00
Assam Boudjelthia 6f01a67bdc CMake: make tst_manual_permissions standalone project
Similar to 0e56dd2746.

Fixes: QTBUG-126415
Change-Id: Ia6993a050bac1eb6860d7bbdf76c454c62eb46b3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 052d8714cdad9126ca69fcbee95bce223ef7eb67)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-10 10:07:44 +00:00
Liang Qi fe090e0a09 tests: blacklist tst_QHeaderView::stretchAndRestoreLastSection()
on Ubuntu 24.04

Task-number: QTBUG-126493
Change-Id: I21c6c4c1b66a48d7c30c98c30557aa2ccfe76b59
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit bc93d5b712f48bf6da400cdaf58daf7e0c852d23)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-10 07:57:32 +00:00
Liang Qi 24c8e309ee tests: blacklist tst_QMenuBar::check_menuPosition() on U2404
Task-number: QTBUG-68865
Task-number: QTBUG-126498
Change-Id: Iee8831cfac5f3317163a33d96b2dcea09bd033bb
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit a5022924109beed1730569d232611bb131a83633)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-10 07:57:25 +00:00
Liang Qi afd6ae6091 tests: blacklist tst_QWidget::saveRestoreGeometry() on u24.04 x11
Task-number: QTBUG-126495
Change-Id: I26905d7c2bbcad9a092bbd8084494a1ad0af9ee3
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit a660c8e94daca1c362fd955d28a01f715b62ade3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-10 07:57:18 +00:00
Friedemann Kleint dd825ccfff tst_uic: Modernize code
Use modern string literals, initializer lists and fix some clang-tidy
warnings.

Change-Id: I77ea935121995e41211f5342552c0dd37191e35e
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 5790d167448eea094439c7520e2fc68aed480e39)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-09 15:16:50 +00:00
Giuseppe D'Angelo 4c1a82e4cf QRegularExpression: coalesce consecutive * tokens in wildcards
When converting a wildcard into a regexp, convert a series of
consecutive '*' tokens in just one '.*' (instead of a series of '.*').
The pattern matched is the same, but we reduce the effects of a
possible catastrophic backtracking. I'm not actually sure whether
PCRE optimizes this case out of its own or it doesn't; Perl appears
not to.

Change-Id: Ia83336391593d56cf6d8332c96649a034a83a15b
Fixes: QTBUG-127672
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a041cd35214e57a189aaa1f1f77199ff42303f83)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-08 01:09:59 +00:00
Mårten Nordheim a903414898 QNonContiguousByteDeviceByteArrayImpl: store value not pointer
Storing a pointer was fine when used with the QBuffer version, but
that means you have to keep the QBArray alive outside the class
itself.

Just store the value and it is a little easier to use.

Changes in this cherry-pick: The dev patch chain has the test update in
the wrong commit, so cherry-picked it along with this.
And apparently I also forgot to commit a bug-fix to this commit as well,
the bug anyway disappeared in dev when I deleted the class and
redirected everything to the ByteArray class.

Change-Id: Ic02e0b4627fde2b5fdd7e5fb69a94e06aa768ab9
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Dennis Oberst <dennis.oberst@qt.io>
(cherry picked from commit 67140afca21efae75aad35f63ca1d7211fe6ec3a)
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-08-08 00:33:14 +02:00
Marc Mutz c250c59f7c Fix QT_SUPPORTS_INT128 checks
The macro is defined or not, not defined to 1 or 0.

Amends 1d7950c946 (qhashfunctions.h),
0d85d0a72f (tst_qfloat16.cpp),
104a0a9ecd (tst_qglobal.cpp),
7a829eaf51 (tst_qtendian.cpp).

Pick-to: 6.7
Change-Id: I190e208f3c96f27100dae3eef512739afa8fadd9
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit c78994a887f56f1bc77a5fa0db3b98196851db5e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-07 19:57:04 +00:00
Matthias Rauter a3e4a7eecb Ensure that RST_STREAM is sent following RFC 9113
RFC 9913 differentiates between stream errors and connection errors.
Some error handling only requires stream errors in the form of
RST_STREAM frames, while other sever errors require connection errors
in the from of GOAWAY frames.

This patch streamlines the sending of RST_STREAM frames, and ensures
that they are sent whenever mandated by RFC 9113. In some cases this
was missing, in some cases we were sending connection errors instead
of stream errors.

Further this patch adds tests to ensure the correct behavior.

Fixes: QTBUG-122345
Pick-to: 6.7
Change-Id: Ic93ae7a358a4eb551aa23342a6683cdd5dd0abb0
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d17d260948e16549d82f1fdd4dec98d246b0622e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-07 19:56:20 +00:00
Tor Arne Vestbø 5400025796 widgets: Persist window Qt::Popup state when reparenting parent widget
As a result of c956eb8edd we are now
reparenting QWindows managed by QWidgets when the widget itself or
any of its parent widgets are reparented. When reparenting a child
widget from being a child to a top level, or top level to child, we
need to know the new top level state to determine if the QWindow
should have a QWindow parent or not. As the window flags of the
widget are in flux during the reparenting, we were using the new
window flags of the reparented widget to determine this.

However, for QWidget children of the widget that's being reparented
we can't use the window flags of the reparented widget. We must use
the flags of the child itself. These flags are not in flux, so we
can use QWidget::windowFlags() directly.

Failing to propagate the child widget window flags was causing us to
lose the transient parent relationship to its parent QWindow for
popup windows.

Fixes: QTBUG-127641
Fixes: QTBUG-125149
Task-number: QTBUG-122747
Pick-to: 6.7 6.5
Change-Id: I6dbc5ff5ad019b0f9188516ff3d645e860a9627b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volodymyr Zibarov <gogan419@gmail.com>
(cherry picked from commit 6c036012b5f2304a05af29f29daa7582603f79ae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-07 09:29:02 +00:00
Jukka Jokiniva 68b07f90f9 Fix cmake module_includes and test_opengl_lib tests when no_opengl
Fixes: QTBUG-126350
Fixes: QTBUG-126351
Change-Id: Ic241e15b45090c69d24efe58c03df91ea8c1d298
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 6899008daab3ec31af4871d3b5063b99296e89fd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-07 08:16:30 +00:00
Eskil Abrahamsen Blomfeldt 5f5dafac08 Fix tst_QTextLayout::softHyphens failure with some fonts
The test did not account for the fact that kerning can alter the
distance between subsequent characters, so sum of horizontal
advances does not accurately measure the width of the string when
kerning is enabled.

This caused the test to fail with e.g. with the font Ubuntu Sans.

This amends 0ffdbb2126 .

Pick-to: 6.7 6.5 6.2
Fixes: QTBUG-127512
Change-Id: Id3ae7a6c79c84edd603db2fc0fed07777fa67741
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit e7ac6667f27369c25719ebedefd2d5344fd93bfd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-06 20:42:59 +00:00
Tor Arne Vestbø 69e5a9fb4a tst_QWindow::framePositioning: Skip on Android and fullscreen-only systems
The framePositioning test was split out from the positioning test, but
without the existing skips. Turns out we do need the same skips, so
add them.

Change-Id: Ib5d1cdf474a3a88a154c7cdc8df346668c8053d6
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 6f46f85899b425729d595af6461c6dbe3f4f7e1c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-06 20:27:28 +00:00
Orkun Tokdemir a9dbdcd986 CMake: Add new signature to qt6_wrap_cpp
* Introduce a new signature to qt6_wrap_cpp so that it accepts a target
name as the first parameter.
* Update the qt_wrap_cpp documentation.
* Show a warning message when the previous signature is used.
* Amends dc4159286b because it deleted
the `qt_wrap_cpp_3` example by mistake.

[ChangeLog][Build System] A new target-based signature was added for
qt_wrap_cpp. The usage of the previous output-variable signature is
deprecated and will issue a warning.

Fixes: QTBUG-126460
Change-Id: I85b7c516d6aebd8bbfda441fb6c68999e4898479
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
(cherry picked from commit f3d29dfb89f3e35623edd7e5bca934a1e85a6c35)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-05 14:44:07 +00:00