Commit Graph

67497 Commits (8a5fed6da41bcc29506d5b4e166a6e87e8fe9eb7)

Author SHA1 Message Date
Timothée Keller 8a5fed6da4 Windows QPA: Prevent restoreGeometry from showing hidden windows
When we use GetWindowPlacement, the showCmd parameter will NOT be
SW_HIDE, even if the window is hidden. To prevent showing a hidden window
with SetWindowPlacement, change showCmd if the window is currently hidden.

Amends 21e4116874

Fixes: QTBUG-120415
Pick-to: 6.7
Change-Id: Ib7de369a6d1a530fdeb5ff930097ae06e25761f3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Zhao Yuhang <yuhangzhao@deepin.org>
2024-05-27 15:22:41 +00:00
Ivan Solovev 88702cc87c QDate: fix C++20 builds with MSVC
Commit c4f7dba81e reworked the C++20
QDate constructors and introduced a helper stdSysDaysToJulianDay()
method. However, the QT_POST_CXX17_API_IN_EXPORTED_CLASS was not used
on this new helper function.
As a result, an application which is built with C++20 but uses a
pre-built QtCore that is built with C++17 cannot call QDate constructors
with the new std::chorono types.

An obvious fix is to add the missing macro to the function.
However, we cannot do it directly, because the function is exported
in C++20 builds, and adding the macro will unexport it.

Use QT6_{DECL,CALL}_NEW_OVERLOAD_TAIL macros to add a new overload of
the stdSysDaysToJulianDay() function and mark it as
QT_POST_CXX17_API_IN_EXPORTED_CLASS.

Keep the old function under the QT_VERSION < Qt 7 check to keep BC.

Amends c4f7dba81e.

Fixes: QTBUG-125610
Pick-to: 6.7
Change-Id: I999354da51ee58c3691dbc1c0351be15a18a268b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-27 16:14:35 +02:00
Viktor Arvidsson 5b7422f74d QWindowsMime: Fix loading of CF_DIB (non-v5)
Drag-dropping and image from for example photoshop didn't work in Qt6
due to a (probably?) copy paste error in the commit
8fa91c75ad

Pick-to: 6.7 6.5
Change-Id: I18dedc09596fe590e915e3aa526131f2d6957d8b
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2024-05-27 16:14:35 +02:00
Assam Boudjelthia e8e369714b Android: bump default sdk build version for Java to 34
To allow using Android 14 APIs, this affects only Java
code.

Amends 7b84cd62b0.

Change-Id: Ie79df773499976ba5c847be98ff5d21ee55036e9
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-05-27 17:14:35 +03:00
Assam Boudjelthia 4438aa5338 Android: use double quotes with androiddeployqt docs
... to avoid coloring mismatch in the generated doc page
of the tool.

Change-Id: I4334d49632c5f119a874e9112d4f13cd4d60e27a
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-05-27 17:14:34 +03:00
Assam Boudjelthia 89937077da Android: rectify class visibility and cleanup for child windows support
* Make classes that don't need to be public as package private
* Remove dead code that serves no purpose now.
* Use lambdas when needed.
* Use @UsedFromNativeCode for methods called from native code.

Change-Id: Ie34eec079366fb3ef048e0f49e03f507cdf90e97
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2024-05-27 13:53:21 +00:00
Alexey Edelev 7d9d1220f3 Prefer using the non-suffixed libzstd over static one
Recent zstd versions provide the libstd target but not only libzstd_shared
or libzstd_static. Attempt to use it as the WrapZSTD::WrapZSTD counterpart
if the target exists.

Task-number: QTBUG-119469
Change-Id: I47916bfa6f10883d099184a497800277c8026b14
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-05-27 15:53:21 +02:00
Mårten Nordheim 9f2dc6d17f Fixup (u)int128 to latin support
MSVC compilers that could use both branches ended up
using one branch for some things and another branch for
other things, which didn't mix and caused build failures.

And in the header the #include was inside the Qt namespace
and caused internal build errors during parse.

Amends 9d693dbfb1

