Commit Graph

68566 Commits (cb6a3fe53e6a01cafed18fac9b1e5a64ebd834aa)

Author SHA1 Message Date
Ivan Solovev cb6a3fe53e QArgumentType: remove the incorrect noexcept from comparison operators
The QArgumentType::name() getter evaluates the name lazily, which also
involves constructing a QMetaType. It's not entirely clear if adding
noexcept there is a good idea, so drop it.

Amends 5a0faa9198.

Change-Id: I73042f22df9615f570823a7745f04e9731c097fe
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e39eb34bc6585c5ec367727e86f70ce67c2d176a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 20:41:33 +00:00
Edward Welbourne d12b85ae0b Document the potential widening effect of upper-casing
In QChar we don't return the upper-case from when it's not
representable as a single QChar; for strings, the uppercase string may
be longer than the original.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I57bb1412d79d579a9cc4dc6bdbb839e56f9ea0a8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 65eb1c5579ec56d15583b4af45b50fddd3c799a6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 18:21:38 +00:00
Oliver Eftevaag 6a2c2488a1 Close popups on window deactivation and orientation changes in qGuiApp
With the introduction of QQuickPopupWindow in 6.8, much of our popup
management had to be moved from QApplication to QGuiApplication.
Most of this was done in e4ef0f03e6, but
closing popups on window deactivation and orientation changes, were
left in QApplication. This code path was used to close popups when the
user clicks outside of a window, on platforms suchs as wayland, were
QWindow::setMouseGrabEnabled(true) doesn't work properly.

As it turns out QApplication::notify() never calls
QGuiapplication::notify(), which is why I'm duplicating the code from
QApplication into QGuiApplication, instead of simply moving it.

Task-number: QTBUG-121363
Change-Id: I36bebd029a2f8e3ec0cdbab40971682cf948d438
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 914c2ef4fb926c16e8874c9c3691401f7e22ae22)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 18:21:37 +00:00
Edward Welbourne 0b89eb6c6f Remove spurious and unused QUtcTZP::init() with too few arguments
QUtcTimeZonePrivate accommodates the custom time-zone API and, as
such, needs to know all of its details when constructed. The
constructor as a plain UTC-offset constructs the details to match a
custom zone, so that it also has those details initialized. As a
result, this backend never initialized a zone from only its IANA ID,
as all the others do, so does not need an init() with that signature
(which did not adequately initialize the instance anyway).

Change-Id: I462f537c9d48e09f05f91aae0ff6c7a317b421c1
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Magdalena Stojek <magdalena.stojek@qt.io>
(cherry picked from commit 70b680502997678b7c9964acef6569b18b6a65bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 18:21:35 +00:00
Łukasz Matysiak d563ec3fba Introduce QT_COMPILER_SUPPORTS_INT128 in qsystemdetection
c661dbd42d injected `QT_NO_INT128` into
every TU when compiling for VxWorks.
VxWorks uses a custom stdlib implementation that does not support 128bit ints
and at the same time they use an off the shelf Clang that defines
`__SIZEOF_INT128__` which is used to detect if 128b ints are available.
This resulted in Qt falsely assuming that 128b ints are available.

Detect if 128bit are available instead of injecting `QT_NO_INT128` and
define `QT_COMPILER_SUPPORTS_INT128`, use it instead of directly
checking `__SIZEOF_INT128__`.

Task-number: QTBUG-115777
Change-Id: I7531ebe780b4bdd78b42daf8dae0e522a316a88e
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 5a10744bb4afc0c95b1b7bbba8848cf14b0bad00)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 18:21:34 +00:00
Alexandru Croitor bbca3a8e02 CMake: Handle multi-value PURLs and CPEs in attribution files
Qt attribution json files might want to specify more than one PURL or
CPE for a given entry. Change the build system code to detect whether
a JSON PURL or CPE key contains an array of values, and if so, convert
it to a cmake list and use that for further SBOM handling.

As a result, the PURL_QT_VALUE, PURL_3RDPARTY_UPSTREAM_VALUE, and
PURL_MIRROR_VALUE getting an 'S' at the end, aka they are renamed to
PURL_QT_VALUES, PURL_3RDPARTY_UPSTREAM_VALUES, and PURL_MIRROR_VALUES.

Also the attribution key is now called just PURL instead of
UpstreamPURL.

The CPE json attribution key and option name stay the same.

Amends 47fd38be4bce0958fcfce8080d1580c4e3c2a15b
Amends 95b7fe49900904d19fca21876c84f97c2a6ae03d
Amends f7e1123620b623be0c321b54eaba7a1d618a7ce1

