Commit Graph

66009 Commits (34372af708cc2ed42ff8f533ca4700a2807555d9)

Author SHA1 Message Date
Ivan Solovev 34372af708 QLatin1StringView: consistently use comparison helper macros
Replace all friend relational operators with comparison helper macros.
This allows to enable operator<=>() in C++20 builds.

Use new \compares and \compareswith qdoc commands in the documentation.

Task-number: QTBUG-117661
Change-Id: I0445d7af3c2d692c810e15e83041de2a19f946a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-02 00:12:54 +01:00
Ivan Solovev 3d0eaf863e Add missing QUtf8StringView relational operators
Add QU8SV vs QSV, QU8SV vs QChar, and QU8SV vs char16_t relational
operators.

This allows to get rid of the dummy relational operators in
tst_qstringapisymmetry.

Task-number: QTBUG-117661
Change-Id: If95d7418efd13c505ed0e3bef748b86ff55e623a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-02 00:12:53 +01:00
Ivan Solovev e2e21bcb2d QString: use comparison helper macros - missing string views [3/3]
The comparison with QStringView works as is, there is no need to add
explicit operators.
Add the missing relational operators with QUtf8StringView. Once it
is added, comparison of QString with u8"string literal" becomes
ambiguous, so explicitly add operators for `const char8_t*` as well.
This also makes the comparison with u8 string literals faster,
because it now uses a view instead of constructing a QString.

Adding QUtf8StringView overloads also makes comparison with
`const char *` ambiguous if QT_RESTRICTED_CAST_FROM_ASCII is defined.
To fix that, mark the overload as Q_WEAK_OVERLOAD. Luckily, we can
just use the third Attributes parameter of the macro for that.

Provide more unit-tests to cover the new relational operators.

Task-number: QTBUG-117661
Change-Id: I60d1f4ad7ea607472deeb5c250e62f2bb7019268
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-02 00:12:53 +01:00
Ivan Solovev 42b6fdfb52 QString: use comparison helper macros - comparison with byte arrays [2/3]
Use the comparison helper macros to replace the member relational
operators for comparison with QByteArray and const char *.

As QString and QByteArray are exported, we cannot simply remove the
inline methods, so wrap them into QT_CORE_REMOVED_SINCE.

Add relational operators with QByteArrayView.

Provide more unit-tests for the comparison with the byte array types.

This enables operator<=> for QString vs byte arrays in C++20 builds.

Task-number: QTBUG-117661
Change-Id: I305343e1b6c5d78b10f2976573db4e904ba6b44b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-02 00:12:53 +01:00
Ivan Solovev 755581e2e7 QString: use comparison helper macros - trivial changes [1/3]
Replace the hidden friend relational operators with hidden friend
helper functions and comparison helper macros.

Provide more unit-tests for the updated types.

This enables operator<=> in C++20 builds.

Task-number: QTBUG-117661
Change-Id: I17329cd6422f272a435fc1da241203581eef7fbb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-02 00:12:53 +01:00
Mate Barany 6d08db8666 Handle informational HTTP replies (1xx) for HTTP/2
Make QHttp2ProtocolHandler discard all informational (1xx) replies with
the exception of 101.

According to RFC 9110:

"A client MUST be able to parse one or more 1xx responses received
prior to a final response, even if the client does not expect one.
A user agent MAY ignore unexpected 1xx responses."

Fixes: QTBUG-121755
Change-Id: I8b8d578f23d4fbe28929f8c54b3607bcaf85405f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-03-01 23:57:13 +01:00
Kai Uwe Broulik c89b1bbddc QDBusObjectPath: Add QDebug stream operator
Prints its path.

Change-Id: I9467f9d33b927cf6b6d4692b2e2824001366625c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-01 22:57:13 +00:00
Marc Mutz 735d2d41c3 QString: document isSimpleText() removal
Amends d1f40ea087.

[ChangeLog][QtCore][QString] Removed undocumented internal, yet
public, isSimpleText() member function. If you still use it, you'll
have to write your own version outside of QString.

Pick-to: 6.7
Change-Id: Iff8e4961542384890df42ef6b5f11106f2c606ec
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-03-01 22:08:57 +01:00
Allan Sandfeld Jensen 367e6ff0b2 Fix previewing a preview on reentrance
Make the print preview more tolerant of reentrance by avoiding
previewing itself.