Change-Id: I1a77abe1fefd21ea3256f5b2d5a55998257762e5
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-05-27 13:40:30 +02:00
Soheil Armin f3f383f097 Android: Add autotest to verify the content of an AAR target
This will build a multi-abi Android AAR target and verifies
its content using a customer target "verify_aar" by running
zipinfo on the AAR, and comparing its content with a subset
of files that are expected to be present in the package.

Task-number: QTBUG-125483
Change-Id: I19ad132bbad1a75c40b00de173ca09ad56500076
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2024-05-27 07:57:47 +00:00
Tim Blechmann 4656fabd8a Widgets: silence clang's -Wimplicit-fallthrough
clang's fallthrough detection is a little stricter than gcc.

Pick-to: 6.7
Change-Id: If1052275f035a8e8a496cc5a40a21137d18712e3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-05-27 08:55:58 +08:00
Giuseppe D'Angelo 274f7bfbf5 PDF: fix typo
This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: I9e1c26749579d645699a180dac88a00e8653ed65
Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com>
Reviewed-by: Albert Astals Cid <aacid@kde.org>
2024-05-26 14:56:15 +02:00
Christian Ehrlicher 373ae6cbd2 SQL/IBase: add partial support for SQL_INT128 datatype
Implement partial support for SQL_INT128 datatype which is used for
DECIMAL/NUMERIC columns with a precision > 18. This support is only
available when QT_SUPPORTS_INT128 is defined and for MSVC.
Binding values to columns which need SQL_INT128 is supported but
numbers given as QString will be converted to doubles even if
QSql::HighPrecision is set.

[ChangeLog][SQL][IBASE] Added support for SQL_INT128 datatype.

Task-number: QTBUG-124575
Change-Id: If3fb1eb0f19dc60f000d163f3bf45da7acb08c87
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andreas Bacher <andi.bacher@outlook.com>
2024-05-25 22:25:12 +02:00
Christian Ehrlicher e9c6adb992 SQL/IBase: factor out setting numeric values
Factor out setting numeric values for better readability.

Change-Id: I8980c63e87934e3bc3777897e9cd42aef17caf51
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-25 22:25:10 +02:00
Christian Ehrlicher 9d693dbfb1 QLocale tools: add q(u)int128toBasicLatin()
Add q(u)int128toBasicLatin() as helper functions until QString::number()
natively supports q(u)int128.

Change-Id: I920dff145eaa4e849d1f340ca5d5491d2da2821a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-25 20:25:08 +00:00
Ahmad Samir 28fd273080 QDirListing: begin() should start iteration from square 0
The old behavior was that calling begin() calls
QDirListingPrivate::advance(), if you call begin() again, it would call
advance() a second time. Not the most intuitive of APIs, but it wasn't
any worse/different from QDirIterator Java-style hasNext()/next() (if
you call next() twice, you advance twice).

Now (c)begin() always starts iterating from the very beginning.

Amends c39a0d1e89

pushDirectory(initialEntryInfo) is now called from beginIterating(), so
don't call it in init().

Not using a std::stack because beginIterating() needs to clear the
iterator containers; for some reason on INTEGRITY something like this
won't work (std::stack doesn't have clear()), complaining about the
constructor being explicit:
nativeIterators = {};

The above works just fine on Linux, so instead of having to spell out
the type... just use std::vector directly (back(), pop_back() and
clear()); this is private API so we have full constrol on how the
vectors are used.

Change-Id: Iaaa849f989b2724bf070730f6273263289dd4d9c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-25 21:41:31 +03:00
Thiago Macieira 56568fdee6 QByteArray::setNum: use assign() instead of clear()+append()
clear() will shed any stored capacity, so that's a waste for the few
people who actually use setNum(). The majority use it from number(), in
which case the clear() is superfluous anyway.

And append() does an extra strlen() check, which we don't need.

This considerably reduces the size of both QByteArray::setNum() in a GCC
LTO build (though the compiler chose to not inline assign()). Moreover,
it now does inline setNum() in the number() functions and in a lot more
places (searching for "qulltoa2" in the disassembly finds it in
QFileSystemEngine::id, for example).

Change-Id: If3345151ddf84c43a4f1fffd17d28f2fc79aa072
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-25 15:14:20 +00:00
Thiago Macieira 6c7738a7d6 QByteArray: use qulltoString_helper() to make strings
Mårten made this code ready for QByteArray in commits
e5e8e4f59b and
5d0542a356, but never actually made
QByteArray use it.

