Commit Graph

68522 Commits (e86c5bf71c73d5cc65570cbaad250a248815c00a)

Author SHA1 Message Date
Christian Ehrlicher e86c5bf71c QFileDialog: return correct name filter with HideNameFilterDetails set
When QFileDialog::HideNameFilterDetails is set, the combobox does not
show the complete filter but only the filter name. Therefore we can't
use the value from QComboBox::currentText() when returning the current
selectedNameFilter()

Fixes: QTBUG-127924
Change-Id: I8feb894e5336f2899b42d798558a3c9380669938
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 92e650832d425944037ad6ad3c1d46667f62f454)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:29 +00:00
Tian Shilin 5ca2e0e48e fix: Redundant condition in abstractitemcontainer
The check to see if m_itemView is empty is already
included in the first condition, and the re-check in
the second condition is unnecessary.
eg: A | | (!A && B) is equivalent to A | | B.

Change-Id: I1a9f003bacea076fc1e72765c196a327a21c33b2
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 063dad967fbea9649683aa02f457c839e1ab56cb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:29 +00:00
Tian Shilin 9de69c4a99 fix: Redundant condition in isValidBasicType
When isValid is true, it must be true; when isValidis false,
whether the conditional judgment is true ornot only depends
on whether !result is true(eg: A | | (!A && B) is equivalent to A | | B.),
so you can optimize the judgment condition to improve thereadability
of the code.

Change-Id: I0231b83e0b50586dff2820b8d0dfc35edec36f70
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 03c547f1010868a0ef2f236c6980094efab7e12f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:29 +00:00
Christian Ehrlicher 225e235cf9 XML/QDom: speedup encodeText()
The code copied the whole string, then replaced parts inline, at
the cost of relocating everything beyond, at each replacement.
Instead, copy character by character (in chunks where possible)
and append replacements as we skip what they replace.

Task-number: QTBUG-127549
Change-Id: I368482859ed0c4127f1eec2919183711b5488ada
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 2ce08e3671b8d18b0284447e5908ce15e6e8f80f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:29 +00:00
Tian Shilin e0b2258b03 fix: Redundant condition in tst_qdbustype
When isValid is true, it must be true; when isValid
is false, whether the conditional judgment is true or
not only depends on whether !result is true
(eg: A | | (!A && B) is equivalent to A | | B.),
so you can optimize the judgment condition to improve the
readability of the code.

Change-Id: Iab621d3d2948d249f6d8a2425bca3f5404c2e1a1
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 3819ad4ea42b707e7b786b3a8b942d1214533ba6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:29 +00:00
Wladimir Leuschner b3a25e845a QWindows11Style: Increase QSpinBox width for layouted QSpinboxes
QSpinboxes used the sizeFromContents from QWindowsVistaStyle, which
produced a too small contentRect for the newly horizontal layouted
buttons on QSpinBox. This patch sets a minimum width for the content
rect, when QWindows11Style is used.

Fixes: QTBUG-124118
Pick-to: 6.7
Change-Id: Ibf58c8da360242587e55f8096fa3157459041ba6
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit bfe8ac4ebff7a1e8114068f2f46e73c588735690)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:28 +00:00
Mårten Nordheim d2e9a03ee3 Http2: flip some checks for PUSH_PROMISE around
It was correctly following the RFC, but we overlooked that the
RFC is talking about restrictions on _sending_, while we are
verifying on the _receiving_ end. So, some things has to be flipped.

And the dataSize offset was incorrect and could read out-of-bounds.

Amends d17d260948e16549d82f1fdd4dec98d246b0622e

Pick-to: 6.7
Change-Id: Idb7e00637398dff190fc4e5b9776a8649a04f391
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 02d1d638545fd8600fac9707a8f9af03f99197ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:28 +00:00
Tor Arne Vestbø cf0b87c7c2 wasm: Ifdef out unused function systemHasStderr
Change-Id: Ifae799d62668382c93ef85826b397f4a9d3e4199
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 09681d46f4cd17b2e78c93ff7da9e030f0ce6e0e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:28 +00:00
Mårten Nordheim 28abd01732 Speed up setup for QSet unite benchmark
Pick-to: 6.7 6.5
Change-Id: I38a56ae2c9f3dcbcb851cf63ae692cd7f9497989
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit ccbf2cd43c1748259410cddbf4f359b6b88df987)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 01:13:28 +00:00
Edward Welbourne 690cc978ea Rename new QTZ::aliasMatches to hasAlternativeName
Raised in 6.8 API change review. The use of "matches" in a name suggests
pattern-matching, which isn't what happens here.

