Commit Graph

17200 Commits (152153cb111db1bbd42e94f27712bbc39accf310)

Author SHA1 Message Date
Ahmad Samir ff4252b0b6 QAbstractFileEngine: remove beginEntryList(QDir::Filters)
It was kept so as not to break compilation of user code (overriding a
function that doesn't exist in the base class). But as Marcus Tillmanns
pointed out in a qtcreator code review, it can't work because
QDirListing calls the virutal
engine->beginEntryList(QDirListing::IteratorFlags).

Removing beginEntryList(QDir::Filters) and getting a compile-timer error
is better than the code failing silently in user code (all sub-classes
of QAbstractFileEngine in qtbase have been already ported).

QDir::entryList() isn't affected because it calls
QAbstractFileEngine::entryList() which has an overload that works with
QDir::Filters.

Change-Id: I3cb18402f602ac78a6b29be57e59febb2b9db7c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4fecfcc867f8215defaa40b50f0340654a36b4c7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-19 10:09:37 +00:00
Mårten Nordheim 701263379a QFreeList: return timer IDs with the serial included
When a timer gets unregistered there is a chance that a new timer is
registered again immediately and gets the same ID.
On Windows this is a problem because there may be WM_TIMER messages
remaining in the native event loop that have not been processed.
This may result in unexpected timeouts for newly started timers.

By not masking away the serial/generation from the ID we generate
we will no longer return the same ID that was just freed.

While QFreeList mostly was prepared to be used in this way, one function
was not, and the tests were written with the assumption that the serial
was masked out. So this patch also addresses that.

Fixes: QTBUG-124496
Pick-to: 6.7 6.5
Change-Id: If6784815bfa41e497cbc4e00bef51da3ded5f255
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
(cherry picked from commit 21e9875d62414306fde9738ab255e55f22d1c8ed)
2024-10-19 06:50:26 +00:00
Even Oscar Andersen 2bd01602dc wasm: Fix tooltip visible
Fixes a problem where tooltips only worked for the first instance
activated.

(cherry picked from commit d69348ed4d659f9408ce74f3b08ee7e9104dde00)
Fixes: QTBUG-129234
Change-Id: I45619b1ca8001b74b148b98a8795000630dcacf7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2024-10-18 06:07:13 +00:00
Ahmad Samir 55a8050d1e QDirIterator: don't crash with next() after hasNext() returned false
The typical use-case is calling hasNext() first before using next, but
the API docs say that calling next() even when hasNext() is false,
should just return an empty string.

[ChangeLog][QtCore][QDirIterator] Fixed a crash that happened if you
called next() after hasNext() had already returned false. Ideally you
should never call next() without first calling hasNext() as that could
lead to unexpected results (for example, infinite loops).

Fixes: QTBUG-130142
Change-Id: If0a8b1fe7dbd13b45793409a7a241e53c7257f24
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c7691842f743f568a073582c8f0cacd6ee188f98)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-18 01:52:28 +00:00
Øystein Heskestad 85c3a2f544 Regenerate certificates for qsslserver auto-test
The 'not valid after' date was set to the last day of 9999 which the
date time parser could not handle. Set the expiry year to 2050 and
regenerate keys with length of 3072 bits instead of 2048 bits.

Fixes: QTBUG-129504
Change-Id: Iaede785264c1d31b021ccabc9d1aaf949c8922f2
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit a5364a279e9ed9bc69a13698f9b43dbe36d0a326)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-17 19:30:35 +00:00
Milla Pohjanheimo 3b3c3f1bfe Add 6.8.0 binary compatibility file
Generated against desktop binary from 6.8.0 gcc_64 from installer.

Task-number: QTBUG-129008
Change-Id: Iea5705cb0491bf9e01129dc8855efbd20df497dd
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit 7767e05ed7f7c573fe4c51b0a88f68379f58e04d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-17 19:30:33 +00:00
Edward Welbourne 3167b157cd Remove untruth from QDateTime::fromString() documentation
Two examples were given, one to show "invalid" usage that would, in
fact, work now - producing a date in 2012 - and the other to show
"correct" code which, while correctly delivering the date in 1912 its
author appears to have meant (albeit, giving a four-digit year would
have made that clearer), uses the string API where code should
normally construct dates - much more efficiently - by just passing the
numbers to suitable constructors.