Change-Id: Ia4774cb51bdda7d311414c4e2f9c2bfbed4f187f
Pick-to: 6.7 6.6 6.5
Fixes: QTBUG-122749
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2024-03-01 21:16:56 +01:00
Santhosh Kumar c606739ad1 Update the default behavior of items with layout
The earlier patch 4ae537e67c had default
behavior as opt-out for size policy of items within the layout. This
can cause a lot more UI regressions than anticipated and, so make it as
opt-in (Qt::AA_QtQuickUseDefaultSizePolicy). This means that the user
needs to explicitly set this attribute to utilize the default size
policy of quick items.

Amends patch 4ae537e67c

Task-number: QTBUG-117597
Pick-to: 6.7
Change-Id: Ibdb3ea9897c19792a110cbb15834b27383b9103e
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2024-03-01 20:41:30 +01:00
Juha Vuolle dad2a60128 Mark QNetworkRequestFactory as TP
The documentation already marks the class as preliminary, but mark
also with the new macro for that purpose.

Amends: b4c90582a2

Pick-to: 6.7
Change-Id: Idcf022283bff04f4c4ee260180d3f5cfd0e80034
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-01 21:41:30 +02:00
Juha Vuolle ab04dcca88 Remove unsused includes in QRestReply
The removed includes were needed when there were separate methods
for returning QJsonArray and QJsonObject

Pick-to: 6.7
Change-Id: I5f08c4afd5487c5ca191ee813a3d94c4ae3b0f06
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-03-01 21:41:30 +02:00
Tor Arne Vestbø f451b01791 Add QWidgetPrivate::rhi() helper method
For accessing the RHI managed by the widget compositing machinery.

Pick-to: 6.7 6.6 6.5
Change-Id: Ia3c1227cc2d9cfebe95611cad3dbcd7aa6f6f8c7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-01 20:41:30 +01:00
Tor Arne Vestbø b571634172 Add QWidgetPrivate::closestParentWidgetWithWindowHandle helper method
In contrast to nativeParentWidget(), we return the closest widget with a
QWindow, even if this window has not been created yet.

Pick-to: 6.7 6.6 6.5
Change-Id: Icac46297a6052a7a5698d752d4aa871bd5c2bdd8
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-01 20:41:29 +01:00
Tor Arne Vestbø f517e85e90 Remove QWindowPrivate::compositing
It was added for Android in a4f50269f8,
for the case of QSurface::RasterGLSurface, but since 6.4 we no longer
use QSurface::RasterGLSurface for composition. And the Android usage
was removed in 2020ce5fd2.

Pick-to: 6.7 6.6 6.5
Change-Id: I8dafe959c54e09b3a974253e15d184365141d559
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-01 20:41:29 +01:00
Tor Arne Vestbø dc5a29b324 windows: Remove workaround for delayed OpenGL initialization
We no longer use QSurface::RasterGLSurface for composition, so the window
will already be QSurface::OpenGLSurface during WindowCreationData::initialize.

Pick-to: 6.7 6.6 6.5
Change-Id: I9b5ea0245ddf4a19d165bde9ad6fd48a98bfca4f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-03-01 20:41:29 +01:00
Edward Welbourne edc3feb07b Clean up conditioning on use of MS backend for timezones
CONDITION can be split across lines, so doen't need to overflow our
usual right margin and can be more readable. WIN32 in fact implies NOT
ANDROID AND NOT APPLE, so don't bother repeating those.

Change-Id: I03b649d4588f7f84b08b41028dd08941100b749e
Reviewed-by:  Alexey Edelev <alexey.edelev@qt.io>
2024-03-01 20:41:29 +01:00
Edward Welbourne 399a7f07e6 Add a "See also" to link a comment to a Jira ticket
Task-number: QTBUG-112006
Change-Id: Id5d09b8e73d9b10c8a3c857c410e3811711e70f8
Reviewed-by: Mate Barany <mate.barany@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
2024-03-01 20:41:29 +01:00
Paul Olav Tvete 997fd3b88e QTextEngine: Protect against integer overflow with huge texts
QPlainTextEdit would crash when adding a string of 136 348 169
characters, due to the integer overflow checks being done with int
variables.

