Commit Graph

47554 Commits (940e4e54280c2daababb7ca030fa70bfd77e2bf0)

Author SHA1 Message Date
Morten Sørvig 940e4e5428 Avoid rounding errors for fullscreen window geometry
Add a special case for handling Qt::WindowMaximized and
Qt::WindowFullScreen which don't call QPlatformWindow::
initialGeometry(). Handle the case by setting window
geometry to be equivalent to available screen geometry.

This avoids any rounding errors introduced by scaling
available screen geometry by a (possibly) fractional
scale factor.

Task-number: QTBUG-87334
Change-Id: Ia1b96057bdf3d3787f1b77b81078856fdd33fe9d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-27 19:53:41 +01:00
Morten Sørvig 96d0f2af75 Fix off-by-one surface pixel size on Android
m_window->size() may have been rounded for devices
with DPI which results in a fractional DPR (e.g.
650 DPI / 160 DPI = 3.5 DPR). In this case scaling
by devicePixelRatio does not give the correct result.

Instead, use QPlatformWindow geometry and DPR to determine
the device size, without using the (possibly) rounded
device independent window size.

Fixes: QTBUG-87334
Pick-to: 6.6 6.5 6.2
Change-Id: I280236a06516cdb2a1a259fd0cfa8084c1ce7f46
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-11-27 18:53:41 +00:00
Marc Mutz b3819d9cc2 Qt::*_ordering: use std::bit_cast when converting to std::_ordering
GCC, in particular, doesn't understand that the types are
fundamentally the same unless you compile with -O3, so help the
compiler by using bit_cast when it is available.

GCC now produces the same code at -O2 as previously only at -O3. Still
no tail-calls, though.

Task-number: QTBUG-118913
Change-Id: Ib1241a98f1de49c59a2e16b7d1f5cf813db4edf7
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-11-27 18:34:10 +01:00
Marc Mutz 9c03935c9a Qt::_*ordering: de-pessimize conversion to std types
Instead of an if-else-if chain, use a switch and Q_UNREACHABLE_RETURN.
We don't need the GCC-8 workaround for Q_UNREACHABLE_RETURN in
constexpr here as GCC-8 doesn't have <compare>, yet, so it will never
compile this code.

Using this test:

  extern Qt::partial_ordering qt_partial_ordering() noexcept;
  std::partial_ordering qt2std() { return qt_partial_ordering(); }

I see these codegen improvements:

Clang -O2 before:
  qt2std():                             # @qt2std()
        pushq   %rax
        callq   qt_partial_ordering()@PLT
        testb   %al, %al
        je      .LBB36_3
        movzbl  %al, %ecx
        cmpl    55, %ecx
        jne     .LBB36_4
        popq    %rcx
        retq
  .LBB36_3:
        xorl    %eax, %eax
        popq    %rcx
        retq
  .LBB36_4:
        cmpb    , %al
        sete    %cl
        movb    , %al
        subb    %cl, %al
        popq    %rcx
        retq

Clang -O2 now:
  qt2std():
       jmp     qt_partial_ordering()@PLT  $# TAIL-CALL

GCC -O2 before:
  qt2std():
        subq    $8, %rsp
        call    qt_partial_ordering()@PLT
        cmpb    $-1, %al
        je      .L194
        testb   %al, %al
        jne     .L203
  .L194:
        addq    $8, %rsp
        ret
  .L203:
        cmpb    $1, %al
        movl    $2, %edx
        cmovne  %edx, %eax
        addq    $8, %rsp
        ret

GCC -O2 now:
  qt2std():
        subq    $8, %rsp
        call    qt_partial_ordering()@PLT
        cmpb    $-1, %al
        je      .L194
        cmpb    $1, %al
        je      .L194
        xorl    %edx, %edx
        cmpb    $2, %al
        cmovne  %edx, %eax
  .L194:
        addq    $8, %rsp
        ret

GCC needs -O3 to produce now:
  qt2std():
        subq    $8, %rsp
        call    qt_partial_ordering()@PLT
        addq    $8, %rsp