Add tests verifying that the two date-times from the out-of-date
examples do in fact work, even if you tell them the wrong century as
default for two-digit dates.

Pick-to: 6.7 6.5
Change-Id: I8155af019c80729323ba3958fe3942a72bfefc22
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 82d85c16d912b25bfa5b0a081e515fcecda1f975)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-17 16:18:37 +00:00
Mårten Nordheim d6c592aa2f QThreadPool: fix regression with negative expiryTimeout
It's supposed to indicate a thread never expires, but following
a change where it stores the expiry with chrono we no longer considered
a negative expiry as 'forever', but rather it immediately expires!

More directly it is because we end up calling
QDeadlineTimer::setPreciseRemainingTime(0 secs, X nsecs), and it only
cares about negative seconds to set Forever. There are complications to
consider nsecs for this since several nanoseconds may pass between
initially calling the function and assigning the values...

Amends 1f2a230b89.

Fixes: QTBUG-129898
Change-Id: I9626de31810fb2751ff6d83165d7dce5258a9baf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c57027199996d0f0d2ac8ebc4505c78afa54ab5a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-15 12:45:00 +00:00
Edward Welbourne ac6f080d16 Remove a duplicate inclusion of qlocale_data_p.h
In tst_qlocale.cpp there was a #include that caused the static data
tables to be duplicated, violating ODR. All it actually needed was the
ability to iterate all rows of the locale_data[] table, so export a
method to do that from QLocaleData and have the test run that instead
of pulling in a second copy of the tables.

Conflict resolution at 6.8 needed the declaration of locale_data_size
moved up qlocale.cpp, which happened after 6.8 as part of other work
that isn't included in 6.8.

Pick-to: 6.5 6.2
Task-number: QTBUG-128930
Change-Id: Ie5ebdf508a622eeca93f8785bc09b086502aa0e2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 96c07655c46afdd3e2da7ef7d339b518d36c83c5)
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-10-14 17:15:03 +02:00
Allan Sandfeld Jensen 1896424554 Fix text drawing onto transparent ARGB32
We can not use the same blend routines for ARGB32 as we use for
ARGB32PM. It needs to blend transparent colors differently.

Pick-to: 6.5
Fixes: QTBUG-91262
Change-Id: I6b75fa8096b92452655dcad94478ae2a74415939
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit bb854606ec8f95787dfd2a4d1b6bcaddbcf4d042)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-10 15:18:36 +00:00
Volker Hilsheimer 34a41d83d8 QTranslator: rewrite loadLocale test, include failing cases
Add test coverage for the bug reported in QTBUG-124898 with
QEXPECT_FAIL to document the failure in our truncation logic in
QTranslator.

The attempted fix in 9a11273b745a30cebb5cd648c89eb224e9704492 then
introduced QTBUG-129434, as we ignored the order of languages reported
by the system locale. Add a test case for that, and use a QSystemLocale
subclass inspired by the QLocale unit test to override the system locale
with a specific one that supports multiple languages for this test.

Pick-to: 6.5
Task-number: QTBUG-124898
Task-number: QTBUG-129434
Change-Id: Iaae80d29e267fd3a2d14df0e73db27ba4c58b31a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 1f2ab46745af12e4776695c1b1a2523ac170368e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-10 11:21:41 +00:00
Thiago Macieira ea4c74ccaf QFileInfoGatherer: Fix internal build (with Q_AUTOTEST_EXPORT)
I'm surprised that this passed the CI on Windows, because
Q_AUTOTEST_EXPORT is Q_DECL_EXPORT, which is __declspec(dllexport) and
all dllexport'ed functions must be defined in the current DLL, not
imported from elsewhere. This is similar on Unix systems with the
no_direct_extern_access mode, because then Q_DECL_EXPORT behaves like on
Windows.

That means Qt modules can't call a Q_AUTOTEST_EXPORT function
from another module (only tests can). Solve this by providing a function
that is properly exported with Q_CORE_EXPORT.

Amends commit 3d08816f4c4245f08a53307775fe3c4ed31a7a32.