Perform intermediate calculations and size checks with qsizetype
instead of int. This commit contains a slight modification of the fix
contributed by Adam Clarke in the bug report. Note that the size check
casts to size_t to cover the 32-bit case where qsizetype is qint32.

Fixes: QTBUG-119611
Pick-to: 6.7
Change-Id: I1cf7e1bc4c35276862f37aa6d01f37075fa11635
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2024-03-01 18:00:33 +00:00
Volker Hilsheimer 7bde3f4c4c Fix spelling of FFmpeg in (end-)user-visible string of windeployqt
It's two capital "FF", lowercase "mpeg".

Pick-to: 6.7 6.6 6.5
Change-Id: I4eca719fa6ce0133e3ddb6163c81e24493b378e3
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
2024-03-01 19:00:33 +01:00
Volker Hilsheimer 83f73df3e0 QTextEdit::event: refactor into switch statement
Replace if/else snake, made more complex by handling of QT_NO_*
configurations. Move the unconditional cases to the top, which also
fixes the handling of ShortcutOverride and ToolTip events when Qt was
built with QT_NO_CONTEXTMENU.

Pick-to: 6.7
Change-Id: I1e2cc2c39e3cef9fe29a71e48595756cff0d2949
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-03-01 19:00:33 +01:00
Mike Chen 402cb510e1 Fix QTextEdit/QPlanTextEdit palette not updated
QPlainTextEdit/QTextEdit, etc. never received ActivationChange
when used as child widget. Set palette to control on
WindowActivate/WindowDeactivate

Pick-to: 6.7 6.6 6.5
Change-Id: Iae75d9dcfba0c6171c556626551b37d4549006c7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-01 19:00:32 +01:00
Wladimir Leuschner 172422fcee Increase padding for LineEdit controls in QWindows11Style
Pick-to: 6.7
Change-Id: Ibf8e43160d7ae0aff04040f0e2bcf5bfbda52e1d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2024-03-01 18:00:32 +00:00
Wladimir Leuschner 1a55926196 QWindows11Style: Fix transparency for overlapping ItemView editing
Fixes: QTBUG-120254
Pick-to: 6.7
Change-Id: Iabaee612f5a0613cbbcafe566b4a14d01cefa47c
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2024-03-01 16:21:07 +01:00
Ivan Solovev 380c01bac5 Bring back QASV::detects_US_ASCII_at_compile_time
Even though undocumented, it's public API, doesn't hurt to carry
along, and improves compiler coverage in the test, so let's not remove
it.

Found in 6.7 API review

Amends 95e6fac0a5.

Pick-to: 6.7
Change-Id: Ia935036a69e0e678f22ac86b48a2c1c5e8c46733
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2024-03-01 16:01:45 +01:00
Shawn Rutledge 60aeeb0e92 QTextHtmlImporter: don't forget to appendBlock after block tag closed
If we see a closing tag that really demands a new block after it,
like </ul>, that needs to be done even if some ignorable whitespace
and "inline" tags come after it. Don't get distracted by those.

Also add a comment in QTextDocument::setHtml() to remind the reader that
HTML parsing is a two-pass algorithm.

Pick-to: 6.6 6.7
Fixes: QTBUG-81662
Change-Id: If723c9d3c211a684725055a06bcf87be4e38923a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2024-03-01 08:01:45 -07:00
Aurélien Brooke 803abb6323 rhi: add support for short and ushort vertex attributes
[ChangeLog][RHI] Add support for short and ushort vertex attributes

Change-Id: I6111a02d442bbad2ec9667ac0336107dd3ab7b62
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2024-03-01 16:01:45 +01:00
Marc Mutz f70e113b2e QRestReply: use qt_ptr_swap instead of std::swap
qt_ptr_swap is our swap compile-time optimizer. It's faster because it
hardcodes noexcept(true) and std::swap() must calculate it.

Amends 9ba5c7ff6a.

Pick-to: 6.7
Change-Id: I1b5a326276bd30638ac9b6dcf597abb5e53ada00
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-01 08:45:09 +01:00
Marc Mutz f9653c4ff2 QNetworkInformation: document a potential SiC
Amends 1b429d6be4.

