Commit Graph

64290 Commits

Author SHA1 Message Date
Eirik Aavitsland
2ac50bb0f5 QPrinter: allow any margins when setting a fullpage QPageLayout
By default, QPrinter::setPageLayout correctly rejects a layout that
specifies margins outside the printable area. However, when the layout
specifies fullpage mode, that check should be skipped, since then one
should be allowed to target the unprintable area, by definition.

Fixes: QTBUG-118580
Pick-to: 6.6 6.5
Change-Id: I8bd93d11aefee0344725ac51c2490d029657f483
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-11-09 16:52:45 +00:00
Jarek Kobus
52eae99b51 QtConcurrent::run() test: Add tests taking static function
Change-Id: I75d862a756d0543d8925459b3871abb979ffd481
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-09 16:52:44 +00:00
Allan Sandfeld Jensen
6532dc5d37 Fix multiple threads accessing same byte
We can not thread mono image formats as the bit access isn't atomic.

Pick-to: 6.6 6.5
Fixes: QTBUG-117494
Change-Id: Ica8e08fc3da73983f6b4da2a133f5e715fd0d787
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2023-11-09 16:52:44 +00:00
Friedemann Kleint
78512135c8 Windows QPA: Fix wheel events when using -platform windows:reverse
Wheel events in WM_POINTER messages use global coordinates.
Move the code doing the RTL correction into the local coordinates branch.

Fixes: QTBUG-117499
Task-number: QTBUG-28463
Pick-to: 6.6 6.5
Change-Id: I10e965da9e9660985eaa2681fcf780b5388299a2
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Timothée Keller <timothee.keller@qt.io>
2023-11-09 15:59:41 +01:00
Axel Spoerl
c93ab8c2a0 QDockWidget: Remove "group" bool trap
The unplug() and startDrag() functions of QMainWindowLayout and
QDockWidget used a boolean argument specifying whether a single dock
widget or a group of dock widgets should be unplugged. The argument
defaulted to true.

That has lead to inconsistent unplug operations, broken item_lists and
crashes, especially when the methods were called without an argument.

To improve code readability, replace bool trap with a meaningful
enum. Remove default arguments, in order to force explicit calls.

This patch does not change behavior, it is just carved out to
facilitate reviews.

Task-number: QTBUG-118578
Task-number: QTBUG-118579
Pick-to: 6.6 6.5
Change-Id: I50341b055f0bb76c2797b2fb1126a10de1fee7dd
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-09 14:59:41 +00:00
Axel Spoerl
c02f8b9d4d Fully export QDockWidget debug operator
Amends bbeff2a335.

Task-number: QTBUG-118578
Task-number: QTBUG-118579
Found-by: Friedemann Kleint <friedemann.kleint@qt.io>
Pick-to: 6.6
Change-Id: I60d8d11a82ff5de8b9641c86b824969fc9a34b91
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-11-09 13:09:55 +01:00
Assam Boudjelthia
b5d615f964 Android: remove redundant manifest android:label tag for <activity>
This is also highlighted by Android Studio Manifest editor.

Change-Id: If159405b0fceeb955e26f3916dd0e96b6ca76003
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-09 12:09:55 +00:00
Christian Ehrlicher
c63a21ae5c SQLite: Update SQLite to v3.44.0
[ChangeLog][Third-Party Code] Updated SQLite to v3.44.0

Pick-to: 5.15 6.2 6.5 6.6
Change-Id: Ibdf8a6e0baf3d2b1bf0f9ffb48e908e2691b6a8d
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2023-11-09 13:09:55 +01:00
Mårten Nordheim
26ded9dedf tst_QDockWidget: use local context for timer
If we use 'this' as context it might still try to invoke
the timer after we have left the function, leading to
stack-use-after-return.

To avoid doing an in-depth dive if it's okay to use mainWindow as the
context or not, I just added a new local QObject.

Amends 9ff40b59da

Pick-to: 6.6 6.5
Change-Id: I2c3bdc1eb06731d9c38979610303876c2748fb73
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-09 13:09:55 +01:00
Lu YaNing
c524ca342b QXkbCommon: Use isKeypad() to replace duplicate logic
This amends 298c950912 .