Task-number: QTBUG-125859
Change-Id: I8aa05b117807b9d1b9b737cd63d44fb4a30f6fa5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 6b36e5de7656e1d9e23364c596cc82f8068d4452)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 16:38:19 +00:00
Wladimir Leuschner ac74885507 QWindows11Style: Use float coordinates for ticks in QSlider
Fixes: QTBUG-127788
Pick-to: 6.7
Change-Id: If7620aade30c45c409cb442a7ed6e4a8aea7551e
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 47ba48e0245e6f57ae0c76db626eb63ce6924cfd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 16:01:20 +00:00
Assam Boudjelthia 9c06169a08 Android: move AppStateDetailsListener from QtActivityBase to Delegate
Implementing QtNative.AppStateDetailsListener under QtActivityBase
exposes the methods as public API to users, where the class
AppStateDetailsListener itself is not public API, so move the
impelementation to the QtActivityDelegate.

Task-number: QTBUG-125859
Change-Id: I9b358a5e9cd9970a2ead11df77b3761a8e7e6c07
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 6e2b92c1b1d229aae56fff9ae4487ce41ca50680)
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
2024-08-27 16:01:16 +00:00
Alexey Edelev 8f09ff24c2 Filter the Android SDK build tools directories
Avoid using non-version like directories from the android build-tools
directory.

Fixes: QTBUG-94956
Pick-to: 6.7 6.5 6.2
Change-Id: Ib201c43db2c5ee4a67bea90027ae5363a8d06709
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 58542f9c367efe5198172dfc7aaabf1e8c2c90bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 16:01:11 +00:00
Michał Łoś 456037a4d3 Enable keyboard handling on VxWorks
Provide VxWorks-specific code to handle keyboard. Note that there is no
support for changing keyboard leds on VxWorks.

This is preparatory change as there is no Qt evdev support for VxWorks.

Task-number: QTBUG-115777
Change-Id: I314f8f1b42501b601d39e65080f2bea4002cc693
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-08-27 18:01:04 +02:00
Michał Łoś af2cf8a67b Enable compilation of evdev touch handlers on VxWorks
In order to provide support for device detection using evdev on VxWorks,
we need to exclude not compiling parts of code for touch handling for
this platform. For now, provide necessary headers and defines, remove
incompatible code for evdev tablet and touch handlers.

Note that this is a preparatory change, as no touch device is being
detected for VxWorks yet, nor evdev is enabled for this OS.

Task-number: QTBUG-115777
Change-Id: I042d2fd464bbe23516646c02ae10354aefe82403
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-08-27 18:01:00 +02:00
Michał Łoś c4dfb8030c Enable device discovery using evdev on VxWorks
Provide VxWorks-specific implementation of keyboard and mouse device
discovery, and enable usage of evdev on this platform.

Task-number: QTBUG-115777
Change-Id: I9370ac085aa58c72e2d39731b78ebd854f5aad9a
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-08-27 18:00:49 +02:00
Christian Ehrlicher 61b9195fc2 QIcon::pixmap() add a note about the changed behavior
With Qt6.8 QIcon::pixmap() no longer scales the size by the devicePixelRatio passed to QIconEngine::scaledPixmap(). This means that external icon engines now must be adjusted to honor this change.

[ChangeLog][Important Behavior Change] QIcon::pixmap() is fixed to no longer scale the size, passed to QIconEngine::scaledPixmap(), by the devicePixelRatio.

Change-Id: Ic93e10a81cd58fba4580c3f1522cc27e2b05cea5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit ecc13e3d41af89bd195e6f173b2c96d2295f407e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 16:00:42 +00:00
Christian Ehrlicher 108162274b SQL/plugins: Fix configure options '-sql-<foo>'
The configure options '-sql-<foo>' and '-no-sql-<foo>' did not work as
expected because they were overridden by some ancient
'plugin-sql-<foo>' option. It looks like an ancient relict from Qt4
times where you could specify if a sql driver could be built as plugin
or as built-in module which is not supported anymore since Qt5.8.