Change-Id: Ic8c57c6e1bc39e247999b45dc263a8a8aef07dd0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-11-27 18:34:10 +01:00
Marc Mutz 4b6f757020 Make Qt::partial_ordering binary-compatible to std::partial_ordering
In particular, match the value of ::unordered to each std library
implementation.

Legal disclaimer:

The values were provided to this author in a comment on QTBUG-118913.
This author hereby confirms he didn't look at any of the
implementations himself. The stdlib detection macros are taken from
existing code in qcompilerdetection.h. I didn't succeed in googling a
corresponding marker for MSSTL, and I didn't look at the
implementation or Boost.Config to find one, so this patch just assumes
MSSTL as a fall-back, which is probably wrong, since we may still have
Dinkumware and RougeWave STLs to deal with on embedded platforms.

Add tests to ensure the values are the same on all platforms.
To maximize coverage, rename qcompare.qdoc to qcompare.cpp and add a
bunch of compile-time tests there. These depend in part on bit_cast,
which we cannot depend on, so tst_qcompare contains the same tests
using memcpy.

Fixes: QTBUG-118913
Change-Id: I46c922c8e3ea37d7c01a71361c7a689340f9047d
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-11-27 18:34:10 +01:00
Tor Arne Vestbø c8cd9017f6 Apple: Use namespaced category name sandbox helper
Pick-to: 6.6 6.5
Fixes: QTBUG-119338
Change-Id: I8a62b3fff0c1f3de2b6ae3332f6a1ecc7b1561e5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-11-27 11:05:52 +01:00
Volker Hilsheimer c5ba3ac95c JNI: remove the environment check in QJniObject again
This amends 944200b5a9 and the follow-up
commit 84e70976f3. We have too many use
cases in Qt where we construct a QJniObject from one thread, and access
it from others. Remove the overhead of checking and warning about the
mismatches.

The responsibility of guarding access to the underlying Java object, by
using MonitorEnter/Exit or synchronization blocks in Java, is with the
caller.

Change-Id: Iadbc9af0476009f2d43ecdd3d8f1335f31a04446
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-11-27 02:13:06 +00:00
Ahmad Samir 9e6c9eda6f QMetaEnum: let key(s)ToValue match fully-qualified unscoped enumerators
For an unscoped enumerator, e.g.:
namespace N {
    class C {
        enum E { F };
    };
};

N::C::F and N::C::E::F are equivalent and key(s)ToValue should match
both.

This already works for scoped enums because the name of the enum can't
be dropped.

Fixes: QTBUG-118240
Pick-to: 6.6
Change-Id: I84d7bbb7aa8f82b2a7c2bc7e4edd5d77d37335c4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-26 22:51:49 +02:00
Christian Ehrlicher 3936d254ca QCommonStyle: Adjust painting arrows in high-dpi mode
PE_IndicatorArrowUp/Down/Left/Right was drawn using integer coordinates
for the three edges which lead to artifacts in high-dpi mode. Fix it by
using QPointF instead.

Pick-to: 6.6
Fixes: QTBUG-114539
Change-Id: I03cbff2ef789e8cee0f3a0d84138d94516340669
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-26 13:59:37 +01:00
Ahmad Samir ea6abe583f QStorageInfo/Linux: include linux/mount.h instead of sys/mount.h
Including <sys/mount.h> in qstorageinfo_linux.cpp broke -unity-build's
in which qfilesystemengine_unix.cpp (which includes <linux/fs.h> which
in turn includes <linux/mount.h>) ends up in the same unity_cxx_nn.cpp
as qstorageinfo_linux.cpp.

MS_RDONLY is a macro in one header and an enum in another, when both are
in the same TU that's UB. This was fixed[1] upstream since glibc-2.36,
but it's still an issue in Ubuntu 20.04, which has an older glibc IIUC.

So, just inlcude <linux/mount.h> which works on Android too (according
to precheck CI on gerrit).

Amends b3eb951d18.

[1] https://sourceware.org/glibc/wiki/Release/2.36#Usage_of_.3Clinux.2Fmount.h.3E_and_.3Csys.2Fmount.h.3E

Task-number: QTBUG-119328
Change-Id: Ifa02272eea004051dd329b35f533385813215bfc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-25 00:54:54 +02:00
Thiago Macieira 1261fa7654 QCborStreamWriter: correct the QCbor{Array,Map} size limitations
Increased due to qsizetype.