Pick-to: 6.6 6.5
Change-Id: I44696464817d6d3f6b1b3a7d005334805fb1cc38
Reviewed-by: Liang Qi <liang.qi@qt.io>
2023-11-09 08:18:04 +00:00
Sérgio Martins
e6a0b6b3c9 Add .cache/ to .gitignore
It's generated by clangd, when used for example from vscode.

Pick-to: 6.6
Change-Id: Iac65face9634c869eaf94881edff82471a33742a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-09 02:42:40 +00:00
Thiago Macieira
8739963c81 QBitArray: fix GCC 13 warnings by improving code
GCC 13 has been complaining that QBitArray could be accessing past the
end of an array (specifically, the 1-element array QByteArray::_empty).
That's caused by the 'QByteArray::data() const' being:

 #if QT5_NULL_STRINGS == 1
     return d.data() ? d.data() : &_empty;
 #else
     return d.data();
 #endif

A way to avoid this is to use operator[], which doesn't attempt to hide
null pointers (it has an assertion).

This is accomplished by writing nicer, more readable code, which is a
nice benefit.

Fixes: QTBUG-118631
Pick-to: 6.6
Change-Id: I85b3fc2dd45c4693be13fffd179579615a6ac98d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-11-08 12:48:13 -08:00
Assam Boudjelthia
5b5f4344da Android: move referral global field to local variable in QtActivityBase
Keep the variable where it belongs, it's not used anywhere else.

Task-number: QTBUG-115017
Change-Id: Ia421eb0cd3f57be3601754f1df11e64f0267fa5d
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-08 19:40:18 +02:00
Assam Boudjelthia
4265245506 Android: fix a11y method name notifyLocationChange
Amends 0f3dbd6dc7.

JNI was calling notifyLocationChange(I)V method but it doesn't exist,
instead it was named notifyAccessibilityLocationChange(I)V.

Task-number: QTBUG-118077
Change-Id: Icc29d4aad97e730af7165d5e057d228bee9c8976
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-08 19:40:18 +02:00
Jan Grulich
63fa92f2ef QCryptographicHash: fallback to non-OpenSSL implementation for Keccak
Current versions of OpenSSL 3 don't support Keccak hashes as these are
going to be introduced with OpenSSL 3.2 so we should rather fallback to
the non-OpenSSL implementation instead of using SHA3.

Fixes: QTBUG-118814
Pick-to: 6.5 6.6
Change-Id: Iedeb81cd76d43d920fc10e1efdac261bc12a394c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-11-08 18:40:14 +01:00
Piotr Wierciński
d544c0ff58 wasm tests: Fix and clean manual Selenium test
Remove obsolete parent_window_limits_moves_of_children test of moving
child window in parent. Child windows no longer have decorations,
therefore they cannot be dragged by a title bar.
Fix child_window_activation test, which now uses correct coordinates
to probe for stacked windows.

Change-Id: If5ddd8d4486673a961572de7c57df72c3cea9350
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2023-11-08 18:24:18 +01:00
Jøger Hansegård
70404a2773 Prevent oversized QToolButton menu from moving to primary screen
The QMenu pop-up used with a QToolButton could unexpectedly move to the
primary screen if it was too big to fit on the owning widget's screen.

The cause of the issue is that QMenu is a top-level window, and can not
infer its screen from any parents. Its positioning is therefore done
using heuristics in QToolButton. These heuristics attempt to calculate a
best guess point relative to the screen that contains the QToolButton.
If these heuristics result in a point that is outside all screens, the
QMenu's own screen takes precedence, and this is always the primary
screen. This way, the QMenu ends up at the calculated position, but
relative to the wrong screen.

This patch works around this issue by ensuring that the first estimate
for the pop-up position is always within the same screen as the
QToolButton. The danger with this workaround is that the menu may end up
in an inconvenient location. This does, however, seem to be handled by
subsequent adjustments in QMenuPrivate::popup.

Fixes: QTBUG-118695
Pick-to: 6.6 6.5
Change-Id: Ibb4a1c82e827c57bbb0798a6c6f5eecb6d639c62
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2023-11-08 18:24:18 +01:00
Jonas Karlsson
a8df174369 QHeaderView: relayout on resetDefaultSectionSize
We now call setDefaultSectionSize with the new default section size.
This clamps the value to min/max section size and it will resize
affected sections.