Task-number: QTBUG-28246
Task-number: QTBUG-31103
Change-Id: I2ba317ab34bda8c18954fffd28395f7354cb54f2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit fbe61def33a2708e35e5e6a796e88976b04941f7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-09 14:58:57 +00:00
Fabian Kosmale dd5c13d09e QMetaObjectBuilder: Fix construction logic for enums
We need to put metatypes in the correct place; this is especially vital
starting with Qt 6.9, given that we need it to query it to figure out
whether we have a 64bit value or not.

As a drive-by, replace some ugly casting when constructing the meta-type
array with a call to QMetaType::iface.

Change-Id: I4b1f42f974e9f7a21f6aa4c87c3f8919f6965d6e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit d392d3b22c94f86fea50f26284bc9ac8b35f6851)
2024-10-09 08:48:13 +02:00
Santhosh Kumar be974c4855 Avoid referring to invalidated observer during binding evaluation
The property observer reference used during binding evaluation can
become invalidated as the container used to maintain the
the observer would invalidate the existing observers during its
resize, leading to referring to invalid memory.

Recognize that we do not need to store the observer, but only its
binding - the observer itself is not used later.

Therefore, change the PendingBindingObserverList to become a list of
QPropertyBindingPrivatePtr to avoid the issue.

Fixes: QTBUG-127596
Original-patch-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Pick-to: 6.5 6.2
Change-Id: I8c97721ca563083d6280194175f8a915dac2ff04
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit 275202215376238bf414d5008d3c727085e58a4c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-07 17:26:50 +00:00
Jøger Hansegård ac81827ed8 Add WS_CLIPCHILDREN style to native window in embeddedwindows test
When a native/foreign window is used as a parent, its WS_CLIPSCHILDREN
style should be enabled. If it is not, the parent will paint on top of
the children and cause flickering. It is not Qt's responsiblity to
adjust the styles of foreign windows, so instead we document this in the
manual test.

Change-Id: I84bc25668d702c3475dfbd75a94dd3ed43a1695c
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit a645128c296756ea6c7e70259958a0d000d029e5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-07 12:30:27 +00:00
Christian Ehrlicher 85af817469 QButtonGroup: make sure to always auto-assign negative ids
QButtonGroup::addButton() automatically assigns a negative id when no id
is given. This logic did not work out when a button with a positive id
was added beforehand.
Add a check to make sure to always return an auto-assigned negative id.

Pick-to: 6.7 6.5
Fixes: QTBUG-129398
Change-Id: Ieadfa44c4b145184a5473713591f4c111a5dafa4
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 772d374ce715de9caaae4f026594d49f6da28dec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-05 19:54:41 +00:00
Allan Sandfeld Jensen cfeb85e877 Correct BGR888 tests
Was accidently using RGB888

Change-Id: I4afaf7a96e6fb7a696f0ce4f35a94babd79d3d07
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit fc0d9b2033d4914c35fa9350dde641d76e581903)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-05 14:16:24 +00:00
Richard Moe Gustavsen f0758fb113 QMenu: don't trigger a menu item if the mouse didn't move
If you right-click to open a context menu, followed by another
click to close it again, without moving the mouse, it can
happen that the menu item under the mouse will trigger.
This is especially prone to happen if Qt has a large scale
factor and the number of menu items is high, since then the
menu has to move a bit up to make room for as menu items as
possible on the screen.

This patch will reuse the already existing hasMouseMoved()
function to avoid triggering a menu item if the mouse hasn't
moved. This will make sure that the user won't trigger a menu
item by accident when instead trying to close it.

Fixes: QTBUG-128359
Pick-to: 6.7 6.5 6.2
Change-Id: Ie4d73ee2031d1159dd6c003124869004b4928d18
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit dc1d3abd7e852829b9bc81c1ba9565f40147402d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-04 16:01:44 +00:00
Liang Qi a506d6bd88 tests: blacklist tst_QSizeGrip::hideAndShowOnWindowStateChange()
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-129361
Change-Id: I5291439dd9e1ba78cf403a0272ecbd8c83d2f94f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 649794fddf9c1d1c96b271de3b29b3b67593dff6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 08:37:07 +00:00
Liang Qi 8719c2f784 tests: use qWaitForWindowFocused() instead of qWaitForWindowActive()
This depends on 9eb06a2848 .

This follows bc7821764b4d50fbb4e0ca1b84f85980ce15eeb0 and
5709baea2c261f77f955ab76c074a39c9c3993aa.