Pick-to: 6.7 6.5
Fixes: QTBUG-128337
Change-Id: I7f0a0cf4b1dd11af32c48b50ceacf0f26eafffcf
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 8a0c86651f1e5091c4fb5ef8cbbcef53a9e336eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 16:00:30 +00:00
Edward Welbourne 16abff0f85 Cache UTC versions of QDTP::getM(in,ax)imum()
The static min and max moments of QDateTimeParser are local times.
Now that baseDate() needs to check whether the start of the two-year
century falls between these, and parsing of simply a date or simply a
time (not a date-time) uses UTC, to comparisons involve mapping the
local time to UTC, with the usual associated expense. Do that
expensive operation once on creation of the min and max local times,
so that it'll be cached for use by the comparisons.

This shall also help with other comparisons to max and min, so is of
use even before the introduction of baseDate(), for all that that
change brought the issue to light.

Thanks to Jøger Hansegård for analysis of the profiler data that
revealed the root cause of a significant slow-down.

Pick-to: 6.7 6.5
Fixes: QTBUG-124465
Change-Id: I539c8ae782717635fb722c4573d85bc63073958a
Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit b6a11a4ee5319366f14c11c7cf3a4f1dbf33cfd5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 15:58:15 +00:00
Edward Welbourne 29934f62ef QDateTimeParser: Move magic section indices out of section type enum
They never belonged there and their presence implied cases for them in
switches on type that make no sense. Presumably it was just a handy
enum in which to declare some constants, but we can do that with
constexpr class members these days, without compilers grumbling about
unchecked members of an enum in a switch. One of them wasn't even
referenced anywhere, so dropped it entirely.

Pick-to: 6.7 6.5
Change-Id: I304cdb07cd86e8d7e926c316729d68fc7770afc5
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit c7e75b2b8da79d736e9d01d81959fec66c4c90e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 15:57:57 +00:00
Marc Mutz b819709c3a QHash: re-SCARY-fy value() and key() methods
This reverts commit ba24125cbf.

The funImpl() functions were specifically designed to be sharable
between the fun(key) and fun(key, def) overloads. Making the return
statement a template argument turns one function into two, duplicating
the executable code. It doesn't even improve readability much, so
revert to returning pointers as a poor-man's optional<>.

This re-SCARY-fies the functions, also adapting the code of the
heterogeneous lookup additions that were introduced later.

An alternative would have been to use qxp::function_ref, but that
produces a lot of code itself, as the recent removal of it from QtTest
has shown, and it's not required, either. KISS applies: the old
return-by-pointer was the most simple implementation possible. There
is no need for a type-erasing function wrapper here.

Change-Id: I8570ce5acd6d6e98321e4003919651cd97cad83e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit cdc04b96dd8a69d0310e1474008b48128d050450)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 06:01:30 +00:00
Marc Mutz 9ebc45c754 Give some TLC to FunctorCallBase::call_internal()
The function takes `fn` by universal reference, so it should be
`std::forward`ing `fn` before calling it. This includes the
unevaluated contexts, so use `std::is_nothrow_invocable_v` and
`std::invoke_result_t` instead of `noexcept(fn())` and
`decltype(fn())`. The std traits take the value category into account
automatically. Linters like to warn about universal/forwarding
references without std::forward(), so this should be fixed even without
and actual overloaded op() &/op() && present.