The simplest change of moving qulltoa2() is sufficient, instead of
moving the template to the header and using it in qbytearray.cpp.
qulltoa2() is called in three places and we don't want the compiler to
inline the function there, so having the function in a separate TU
accomplishes that for us. GCC won't inline it in LTO builds either.

Change-Id: If3345151ddf84c43a4f1fffd17d28682445fbdaa
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-25 12:14:17 -03:00
Ilya Fedin 297cdf16d0 xcb: move QXcbXSettings initialization to QXcbVirtualDesktop constructor
This prevents e.g. gtk3 platformtheme from hanging.

Pick-to: 6.7
Change-Id: I68593ad54fa5530366d590309c10621e5a48bd22
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-25 02:19:08 +00:00
Thiago Macieira e32009fc0d QFileSystemEngine::canonicalName: don't use malloc()'ing realpath()
It is available in POSIX.1-2008 but is not worth it. The Linux man page
says it only works up to PATH_MAX anyway and the POSIX documentation
says it's UB if PATH_MAX isn't defined.

This cleans up the source code out of these messy #if and should be
faster, because we avoid a heap allocation (stack is always faster).

Instead, we only relegate the heap version to the case where PATH_MAX
isn't defined (i.e., GNU HURD), because in that case the realpath()
function can't be used with a stack allocation.

Pick-to: 6.7
Change-Id: Ie30a3caf09ef4176bb36fffd17cde1ed5c5dad59
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-05-24 21:34:27 +00:00
Mårten Nordheim 48aad482a8 Http: Add support for full localsocket paths
[ChangeLog][QtNetwork][QNetworkAccessManager] QNetworkAccessManager now
supports using full local server name, as in, named pipes on Windows or path to
socket objects on Unix.

Task-number: QTBUG-102855
Change-Id: Ifc743f5025b3d8d0b558ecffff437881897915d9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2024-05-24 22:36:59 +02:00
Ivan Solovev 72b8c7d59c Docs: fix include header for Qt::*_ordering types
As the classes do not use the common naming pattern, qdoc suggested
some weird non-existend includes when generating the docs for these
classes.
Explicitly use the \inheaderfile qdoc command to point to a proper
include.

Amends bdd41f491c.

Pick-to: 6.7
Change-Id: Ia721658df38f1006fdc2fa1de1fab7eb381ceb0b
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-05-24 22:17:46 +02:00
Ivan Solovev 81214dabc3 Document Qt::totally_ordered_wrapper
Change-Id: I9249ee6473b68c5e3a9c328ae4d61b7cd83cb505
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-24 22:17:46 +02:00
Marc Mutz cbda958352 Port QPersistentModelIndex to new comparison helper macros
Decided to keep the strong_ordering semantics, as user code is very
much guaranteed to rely on it.

Update the docs.

[ChangeLog][Potentially Source-Incompatible Changes] Made several
operators (relational, QDebug streaming, etc) hidden friends. This may
break code that calls these operators a) with types that require
implicit conversion on the arguments, or b) using member-function
syntax (lhs.operator<(rhs)). The backwards-compatible fix for (a) is
to make at least one of the argument's implicit conversions
explicit. For (b), use infix notation (lhs < rhs).

[ChangeLog][EDITORIAL] Replace all "Potentially Source-Incompatible
Changes" items that mention making operators hidden friends with the
catch-all one from the QPersistentModelIndex change.

Fixes: QTBUG-117660
Change-Id: I8175af5e2cb3c77e7486e972630b9410b3a0896c
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-24 22:17:46 +02:00
Marc Mutz ece36a7394 Port QModelIndex to new comparison helper macros
Use Milian's asTuple() trick and compareThreeWayMulti().

The pointer variable presents a challenge, because, like op<, op<=>
cannot order unrelated pointer values. Trying to is UB; one is
supposed to use std::less and std::compare_three_way instead, but, you
guessed it, less<tuple<T*>> uses op< to compare the tuples, which, in
turn uses op< on the T* member, causing UB.