Pick-to: 6.5 6.6
Change-Id: I85b3fc2dd45c4693be13fffd179662c8b898fb79
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-11-24 12:42:12 -08:00
Thiago Macieira 1d9137e13f QCborStreamReader: add UTF-8 reading API
Change-Id: I8bd6bb457b9c42218247fffd1797605d1687b0dc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-11-24 12:42:12 -08:00
Thiago Macieira 8af346c1f6 QCborStreamReader: add toString() and toByteArray()
They've been a long time coming. I had them in TinyCBOR before the
chunked reading; in fact, I added the chunked reading specifically for
Qt's CBOR support.

[ChangeLog][QtCore][QCborStreamReader] Added toString() and
toByteArray(), which read a full string whether it is chunked or
not. They also guard against attempting to allocate more memory than the
underlying stream could provide.

Change-Id: Icfe44ecf285a480fafe4fffd174c5815f153d5b5
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-11-24 12:42:12 -08:00
Thiago Macieira 8e8815b688 QCborStreamReader: fix API mistake: lastError() wasn't const
[ChangeLog][QtCore][QCborStreamReader] Fixed lastError() not being
declared as a const member.

Change-Id: Ib1d2fc7100134f7597cdfffd174a8401b43576d4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-11-24 12:42:12 -08:00
Thiago Macieira 23a1ac7d40 QCborStreamReader: refactor readStringChunk_unicode() to append
It was always overwriting the QString, while readStringChunk_byte() was
appending to the QByteArray. The appending was used by QCborValue, which
appends byte and text strings to its QByteArray in QCborContainerPrivate, but
keeps the UTF-8 encoding for simplicity sake.

I will need the QString appending for the next commit.

Change-Id: Icfe44ecf285a480fafe4fffd174c6a89e91cef74
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-11-24 12:42:12 -08:00
Giuseppe D'Angelo d201c0a218 OpenSSL: remove support for 1.1
OpenSSL 1.1 reached EOL last September [1]. We will only support
OpenSSL 3.

Cherry-picking aggressively, as there's no purpose at keeping maintained
Qt versions work with an unmaintained library given the security
implications.

[1] https://www.openssl.org/blog/blog/2023/09/11/eol-111/

[ChangeLog][QtNetwork][SSL] Support for OpenSSL 1.1 has been dropped. Qt
now only supports OpenSSL 3.

Change-Id: I51a231a9ca17804739acbd2f22c478d2a8ff9b3b
Fixes: QTBUG-119330
Pick-to: 6.6 6.5 6.2 5.15
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-24 19:00:06 +01:00
Edward Welbourne d59e539b3a Implement a TODO: cache the list of MS TZ IDs
The MS TZ-backend's lookup of available Windows IDs included a TODO
advocating caching the result, since it is unlikely to change at
runtime. Given that MS's time_t functions don't believe in times
before 1970 and two-digit year parsing (such as the ASN.1 parser does,
apparently many times, during SSL handshakes) assumes the 1900s (and
certs in use today have mostly been issued this century), SSL involves
DTP falling back repeatedly to lookups of local time's offsets from
UTC (before it discovers it shouldn't have been using local time
anyway) via the system timezone object, this cacheable list can be
accessed many times. (A user has reported thousands per SSL socket
created.) So let's implement that TODO and trust that updates to the
registry's set of available zones aren't a common occurrence at
runtime.

Pick-to: 6.6 6.5
Change-Id: Iefe235c71da1bf5c3372c52dba89ad0657e06c0b
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-24 18:09:16 +01:00
Edward Welbourne 305c8e9cf0 QDTP: minor fixes to handling of two-digit years
Although the days in month for a year might be affected by century (if
last two digits are 00), actualDate() has at least set the year to its
best guess, which will give the right days in the month at least 99%
of the time. So take year into account if either year field is set.

Adjust a comment's position so that it's clear it's referring to the
two-digit case, when (at first sight perversely) using 9999 as the
field's max value (it's the datum controlled by it that matters,
here).