The function passed as `fn` may also be marked as `[[nodiscard]]`, so
make sure that we never ignore the return value (unless it's void) to
avoid throwing warnings.

As a drive-by, replace Q_UNUSED with [[maybe_unused]] and inline the
SlotRet type alias into its only user.

Amends f894f04c9d.

Change-Id: I5e045fc735f461a82244d7e80f81c2a9b1e69046
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 832e47ca44d3af1b7a3f722bad2a1d0c6fd56b5f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 06:01:25 +00:00
Marc Mutz ac05ee3746 QAbstractEventDispatcherV2: clean up override keywords
Virtual functions should have exactly one of 'virtual', 'override' or
'final', because 'final' implies 'override' and 'override' implies
'virtual' (CppCoreGuidelines C.128;
https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rh-override).

So add 'override' to the dtor and remove 'virtual override' from the
final functions.

Amends af6afad3b3.

Change-Id: I65711c4ca87d522fc0d3afc994f8812914eab7d3
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e6dab10c32b2d57e8f47e5c16827a3c1560f2e27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 06:01:19 +00:00
Thiago Macieira fbfec48c42 tst_QByteArrayView: remove use of std::char_traits
Complements ab05e05f60253b9be615c09aa340ee75f2e5bcaf:
    Strings: get rid of the last std::char_traits use

    LLVM's libc++ became pedantic and insists on only accepting
    instantiations for one of the standard Char types, so remove all uses of
    it with a template parameter.

    Complements dc2ae08e02.

which is:

    QStringView: stop instantiating std::char_traits<QChar> and <uchar>

    It's deprecated and will be removed with LLVM 19.

    Amends b1ee49b465.

Fixes: QTBUG-128325
Task-number: QTBUG-126214
Task-number: QTBUG-122753
Pick-to: 6.7
Change-Id: I2c7fbe3c0f557e98e7edfffdb00b4cc71a6612ca
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
(cherry picked from commit b387537d3e9c35d9f112d4aa32ad71df5e5e9028)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-27 05:22:58 +00:00
Christian Ehrlicher 0b328b6b00 SQL/OCI: misc cleanup
Do some cleanup:
 - use qsizetype instead int
 - use default member init instead in ctor
 - remove unneeded functions
 - make a getter const

This is a follow-up of 7005630a9b735f2e59e3345fee0305e0277c0208-

Change-Id: Ibb02bd93a130c5d60bf431608666a5ad1fe71ead
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 4bf7cc2440bb09578d95e8eea51ebfbddd2897e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-26 04:19:38 +00:00
Dongmei Wang 65b6de2a20 xcb: handle XI2 input button and motion events from slave devices
On Ubuntu 24.04, when the SuperKey is pressed, Qt only receives XI2
input events sent from the slave pointer devices on a mouse click or
a mouse move, but does not handle those XI2 input events.

Fixing this by allowing Qt to handle such an XI2 event and generate
a QMouseEvent for it if it is not handled previously.

Upon receipt of an aforementioned event, check if the event
is a duplicate XI2 event. A duplicate XI2 event means that
the XI2 event was sent from another device previously.

- If it is not a duplicate event, the XI2 event is passed to
  QXcbWindow to be handled. Eventually, a QMouseEvent is
  generated and sent from the GUI for the XI2 event.
- If it is a duplicate event, ignore it.

Note, part of commit:3bc0f1724ae49c2fd7e6d7bcb650350d20d12246
is re-done with the fix.

Fixes: QTBUG-110841
Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I93beddef7261c37ddbe8bfdb6ae08c95f8f155c5
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b71be292780b858f2c55ce92601452e2ea946de2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-26 04:18:39 +00:00
Christian Ehrlicher 432b7187e1 Widgets/doc remove all \since 4.x comments in widgets/dialogs
Remove all \since 4.x comments in widgets/dialogs - this is no longer
of interest.

Change-Id: I4835be8c16363b13615ffc921454e2b5ade295eb
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b5bb8897d0809bae4e414c74420440255fc5b08d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-26 04:18:34 +00:00
Christian Ehrlicher c211b1dbbe SQL/Doc: remove paragraph about CMAKE_INCLUDE/LIBRARY_PATH
Using CMAKE_INCLUDE_PATH/CMAKE_LIBRARY_PATH to find the correct database
includes and libraries does work but is nothing which should be
documented here - it's a common way to specify common paths for cmake.
Documenting this here just confuses the user (which already has hard
times to compile the plugins by itself).

Change-Id: I0cb051f06f3c71f005290700e3b6c32da9a0b2b5
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit e279dd8c20794810292047c8c84f309e8aed004b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-26 04:18:31 +00:00
Ahmad Samir f1e15832dd String Views: optimize the QByteArray/QString constructors
By using {QString,QByteArray}::begin() instead of data() (for const
objectst); both begin() methods, respectively [1], return nullptr for a
const null {QString,QByteArray}. Whereas data() returns &_empty if
QT5_NULL_STRINGS is defined.

[1] QByteArray::begin() since a116b2ddfc
QString::begin() since 287ace562e

[ChangeLog][QtCore][QLatin1StringView] Creation of QLatin1StringView
from QByteArray or QByteArrayView now preserves the origin's isNull()
status. This matches the behavior of creating a QUtf8StringView from
those types.

Change-Id: Icbdfe282e315c08ca6a17201bcd32c1a3bba8bf5
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 221d8fdfb14c16472267320f859105f1a3834952)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-26 04:18:29 +00:00
Alexandru Croitor e43f4a7142 CMake: Automatically detect single arch macOS cross-compilation
Implicitly detect macOS cross-compilation in case the value of
CMAKE_OSX_ARCHITECTURES is a single arch that is different from
the real host macOS architecture.