Pick-to: 6.5 6.6
Fixes: QTBUG-116013
Change-Id: I39849aca8d0672629ce0b3ca244038c27e045d4b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-08 18:24:17 +01:00
Wladimir Leuschner
7e8ae9cf12 Use Desktop Handle in case of no valid app HWND for QPrintDialog
The call Win32 API PrintDlgEx needs in the PRINTDLGEX struct a valid
window handle for hwndOwner to show up. In case there is no window
created, as seen in the example, the call to PrintDlgEx fails with
COM error code E_HANDLE. Using the Desktop HWND, in case of no valid
app HWND creates a valid call to PrintDlgEx with showing up the dialog.

Pick-to: 6.6
Fixes: QTBUG-118899
Change-Id: Ie7009c8e6e8285a0b6312e310b3d065c532f9e17
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2023-11-08 18:24:17 +01:00
Dimitrios Apostolou
19aa21b595 CTest should write a JUnit XML test summary
This feature is to be used when testing Qt in Coin (our continuous
integration platform). The command line option --output-junit is
supported in CMake 3.21 or greater. However we have one particular
configuration that tests with CMake 3.16, so we exclude that one.

We have already configured the individual tests to print detailed
results in their own XML files, using QTest's functionality. But then,
when a qt test process crashes, it leaves behind a half-baked XML
file, or no file at all.

CTest on the contrary knows nothing about the internals of a Qt test,
and only cares about the process exit code. Even if a test crashes, it
catches that and reports it as a failure.

We enable this functionality here to use in addition to what QTest's
XML files provide, in order to collect more complete information on
test results.

Pick-to: 6.6 6.5
Task-number: QTQAINFRA-5146
Change-Id: I226203f93413689f5767a4d01ea1852b453ebf31
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Toni Saario <toni.saario@qt.io>
2023-11-08 18:24:17 +01:00
Timur Pocheptsov
3159b337f0 Openssl V3: try to work around the lack of SHLIB_VERSION_NUMBER
It's no more defined in opensslv.h, try to use OPENSSL_SHLIB_VERSION
instead.

Pick-to: 6.6 6.5
Fixes: QTBUG-116295
Change-Id: Ie465f4147e0ec95897bd8d35f71241884bf64b4e
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-11-08 18:24:17 +01:00
Friedemann Kleint
01d55f0203 Windows QPA: Emit QGuiApplication::primaryScreenChanged()
Patch as contributed.

Pick-to: 6.6 6.5
Fixes: QTBUG-93368
Change-Id: I8cc884e64e84128b125415e78e3a34245ae4e626
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
2023-11-08 18:21:30 +01:00
Toni Saario
7eb0cc2b4d Remove downstream config
It is outdated and it was discussed that it would be removed in favor
of other options.

Change-Id: If2468c84d8ca8197587577ae3d72aeb96c822c5f
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
2023-11-08 20:21:30 +03:00
Ivan Solovev
e85a3cde2f QSharedMemory: fix attach() -> create() for non-legacy SystemV mode
The problem with non-legacy mode is that the backend uses the same
filename for the system semaphore file and for the shared memory file.

What happens is that when we try to call attach(), a semaphore is
created. Later in attach() we set unix_key, because ftok() returns
a valid handle (it uses the file which was created for semaphore).
After that, an attempt to actually attach to a shared memory fails, but
no clean-up is done.
So, a later call to create() sees that unix_key is already valid, but
it cannot properly clean it, because it does not actually refer to
any shared memory.

Fix it by cleaning up unix_key and nativeKeyFile if shmget() call in
attach() fails.

Pick-to: 6.6
Change-Id: Ibccc3ac307d8b2e07e1b9b24b55f97a859a03131
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-08 15:56:54 +01:00
Laszlo Agocs
7c3779006d tst_qrhi: Exercise a readonly storage buffer in the simple test
...not only in the tessellation-related ones (that are skipped
with D3D).

The checked-in .qsb file is generated with a patched shadertools
that fixes a bug regarding readonly storage buffers and HLSL.

