Commit Graph

64554 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
Christian Ehrlicher 297f1da1a7 tst_qstatictext: remove dead code
Remove dead code from tst_qstatictext as proposed in the bug report.

Fixes: QTBUG-22424
Change-Id: Id0916cba75eb7c7a21c61c078d94470b143d0f24
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2023-11-26 12:59:27 +00:00
Ahmad Samir 4e703875d7 QPlatformTextureListWatcher: port Q_FOREACH to ranged-for
The loop doesn't modify the member QHash.

Pick-to: 6.6 6.5
Task-number: QTBUG-115803
Change-Id: I77704b5c90b25a82006004907b4591e783096594
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2023-11-26 14:47:03 +03:00
Volker Hilsheimer 4bce81b03b Manual iconbrowser test: Add a Quick test tab
Task-number: QTBUG-102346
Change-Id: I80dc7a393f08510c26ac8802e24b17e760c21e56
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-25 06:51:28 +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
Serg Kryvonos 49f8ec54df Git ignore Visual Studio CMake build directories
Change-Id: I58560780472184db9297711ad4639ddc4de0c194
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2023-11-24 23:42:05 +01: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 7befd4cad4 Purge empty BLACKLIST files from tests
There's no point to the file if it has no content.

Change-Id: Ie0deb59a63d5f7a654fcab1218e0a814710072ff
Reviewed-by: Jason McDonald <macadder1@gmail.com>
2023-11-24 18:09:16 +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
Alexandru Croitor 72be53ca28 CMake: Fix doc building when current prefix is different from original
When qtbase + qtools is built with -DCMAKE_INSTALL_PREFIX=/opt/foo
and then qtsvg is built with -DCMAKE_INSTALL_PREFIX=/
building docs will fail to find the installed .qdocconf files with an
error like:

 qtsvg/src/svg/doc/qtsvg.qdocconf:1: (qdoc) error: Cannot open file
 '//doc/global/qt-module-defaults.qdocconf': No such file or directory

That's because we pass QT_INSTALL_DOCS=/ (pointing to the new prefix)
as an env var to qdoc and it uses that to try and include various
qdocconf files.

Instead of passing the currently specified CMAKE_INSTALL_PREFIX, use
QT_BUILD_INTERNALS_RELOCATABLE_INSTALL_PREFIX which points to where
qtbase was installed (and thus all previous .qdocconf files).

This was already in the code but we preferred CMAKE_INSTALL_PREFIX
when it was set, so just remove it.

Pick-to: 6.6
Change-Id: Ibe326132b9504341fa998d9e772ea2bea79727c0
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-11-24 17:19:32 +01:00
Edward Welbourne 9f3ae15933 Add a comment to tst_qtimer.cpp to point out its reuse by QtGui
The same test code is compiled by two different modules' tests, which
won't be obvious to the reader of the code unless it's pointed out
explicitly.

Change-Id: I99dba6eb186939c372636c5c1fc29799003d32a7
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-24 15:37:17 +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 9826e4e38b Android: report more warnings for Jar builds
this makes it more visible in the build when introduing
or having java code that for example might be doing
something wrong. deprecation option can't be added at this
 point since we compile the java code against the max
supported version and that will always print a lot of
deprecation warnings that are valid for the max version
but not valid for the min supported version.

Task-number: QTBUG-118077
Change-Id: I7d1e9c80d5208817a342cc1d79a28f233feeda0e
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
Piotr Wierciński dabf8a0d89 wasm tests: Disable unstable qcborvalue test
Change-Id: Idd22897a7ecb4c5e28d60acf390d65517f89c05a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-23 19:26:49 +01:00
Tomasz Kozłowski aab81f51b8 Change created socket protocol to IPv4 in broadcast test
Broadcasting is only supported with IPv4. Previously set AnyIPProtocol
was handled the same as IPv6, which does not support it, so system
library was returning error code and initialization was failing.

Task-number: QTBUG-115777
Change-Id: Iefb1c7237d18cd7af7ccd53f7e5f3f5749a12fd1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-23 19:26:49 +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 fa045a3ce7 SQL/drilldown example: add new icons and misc cleanup
Cleanup the drilldown example:
 - use icons with the current style
 - remove unneeded QOverload<>
 - remove some empty lines which don't look good in the documentation
 - use Q_SLOTS/Q_SIGNALS instead slots/signals

Fixes: QTBUG-113696
Change-Id: I62476a8989c0abd1f424d1425cb05489491e2153
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-23 11:33:28 +01: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
Jacek Poplawski 2da43b563e Disable dbus on VxWorks
dbus is not supported on VxWorks

Task-number: QTBUG-115777
Change-Id: Ia594ddca819ade2d5004dde3da59717e4735b823
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-23 08:18:15 +01: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