There are lots of work to remove QApplicationPrivate::setActiveWindow()
in test code, see also QTBUG-121488. We need to adapt them for Wayland.

Task-number: QTBUG-125446
Task-number: QTBUG-121488
Change-Id: I093568c1d89de31c3893d3c7b139f1db33579633
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit f42979cf6937c78c412fcfa25ec011fb66b48132)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 08:37:05 +00:00
Liang Qi faff79d59e tests: blacklist tst_QWindowContainer::testFocus() on Wayland
Task-number: QTBUG-129292
Change-Id: I1b0dfae10b7b0f5348605121da1903d9c7247dba
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 7039232c2e4c623b341461526a22f775b1196882)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 08:37:04 +00:00
Liang Qi d10181d37c tests: blacklist a few tests on Ubuntu 24.04 GNOME Wayland
* tst_QListView::styleOptionViewItem()
* tst_QTreeView::styleOptionViewItem()

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: I4136a97441870a769814a483c0f91aeacd830651
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 5d71f4680df30674b8615b9b9a6b418f0a1c0864)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 08:37:02 +00:00
Liang Qi 18a24eabbe tests: skip tst_QWidget_window::tst_dnd_events() on u2404 x11
Task-number: QTBUG-129567
Change-Id: I108a468033a9579b07a379470a43aa94d5cf9ec0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
(cherry picked from commit c851602020cd564d42c9721eb19888471a11107c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 08:36:59 +00:00
Liang Qi 8b21bf2ae2 tests: blacklist tst_QWidget_window::mouseMoveWithPopup() on u2404 x11
Task-number: QTBUG-129568
Change-Id: Ie1d9fc7e32c0766d55324aae0dbd07218ac8599f
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c5ee1f68c02ca3942c94f246fba56ef4ffe7f229)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 08:36:57 +00:00
Thiago Macieira 4374f3ce41 tst_QDnsLookup: don't add duplicate 'nameserver' lines
I don't know why systemd-resolved did have those for me, but it did, so
QtTest complains.

QWARN  : tst_QDnsLookup::setNameserver() Duplicate data tag "..." - please rename.

Change-Id: I8df70eb429682b529ecefffd0aca735f94d77225
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 1420ee85165c03bac2aa1678b295f7b1ebe44f51)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 03:43:03 +00:00
Thiago Macieira c2df419edf tst_QDnsLookup: add the ability to specify an alternate default server
For people running this test who are burdened with a broken DNS server
and for whom the check added in the previous commit fails, skipping the
test.

Incidentally, this is useful for developing QDnsLookup itself, because
some otherwise-reasonable servers are known to fail for some queries.
For example, dnsmasq doesn't like queries of type ANY:

SKIP   : tst_QDnsLookup::lookup(any-a-single) Server refused or was unable to answer query; a-single type ANY: Server failure
SKIP   : tst_QDnsLookup::lookup(any-a-plus-aaaa) Server refused or was unable to answer query; a-plus-aaaa type ANY: Server failure
SKIP   : tst_QDnsLookup::lookup(any-multi) Server refused or was unable to answer query; multi type ANY: Server failure

Now I can get it to pass with QTEST_DNS_SERVER='[2001:4860:4860::8888]':

PASS   : tst_QDnsLookup::lookup(any-a-single)
PASS   : tst_QDnsLookup::lookup(any-a-plus-aaaa)
PASS   : tst_QDnsLookup::lookup(any-multi)

Note for the future: setting a non-default server may exercise different
code paths inside QDnsLookup, so this is not a replacement for having
proper DNS servers in the CI.

Fixes: QTBUG-129335
Change-Id: I81dcd4834972efa84c9ffffdd8aaafb68f20560b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 10fea78bdcad2086c980fa1c1bbcd5bb543e4366)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 03:43:01 +00:00
Thiago Macieira 5ce4677f2e tst_QDnsLookup: check for DNS server sanity
Instead of failing tst_QDnsLookup and blaming the class for problems,
let's first verify that the resolver can resolve an address. If it can't
and we're not in the CI, then just skip the test.

I chose "a-multi" because a) it required the least variability in the
command-line and b) it has more than one RR in the RR set so it may find
more problems than "a-single".

Output when I forced a domain that doesn't exist:

QWARN  : tst_QDnsLookup::initTestCase() Default DNS server in this
system cannot correctly resolve "a-multix.test.qt-project.org"
QWARN  : tst_QDnsLookup::initTestCase() Please check if you are
connected to the Internet.
QDEBUG : tst_QDnsLookup::initTestCase() Output was:
Server:		127.0.0.53
Address:	127.0.0.53#53

** server can't find a-multix.test.qt-project.org: NXDOMAIN

SKIP   : tst_QDnsLookup::initTestCase() DNS server does not appear to
work

Task-number: QTBUG-129335
Change-Id: Id2dcc2ce7cfdd83c556ffffddb88a1f1b4339606
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 40986460e3f372cdb42ad80377455dc43b7cdb42)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 03:43:00 +00:00
Thiago Macieira ea871ee2e2 tst_QDnsLookup: don't require "localhost" to resolve
It must for QHostInfo, but DNS servers are not required to have that
label. It appears to be a good practice the majority of admins follow,
but it's not universal, so we cannot require it.

But if it does resolve, then RFC 2606 requires it resolve to 127.0.0.1.

Task-number: QTBUG-129335
Change-Id: Ib3b11de6616665658a20fffd754f2fbd78780b1c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 252bd7c67ce7a0ed3c41059f551f87f0f77b5606)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 03:42:59 +00:00
Liang Qi 228dfd5b31 tests: blacklist tst_QAIV:testDialogAsEditor() on u2404 x11
Task-number: QTBUG-129516
Change-Id: Id36c8b6b4f5444b7bd3e982bdcf4d2b45b64a4cd
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit c35e6fffd6ccc4230f31b6a5610f466782ef5f75)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-03 00:14:08 +00:00
Tor Arne Vestbø 42439087eb Darwin: Teach QFileSystemEngine how to resolve case-sensitivity
Both APFS and HFS+ can be both case-sensitive and case-insensitive
(the default), and the mounted file system may be any other file
system than these two as well, so hard-coding to case-sensitive
is not sufficient.

Task-number: QTBUG-28246
Task-number: QTBUG-31103
Change-Id: Ibdb902df3f169b016a519f67ad5a79e6afb6aae3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3d08816f4c4245f08a53307775fe3c4ed31a7a32)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-02 21:36:48 +00:00
Tor Arne Vestbø fb69c5a354 tst_QDnsLookup::lookupReuse(): Rewrite using lookupCommon helper
Task-number: QTBUG-129335
Change-Id: I8417ff9e76076d0b1a40270edc1b2692a122657f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 41768db300b70dda36344ab1cafb6b99937da435)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-10-02 12:43:37 +00:00
Kai Köhne e5c1d02ac6 Revert "QTranslator: fix loading order when loading from locale"
This reverts commit 9a11273b745a30cebb5cd648c89eb224e9704492.

Reason for revert: The fix tried to find a sensible order if
the same language is listed multiple times in QLocale::uiLanguages().
Anyhow, it breaks for lists where entirely different languages are listed. This needs more thought.

Fixes: QTBUG-129434
Pick-to: 6.7 6.5
Change-Id: I8c074cbf1ddc2ddf223ec09aef38dfc1ef7fc85f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f3fc7b210f79e5eb427b0ff49c45c5d6d390fb34)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit a30c1bcd3c8b8eb4befeb254840224ca7bb52497)
2024-10-02 04:35:19 +00:00
Tor Arne Vestbø d8c7364ffe tst_Http2: Ensure each test uses temporary keychain if needed
The duplicateRequestsWithAborts test was missing this, causing failures
on macOS 14. Instead of adding it to each test function, we now set up
the temporary key chain in init(), and restore things in cleanup().

Task-number: QTBUG-119616
Change-Id: Ia9d80ae632774b8628417ad30d354a22b6a4916e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 882e5d72fc2dcca3c35035564fbb9ce5abc4bc4c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-28 16:00:58 +00:00
Axel Spoerl 47ee855740 tst_QDockWidget: Refactor skipping for Wayland
QTest mouse emulation doesn't support drag & drop on wayland.
This is why all tests fail, where dock widgets are undocked by mouse.

Move skipping in the qCreateFloatingTabs macro, where possible.
Remove skipping where possible.