[ChangeLog][Potentially Source-Incompatible Changes][QtNetwork] The
enums in QNetworkInformation must now be scoped when used from
QML. The scope is no longer optional. Adding the scope is a
backwards-compatible fix.

Pick-to: 6.7
Change-Id: I0855c0c2edd569f486b283b4671cdc3177cb7d3b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2024-03-01 08:45:02 +01:00
Marc Mutz f9474364ee QByteArrayView: make conversion to string_view constexpr
Both QByteArrayView and std::string_view are Literal Types, so the
conversion between them should be constexpr.

Amends 96d67da420.

Found in API-review.

Pick-to: 6.7
Change-Id: Ic513ce32aa2a743ca890dc05a683a62c0f3a7d50
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-03-01 09:41:11 +02:00
Thiago Macieira aadf1d447c Split the siphash algorithm into init, main loop, and finalize
This is supposed to be a no-op change: I simply split the three phases
of the siphash algorithm into separate functions. This will be needed
for hashing of QLatin1StringView equal to QString's.

Drive-by slight modernization of the code too and made the 32-bit code
be compiled (but not used) on 64-bit, so we don't accidentally let it
bit-rot.

Change-Id: I664b9f014ffc48cbb49bfffd17b03d10c8bd55b2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2024-02-29 19:22:41 -08:00
Tim Blechmann c26994ff15 Fix -Wimplicit-fallthrough for clang
Clang's `-Wimplicit-fallthrough` warnings are a little stricter than
gcc's interpretation:

switch (i) {
case 0:
    foo();
case 4:
    break;
}

While gcc accepts the implicit fallthrough, if the following statement
is a trivial `break`, clang will warn about it.

Pick-to: 6.7
Change-Id: I38e0817f1bc034fbb552aeac21de1516edcbcbb0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-01 03:04:06 +00:00
Marc Mutz ddaf764282 QJniObject: use ctor delegation instead of construct+assign
The old code used unintialized construction followed by (move)
assignment to construct a QJniObject that requires a LocalFrame
object. That is two constructors and therefore one more than we need
(and need to destroy in inline code again).

Everything can be solved with another level of indirection.™

Since the LocalFrame needs to remain alive for the duration of
argument evaluation, the usual comma operator trick won't work. But we
can add a private helper ctor that takes the LocalFrame as an
additional argument to inject the object with the correct lifetime
into the ctor delegation chain.

Put the new argument in the front, to avoid clashes with the primary
contructor's trailing universal references, which might be a better
match than the new overload had we added the argument at the end. The
hope is that the compiler will avoid the ensuing register shuffling by
inlining the outer two constructor calls.

This brings the number of QJniObjects constructed down to one, as it
should be. We might also be able to remove the Uninitialized ctor
again.

Found in API-review.

Amends 62cb5589b3.

Pick-to: 6.7
Change-Id: I326187e54fd0705a1bbedb2d51d94a46b108a3c8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-03-01 01:31:07 +00:00
Wladimir Leuschner 41854cfaac QWindows11Style: Revert Windows global palette changes
Revert Windows global palette changes and set the QPalette for
QWindows11Style in QWindows11Style::polish

Fixes: QTBUG-120571
Pick-to: 6.7
Change-Id: Iad4eb699c2dbfed38a917e6c9bc378c4262dc66e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-29 22:15:24 +01:00
Axel Spoerl 2d1db53f9c QApplicationPrivate::dispatchEnterLeave: remove dead code
Remove #ifdef 0 section added in 2011.

Task-number: QTBUG-121478
Pick-to: 6.7
Change-Id: I2154cd5616e2695af89cf4fc5ec9d1b3ae5572d5
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-02-29 22:14:40 +01:00
Axel Spoerl cd2a3e970a Refactor and fix QMainWindow::tabifiedDockWidgets()
The method traversed QDockAreaLayoutInfo::item_list, to identify
dock widgets tabbed with the QDockWidget argument in a tab bar
It relied on bool QDockAreLayoutInfo::tabbed, which is set to true, when
a QMainWindowTabBar is to be added to a QDockAreaLayoutInfo. This flag
isn't cleared, when the second last dock widget is removed from the
tab bar. It can't be replaced by QMainWindowLayout::isDockWidgetTabbed,
because the flag also represents intermediate states, where e.g. a dock
widget is hovered over, prepares to become a floating tab and then rolls
back, because hovering doesn't result in a drop. In that case, tabbed
must become true, which the dock widget isn't actually tabbed.