In that case, the build system will implicitly set both
-DCMAKE_SYSTEM_NAME=Darwin and -DCMAKE_CROSSCOMPILING=TRUE.
It will also set those variables in the qt generated toolchain file,
otherwise user projects might not be built with the correct
architecture depending on the arch of the host machine where the user
project is built.

For such a cross-compilation scenario, as usual, a host Qt needs to be
specified during configuration, for usage of its host tools. Which
means that if cross-compiling to x86_64 from arm64, we will not try
to build and use the x86_64 tools via Rosetta.

Fixes: QTBUG-121322
Change-Id: Ib484af445b3fc6eb676b0ee174ac81d63f2f450f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit fc2fa92de02e8b57472058a8281c24775e97d9eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:04:41 +00:00
Tatiana Borisova eae3d0807a Convert a Qt ordering type to the weaker std ordering type
- Added missing conversion from Qt::strong_ordering to
std::weak_ordering, std::partial_ordering.
- Added missing conversion from Qt::weak_ordering to
std::partial_ordering.

Usage of Q_IMPLICIT specifier in new std::*_ordering conversion functions leads to following ambiguity errors on WIN + MSVC configuration:
C:/Users/qt/work/qt/qtbase/src/corelib/global/qcompare.h(334): error C2440:
'static_cast': cannot convert from 'Qt::weak_ordering' to 'Qt::partial_ordering'
qcompare.h(334): note: 'Qt::partial_ordering::partial_ordering': ambiguous call to overloaded function
qcompare.h(249): note: could be 'Qt::partial_ordering::partial_ordering(Qt::partial_ordering &&)'
qcompare.h(153): note: or 'Qt::partial_ordering::partial_ordering(std::partial_ordering) noexcept'
qcompare.h(334): note: while trying to match the argument list '(Qt::weak_ordering)'

For solving the problem we can exclude the conversion function from the argument list(make it explicit in case of MSVC).
Q_COMPARE_CAST_IMPLICIT is used for setting explicit or implicit specifier depending on the compiler type

[ChangeLog][QtCore][QtCompare] Added missing conversions
from Qt ordering types to std ordering types.

Fixes: QTBUG-127670
Pick-to: 6.7
Change-Id: I32a9a33fa8921c75b0e5a40bd413572f1bd6765a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 521e091bca1764d53ac06bb60707475d1032f5d5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:04:38 +00:00
Alexandru Croitor fdd8924dce CMake: Allow opting out of Qt6HostInfo package lookup in user projects
A developer can cross-compile Qt and force the build of the tools
for the target architecture. In this case, the resulting Qt libraries
and tools can theoretically be used as an SDK on the target platform
without having to rely on host tools or packages.

Examples of this scenario include Boot2Qt, cross-building a Qt SDK for
a raspberry pi on a more powerful machine, or cross-building an arm64
macOS SDK on an x86_64 machine.

To achieve that, the build system needs a way of disabling the
mandatory host path check and the lookup of the Qt6HostInfo package
that are added due to the nature of 'usual' cross-compilation cases.

This was partially addressed in
0f8017efb6 by offering an opt out via
the QT_REQUIRE_HOST_PATH_CHECK and QT_NO_REQUIRE_HOST_PATH_CHECK
variables.

The change was incomplete though. While it was possible to disable
the _qt_internal_setup_qt_host_path call at user project time, it was
not possible to disable the lookup of the required Qt6HostInfo
package in _qt_internal_find_host_info_package.