Task-number: QTBUG-46843
Change-Id: Iebebe4b2617eb0820ec57398a774b70bf2ae0898
Reviewed-by: Isak Fyksen <isak.fyksen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-24 15:37:16 +01:00
Edward Welbourne 7d929f13d5 QDTP: consolidate defaultValue computation and clip to range
Previously setting a range on the QDTP that excluded 1900 would have
lead to using a default value outside the QDTP's valid range. This did
not arise in practice (QDTE supplies its own defaultValue, which is in
range, and QDT/QLocale's use of QDTP don't set a range). However, I
now want to give callers some control over the century used in
two-digit years, which shall mean they can select the defaultValue's
year; and we'll still need to ensure this is in range.

Task-number: QTBUG-46843
Change-Id: I3884853dc1d2775e1049c25f208d90b8a363d0a7
Reviewed-by: Isak Fyksen <isak.fyksen@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-24 15:37:16 +01:00
Marc Mutz 54f49803de String-ish: Add missing <string_view> #includes
Don't depend on transitive includes.

Amends 96d67da420.

Change-Id: I3ec93e4d786af0babd36bb71a15222ffc3538e38
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-24 11:09:54 +01:00
Fabian Kosmale d39353085e Moc: don't stumple over inline namespace in more places
Ignore the 'inline' in case of nested namespace with another
nested inline namespace.

Amends 5222df2be7

Fixes: QTBUG-117765
Pick-to: 6.6 6.5
Change-Id: I87f2649606f63c818f225f8cc5ec914920763c5f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-11-24 08:48:01 +01:00
Thiago Macieira 905593a40b IPC: Un-deprecate the "legacy" key API
This the API that has been around since Qt 4.5. We decided not to
deprecate them individually. Instead, we'll deprecate the whole class.

Pick-to: 6.6
Change-Id: Ia930b1a2ed1e465a826ffffd179a1b7b3250fd89
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-24 05:10:52 +01:00
Assam Boudjelthia b09168740b Android: don't return an unused result from QtNative.startApplication()
No one is using that return code, instead print an error when the
call to startQtAndroidPlugin() fails.

Task-number: QTBUG-118077
Change-Id: I98c8e4ca9af5f1c45af36044336d461bed6acdc9
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-11-24 03:48:39 +02:00
Assam Boudjelthia 41765ef3e2 Android: fix few deprecation and wrong code usage warnings
* Some more leftover unused imports.
* Deprecated API, especially reflection warnings.
* Some unused method parameters warnings.

Task-number: QTBUG-118077
Change-Id: Ic9b7d5b69ef64aaf640bc9f53a13428f1c49278c
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-24 03:48:39 +02:00
Assam Boudjelthia 64fe6d836c Android: support lambda expressions in Java code
use -classpath instead of -bootclasspath param to allow
javac to use the default boot class path to support
building lambdas, pass the user Android class via -classpath.

Task-number: QTBUG-118077
Change-Id: I1ba8274d57e1bd528a1d5b7d779191e7f1412184
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-24 03:48:39 +02:00
Christian Ehrlicher 323cf718f6 QTabBar/Widget: use pmf-style connects
Use pmf-style connections instead old string-based ones.

Change-Id: I592a8918f8a06315db2e08da8d4c7fa8b52aa6f8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-23 19:31:14 +01:00
Christian Ehrlicher 11d8200249 SQLite: Update SQLite to v3.44.1
[ChangeLog][Third-Party Code] Updated SQLite to v3.44.1

Pick-to: 5.15 6.2 6.5 6.6
Change-Id: I156472b14dcf37b8632b948118ef95e62cf0118e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-23 19:31:14 +01:00
Lauri Pohjanheimo 476e8f8aef Fix Japan locale not showing japanese fonts correctly
Fallback font determination did not take locale into account when
Japanese locale was used. Android devices show Chinese fonts instead.
Fixes the problem by prepending japanese defaut "Noto Sans Mono CJK ..."
type font before other fonts. Does same for Chinese and Korean locales.