Fixes: QTBUG-129362
Change-Id: Ic71529f34b8bc39864c9eccadc2aff7b6d426ca8
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 597f4bd4734e8a165929bc163ac910f44ba7a1e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-28 14:00:43 +00:00
Axel Spoerl 64da99d2e4 Wait for mainWindow exposure in tst_QDockWidget::createTestWidgets()
The helper function shows the main window and uses the
QApplicationPrivate::setActiveWindow() antipattern afterwards.

Use qWaitForWindowExposed() instead.

Task-number: QTBUG-129362
Change-Id: I915c5f8221e4e289950e917ad9c4fc2a7f5b9987
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 899c89c8d71d90b30c21b688cfe6b62868ad1ee9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-28 14:00:26 +00:00
Timur Pocheptsov 3ba0bb61ad tst_QHostInfo: re-enable back the test on macOS
It went unnoticed (by me) the test was disabled via *.pro and later CMakeLists.txt
rather than BLACKLIST I was checking back then.

Fixes: QTBUG-129349
Change-Id: I509485bac9f32d544ef4bec120590a00d85ed608
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e498a076ae035588ed6f29e91a20eb727d608342)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-26 18:10:35 +00:00
Axel Spoerl c20a382023 Send events as spontaneous in QWindowPrivate::forwardToPopup()
QWindowPrivate::forwardToPopup() sends key events with
QCoreApplication::sendEvent(), which sets QEvent::m_spont to false.
That makes key and pointer events sent to popups appear synthetic,
while they are sponaneous if sent to other widgets.

The method has been newly implemented in the course of moving
popup handling from QApplication to QGuiApplication.

Make current behavior consistent to the behavior prior to
e4ef0f03e6.
Since events are always spontaneous, use
QCoreApplication::sendSpontaneousEvent() instead.

Add a test function to tst_QComboBox to Verify, that key events
- are sent directly to the popup
- not seen by the window
- appear as spontaneous.

This amends e4ef0f03e6.

Fixes: QTBUG-129258
Pick-to: 6.8.0
Change-Id: Iff61b98b290f6483948007b5f12b19393759d9db
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3fbae61ea245291cb4c34e9126562c307741a600)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-25 19:59:42 +00:00
Tor Arne Vestbø f5e0d2e879 selftest: Disable NSLog/CFLog output to stderr
Ideally we want to catch if any of our selftests produce errors or
warnings from system frameworks that are out fault, but in this case
the warning does not seem to be something we can do anything about.

The "+[IMKClient subclass]: chose IMKClient_Legacy" warning is logged
via NSLog, so as a workaround we disable NSLog/CFLog output to stderr.

Change-Id: I17b6b83844c4160aa5980d954b70f2582ff94da5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 493fa52e135f73c1496715bb45602d9a4da1ade4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-25 17:23:48 +00:00
Thiago Macieira c1b13a0c5f moc: add a test for Q_FLAG getter/setter on integers
This is legacy behavior from Qt 3, before we had QFlags and before
QVariant could support user types. I cannot find any instance of a
getter returning an integer in current Qt or Qt Creator code. And note
this only compiles if the flags type with Q_FLAG - not Q_ENUM.

The content is wrapped as Qt 6.x only so it can be removed in Qt
7.0. The deprecation warning will come in a later commit, for 6.9.

Change-Id: Ie3ddd8025e3b4387866efffd8e8d46c3daa0dff2
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 939f7f56227e65c9797d17640a7b9c29166efc44)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-24 20:30:14 +00:00
Volker Hilsheimer 22a6dd8a66 Vulkan test: replace QVERIFY with appropriate QCOMPARE
The test has started to be rather flaky, and QCOMPARE provides better
diagnostic messages when failing, printing both the actual and the
expected value.

Pick-to: 6.5
Change-Id: I262e8e85de596ff3502e02ae26a1dd2724af92de
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit d736a5e00030058f90a5f83316581e86e434c119)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-23 19:36:54 +00:00
Tor Arne Vestbø e336111a5d tests: Explicitly check for pathconf(_PC_CASE_SENSITIVE) == 1
We use pathconf in some of our tests to determine if the file system
on Darwin is case sensitive. But pathconf returns -1 if the case
sensitivity can't be determined, with errno set to ENOTSUP.