Change the code to consider the value of QT_REQUIRE_HOST_PATH_CHECK
also when looking up the Qt6HostInfo package in Qt6Dependencies.cmake
in user projects.

When building additional Qt repos, as opposed to user projects,
where we call _qt_internal_find_host_info_package in
qt_internal_setup_find_host_info_package via the BuildInternals
package, users will still need to pass both QT_REQUIRE_HOST_PATH_CHECK
and QT_NO_REQUIRE_HOST_PATH_CHECK to disable the host path check.
This case is less likely to happen, so no adjustment is made to unify
that behavior.

Additionally make it also possible to use an environment variable
as an opt-out with the same QT_REQUIRE_HOST_PATH_CHECK name.

Amends 0f8017efb6

Change-Id: I3b1f35d1540493680323330bddc28c65e88b966f
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 98450a332e317aeafa3381abd6266829e8900758)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:04:35 +00:00
Giuseppe D'Angelo 27dc042712 Rename qt_saturate to q26::saturate_cast
C++26 adds std::saturate_cast, so follow the established pattern of
other similar "backported" APIs. The old name is left around while
we port other submodules.

While at it, move qt_saturate's tests to the qnumeric test.

Change-Id: I653a2e3d936081378298a9c8e51e7c1a2d438d83
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7447ad503330ed176cf369792ffb33b7e00a58d3)
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-08-25 17:04:32 +00:00
Juha Vuolle f2e083156e Fix minor Android manifest documentation issues
Change-Id: I0b7a8a88acd7c6fd30ce67cc140a819c9e72862f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 1b963f02c102750af807ec08b04ab54986a35e8d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:04:29 +00:00
Tinja Paavoseppä e04eca32a0 Android: Move EditPopupMenu to QtWindow
The EditPopupMenu requires a View in its
constructor, making it important that we do
not hold a reference to it after that View
is no longer valid.

In cases where we do not have one, top level View
that will stay valid for the lifetime of the whole
Activity, e.g. when embedding a QtView to non-Qt
Android Activities, making the popups QtWindow based
makes sense, as the lifecycle of the popup and
it's corresponding QtWindow should match.

Task-number: QTBUG-126180
Change-Id: Ibb45513de98f79a293a05eeb317d959ac0328dbe
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9e167af3f6a4b2ac192aedd83f5066808d719415)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:04:24 +00:00
Tor Arne Vestbø 8d2f2cc791 Avoid dock widget separators stealing mouse events from expanded toolbar
The way QMainWindow handles dock widget separators is a bit evil. They
are real QWidgets, added as direct children of the QMainWindow, but
painting and mouse interaction is handled by a hook into the QMainWindow
events, via QMainWindowLayoutSeparatorHelper::windowEvent(), which
is called at the start of QMainWindow::event().

For reasons unknown, we also raise() these separator widgets, which
means they are always at the top of the child window stack of the main
window. This is problematic for the situation when a QToolBar has an
expanded overflow-menu, which is also raised(), but where we end up
raising the separators on top of the toolbar again. As a result the
toolbar gets leave events when we hover one of the separators, even
if the toolbar menu is overlaid the dock area, resulting in the menu
closing.

We don't see this visually, as the separators are drawn via the hook
mentioned above, which happens before QMainWindow draws any of its
child widgets, like the toolbar.

Fixing this requires us to selectively place the separators below
any expanded toolbar each time we raise a separator, so that we
respect the request of the toolbar to be on top, while still
ensuring that the separators are above any of the dock widgets.

Unfortunately the QMainWindowLayoutSeparatorHelper hook also
processes mouse move and click events, resulting in the cursor
changing shape when hovering the separator, even if the toolbar
menu is over it.

To fix this we amend the logic of finding a separator widget
based on the mouse event position to also querying the QWidget
childAt() function, and if we are over a tool bar, we bail out
instead of looking for a separator on that position in the dock
area layout.

As the special separator logic in QMainWindow is conditioned on
the style returning 1 for QStyle::PM_DockWidgetSeparatorExtent
the test checks for this, and skips if another style is in use.
So far only the macOS style is affected by this. See the original
change in fba33a6bbc09bb278df75829d8d705863d40a6a3.