Change-Id: Iafbad4e81875d7b4f877435b9b1e6078019d52ac
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-11-08 16:15:18 +02:00
Laszlo Agocs
92167f0119 rhi: Add a flag to suppress D3D11 smoke test warnings
Applicable to D3D11 only, although the flag is general enough that
other backends could use it if it made sense for them.

This allows Qt Quick to state that warnings about QRhi::create()
failures that lead to retrying with a different set of flags
(PreferSoftwareRenderer to get to use the WARP software rasterizer)
should be suppressed and turned to regular categorized debug prints.

Other users, e.g. an application directly working with QRhi may not
want this. A create() failure must be complemented by an unconditional
qWarning since normally that is pretty serious error. Hence the opt-in
flag.

Task-number: QTBUG-117926
Change-Id: I808bd1670b631e2068b566ab08589e1783f62ca5
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-11-08 14:15:18 +00:00
Axel Spoerl
bbeff2a335 Extend qDebug functionality for QDockWidget
Add features and floating flag to QDockWidget debugging.
Debug dockwidget parents of a group window.

Task-number: QTBUG-118578
Task-number: QTBUG-118579
Pick-to: 6.6
Change-Id: If2a6caacf5d02f9018c2a3073fdbc1de39bce1ee
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Keith Kyzivat <keith.kyzivat@qt.io>
2023-11-08 15:15:18 +01:00
Samuli Piippo
f0b2c5f21c tslib: generate event with correct buttons and event type
Tslib doesn't give button and movements events separately, so send
the first event with pressure as MouseButtonPress, subsequent events
as MouseMove and event without pressure as MouseButtonRelease.

Pick-to: 6.6 6.5 6.2
Fixes: QTBUG-111952
Fixes: QTBUG-113307
Change-Id: I7ed6e37936887e11affb254d2fca74c79b6a43b9
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-11-08 13:40:44 +02:00
Christian Ehrlicher
5a5c96c65d Add QPixmapIconEngine::isNull()
Reimplement the virtual function QIconEngine::isNull() for
QPixmapIconEngine. This lets QIcon::isNull() return true when no pixmaps
are loaded during QIcon::addFile() e.g. due to a wrong filename.

Pick-to: 6.6 6.5
Fixes: QTBUG-118667
Change-Id: I29f2c492e55b60638507fa398ef7af76f4e9ff48
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2023-11-08 11:11:48 +01:00
Christian Ehrlicher
a5a925bf2e QWidgetWindow: pass QPointF to QMouseEvent
QWidgetWindow::handleMouseEvent() passed a QPoint to QMouseEvent which
might result in a wrong result on high-dpi displays. Since the incoming
event has a correct QPointF coordinate, use this for the QMouseEvent

Pick-to: 6.6
Fixes: QTBUG-106262
Change-Id: Idbfdab19220cb06aa0a28eef4e6ab4cab1035d97
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-11-08 11:11:48 +01:00
Christian Ehrlicher
90822833f3 QCheckBox: Don't emit checkStateChanged when nothing changed
QCheckBox::checkStateChanged() was emitted with msvc even though the
check state was not changed due to a faulty comparison.
Amends: 37b47ebf94

Pick-to: 6.6
Fixes: QTBUG-118716
Task-number: QTBUG-104688
Change-Id: Iafeabeb9214f6c7510ea4ed87fabb7dc0ba175a6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2023-11-08 11:11:48 +01:00
Alexey Edelev
c8c8299a63 Re-enable LTO for gcc versions >= 10
Assume the related GCC version is fixed.

Fixes: QTBUG-118851
Change-Id: I0160440c5e8a0341ec5bc2ab9ea6fed9a2325bba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-08 08:04:07 +01:00
Gleb Popov
295e56201d Implement QDBusAbstractInterface::setInteractiveAuthorizationAllowed
Task-number: QTBUG-100458
Change-Id: I48d6f17943a554c1173d16a2320eb460c3d5c387
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-07 19:49:34 +00:00
David Faure
889c3e2e5b QMimeDatabase: update freedesktop.org.xml to shared-mime-info 2.3
... and update the unittest accordingly.

