When initializing m_uiWindow (instead of trying to retain this window
itself, which is harmless, since it's nil, but useless, since it's
not the right window).
Pick-to: 6.4 6.2 5.15
Change-Id: I7855fd7c24ebfc28fbb912966f8010caba914fe7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The "qhash" test relied on the fact that those four elements would
produce a different order with a zero and a non-zero seed. But since
commit b057e32dc4 removed the setting of a
deterministic non-zero seed, this test had a 1 in 4! chance of failing.
Since 4! = 24, 128 retries should be more than enough to ensure we do
find at least hash seed that provokes a different order.
Fixes: QTBUG-107725
Change-Id: I3c79b7e08fa346988dfefffd171ee61b79ca5489
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Freetype itself does not support transforming bitmap fonts, so
FT_Set_Transform() is just ignored in this case. This causes
problems in particular for fonts rotated at 90 degree multiples
when used as tab labels. So we need to rotate the actual glyph
images after they have been rasterized instead.
Since we do have most of the mechanisms in place for this when
using the regular glyph cache, we set cacheEnabled to false
for all non-scalable fonts to ensure we take the correct code
path.
In addition, we need to transform the alpha maps before
returning them.
Note: This changes the glyph format to alpha8 for the glyphs
when they are transformed. This is a simplification because
the mono code path requires that glyph widths are aligned
to 8, so there would be more adaptation needed if we wanted
to use this code path. This will only affect non-antialiased
fonts that are drawn with a transform.
[ChangeLog][QtGui][Text] Fixed an issue with the Freetype
backend where rotations would not be applied correctly to
bitmap fonts.
Fixes: QTBUG-81540
Change-Id: Ia68815b425ca1776a5ff81d26d227569467095cf
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
It makes it impossible to rerun it, bad for both CI and local test runs.
As a drive-by name the database file sqlite.db instead of foo.db
Pick-to: 6.2 6.4
Fixes: QTBUG-100245
Change-Id: I2e4ee01189ccbad2a6add5db7771d35fd7248da8
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Use calendar's month length upper bound instead of hard-coding 31.
When year isn't specified, QCalendar can still tell us a month's
"usual" number of days, so use that rather than giving up on getting
the day of month within that bound. Still don't try to fix the day of
the week when we don't know the year.
Change-Id: I90fbe02b180fc4c88b809d2ca71c075ff4dfd473
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This way we only apply a spring-forward fix when it's relevant.
Change-Id: I5fbbb68b6e474566e0497c6ae89d74097570dccc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
Various places were knowingly provoking warnings without telling QTest
to check for and suppress those warnings. Some others did check for
this warning, so let's consistently suppress the noise.
Change-Id: I71b9829680c7a513f4d8fbb3c57442875a6c2dc4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
For some reason the QTest::ignoreMessage() was conditioned on the type
being tested being Array; however, the warning is in fact produced for
all types. So anticipate it for all and make the test log less noisy.
Change-Id: I78681624252ff8a71f080204f8b031609ddac468
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
When list->next is nullptr, setting ignoreResultList to list->next is
the same as setting it to nullptr.
Change-Id: If328ce31db4344cf0136b7a827be871eb89e35b5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
There were two copies of the 0x1D157 row and we can't remember why.
So change one of them to the Chakma digit 3 (a spiral) and annote all
three test-cses with what meaning Unicode assigns to them.
Change-Id: I95837588bd5944f7f2c39c8438d9076e844e4dd0
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Two test-cases had the same name; distinguish them by the part of
their data in which they differ - one closes, the other doesn't.
Change-Id: I37051baf194bf8df742688739ad01e3335e64dc7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Two rows shared the same name. They claimed the value used was out of
range, but actually that was only true for one of them. The other was
in range, but the test reduced the number of digits allowed after the
decimal point, thereby making it invalid, so rename that one to
reflect this.
Change-Id: I0936ea25ec799c0069cd148b9f9bae5d35906093
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Include the spacings used, to avoid a naming collision.
Change-Id: Iaf78f7142f6780dcf4c7a0b973db9f625af06767
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Avoid duplication by distinguishing similar test-cases.
Change-Id: I1a100d6c9729f0ea356f177535d15c3d36e2da9e
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The test used to trigger a lot of QWARN messages; these are clearly
intended, so tell QTest to expect them, so that we get an error here
if those warnings ever don't show up.
Incidentally tidy up a comment and convert a != verify to a
QCOMPARE_NE(), since it's now available to do that job.
Change-Id: I83e225c37abe8446dac06ebe4e75258cb87b71b0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
In the process, clean up the building of the data tags: use a
range-for loop, albeit we do need an index to show in tags; show it
and the angle in the tags using addRow()'s easier formatting. Change
the low angle tests to show the sign of the angle (which is how they
differ)rather than just labeling them 1 and 2.
Change-Id: Ib5aaa3e22d771c530c9343ba368b0fdfceb264ce
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
The last three duplicated earlier ones; and their names didn't take
into account the circle that had been added to the path since those
tests. So revise their names to reflect that.
Change-Id: I32d74f21947b4ba0c04eee53daf8efde6b4a6409
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Two rows shared a data tag. Prefixed one of them with the color of the
half-transparent image it involves (the other's is fully transparent).
Change-Id: I1bd174008ed29bcf2f460e683fdf6d1f12ba19d0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
The same data tags were used with two distinct filenames in their
data. Include the basename of each filename in the data tag, to avoid
duplication.
Change-Id: I216fecbd413fab409227ad6f93f8ac3fcc74b059
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The "a" and "A" rows appeared under Valid, then again under Only Keys.
The two copies were identical, in each case, so drop the latter.
Change-Id: Ib3d84710e772171bb4a5e0aefd20022810fb41cd
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
tst_QDBusType::isValidFixedType_data() called addFixedTypes() and then
addBasicTypes(); but the latter calls addFixedTypes(), too; so those
rows got duplicated. Only add the fixed types once.
Change-Id: If0d6f44ec7defb12117dad251878850ca75beb48
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The row 27 that was positioned before row 01, as if it were meant to
be numbered row 00, was identical to the row 27 that appeared after
row 26. Since row 26 was the other case dealing with the null
QRectF(), I kept the one after it instead of renumbering row 00 and
deleting row 27.
Change-Id: I3585839184233f1f1629280ac9e5b25110c155c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use key(i) rather than valueToKey(value) as the Sha3_* alias Kekkak_*
or RealSha3_*. This way, we still test all members of the enum,
without duplicating row keys (albeit the aliases duplicate values).
Change-Id: I6acba5ffdf5b68294031d609a76b37ca8fad9d94
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Both countBits() and datastream() had two copies of an all-zeros test
with 35 zeros. Removed the second, in each case.
Change-Id: I5dec4765236ae870c30828dae0f04b8902a100f0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
/Zc:lambda seems buggy. Although in my experiments it works well
for 99% Qt repos, it seems some tests will trigger the bug and it
also blocks some new commits. So disable it for now, it's not stable
enough.
Now that this check is disabled, the workaround for tst_qstringapisymmetry
is also not needed anymore, so remove the workaround as well.
Partially reverts commit 8cb832090a
Change-Id: Icf0ecbbaa6262522470e5f5dea05705985ab18f1
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
setFocus() was called on a double spinbox without calling show()
first. That causes flakiness on XCB when checking focus afterwards.
The test can still fail, when focus is acquired by e.g. a system
popup.
This patch adds a show() call before setFocus() to stabilize normal
behavior. In case the double spin box is shown, but cannot acquire
focus, the test is skipped.
Fixes: QTBUG-70088
Change-Id: If02e88800a31b09a1da63dcc074eb8bb1b0df391
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
The function getPrimaryClipDescription was used to establish if the
clipboard data had text, html and/or uris. Analysing QTBUG-106646 and
tst_qquicktextedit showed inconsistent results, namely the description
hasMimeType failed to find html mimetype on copy&paste.
This patch changes it for searching it by hand instead of using
hasMimeType function.
Task-number: QTBUG-106646
Change-Id: I8918938e7a3fa6953eac95b72959fca85050e52f
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
If the library we've found is already loaded, set the tag to Loaded.
Pick-to: 6.4
Change-Id: I12a088d1ae424825abd3fffd171ce3831b884eee
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Make QtUiTools a known module with command line options and
plugin dependencies.
Note: There is no automated dependency checking for those
plugins as this can lead to undesired libraries being pulled.
Pick-to: 6.4
Fixes: QTBUG-104831
Change-Id: I31a0c3620460d6558edcf8245f43502f2bca7748
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
The zlib convenience API we've been using so far has two problems:
- On Windows-64, where sizeof(long) == 4, the use of ulong for sizes
meant that we could not compress data compressable on other 64-bit
platforms (Unix). While zstream also uses ulong, being a stream API,
it allows feeding data in chunks. The total_in and total_out members
are only required for gzip compression and are otherwise just
informational. They're unsigned, so their overflow does not cause
UB. In summary, using zstream + deflate() allows us to compress more
than 4GiB of data even on Windows-64.
- On all platforms, we always allocated the output buffer in such a
way as to accommodate the pathological case of random, incompressible
data, so the output buffer was larger than the input. Using zstream
+ deflate(), we can start with a smaller buffer, then let zlib pick
up where it left off when it ran out of output buffer space, saving
memory in the common case that compression meaningfully reduces the
size. To avoid the first few rounds of reallocations, we continue to
use zlib's compressBound() for input less than 256KiB.
This completely fixes the compression side of QTBUG-106542 and
QTBUG-104972.
Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-104972
Fixes: QTBUG-106542
Change-Id: Ia7e6c38403906b35462480fd611b482f05a5c59c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Add at least a few, so size() isn't completely untested.
Pick-to: 6.4 6.2 5.15
Change-Id: I500d28f7efb30ab578808d8fefb6ea57949edc2e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
With this update, there are no longer any diffs to upstream
libpng. Hence, the qtpatches.diff file is removed. Details:
- #define _CRT_SECURE_NO_DEPRECATE: Done on compiler cmdline instead
- #undef PNG_BUILD_DLL: For our usecase, that only caused PNG_IMPEXP
to be defined to an empty string. Done on compiler cmdline instead.
- #ifdef for WinCE: dead platform.
- A memory leak fix: Included in upstream 1.6.38.
[ChangeLog][Third-Party Code] libpng was updated to version 1.6.38
Pick-to: 6.4 6.2 5.15
Change-Id: I229db30e1dd54c209dc93e76d11e6fdb1f7adbdb
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Use NSWritingDirection and corresponding enumerators instead.
Pick-to: 6.4 6.2 5.15
Change-Id: Ie76ec2b8d07ab70288c7071182f215412d3e133c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This reverts commit 22d4c67234.
Reason for revert: The fix causes crashes
tst_QObjectRace::disconnectRace2 and we don't currently have a
clear resolution on further fixes.
Task-number: QTBUG-107034
Change-Id: I310c27654f125cdb2939940d432724e73c89f485
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
A violation of coding style (requiring braces on multi-line bodies
of conditionals) was accompanied by a mis-indented else block.
Fix a long line while I'm about it.
Change-Id: Ibe9cf15eadbe9ef58138d7876e5e2c5a14a92fd4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Pull out the arbitrary factor of three as a named constant and
document its arbitrariness once.
Pull out the mask and bit used in each function's loop to the outer
layer of the loop, since they don't depend on the inner loop variable
(or the random value generated in that loop).
Use QTest::addRow() instead of constructing a string to pass to
newRow().
Change-Id: Ifacbcb390e00828fd47f51b0c73d0ad5f6bc8bdb
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The tests for indexOf() and lastIndexOf() had duplicate data row tags,
due to only using the needle and haystack, although some tests
differed only in start position. Include start position where needed.
Change-Id: I197d415265ab1a805f2d36fb88aec92ea8646f7a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Enclosing one string in each substring of another does not need to
repeat the empty substring of the latter. Extracting the empty
substring from different positions doesn't get different results.
In the process, tidy up the code a bit.
Change-Id: Ic66febbdadeaac0c466f4f1174d831a991d31e20
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
There were two copies of the same line in mid_data(), leading to
duplicated data row tags.
Change-Id: Ia21e855ff781b13fe18c932cff48cb0aabd12750
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Commit 64ffe0a broke pressing RETURN aka. the default key in a dialog
to close it, when a read-only QComboBox has the focus.
Before that patch, Enter + Return were actively ignore()d, but this
code path was removed, resulting in those keys to be auto-accepted.
Fixes: QTBUG-107262
Pick-to: 6.4
Change-Id: I3dd8dca7d2f9d94f5172adc92ef508fe81c0df57
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This is likely a problem only after the 6.4 changes to move QQuickWidget
composition from OpenGL to QRhi.
Add an extra check to the condition when bailing out.
In QWidgetPrivate (qwidget.cpp) all similar calls into the
repaintManager are guarded by
if (tlwExtra && tlwExtra->backingStore && tlwExtra->repaintManager)
therefore it makes sense to perform the same check in the other file too.
The assumption is that the check was not added here due to being outside
of qwidget.cpp.
Change-Id: Ic94d4e5153f4a194a997cd669b0f7c48c7932d97
Fixes: QTBUG-107166
Pick-to: 6.4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
With the latest Xcode 14 an attempt to 'Archive' and distribute an
app to the App Store Connect ends with a strange warning:
"App Store Connect operation Error The app references non-public
selectors in Payload/appname.app/appname: redo:, undo:". Googling
finds many similar reports and complains (with a bunch of different
selectors suddenly reported as non-public). We filter out undo/redo
instead, the selectors without parameters.
Change-Id: I9667dc61f650f6b6ec42c64a9aa6fbff57fe5049
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The zlib convenience API we've been using so far has two problems:
- On Windows-64, where sizeof(long) == 4, the use of ulong for sizes
meant that we could not uncompress data compressed on other 64-bit
platforms (Unix). While zstream also uses ulong, being a stream API,
it allows feeding data in chunks. The total_in and total_out members
are only required for gzip compression and are otherwise just
informational. They're unsigned, so their overflow does not cause
UB. In summary, using zstream + inflate() allows us to decompress
more than 4GiB of data even on Windows-64.
- On all platforms, if the size hint in the header was too short, we'd
double the output buffer size and try again, from scratch. Using
zstream + inflate(), we still need to reallocate, but we can then
let zlib pick up where it left off when it ran out of output buffer
space. In all but the most pathological cases, copying the
already-decoded data instead of re-decoding it again should be
faster, esp. if QArrayData uses realloc() instead of malloc() +
free() to grow the buffer.
We also now directly allocate at least as much output buffer as we
have input, to cut the first few rounds of reallocations when the
expectedSize was created, as qCompress still does, using modulo
arithmetic mod 4GiB instead of saturation arithmethic.
Factor the growing of the output buffer into a wrapper function,
flate(), which can be reused when porting qCompress().
This completely fixes the uncompression side of QTBUG-106542 and
QTBUG-104972.
Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-104972
Task-number: QTBUG-106542
Change-Id: I97f55ea322c24db1ac48b31c16855bc91708e7e2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>