[ChangeLog][QtCore][QtCompare] Added a Qt::totally_ordered_wrapper
class whose relational operators use the std ordering types. Use
it to wrap the pointers when doing the comparison to avoid UB.

This allows a smooth migration once we depend on C++20 and class
authors start using lhs.asTuple() <=> rhs.asTuple() or even start
to =default op<=>. The wrapper type is robust against all these
transformations.

Update QModelIndex comparison documentation part.

Task-number: QTBUG-117660
Change-Id: I126b2ebff458800134ed6e774a389d85d76a395f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-24 20:17:46 +00:00
Giuseppe D'Angelo 5fe166ab41 PDF: add a comment to what otherwise looks like an unused method
I'm not 100% sure we still support WebKit, still leave a note.

This work has been kindly sponsored by the QGIS project
(https://qgis.org/).

Change-Id: I45d4351fd4a106763f26685a5510ed630d752745
Reviewed-by: Tobias Koenig <tobias.koenig@kdab.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-05-24 20:10:59 +02:00
Tatiana Borisova e011c3c4b0 Remove CHECK macro from quuid.h file
- CHECK name is too common, it turns out webengine uses it
widely

Amends ef964c254c.

Fixes: QTBUG-125627
Change-Id: I53d90621c09c0f50b7bea910875192bc49095987
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-24 10:34:19 +00:00
Nicholas Bennett 480940f0aa Docs: update the QAndroidApplication::context() documentation
The word "main" here is confusing. use "most recently started" instead.

Fixes: QTBUG-86203
Pick-to: 6.2 6.5 6.7
Change-Id: I3fd4e49204fac8a2f97cdfc57d5f7901fa7b96a6
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-05-24 11:02:54 +03:00
Marc Mutz 0076999031 QRegion: re-add rects() and port setRects() to QSpan
In Qt 5, we had QVector<QRect> QRegion::rects(), but it was
deprecated, because just iterating over the QRegion as a container of
QRects was more efficient (QRegion has a SSO for the case of one
rectangle). With QSpan, we can now bring it back with the same
efficiency as iteration, supporting Qt 5 code that never made the move
away from rects() and new code that wishes to make the conversion into
rectangles more explicit. Re-add the Qt 5 tests, which show that the
function is nearly a drop-in replacement for the Qt 5 rects() (QSpan,
at the time of this commit, doesn't have relational operators, yet).

Also add a QSpan overload of setRects(). The old (ptr, n) function
(now obsoleted, but not deprecated) allowed nullptr + n != 0, which
QSpan doesn't accept, so print a warning in that case. Also, QSpan can
hold more than INT_MAX elements on 64-bit platforms, but QRegion's API
was never ported from int to qsizetype, so we need to catch oversized
spans used as inputs, too.

[ChangeLog][QtGui][QRegion] Added QSpan overload of setRects();
re-added Qt5's rects(), but returning QSpan instead of QVector now.

Fixes: QTBUG-124712
Change-Id: I24570c886cbf77abd8d1f4a3f42ae53c892cd9ff
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2024-05-24 04:38:21 +00:00
Rami Potinkara f22e9795d9 Android: Update Gradle to 8.7 and Android Gradle Plug-in (AGP) to 8.4.0
Updated Gradle to 8.7
Updated AGP to 8.4.0
Updated same versions in examples and docs macros

Task-number: QTBUG-113383
Change-Id: Ib2e841f2e57e576c5d689a208a275ce5e9e4b80f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-05-24 06:37:13 +03:00
Volker Hilsheimer f9cf13d23e QPalette: clarify documentation of resolve a bit
Explain where the colors come from for unset roles, and add a see-also
for isBrushSet.

Pick-to: 6.7 6.5
Change-Id: I35e58e6b0f3ff9e57d9df95879859dd10424dc92
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2024-05-24 01:23:42 +02:00
Alexandru Croitor b151b0a949 CMake: Fix incorrect framework versioned_binary_dir output for iOS
There was a stray '}' character in the value.

Amends 8f03bb6bd8

Change-Id: I06f9200b1449bc54ec07ace1336bb97a8f132158
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-05-24 00:31:48 +02:00
Edward Welbourne ea3c763de4 Move shbang lines to before copyright headers
They don't work unless #! are the first two bytes of the file.
This is a fix-up for commit d6bc7613ac

Change-Id: I83c976a538a67eef3d40b50674a255d6e2f3205a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
2024-05-23 23:58:10 +02:00
Tor Arne Vestbø 668914649c QFrame: Disable implicit inclusion of safe area margins in contents rect
The QFrame::frameRect property is implemented in terms of the QWidget's
contentsMargins, and when the QFrame is resized it recalculates the new
frame rect by reading the contents rect and then setting the widget's
content margins based on the new value.

This conflicts with the implicit inclusion of safe area margins in the
widget's contents rect, as those implicit margins are then persisted as
user-set contents margins. If the safe area margins later change (to 0),
the frame will still reflect the old safe area margins.

We may find a way to untangle this for QFrame, but in the meantime let's
set Qt::WA_ContentsMarginsRespectsSafeArea to false. This avoids the
issue above, and also informs child widgets of the QFrame that they
themselves need to potentially take the safe area margins into account.

Disabling Qt::WA_ContentsMarginsRespectsSafeArea in this manner should
not cause any major behavior changes, as a QFrame is typically part of
a parent widget that does respect the contents margins, and so the frame
will not need to apply any margins of its own once the layout settles
down.

Task-number: QTBUG-125345
Pick-to: 6.7
Change-Id: I936ff5ec9056d05676560cc7659ba31105fdc224
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-05-23 18:55:47 +02:00
Tor Arne Vestbø bc1f983781 rhi: Don't fall back to OpenGL backingstore if Metal is not available
We were reusing the QRhiMetalInitParams when falling back to OpenGL,
which caused crashes at runtime.

We remove the fallback altogether, as tests or clients that rely on
a specific RHI backingstore backend should do feature-testing before
requesting the specific backend.

Pick-to: 6.7
Change-Id: Iee38348ae06ea118aafcada33a8956ae07bb2228
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-05-23 18:55:08 +02:00
Assam Boudjelthia 529267972b Android: cleanup AndroidManifest.xml files in examples
Change-Id: I6b0a11ace348891da7ed16dd9039b807902cb828
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2024-05-23 17:52:21 +03:00
Christian Ehrlicher e337f14707 SQL/models: use qsizetype/range-base for loops where possible
Replace some 'native' for loops with range-base for loops or use
qsiztype instead int, mark some helper functions as const.

Change-Id: Ib3f368d6c07bc170ab4ed7cbf28181a226dbeac5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-05-23 16:52:20 +02:00
Christian Ehrlicher 434494dfb7 SQL/IBase: don't let open() fail when no timezones are available
When connecting to an old Firebird instence with a Qt Firebird plugin
linked against Firebird >= 4 the timezone table is not available and
therefore open() will fail. Therefore downgrade the non-existence of
this table to a qCInfo().

Fixes: QTBUG-125467
Change-Id: Iae6d110bc2a48b5b90ffb9cb38f3fba60f30770f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Andreas Bacher <andi.bacher@outlook.com>
2024-05-23 16:52:20 +02:00
Marc Mutz 462c958a92 QSpan: add as_(writable_)bytes
For std::span, these are free functions in namespace std and therefore
work for anything implicitly convertible to std::span,
incl. QSpan. But they're C++20, QSpan needs something for C++17
builds.

By adding them as hidden friends for QSpan, we allow unqualifid calls
to transparently resolve to the respective overload, ensuring
source-compatibility between std:: and QSpan, and, eventually, a
transition back to std::as_*_bytes.

I considered the alternative to add these functions in the q20
namespace, but q20::as_bytes() would have to take QSpan, and QSpan is
convertible from more types than std::span, so we wouldn't be able to
guarantee that std::as_bytes(t) works for all T t for which
q20::as_bytes(t) works, the fundamental guarantee for namespace qNN.

[ChangeLog][QtCore][QSpan] Added std::span-style as_bytes() and
as_writable_bytes() functions.

Fixes: QTBUG-125489
Change-Id: Ia9a7560c7843e182892608178433be7349c825ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-23 16:18:35 +02:00
Andreas Eliasson 71bc951870 Doc: Document function argument
The current docs describes the function name, when, in fact, it should
refer to the argument.

Fixes: QTBUG-123838
Pick-to: 6.7
Change-Id: I36e3bdff66712b8f35ac19859acb65e6fdcdf355
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-23 09:05:08 +00:00
Assam Boudjelthia f1c6c66985 Android: prefer wlan IPv6 connection over other interfaces
Android doesn't allow connection from interfaces like (radio0, eth0,
etc.) when wlan0 is already connected, so prefer testing that.

Task-number: QTBUG-125023
Change-Id: Id48a6717755edc22909a4a0d58631d8132a42b1a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-23 10:26:20 +03:00
Assam Boudjelthia 4370f9f227 Network: add MTU implementation when getifaddrs is defined
Task-number: QTBUG-125023
Change-Id: I288df0d766f23dc569cedba52523fadedbff6491
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-23 10:26:20 +03:00
Assam Boudjelthia 841bbbe8ec Android: bump min supported SDK to 28 (Android 9)
Bump the minimum supported Android API from 23 to 28 i.e.
Android Oreo 9. This is done to focus more and more on
recent versions.

Fixes: QTBUG-125023
Task-number: QTBUG-124890
Change-Id: I4d510b771f413e5711dd44de454211e019c63db6
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
2024-05-23 10:26:20 +03:00
Lorn Potter aae5c89d5f wasm: add autorepeat for QKeyEvent
We weren't handling it at all, emscripten already supports it.

Fixes: QTBUG-125222
Pick-to: 6.7
Change-Id: I761eed2c8c034604cd02ba436db68cec4fdeb784
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2024-05-23 13:15:10 +10:00
Marc Mutz 23dfacb17d QString: replace homebrew toString() with the Real Deal™
QLatin1StringView has had a toString() since Qt 6.0. Remove the
wrapper.

Pick-to: 6.7 6.5
Task-number: QTBUG-124365
Change-Id: I91e1cc9a2be2d01f309d681b5abcaf417fa584da
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-05-23 01:36:55 +02:00
Marc Mutz 3f3be9d774 tst_QStringView: (re)fix GCC ubsan build
Move the constexpr fromArray() check from fromArray() to constExpr()
and there add the protection necessary to work around
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71962, copied from
tst_QByteArrayView.

As a drive-by, add the test for constexpr construction from a char16_t
array, which was missing here (probably because of the GCC bug) while
the corresponding test was already in tst_QByteArrayView.

Amends 107ff4c1d6b5da2cb11c65b2bd9106817f7fdb02(!).
(iow: 6.0, and no, I don't know why it became a problem only now)

Pick-to: 6.7 6.5 6.2
Change-Id: Id9d2a08175709f8bf85b3b192e7aa49783b9e715
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-23 01:36:55 +02:00
Marc Mutz 6d28744e43 tst_QByteArrayView: (re)fix GCC ubsan build
Move the constexpr fromArray() check from fromArray() to constExpr()
where there is already the protection necessary to work around
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71962.

Amends bbe7570ddcc6fcce707a355b76d2d0024c44ea38(!).
(iow: 6.0, and no, I don't know why it became a problem only now)

Pick-to: 6.7 6.5 6.2
Change-Id: Id9d2a08175709f8bf85b3b192e7aa49783b9e714
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-23 01:36:54 +02:00
Marc Mutz 564be117fe tst_QByteArrayView: expose constExpr() test to non-ubsan GCC builds
Because of https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71962, and
because marking constExpr() as __attribute__((no_sanitize_undefined))
doesn't fix a thing, we opted to disable the triggering parts of
constExpr() from all GCC builds.

This is, of course, unfortunate, since it meaningfully reduces
compile-time coverage in the general case for a rather obscure build
type most won't ever use.

While GCC doesn't give us a predefined macro to check for in the .cpp
file, the cmake build system knows whether we use ubsan, so just
define a macro of our own.

As a drive-by, simplify GCC detection by using Q_CC_GCC_ONLY.

Amends de6a004bc5.

Pick-to: 6.7 6.5 6.2
Task-number: QTBUG-101307
Change-Id: I4be5bd103b9d2386b2ac9fd22e0c34f9c63fee04
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-05-23 01:36:54 +02:00
Tatiana Borisova ef964c254c QUuid, GUID: use new comparison helper macros
Replace public friend operators operator==(), operator!=(),
operator<(), etc of QUuid and GUID with friend methods
comparesEqual() / compareThreeWay().

Use Q_DECLARE_EQUALITY_COMPARABLE_LITERAL_TYPE, because
the (in)equality operators are constexpr.
And then we use helper macros, because the other relational
operators are not constexpr. Cannot make relational operators
constexpr, because it requires to make variant() and isNull() methods
constexpr and QT_CORE_INLINE_SINCE. But the experiments
show that it does not work with adding constexpr to
QT_CORE_INLINE_SINCE.

Put relational operators under !QT_CORE_REMOVED_SINCE(6, 8) to prevent
an ambiguity. On Windows the metatype for QUuid is created
in removed_api.cpp. That leads to an ambiguity, and as a result
the compiler fails to create the equals methods of QMetaTypeInterface.
This, in turn, leads to the failed comparisons.
The usage of !QT_CORE_REMOVED_SINCE(6, 8) solves the problem.

Task-number: QTBUG-120304
Change-Id: I640bdeb8f1f7306ba06b9e4193d008cf2bb6dbfb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2024-05-22 23:32:56 +00:00
Michael Weghorn bd0a6e8307 a11y uia: Bridge QAccessibleAttributesInterface to UIA
This bridges the 2 currently existing attribute types for
the newly added QAccessibleAttributesInterface to UIA.

As described in the AT-SPI bridge implementation already,
QAccessible::Attribute::Level semantically matches
the "aria-level" ARIA attribute, and is mapped to
a "level" property for the UIA_AriaPropertiesPropertyId
as described in the Core Accessibility API Mappings
specification for both, headings [1] and non-headings [2].

Map all attributes set in QAccessible::Attribute::Custom
to that property as well, keeping key and value as they
are.

As described in the UIA Element Properties Identifiers
doc [3] for UIA_AriaPropertiesPropertyId:

> AriaProperties is a collection of Name/Value pairs with
> delimiters of = (equals) and ; (semicolon), for example,
> "checked=true;disabled=false".

In addition, if the level attribute is set for an object
of role heading, report the corresponding
StyleId_Heading for UIA_StyleIdAttributeId, as also
described in the Core Accessibility API Mappings spec [1].

For MingW, add UIA_StyleIdAttributeId and
StyleId_Heading<NUMBER> defines
to qwindowsuiautomation.h, as the MingW headers
apparently don't have them yet (see log of
failed MingW builds without those defines: [4] [5]).

[1] https://www.w3.org/TR/core-aam-1.2/#ariaLevelHeading
[2] https://www.w3.org/TR/core-aam-1.2/#ariaLevel
[3] https://learn.microsoft.com/en-us/windows/win32/winauto/uiauto-automation-element-propids
[4] 051e46739b/build_1716364832/log.txt.gz
[5] b8e6241678/build_1716370445/log.txt.gz

Fixes: QTBUG-119057
Change-Id: I00b15e95c35c0f31ba34161bc061a3085fc28682
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-05-23 01:12:32 +02:00
Axel Spoerl 2d4993899f Widgets focus abstraction: Fix re-parenting
Focus abstraction in 58d5d4b7c2 was
supposed to be behavior-neutral. QWidgetPrivate::reparentFocusChildren
used QObject::findChildren() to find children inside and outside the
current focus chain. If the re-parented widget had only direct children
and the focus chain was equal to creation-order, the result was
identical to previous behavior.

When the re-parented widget had grandchildren, the behavior differred.
While not being detected by existing tests, it caused a regression.

Re-implement the previous logic: Iterate through the focus chain,
instead of relying on QObject::findChildren() returning a complete and
well-ordered list.

Modify tst_QWidget::focusChainOnReparent() in order to cover the
regression.

This amends 58d5d4b7c2.

Fixes: QTBUG-125257
Change-Id: Iff4f1d0d9b6117c50c8980dfb6eebfc6f6d4a710
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-05-23 01:12:32 +02:00