Compared to the 2.3 release there 2 fixes in freedesktop.org.xml,
due to issues discovered when running tst_qmimedatabase:
* Give higher priority to the more specific image/apng magic
https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/262
* Lower priority for text/x-mpsub's magic
https://gitlab.freedesktop.org/xdg/shared-mime-info/-/merge_requests/263

Task-number: QTBUG-118616
Change-Id: I56053b343619a8a711af28e6490c160d13169734
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-07 16:04:03 +01:00
Alexandru Croitor
28516ed1fd CMake: Remove qt_internal_qt_configure_end workaround
Now that the top-level build calls qt_internal_qt_configure_end
itself, we don't need to call it in qt_print_build_instructions.

Pick-to: 6.6
Change-Id: I906ee7bc1aed3b597049b5996a41dd298175343c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2023-11-07 14:56:01 +00:00
Ivan Solovev
fb1dcbfcba QSharedMemory: fix attach() -> create() for legacy SystemV mode
The attach() -> create() sequence was not covered by unit-tests in
qtbase, but this approach is used inside QSharedImageLoader.

It turns out that 02c42b26e1 broke this
usecase for legacy mode, and the create() triggered an assertion
in QSharedMemorySystemV::updateNativeKeyFile(). Fix it by clearing
the nativeKeyFile if ftok() call in QSharedMemorySystemV::handle()
fails().

Add unit-tests for the attach() -> create() scenario.
These tests revealed that this scenario fails also in non-legacy mode
for SystemV, so add QEXPECT_FAIL for these cases for now. This will
be addressed in a separate patch.

Pick-to: 6.6
Change-Id: If133fa56c82eba902374dc48d2757046b3d40baf
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-07 15:43:05 +01:00
Ivan Solovev
aa8dfc5589 QDate: fix condition in conversion between chrono types and Julian Day
Surely, sizeof() returns the number of bytes, so we need to multiply
by CHAR_BIT if we want to compare with the number of bits.

This commit amends c4f7dba81e

Task-number: QTBUG-118221
Change-Id: I2cca75bfed7f0554f6cffd22cc06475ffc9c6e43
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-11-07 14:42:16 +00:00
Tasuku Suzuki
2db7a5ebfb Fix build with -no-feature-shortcut
Change-Id: I43b95991fcf37ac8b125b176a59518e6a81e11dc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-11-07 09:59:06 +09:00
Alexey Edelev
a8118caad6 Remove forward declared QHash
Fixes the complication issue since the typedef was used as class member.
Replace the typedef with using statement.

Fixes: QTBUG-118627
Pick-to: 6.6 6.5
Change-Id: Ie3d341fb8f18a7341d018f51947127ace941a620
Reviewed-by: James McDonnell <jmcdonnell@blackberry.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2023-11-06 22:44:35 +01:00
Edward Welbourne
be55fbede9 QTZ/Darwin: Make available-ID checks cheaper
Previously we've checked whether an ID is available by computing the
full list of all known available IDs (converting each from NSString to
QBA in the process) in order to compare the offered ID to each of
those in turn. This is a significant performance bottle-neck

Simply trying to construct the NSTimeZone instance should suffice to
determine whether there is such a zone; if the ID is not available, we
apparently get back a null pointer, which is easy enough to test for.

Pick-to: 6.6 6.5
Fixes: QTBUG-118759
Change-Id: Ib272c96e25db9640490299c638e2e9196a58712f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-11-06 20:50:44 +01:00
Wladimir Leuschner
c88211d1e4 Restore WindowState when changing SurfaceType
Restore the WindowState, when a Window has to be recreated due to
changed SurfaceType.

Fixes: QTBUG-118194
Pick-to: 6.6 6.5
Change-Id: I40ba552cda9dfc8ab543611595c068f80b8fa1d6
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-11-06 20:50:44 +01:00
Kai Köhne
b23a06e039 Doc: Add HTTP Client example also to Web Technologies category
HTTP belongs to Networking, but also fits well with the scope
of Web Technologies - qtnetworkserver is there after all, too.

So just add the example to both.