Task-number: QTBUG-122899
Change-Id: Ieec919901c3b44df80bc196536f68632a9761d92
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 797ce76ee946245898f9d11fa7e3ffb889e117d7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 18:21:31 +00:00
Edward Welbourne e5c551a5cf QtXml: be systematic about feature dom
All the actual code of the module was subject to #ifndef QT_NO_DOM,
aside from the *_p.h that were only included subject to such #if-ery,
so there's nothing left of the module if the feature is ever disabled,
but be consistent with the module defining a feature that allows that.
Convert #ifndef QT_NO_DOM to #if QT_CONFIG(dom) (and move to outside
the namespace, where nothing was inside without the define), require
feature dom in the *_p.h and test, change CMake config to skip the
test when the feature is disabled (and add a missing SPDX comment),
condition including sources on the feature.

Pick-to: 6.7 6.5
Task-number: QTBUG-122619
Change-Id: Ie2167b6c56d96c7804785e225f3fe02dbc78984c
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit a4c85a5cf19d8919797aba41077bfa8796427f54)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 18:21:29 +00:00
Ivan Solovev 790a52b7e0 Register Qt::TimerId with the meta-object system
By using Q_ENUM_NS macro.

Amends 4bc0834bc1.

Found in 6.8 API review.

Task-number: QTBUG-128144
Change-Id: Icb3b4e76e0c36066d480b1f756c5a9c8aa5cb43f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 6e2705bbc891d5ddd4924815a641830d2a0ccf4b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 17:57:27 +00:00
Julian Greilich b2706531e9 Android: Exclude the QtWindow itself from Accessibilty
Since the QtWindow and its QtEditText are focusable only to hand
over events to other components, the QtWindow itself should not be
focusable by TalkBack, since this leads to an unnecessary nameless A11y-Element
in the A11y tree.

Task-number: QTBUG-126672
Change-Id: I532b9d3e252fbe01da7c953446242b045c57eebe
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
(cherry picked from commit 46cb9027f1ed6c61faec5364b5537ae7ab9e57c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 17:24:19 +00:00
Ivan Solovev 571a4a3efb QDirListing: unexport the class
This is a non-polymorphic class, so we should export only individual
out-of-line methods.
Same for the nested DirEntry class.

Amends c39a0d1e89.

Found in 6.8 API review.

Change-Id: Ifde785d9ece1641351501159963d8cc065d8e140
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 7394f7151404e0649eb59d8fa84eb7061635ee70)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 17:24:15 +00:00
Marc Mutz 6dfb013b62 DRY QT_FOR_EACH_STATIC_CORE_TEMPLATE()
Use the same technique used elsewhere in qmetatype.h to deal with
missing features: define a new macro to either contain the types
controlled by the feature or be empty, and then call that macro from
the larger-scale one.

DRYs the list of types to not repeat QByteArrayList and QStringList.

Amends cdbc76360a.

Change-Id: I767452aa33c1a2404315a0c3cd02f7102b9d6653
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fbc80ee163f16baafcc236b533ea7ccc3376fa2f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 17:24:14 +00:00
David Faure a9e464119a QTableView: implement moving rows by drag-n-drop
This is only available when calling setDragDropOverwriteMode(false)
so this makes no difference in most applications (see implementation
of QAbstractItemView::position).

QTableWidget::dropEvent() was assuming we were dropping onto items
without checking that this was the case, this is fixed here,
and QTableView::dropEvent() is added to handle moving rows,
with very similar code to QListView::dropEvent().

Task-number: QTBUG-13873
Task-number: QTBUG-101475
Change-Id: I96e75da2c0abf6f568edba461735905dee5cb84f
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 8e63cf282cb248ddd7fbc908766091659b3a0b22)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:55 +00:00
Ahmad Samir 679ae93507 QDirListing: fix typo in header guard
Was missing an `R`.

Change-Id: Iefdb373c152c31baf3e6769a5e2814c0d9800e60
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 61a3ca6f635c86b91fe3a2ac481e7de138447523)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:53 +00:00
Marc Mutz 514e244913 qFuzzy(Compare|IsNull)(): mark as noexcept
These all cannot fail, so can and should be noexcept. Most were
already.

Found in API-review.

[ChangeLog][QtCore/QtGui] All qFuzzyCompare() and qFuzzyIsNull()
overloads are now noexcept.

Change-Id: I67a2981ea4af9be0370becf84103822fd766ab5e
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 6a3a28236c6a0c34d37a614ca4e68ccd136d90e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:52 +00:00
Tor Arne Vestbø b86a0cb720 xcb: Sync XCB connection after reparenting window
This is important for the reparenting to take effect even if there
are no other state changes to the window, such as changing its
geometry.