Fixes: QTBUG-111528
Pick-to: 6.6 6.5 6.2 5.15
Change-Id: I70994c0059c3819eeb09dacb9bbe6634490ecf37
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-11-23 20:31:11 +02:00
Volker Hilsheimer f54393ba70 Add initial implementation of an Android icon engine
Try to use the Downloadable Font APIs from AndroidX to download the
Material Symbols font. This would ideally allow us to add the official
icon variations dynamically to the device's font cache.

This works for several fonts from Google Fonts, but not for the fonts
we need. So, for the time being, add a path where we consult the
resource system for an embedded font file as well. Then an application
can add e.g. the font file for the desired icons variation, and Qt will
use those glyphs to render icons. Do this in the manual test, using
cmake's FetchContent feature to download the font from Googlei's github
repository.

The incomplete mapping is based on the standard Material icons
documentation at https://fonts.google.com/icons. We could in theory use
the `codepoints` file that comes with the font files to create the
mapping, but then we'd end up with platform specific icon names.

Task-number: QTBUG-102346
Change-Id: Ibff3fe6d310a388e6111d983815ef0ddffb684c8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-11-23 19:26:50 +01:00
Morten Sørvig 9e740c7266 QPainter: support painting at DPR < 1
QPainter was clamping the DPR at 1, which makes Qt paint
a blank window when the DPR is less than 1. Fix by
not clamping and treating only DPR == 1 as a special
case.

This is particularly relevant on Qt for WebAssembly
where the user can set the page scale to a value less
than 100%.

Fixes: QTBUG-111787
Change-Id: Iaa1f7a9b7837dd933c28380b5049422dc1ce9657
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-23 19:26:49 +01:00
Morten Sørvig 67fa2585ac highdpi: fix map to/from global for "off-primary-screen" windows
By "off-primary-screen" here I mean windows which are visible on
more than one screen, e.g. a secondary screen in addition
to the primary screen.

In this case the call to QHighDpi::toNativeGlobalPosition(pos, this)
problematic, since it uses the scale factor for the primary
screen, while pos might be on the secondary screen.

One way to fix this is to look up the correct scale factor
based on pos. Another way is to realize we don't have to
use scaling to get the native window position, and get
it from platformWindow geometry. This patch implements this
fix.

Fixes: QTBUG-106695
Change-Id: I03ffc261e199f65e54b06b964d067b6a9e0dd021
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-23 19:26:49 +01:00
Axel Spoerl 773f9ab018 QMesageBox: add Q_ENUM and sync assertions
Add Q_ENUM to StandardButton and ButtonRole.
Add static assertion to enforce sync with QDialogButtonBox.

Task-number: QTBUG-118489
Pick-to: 6.6 6.5
Change-Id: I38a7367d6287ab7fa5e5ca0c94ea6daa0f95fc52
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-23 18:58:21 +01:00
Assam Boudjelthia 9d3b55b2a8 Android: use WeakReference for static activity/service objects
Wrap the activity and service static objects with
a WeakReference to fix a potential memory leak warning.

Task-number: QTBUG-118077
Change-Id: Ifafd137cc49ec5ea23d8425b6bd58b43573970b9
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-23 19:58:21 +02:00
Assam Boudjelthia f6e5e52c84 Android: add note on usage of QtNative.runAction()
Task-number: QTBUG-118077
Change-Id: I2a743c1b65733e1ca0bf20d172d35c46d7ec8b08
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-23 19:58:21 +02:00
Jan Arve Sæther bc8141d286 a11y: Fix bug where some characters were not spoken while moving cursor
The problem occurred when we moved the cursor to the penultimate
character of the string, because the boundary condition was wrong. It
is important to realize that the offsets are moved *between* each
character (and also before and after the whole string), just like you
would move a cursor. This means that the offsets can be in the range

  [0, len]     (closed interval)

The problem could only be reproduced with JAWS.

Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-115156
Change-Id: I0c5f05fa391e6c7744ab22d71afe8904b49e89bc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
2023-11-23 13:25:41 +01:00
Christian Ehrlicher 1082038bd8 QTabBar: properly calc tab positions when changing tab position
When changing the tab position, the scroll offset is calculated wrongly
because the calculation is done before the size of the tabbar is
recalculated. Therefore wait until QTabBar gets the resize event and
calculate the new tab positions there.