Pick-to: 6.6 6.6.0
Change-Id: I588e4e0eefc92ba396fbb21d6f55b33f68332a74
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-11-06 17:59:51 +00:00
Assam Boudjelthia
0f3dbd6dc7 Android: remove a11y methods from QtNative, call a11y delegate direct
Remove yet another two layers of delegation, QtNative calling
QtActivityDelegate and that in turn calls QtAccessibilityDelegate.
Now from c++ native code, acquire the a11y delegate and use it to
call a11y operations that live in QtAccessibilityDelegate.

Task-number: QTBUG-118077
Change-Id: I9e84520c2caa281a6f786a687b0106d702f92a67
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
2023-11-06 19:59:51 +02:00
Jan Grulich
ddb1c75afe QCryptographicHash: Do not rely on auto-loading of the default provider
When using OpenSSL implementation, we were assuming the default provider
will be automatically loaded, but this is not going to happen after it
gets unloaded. Even the documentation says that automatic loading of the
default provider occurs max once and if it's explicitly unloaded, it
will not be automatically loaded again. In our case we are explicitly
loading and unloading the provider after MD4 hash is used so using it
afterwards we will always fail.

Fixes: QTBUG-118227
Pick-to: 6.5 6.6
Change-Id: I8107b9ab02321b57978c3d25a061672fd2a7aee8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-11-06 18:59:51 +01:00
Volker Hilsheimer
93a6cd8bdf JNI: allow QString as a parameter to native methods
Expect a jstring on the va_list, and implicitly construct a QString from
that.
As a drive-by, allow native methods to take parameters by reference, and
move implementation details into a Detail namespace.

Add test coverage.

Change-Id: I31214938ccaea3f4d539b432e29d12434dd98377
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-11-07 01:59:51 +08:00
Mårten Nordheim
e579cdceb8 QLocal8Bit::convertToUnicode[win]: Pre-2Gi changes
Prepare the code for the upcoming changes to support strings longer
than 2GiB.

We will have to loop from start to end, and increment the pointer
whenever we succeed, rather than assuming there is a single success
before we return.

This also means the error-handling code goes into an else-branch and
gets indented.

Pick-to: 6.6 6.5
Task-number: QTBUG-105105
Change-Id: Ibe49cc661f582fd54ce36ad466cf798a62b5c4c6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-06 18:23:19 +01:00
Mårten Nordheim
6f48233482 QLocal8Bit::convert*Unicode[win]: Converge logic
I ended up writing different logic for similar things.
And using points_into_range doesn't work if we, by coincidence,
point at end, though this shouldn't be possible yet, but it may happen
once we support input larger than 2Gi. So, let's instead check if the
destination buffer has been initialized.

Pick-to: 6.6 6.5
Task-number: QTBUG-105105
Change-Id: I28c367eb965339ae84355c0cac27c5d0352d9271
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-11-06 18:23:19 +01:00
Mårten Nordheim
10f5e4f809 QLocal8Bit::convertToUnicode[win]: Support stateless flag
By just setting state to nullptr.

Pick-to: 6.6 6.5
Task-number: QTBUG-105105
Change-Id: I6b4f8fe39f1ba51dcfaf98ce7e42c2acd4c4cf98
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-11-06 18:23:19 +01:00
Mårten Nordheim
127e6cc907 QNonContiguousByteDeviceThreadForwardImpl: reset m_atEnd during reset()
Because otherwise the atEnd() function will return true if we finished
an upload, and then we reset due to an error and try to upload again.
In a future patch we rely on atEnd() returning true only if the data
has actually been consumed, so re-uploads will not work correctly.

Pick-to: 6.6 6.5
Change-Id: Id914648f2509dd112b6bfc71231caa59cbe8ae68
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-11-06 18:23:19 +01:00
Mårten Nordheim
3ea46fa978 Schannel: Return if socket is invalid
In a couple places we already check if the socket is connected,
however we can be connected _and_ have the socket be closed.
The logic behind that I don't really understand, but there are
similar checks for validity in the OpenSSL backend.

This happens when calling close() on a still-connecting
socket. The QIODevice is marked as closed, but the connection
cannot yet be aborted. And when it finishes connecting we
handle the signal, start encryption, and then disconnect.

Pick-to: 6.6 6.5
Fixes: QTBUG-116550
Change-Id: I06c0a2db32bea0b573a99a971b8fb0b66a7a73d5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2023-11-06 18:23:19 +01:00