Pick-to: 6.7 6.5 6.2 5.15
Change-Id: I9b39b56d163faf7a9b472cefbb19efdb944cb304
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 92619ce2ec8381aa01647337665e626b84063f59)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:51 +00:00
David Faure d5109e4a88 Implement QTableModel::moveRows
Implemented the virtual method moveRows to allow row movement.
Used it for the case of sorted insertion.

Heavily based on QListModel::moveRows and its unittest.

[ChangeLog][QtWidgets][QTableWidget] Implemented moveRows in model.
When sorting is enabled, setItem() now moves the row to its
sorted position, emitting rowsMoved rather than layoutChanged.

Task-number: QTBUG-69807
Change-Id: I62a150cca4e5b7d982f2359a6d8c248494528cac
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit f951c11586081efea108ea5b6a7028c672e12c2a)
2024-08-29 04:16:49 +00:00
Christian Ehrlicher 517d11d0c5 SQL/PostgreSQL: use PostgreSQL_ROOT in documentation
Instead specifying CMAKE_INCLUDE_PATH/CMAKE_LIBRARY_PATH use
PostgreSQL_ROOT which is suits much better for the usecase.

Change-Id: Iac239d88d4c9c11d5482acacb2bbb1bb034c4365
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit a664a6e225abdd4a62aac57df10e3507fcd2b561)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:48 +00:00
Alexey Edelev 8e0d08d0c6 Add the missing dependency between _copy_fw_sync_headers and _sync_headers
The dependency is specified for the Ninja generator, but is missing for
others, which leads to the invalid order when building with Unix Makefiles
generator for MacOS platform.

Amends 103eca1070

Pick-to: 6.7 6.5
Fixes: QTBUG-127987
Change-Id: I78927ee3fa7b0926f03b0e5eab67983c4d0d3e67
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 2d87bb7d2eb9827899546cca3e59e8174ce04b8c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:46 +00:00
Christian Ehrlicher 60590c1a2b SQL/Oracle: use Oracle_ROOT in documentation
Instead specifying Oracle_INCLUDE_DIR/ORACLE_LIBRARY use Oracle_ROOT
which is suits much better for the usecase.

Change-Id: I8a0858b3ae491212a79ad982eb8e067e6f1b750f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
(cherry picked from commit 5e478ebbcc42471b4c70c10bb513e7343c05933e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:42 +00:00
Marc Mutz 99f8efd0ef QStringTokenizer: clean up Q_STRINGTOKENIZER_USE_SENTINEL
The macro was unconditionally defined since
44a7412795 and, despite being named like
a public Qt macro, never documented, so just remove it.

Also means we can remove the ODR protection from end() and cend() now.

[ChangeLog][Potentially Source-Incompatible Changes] The undocumented
Q_STRINGTOKENIZER_USE_SENTINEL macro was removed. It was
unconditionally defined since Qt 6.0.

Change-Id: I8ba2aeddea79ad89cef8912e9cf34098f2793f1b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 799e16149ce9d34419da9ea35f790412202ce7a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:40 +00:00
Marc Mutz f85f5b35bb qhashfunctions.h: unindent <concepts> include
Qt will at some point require C++20 and then the indented include will
have to be un-indented, anyway, so might was well do it now to have
less work later.

Also sort the <concepts> header in with the other C++ headers.

Amends 52abff8cc1.

Found in API-review.

Change-Id: Ic092d3c0d47e9ecab0492d533b6a10c2a8227e88
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 3ac48281d9971998882612a43cbcf923104ee592)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:37 +00:00
Jøger Hansegård 2f7d52a9ba Update tika-mimetypes.xml from upstream
This patch updates the tika-mimetypes.xml MIME types definition file to
version 5ea8bbf1644a593ed22ee5c7608ba33aff949d5d, which is currently the
latest on main.

The reason for the change is to include audio/aac as an alias for the
deprecated audio/x-aac MIME type, which is useful in QtMultimedia to
determine the file extension for AAC media files.

In addition, the update adds the application/x-java-keystore MIME type,
similar to the one in the old freedesktop.org.xml MIME type definition.

[ChangeLog][Third-Party Code] Updated TIKA MIME types definition file to
add the audio/aac and application/x-java-keystore MIME types.

Pick-to: 6.7 6.5
Change-Id: I14fa331c5c57e4fae8f8b31880dc66d6ca559f62
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 5774aa2560b65a67e72f98cf2f776325b6760950)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:36 +00:00
Marc Mutz abcee9eb99 QStringTokenizer: update docs for a world in which C++17 is required
Remove mentions of pre-C++17 behavior.

Don't recommend against qTokenize() any longer (it's shorter than
"QStringTokenizer") and mention it in the QStringTokenizer class
documentation, too.