Pick-to: 6.6 6.5
Fixes: QTBUG-119366
Change-Id: I261a91bb584409b9b0dac4339a32894f47540bcf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-23 11:41:26 +00:00
Christian Ehrlicher 1ffd12a8dc QComboBox: don't eat non-printable key strokes
QComboBox in non-editable mode passes all keyboard input to the internal
item search. This was done regardless if the character is printable or
not and therefore e.g. '\t' composed by Key_Tab + ControlModifier was
accepted and not passed to the parent (in the bug report to the
QTabWidget which could not switch tabs due to that).

Pick-to: 6.6 6.5
Fixes: QTBUG-118605
Change-Id: If39423587460a70231c735df4912b72c5ae77475
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-23 10:33:28 +00:00
Marc Mutz 062718a7d3 qxp::function_ref: try to work around compilation failure on VxWorks
Task-number: QTBUG-115777
Pick-to: 6.6 6.5
Change-Id: Icda59c33ae8c92460c7cb06e204c6b1926b82f66
Reviewed-by: Krzysztof Sommerfeld <krzysztof.sommerfeld@siili.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-23 05:24:43 +01:00
Tor Arne Vestbø 8723daf696 Rename QWSI::handleWindowActivated to QWSI::handleFocusWindowChanged
A single QWindow is QGuiApplication::focusWindow() at a time, and this
window is typically also QWindow::isActive(), but other windows may also
be QWindow::isActive(). For example, we treat any sibling or ancestor
of the focusWindow as being QWindow::isActive() as well.

In addition, in the case of non-QWindow child windows, we may have to
query the platform for the activation state, which means we also need
a way for the platform to reflect changes in this state through QWSI.

The current API for this, QWSI::handleWindowActivated, is in practice
a focus window change API, so as a first step let's rename it to better
reflect what it's doing.

Task-number: QTBUG-119287
Change-Id: I381baf8505dd13a4a829c961095a8d2ed120092b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-11-23 02:37:12 +01:00
Assam Boudjelthia 5ab2b8b951 Android: don't directly access m_qtThread member
Task-number: QTBUG-118077
Change-Id: I2103483a2bfa8abe9be832790611b07a5d011f76
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-11-23 03:34:26 +02:00
Assam Boudjelthia c0eca51570 Android: rename m_quitApp to m_retainNonConfigurationInstance
Rename m_quitApp to m_retainNonConfigurationInstance and keep it
inside QtActivityBase since it's only used there based on whether
onRetainNonConfigurationInstance() is called, in wish case,
onDestroy() would skip the Qt specific app destruction/exit logic.

Task-number: QTBUG-118077
Change-Id: I1cf03bd6f5266a9283660db7943d053a9dba889c
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-11-23 03:34:26 +02:00
Assam Boudjelthia 9a58062a73 Android: print correct return code of main()
... and print it always after main() returns.

Task-number: QTBUG-118077
Change-Id: I1f57b3f7a646d01eebf67d4a4ff6a8d9f6e82cc7
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-11-23 03:34:26 +02:00
Volker Hilsheimer d2e163d2e4 Add initial implementation of a Windows icon engine
Implement an icon engine for Windows that renders glyphs from the
Segoe Fluent Icons font on Windows 11 and the Segoe MDL2 Assets fonts
on Windows 10. These fonts are installed on the respective Windows
versions by default, and otherwise freely avialable for deployment.

Icons from that font will mostly be based on single code points, but as
the font is specifically designed to allow combining glyphs by layering,
the implementation supports multiple code points as well, and can also
use a surrogate pair as well to render e.g. an emoji.

Task-number: QTBUG-102346
Change-Id: Ib47a267c3a1878d8f0e00dd954496fc338bb0110
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-23 00:52:13 +01:00
Volker Hilsheimer 5ae6355487 Add initial implementation of macOS and iOS icon theme implementations
From macOS 13 on, AppKit provides an API to get a scalable system image
from a symbolic icon name. We can map those icon names to the XDG-based
icon names we support in Qt, and render the NSImage with palette-based
coloring when needed, in an appropriate scale.
On iOS, we can use the equivalent UIKit APIs. Coloring functionality is
only available from iOS 15 on.