The convention in this case is to treat the file system as not being
case sensitive (as reported by NSURLVolumeSupportsCaseSensitiveNamesKey
and VOL_CAP_FMT_CASE_SENSITIVE in equivalent APIs), so we need to check
explicitly for a return value of 1.

Change-Id: I1107e849babd8813da3b148c92494e8e35a32d36
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit bd3aabf38454087a96a17ff0130d7f5c2b2b39a9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-23 19:36:53 +00:00
Tor Arne Vestbø 3c6618b0f0 Unblacklist tst_QGraphicsProxyWidget::windowOpacity on macOS
Setting the opacity on an NSWindow does not result in a paint event.

Change-Id: I6d2780191ba97082f7ca80e2aa1094ccf796fb75
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3d1ec9ee94bac4222637bc9791ffc4d051c08fbd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-23 16:57:33 +00:00
Tor Arne Vestbø 964b16e6d3 tst_QWidget::tabOrderWithProxyOutOfOrder: Ensure Qt::TabFocusAllControls
The test requires Qt::TabFocusAllControls, so Qt::TabFocusTextControls
and/or Qt::TabFocusListControls, which is the default on macOS, is not
sufficient.

Change-Id: Iaf84c7ba67b978b942f396911048716417c38c03
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 283cfe0b80f83833a549d79e2787f5b936d90236)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-23 14:44:13 +00:00
Tor Arne Vestbø bab5421dbf tst_QDialogButtonBox::hideAndShowButton: Check for Qt::TabFocusAllControls
The test requires Qt::TabFocusAllControls, so Qt::TabFocusTextControls
and/or Qt::TabFocusListControls, which is the default on macOS, is not
sufficient.

Change-Id: Ideb673f570125c0d73c67a408f3d144f29052ace
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0a1c5d6e7de13afdb76161a6655d1024df03f454)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-23 14:43:44 +00:00
Liang Qi 950f928837 tests: blacklist tst_QStatusBar::QTBUG4334_hiddenOnMaximizedWindow()
on u24.04 x11

Task-number: QTBUG-129027
Change-Id: I7bbcf0e715b620d1f835fa361acbcbad32cbc57e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 0dfb1acfe1f3b7437775880d2f8863732c09c1e3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-20 15:28:58 +00:00
Liang Qi d51205b0b4 tests: port touchGraphicsItem to Qt 6
Replace deprecated APIs with recent ones:
* QTouchEvent::touchPoints() -> points()
* QEventPoint::pos() -> position()
* QPointingDevice::Capabilities and etc -> QInputDevice::Capability

Pick-to: 6.5 6.2
Change-Id: I45335886199a65e519cbd4872138e0715dd08103
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 1b5c6d0009fb2f3b418b84ae610c1ed39509c0e5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-20 15:23:58 +00:00
Tim Blechmann c5a27f4cfe QObject: disconnect - document behavior with queued connections
QObject::disconnect does not cancel pending events. This can cause hard
to find bugs in application code, so we explicitly document and unit
test this behavior.

Task-number: QTBUG-127675
Change-Id: I5e94d60c27b9ce2dd2bceb832eb817b7eaa9cdcd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 0681e720a9851f1873ce5a5f99b5567d2b418261)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-20 01:30:56 +00:00
Liang Qi 59a3f43031 tests: blacklist tst_QWidget_window::setWindowState(maximized)
on u24.04 x11

Task-number: QTBUG-129026
Change-Id: I14bf0ff3f2704aa1f7fccfdd57164f935892ae46
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 90ed33091a62ddfd53fc2cd8c232089367aca80b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-20 00:43:17 +00:00
Liang Qi 802c798703 tests: update row names in tst_QWidget_window::setWindowState()
Task-number: QTBUG-129026
Change-Id: I18c02b0a099924bd64115a1721c1d4f26b91f110
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 0c1c91aee9c9f4aa2e67412ebec885f92f06a5dc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-20 00:43:10 +00:00
Liang Qi e68e6be13b tests: blacklist tst_QComboBox:popupPositionAfterStyleChange()
on u24.04 x11

Task-number: QTBUG-129029
Change-Id: I1a7330fc781e1ca925234bc0f0548968bee1b984
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 9f7c826d62c5ef788930a4ef0176226fd6eef53d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-09-20 00:43:04 +00:00