Fixes: QTBUG-124733
Pick-to: 6.5 6.2
Change-Id: Ifc741336bd9725ef0fea9f0474e27b7481f3a183
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 3d99f90b50ab22ef5ab4433c57f9ee584a0a7cae)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:04:20 +00:00
Tinja Paavoseppä f149f0245f Android: Move CursorHandles to QtEditText
The CursorHandles are the handles visible when trying
to select text from a text edit, or select a position
in the text. As it is not used anywhere outside
a text edit, move it inside QtEditText, making it
easier to handle cases where we have multiple windows,
and multiple QtTextEdits.

Task-number: QTBUG-126180
Change-Id: I765f229050ca33887570c1434bdc0a2aa3659649
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 996e1fba5e83e09a897272b16062a8e4fad291ef)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:04:16 +00:00
Tinja Paavoseppä e1b7a0d3ee Android: Remove getQtLayout() method
After refactoring the various keyboard input
related Java classes so that they are more contained
inside their respective windows, this method becomes
unnecessary.

Task-number: QTBUG-126180
Change-Id: I608399e98892752182039b8ece60005670da8224
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 9ed29c73674939c772cc6b407881935e7fa19bcd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:04:11 +00:00
Axel Spoerl 38e8899249 QCompleter: Forward mouse press/release to virtual keyboard
When the list view of a QCompleter is visible, it receives mouse events.
A mouse press event outside the completer hid it.

If a virtual keyboard was active, it did not receive mouse press/release
events in case the completer's list view was active.

Add a helper to QGuiApplicationPrivate, that detects a virtual keyboard
under a mouse event position, and forwards the event if needed.

Adapt QCompleter::eventFilter() to use the helper.
If a virtual keyboard one exists and a mouse press event occurs inside
it, don't hide the completer and forward the event.
Add handling of mouse release events, and also forward them to the
virtual keyboard, using the helper.

Add logging.

Fixes: QTBUG-126752
Pick-to: 6.7 6.5 6.2
Change-Id: I613523a9c83b319810397770c43b2eb4ae01c31a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 93ce8f13fc8042eac976a3c911af7d7664e8d5dc)
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2024-08-25 17:04:07 +00:00
Paul Wicking 9c032ad5fe Doc: Specify target_link_libraries item for CorePrivate module
QDoc has a new command, `\qtcmaketargetitem`, that allows for overriding
the content generated for the `target_link_libraries` instructions on
class/namespace pages. The new command must be used on the documentation
for the module, in conjunction with the `\qtcmakepackage` command.

This patch makes use of the new command for a limited number of
Android-related classes that belong to the CorePrivate module. It also
removes the "usage snippet" and drops its inclusion from the few classes
that included said snippet, as that's no longer needed.

Task-number: QTBUG-109214
Task-number: QTBUG-121991
Change-Id: Ic715b6512a26b3b89e24f418295640f9bbda9417
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 4ed994487484b37ff960144806445f8f9ce42286)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:04:03 +00:00
Matthias Rauter 1909435b03 Work around compiler bug in QTransform
gcc version 13.2.0 (Ubuntu 13.2.0-23ubuntu4) seems to remove some
code in release builds that is embedded in a macro in qtransfrom.cpp.
This patch changes the macro into a function such that it is not
removed by gcc.