Implement a QAppleIconEngine that does that in its scaledPixmap
implementation. Use basic caching to store a single QPixmap version of
the native vector image. We regenerate the pixmap whenever a different
size, mode, or state is requested.

Add a manual test for browsing all icons we can get from the various Qt
APIs that: standard icons and pixmaps from QStyle, QPlatformTheme, and
QIcon::fromTheme, in addition to showing all icon variations for a
single QIcon.

Task-number: QTBUG-102346
Change-Id: If5ab683ec18d140bd8700ac99b0edada980de9b4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-23 00:52:12 +01:00
Assam Boudjelthia fdc2036640 Android: use non index for loop syntax
Task-number: QTBUG-118077
Change-Id: Ifd09d0a2aeeee4e7dcb0c80391ba0e3c08f0fe13
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2023-11-22 22:15:38 +02:00
Eskil Abrahamsen Blomfeldt 4162a46378 doc: Remove outdated comment about DirectWrite
Qt 6 does not support any Windows versions without DirectWrite
and no special configuration flag is needed to build it anymore.

Pick-to: 6.2 6.5 6.6
Change-Id: I6553c4d1c70e5616f8cb3ec8fe6343c600a74462
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2023-11-22 21:15:38 +01:00
Vladimir Belyavsky 18aa36cf87 QTest: make failOnWarning() functional on temp objects destruction
We need to be able to handle warnings that may occur when temporary
objects, that were created in a test function, are destroyed.
For example, now we miss all warnings that might be triggered from
the object destructor, if the object's deletion was delayed (e.g. via
deleteLater()). Also we miss all the warnings that were triggered on
the test's cleanup() call.

To fix this we need simply move QTestLog::clearFailOnWarnings()
from QTestResult::finishedCurrentTestData() to the later stage,
i.e. into QTestLog::clearCurrentTestState() which is actually called
in appropriate time from QTestResult::finishedCurrentTestDataCleanup().

Same for QTestLog::clearIgnoreMessages(), since they are interrelated,
so we need to clear them at the same time.

We need this change for QML tests in particularly, to be able
fail on warnings that might be triggered from Component.onDestruction()
of some temporary test object.

Pick-to: 6.6 6.5
Change-Id: I58a57691f20761619f56bd1bea3a862f2c26f569
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-22 20:15:38 +00:00
Piotr Wierciński f2f2b6ef18 wasm: Proxy emscripten_fetch() to the main thread
Calling emscripten_fetch() on worker thread which never yields control
back to the browser, will leave the fetch request pending forever.
This can be a problematic for example in QML Loader, which tries
to load resource by network.
Proxy this function call to the main thread, so it can be processed by
the browser.

Fixes: QTBUG-118225
Pick-to: 6.6 6.5
Change-Id: I969d73f6a66670c4135960e08d2eedc8d2a6e5c3
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-11-22 20:15:38 +00:00
Kalle Viironen a397247e2b qtestlib: Add option to skip blacklisted tests
Add a command-line option "-skipblacklisted" to testlib to skip
blacklisted test cases. Currently, blacklisted test cases are run,
but results are ignored. For test code coverage measurements, it's
important to see the code coverage of the actually tested code in
comparison to the code that was run but not actually tested.

The default approach remains unchanged, meaning that blacklisted
tests are run with the results ignored.

Fixes: QTBUG-112793
Change-Id: I6fe0a6353cb1c021e0232c79bb4f404632fb0bce
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2023-11-22 20:09:34 +02:00
Volker Hilsheimer 0b60450eee Mime type conversion: clarify and clean up documentation
The converters need to be instantiated (which implicitly registers)
after QPA has been initialized, i.e. after QGuiApplication has been
instantiated. Clarify this in the documentation of the types.

Remove the dead documentation for the explicit registration function.
The API does not exist, and the documentation was never generated for
Qt 6 either. The function does not need to be called as long as new mime
converters are instantiated correctly (after QPA was initialized).

Pick-to: 6.6 6.5
Task-number: QTBUG-119216
Change-Id: I4e31b3773e88f7a6d579265f093bab46847cb028
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-22 14:42:17 +00:00