Furthermore, the way to traverse item_list didn't find dock widgets
in a floating tab. In that case, tabifiedDockWidgets() wrongly returned
an empty list.

To fix both issues, refactor QMainWindow::tabifiedDockWidgets() to read
the list of dock widgets directly from the QMainWindowTabBar.

Add tests in tst_QDockWidget::floatingTabs() and
updateTabBarOnVisibilityChanged()

Fixes: QTBUG-122001
Pick-to: 6.7 6.6 6.5
Change-Id: Ia9eb3711be642101261f34ee447521cc6accc20c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2024-02-29 21:14:40 +00:00
Shawn Rutledge 08dde3ac0c Add tst_QTextMarkdownImporter::paragraphs
Test how QTextMarkdownImporter reacts to paragraphs ending with
premature LFs (created by shift-Enter in QTextEdit, for example) and
paragraphs broken by Unicode LineSeparator characters. It turns out that
the u2028's are retained and have the desired effect for rendering.
Currently we don't distinguish auto-wrapped paragraphs from paragraphs
that the user broke manually in QTextEdit (because we use a plain
newline for both).

Task-number: QTBUG-121475
Change-Id: Icaca4dba8be03b37ad6faa40ce1f9dfceadc48a8
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Oliver Eftevaag <oliver.eftevaag@qt.io>
2024-02-29 13:49:27 -07:00
Ahmad Samir 61c9b8bb28 QDirListing: minor code cleanup
Change-Id: I37144958c67dd116972e2822868e29684c406757
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-29 21:30:21 +02:00
Yansheng Zhu 70096b2bbd Implement Qt::ImEnabled by isEnabled() and isReadOnly()
Previously, querying Qt::ImEnabled only returned the value of
isEnabling(), which is incorrect for edit widgets with read-only
properties set, as Qt::ImEnabled indicates whether text can be *input*
through the input method, which results in the IM being able to insert
text into read-only edit widgets.

The fixed version uses both isEnabling() and isReadOnly() values to
determine whether input methods need to be enabled. For some platforms
(like iOS and Android) that rely on IM to select text, a check for
ImReadOnly has been added to their QPA plugins to enable handles on
read-only input boxes.

At the same time, the imEnabledNotImplemented function in the test file
tst_qwidget was modified, since ImEnabling should give a _false_ value
when a lineedit is read-only.

Task-number: QTBUG-105009
Task-number: QTBUG-110838
Task-number: QTBUG-119182
Pick-to: 6.7 6.6 6.5
Change-Id: Ia2abcdb3200826d567f90447d4f8b71d0ef1fbf0
Reviewed-by: Yansheng Zhu <670429759@qq.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2024-03-01 02:22:06 +08:00
Alexey Edelev 356b0aee0e Disable depfile support for the external projects when building for Android
androiddeployqt rules that support depfiles cause creation of rules that
interfere each other and cause the test build flakiness in CI.
This disables depfile support for ABI-specific external project until the
rootcase is found.

Task-number: QTBUG-122838
Pick-to: 6.5 6.6 6.7
Change-Id: I12e85f43494331c943c9b516d9494593facf9180
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2024-02-29 16:30:31 +01:00
Topi Reinio a4ce469a27 Doc: qmake manual: Fix links to 'Qt Widgets Designer'
'Qt Designer', and related documentation links, were renamed to
'Qt Widgets Designer'.

Amends 8aceccc7eb.

Task-number: QTBUG-122253
Change-Id: I38d8b221716de59fe8faefbd4928eb1007e19b81
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2024-02-29 14:35:58 +00:00
Kai Köhne b74f814ae2 Doc: Further replace 'Qt Designer' with 'Qt Widgets Designer'
Use \QD macro wherever possible.

Amends 8aceccc7eb

Task-number: QTBUG-122253
Change-Id: I276dabd40fb81486f6380fd90cf9968990932a24
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-02-29 15:35:58 +01:00
Kai Köhne d5deca54cb Remove dist/README
Remove another README that wasn't updated since Qt 5 times.