It seems like the switch statement is (wrongly) optimized away if it is
embedded in the QTransform::map(QPolygonF) overload. nx and ny are
always 0 (as initialized by QPolygonF) after the macro (but only within
the QTransform::map(QPolygonF) function.

The bug happens only in a release build. Added debug messages of nx and
ny created no output, adding qDebug() << t, which made the macro work.

It seems that a complex combination of macro and switch statement can
tigger the bug in gcc. So rewriting the macro as a function works around
the bug.

Fixes: QTBUG-127723
Change-Id: I7e0b02cde276e591cf773f4e18dd505134421957
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 11b70b66de627d3bd0ef4193d5cfa624c88ac96a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:03:57 +00:00
Wladimir Leuschner 11473410c2 QWindows11Style: Make MdiControls darkmode aware
Pick-to: 6.7
Change-Id: I525602c9757a8fed3d5ab6d64fe856adaa75b83d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 982314aace15109857784b0b6c3b49cc6e13b9b7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:03:54 +00:00
Tian Shilin 001afe49b4 fix: Redundant condition in qplaintextedit
The redundancy in the conditional judgment exists
because QApplicationPrivate::keypadNavigationEnabled()
appears in both conditional branches. Specifically, the
conditional expression can be simplified because
!A || (A && B) is equivalent to !A || B.

Change-Id: I071e349ea4f67a03f89136e2156eb5918a65214f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 792373595d9d9d45f5c43e6a9e3f90c1b7ad54d8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:03:51 +00:00
Tim Blechmann 6c8d2e042c Gui/Testlib: fix compilation for FEATURE_qreal
Task-number: QTBUG-118877
Change-Id: I4988f3b8b9ed09d8f01873fe34bf78d8105a25da
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit a74b550e2c38679c329cd40d2119ab440668468e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:03:41 +00:00
Wang Yu ee09375bba Fix Windows drag and drop crash
When QGuiApplication::primaryScreen() is empty,
dragging it causes a crash

Change-Id: I6c5e48be44db90acec5126957bee60b8514b10a7
Pick-to: 6.7 6.5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit f8e7dfe93ab9622f77aade23707cd6f0b9386379)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:03:37 +00:00
Thiago Macieira d6bef9a6f9 Switch tools and apps to non-strict C++ builds too
This complements commit 30e04340dac26ebd09f9bc8ceb598e873ab63ba7
("Switch to non-strict C++ builds so QT_SUPPORTS_INT128 is true") and
adds the same modification to tools and apps.

Otherwise qtconnectivity's sdspscanner won't compile, as it needs
quint128.

Task-number: QTBUG-119901
Change-Id: Ib9a6fe573e9420a471fdfffd76a2e43d3c5496d8
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 7e37962cd0d1faf65249e08020619ef7175a280e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 17:03:29 +00:00
Ivan Solovev a2b94167ab Clarify QT_DISABLE_DEPRECATED_UP_TO usage in static builds
Explicitly mention that in static builds Qt itself needs to be built
with the same deprecation version as the user code.

Fixes: QTBUG-125975
Pick-to: 6.7 6.5
Change-Id: I51b1e8b4ecd1731d3ff2320e758a52c5ef2c7cd9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 47ff7d99a06321559d7ab1682869732ea6e08359)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 16:40:12 +00:00
Doris Verria 57f0085fec QWindowsTheme: Set correct accent color depending on color scheme
The accent colors retrieved through the UISettings.GetColorValue API
are not theme aware. They will report the same values for both light and
dark mode. We were using the same Accent color value for both color
schemes giving us poor contrast when app is running on dark mode.
The API gives us several shades of accent colors from lightest to
darkest which we need to map to the accent roles in our QPalette
depending on the active color scheme. The following colors and their
mappings are based on the modern WindowsUI3 and its official Figma file:

Light Mode
AccentDefault (default accent color for controls) -> AccentDark1
AccentText/Primary (accent color for links) -> AccentDark2

Dark Mode
AccentDefault -> AccentLight2
AccentText/Primary -> AccentLight3

Fix this for the qwindowstheme so that it affects both the windows11
style and the FluentWinUI3 for Quick.

Pick-to: 6.7
Change-Id: If1c3a909d0a4dc9082e7589eaeaebd05e9f65a29
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit d4a2f01976bbb0f8b357bfd96faf9ec249047c95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 12:54:34 +00:00
Axel Spoerl 0a8a34fbe1 Remove tst_QWidget::render_task252837()
The test function renders a pixmap into a widget that is never shown.
It checks for a crash, without failing or passing.

tst_QWidget::render_graphicsEffect() tests the same code path.

Remove the unneeded test function.

Change-Id: I1b64e0466c5a133deec28d0f74ef5acd9858e1ea
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit dfdcb90ffdec0c3a4f7c1c5c59dfba5c04b8c521)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-25 12:54:34 +00:00
Christian Ehrlicher d8c7856312 SQL/OCI: Compile with MSVC/64bit
Make the oci driver compilable with MSVC 2022 / 64bit. One more reason
to get those drivers checked within the CI.

Pick-to: 6.7 6.5
Change-Id: Iec07adcd4cafde5e028ea306fb88e635a22e2234
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 2eb66149131b852f687302417cb2f76ef3184dbe)
2024-08-25 12:54:34 +00:00