Pick-to: 6.7 6.5 6.2
Change-Id: I8cf3310fc9de80db0a89aecfdf695a49d390da47
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit c1fc85df109a4dff57d7615a353bfcc7e172b0c9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:34 +00:00
Christian Ehrlicher 20429da06a SQL/MySQL: use MySQL_ROOT in documentation
Instead specifying CMAKE_INCLUDE_PATH/CMAKE_LIBRARY_PATH use
MySQL_ROOT which is suits much better for the usecase.

Change-Id: Ieb75f80a6eb3a3e7913a7c04ca6511a014fa7e4e
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 0c0b5cbb0d0b43f6be4e54caea89d5764511e94f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-29 04:16:32 +00:00
Marc Mutz 5a9e93630e QXmlStream: actually make the (in)equality operators noexcept
Do not use the getters, as they are not noexcept. While they could
probably be made noexcept, we're too close to release to make a hasty
change there. Directly access the data members instead.

Found in API-review.

Amends cd5dd8b95b.

Change-Id: Ic3a6b0f933956d57d2c3b4ebdd5ad40ec4736fb0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 23784ec9d6eca9b138cd2528389e8150ebc66667)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 23:03:33 +00:00
Marc Mutz 1f129d1589 QXmlString: add a few missing operations
... namely isNull() and op==/!=().

These will be needed for porting comparesEqual() from public getters
to direct data member access, in order to make them earn their
noexcept tagging.

Change-Id: Id8677d39dc581d03adfd3d0d420907ff60c0423a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e0ae91bd5880d1f8ab36d42cff428bb8246f73c2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 23:03:27 +00:00
Marc Mutz 92597843d6 Make from_msecs a QTimer class-static again
It will need to be called from removed_api.cpp once we widen
QTimer::singleShot() from ms to ns.

Don't use the QAbstractEventDispatcher::Duration typedef in qtimer.h
to avoid including the resp. header. Keep the typedef as the return
value on the definition of from_msecs(), though, as a static assertion
that they're identical.

Task-number: QTBUG-128426
Change-Id: Ib59895f4441e92813fe39778bb3836b039fdfbf0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 65a249715941bf6b6ecc980d3f865f367f66522d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 23:03:22 +00:00
Marc Mutz 79dec148a9 QXmlString: add noexcept to size() and operator QStringView()
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>
2024-08-28 23:03:20 +00:00
Marc Mutz ee6b101adf QTimer: port defaultTypeFor() helper from ms to ns resolution
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>
2024-08-28 23:03:16 +00:00
Marc Mutz 3b7f21996e QXmlString: fix ADL swap
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>
2024-08-28 23:03:13 +00:00
Marc Mutz 5d23f03860 Fix position of qtimer.h in removed_api.cpp
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>
2024-08-28 17:40:06 +00:00
Marc Mutz 52f471e23e QNetworkRequest: document the new saturation behavior of transferTimeout()
Change-Id: I1b8b57c76f41e36ad14fff9c52f0c346f83426ed
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 4403b6561b91c7435186116265b6e59e81c7ce03)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-28 17:40:06 +00:00
Marc Mutz b2df824e02 QLocale: mark c_locale Q_CONSTINIT and c_private() noexcept
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>
2024-08-28 17:40:06 +00:00
Mårten Nordheim 1714af1721 QNetworkRequest::transferTimeout: saturate int return value
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>
2024-08-28 17:40:06 +00:00
Tinja Paavoseppä 951864d72a QtActivityBase: Don't finish after library loading fails
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>
2024-08-28 17:40:05 +00:00
Ahmad Samir e1f4f2ef47 String Views: add slice() methods
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>
2024-08-28 17:40:05 +00:00
Tor Arne Vestbø c97e58bb61 Reset QWindow positionPolicy on destroy
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>
2024-08-28 17:40:05 +00:00
Ivan Solovev fe88ab0f5d QtJniTypes::JObject: fix comparison operators
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>
2024-08-28 17:40:05 +00:00
Ivan Solovev d6e8fa64e8 QStorageInfo: actually make the (in)equality operators noexcept
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>
2024-08-28 17:40:05 +00:00
Ivan Solovev 9f06e0b1f8 QEasingCurve: remove incorrect noexcept
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>
2024-08-28 17:40:05 +00:00
Ivan Solovev f2bcf582dd serialization: remove incorrect noexcept on comparison operators [1/2]
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>
2024-08-28 13:07:38 +00:00
Ivan Solovev 67ce24cf30 QtPrivate::ResultIteratorBase: remove incorrect noexcept
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>
2024-08-28 13:07:36 +00:00
Paul Wicking 4cef74fe76 Doc: Remove usage of defunct QDoc command
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>
2024-08-28 11:39:51 +00:00
Ivan Solovev 567dc5c84e QMetaType: remove the incorrect noexcept from comparison operators
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>
2024-08-28 01:13:30 +00:00
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