Change-Id: I833ce774e7ec67b261591558f25ce854619d69c4
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2024-02-29 15:35:57 +01:00
Ahmad Samir 5e9de279ac tst_bench_qdiriterator: add benchmark for QDirListing
Make the benchmarks more comparable:
- Store the QDir::Filters in one central var, this way it's the same in
  all the call sites

- Add a `bool forceStat`, when true force calling stat(), either
  explicitly in posix_helper(), or implicitly in Qt classes by e.g.
  calling a QFileInfo method that would have to call system stat()
  internally. Otherwise benchmarking readdir()/dirent showed bigger
  times, which was mostly due to the explicit stat() calls, whereas we
  can use dirent::d_type (on the platforms where it's available)

Drive by change: for std::filesystem::recursive_directory_iterator, set
skip_permission_denied option and use the non-throwing constructor.

Change-Id: Icf138a5dc41d32741c1be611d664b01008b2f3fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-29 16:35:57 +02:00
Ahmad Samir c39a0d1e89 Add QDirListing, an STL-style iterator for directory entries
This class offers a forward-only const_iterator, that matches the system
low-level functions' logic (e.g. readdir()/dirstream logic). This
iterator is a std::input_iterator_tag.

QDirIterator uses Java-style iterators that have a couple of issues:
- They don't fit the logic of the underlying native system functions
  (readdir()/__dirstream and co.), there is no way to know if there is a
  next entry except by advancing the iterator (calling readdir()) first
- As a consequence of the above, two QFileInfo objects, current and next,
  had to be used to fit that paradigm; and the code always
  iterated/stat'ed an extra entry past the one we want, e.g. when
  filtering

The next step is porting QAbstractFileEngineIterator and its subclasses
to be like QFileSystemIterator, i.e. replace hasNext()/next() with a `bool
advance()` virtual method. This is easier to reason about than the
Java-style iterators, and is more in-line with the new class.

Discussed-on: https://lists.qt-project.org/pipermail/development/2023-December/044745.html
Change-Id: I8e696cefdca18d8c78f803efdb83a73dd43eb720
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-29 16:35:57 +02:00
Ahmad Samir 78c33a7741 Copy QDirIterator.{cpp,h} to QDirListing.{cpp,h}
To make it easier to follow the history in git.

Change-Id: I094056c1ec130aeef77aa2d20289ab766bc25083
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-29 16:35:57 +02:00
Marc Mutz 6c424dbcb0 QCborStreamReader: don't assume that clear() results in isNull()
That QString and QByteArray::clear() shed all capacity() is a
historical artifact we will fix at some point. Don't add more code
that assumes a clear()ed string isNull().

Amends 8af346c1f6.
Amends 1d9137e13f.

Task-number: QTBUG-31283
Task-number: QTBUG-60745
Pick-to: 6.7
Change-Id: Ib0d929325088d3e8e119fee3eafa964a783dc8e9
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
2024-02-29 15:35:57 +01:00
Ivan Solovev ff034ebbfa QCborStreamReader: rename toType(Type&) -> appendToType(Type&)
Rename the toType() overloads taking an out-parameter to appendToType(),
because that gives a better understanding of the usecase.

Found in 6.7 API review

Amends 8af346c1f6 and
1d9137e13f.

Pick-to: 6.7
Change-Id: Ic1a462e9507123a59e6086bfb48b8b61ab79abb8
Reviewed-by: Juha Vuolle <juha.vuolle@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-29 15:35:57 +01:00
Tor Arne Vestbø f6d09a68f6 QMessageBox: Forward helper checkbox state via lambda
There may not be a checkbox when the helper is initialized, and
we want to support the case of a checkbox being added at a later
stage.

Regression from e5c40ec5c1.

Pick-to: 6.7
Change-Id: I397c3b3a101b249aab17804bd90085cfd4ab7dbb
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
2024-02-29 15:35:57 +01:00
Mårten Nordheim 788ce26882 tst_qudpsocket: add helper exe to dependencies
Pick-to: 6.7 6.6 6.5
Change-Id: I2bea493c5273175746d502e62d1044eca20ece04
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2024-02-29 14:56:11 +01:00