size() is obviously noexcept. QStringView ctors have an implied
precondition that the (ptr, n) range passed represent a valid
range. Since this is a member function QXmlString, we can assume that
the class variants hold and m_string itself represents valid (or null)
data, so this operation is also noexcept.
As a drive-by, remove pointless inline keywords.
Change-Id: Ia7637e77005062b6515ceac4b62efaf14a2eb486
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 792bea9be3760f58de4d1c30fbecab0071fe311e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This doesn't change a thing for QTimer, but is a building block for
making its singleShot() have nanosecond resolution, and allows
QChronoTimer to reuse the function.
Task-number: QTBUG-128426
Change-Id: I3d7e79972f236ca63b216a1a5a871edf5025e1b8
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 25b8d3743455bd2a4a327e1068fc83acb2f1c481)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The classical Q_DECLARE_SHARED assumes it's placed right next to the
class in the same namespace as its argument type. If that is not the
case, then the free swap() function might not be found using ADL,
since it was defined in an outer namespace. Since 6.8, we have
NS-aware Q_DECLARE_SHARED versions, so use that.
Change-Id: I2969c641b501b07b4ebb9fce46d2544bf788fc9b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 877fe0e7b3aada3f99bbf0415cba9daf97b067db)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The include for INLINE_SINCE(6, 8) QTimer API was in the 6.7
block. Move it to the 6.8 block.
Amends a4a679ee79.
Change-Id: I503428bcb73138af5eaed8f1d1523a448e1bf67c
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 0dd5b2de4c59e2f0175aba3cf720a47998108330)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add Q_CONSTINIT to the c_locale variable to statically assert that
it cannot fail (no runtime initialization = no failure). The
QLocalePrivate ctor is already constexpr, so Q_CONSTINIT works out
of the box here.
Because c_locale construction is now known not to fail, c_private()
cannot fail, either, and can and should be noexcept.
Change-Id: Ibe94cb4bcd990fbd0b440dd98509eb39447a94b7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c745b59e36b421039e71779fd9e5db8c619163f2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
So the value is at least sufficiently large even if int could not
fully represent it.
From the API review.
[ChangeLog][QtNetwork][QNetworkRequest] The transferTimeout() function
now returns INT_MIN or INT_MAX when transferTimeoutAsDuration().count()
cannot be represented in an int.
Change-Id: Ic37ad5bc19ea7da4041c989acd3b989923d48cef
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 7fb3a18282281023bd8e47e9dae79dbab3660848)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Since we show an alert dialog for the user to let them know the loading
failed, and accepting the dialog will finish the Activity, there is no
need to call finish() right after showing the dialog.
Change-Id: I954ba1d0b77591665baf2f1e0eb94567768902db
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 55fe33f794c1961f2c691b91fe58525dd1a203e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Methods with preconditions can't be noexcept (from Marc in code
review).
[ChangeLog][QtCore][String Views] Added slice() methods to
Q{String,ByteArray,Latin1String,Utf8String,AnyString}View which work
like sliced() but modify the view they are called on.
Found in API review.
Task-number: QTBUG-99218
Change-Id: Ic8ef3085f7cfac86b8404fb28d491ca38ad121eb
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 8f68bd9e6353a42d3b71d893b27fec6bedced501)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If a window is positioned with setFramePosition, we reflect that to
the platform window via QPlatformWindow::setGeometry(), but with the
QWindowPrivate::positionPolicy set to WindowFrameInclusive. On the
platform side the position policy is read from QWindowPrivate to
determine how to interpret the incoming geometry.
When the resulting geometry is applied to the native window,
it's reflected through QPlatformWindow::geometry() and reported
back via QWSI::handleGeometryChange() as client geometry, ie.
without the frame margins.
If the platform layer later interprets this geometry in
combination with the window's positionPolicy, it will incorrectly
position the frame top left at the point of the client geometry's
top left.
It would make sense to reset the window's positionPolicy at
the point of QGuiApplicationPrivate::processGeometryChangeEvent,
but doing so might break situations where there's another in
flight geometry request.
What we can do as a first step is reset the positionPolicy when
the platform window is destroyed. This ensures that the next
time the platform window is created it will be placed at the
same position, even if the initial position was requested via
the setFramePosition() API.
Change-Id: Ic555f19884ccd68c46421d0fe666717170ba7638
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 11a09a9bd0a7e899a918b078a94c6c3b82240dee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The comparesEqual() helper method cannot be noexcept, because the
comparison operators of the underlying QJniObject are not, and
cannot readily be made noexcept, because they end up calling JNI
stuff like jniEnv()->IsSameObject().
Also, the *_LITERAL_TYPE helper macro should be used only if the
operators are constexpr, which is also not correct in this case.
Remove the noexcept specifier from the helper method and use the
*_NON_NOEXCEPT version of the comparison helper macro.
This change is picked to 6.8 and 6.7, because the API is marked as
tech preview.
The 6.7 cherry-pick would require a manual fix, because the
*_NON_NOEXCEPT version of the macro didn't exist back then.
Amends a5d14a9f5c.
Pick-to: 6.7
Change-Id: Ic01c0b09f94b94677a9771d1763518697aafc3ef
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 405cee34297f3cf2a822658ba14922dfaaa8429d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Do not use the getters, as they are not noexcept. Directly access
the members of the d_ptr instead.
Amends d292648d0bbac50388dae035dc34782accb3807f.
Found in 6.8 API review.
Change-Id: I69eee9db2274d1e99a4f56e841cfaea223341ced
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 495a06a22aef2aa62dd993217e4f4ec099ad4e94)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The comparison operators cannot really be noexcept, because they
call other non-noexcept getters, like QEasingCurve::amplitude(),
QEasingCurve::period(), and QEasingCurve::overshoot().
Amends a4341827ac.
Found in 6.8 API reivew.
Change-Id: I77c01792adbf7d9a7e36d7efec6defbea866b7d2
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 3cf7eff6265b4321e216f830b2ecf1ee4118fad4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QJsonValue comparison cannot be noexcept, because it might allocate,
for example when calling QCborValue::toString(). As a result, all
the QJsonValue(Const)Ref comparison operators also cannot be
noexcept, because they convert to QJsonValue to do the comparison.
QJsonObject comparison cannot be noexcept, because it might call
QCborValue::makeValue(), which might allocate.
QJsonArray comparison cannot be noexcept, because it might also
call QCborValue::makeValue(), which might allocate.
Found in 6.8 API review.
Change-Id: I775746b2a76765bca26b87d5af396a8dfdfca7f9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7f01b62969d1734832ead0547904902ae0f1b5dd)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The (in)equality operators cannot be noexcept, because the
QMap::const_iterator comparison is not noexcept.
QMap::const_iterator basically uses std::map::const_iterator comparison
operators, and I could not find any proof that it is noexcept.
Amends ed71387d1c.
Found in 6.8 API review.
Change-Id: I9014052588a7864b729a7b8ac703f5145675f860
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit a942a373051ddab40742f213e36fa5851c97b384)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The QDoc command `\tableofcontents` was rendered useless by a change
more than a decade ago. Remove the use of `\tableofcontents` as it
serves no purpose, and ensure that the surrounding context still makes
sense for the reader, by removing preceding text that refers to a
non-existing table of contents, such as `Contents:`.
Task-number: QTBUG-128173
Change-Id: Ibb5a6af0e80f70fa487cdf6a7e38009a9ef60cbf
Reviewed-by: Safiyyah Moosa <safiyyah.moosa@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit cd8244131e2d6fe2c2453ae40213e7f12bff893d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The implementation calls QMetaType::id(), which may call
registerHelper() to register a custom type, and that surely allocates.
Amends 5a0faa9198.
Found in 6.8 API Review.
Change-Id: I26979379b8fd12c3d52f6489fb25145ac2fa95ed
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 31d3e57342161a9a8edaebacb968950e6a16d67e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
- 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>
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>
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>