Commit Graph

59862 Commits

Author SHA1 Message Date
Morten Sørvig
daba0b8c19 wasm: Fix secondary thread event processing
Fix test failure in WasmEventDispatcherTest::postEventSecondaryThread()

Revert to using qGlobalPostedEventsCount() for determining
pending events state, but move the final check to after
sending posted events. Also remove a superfluous check.

This partially reverts/amends cc60d706.

Task-number: QTBUG-109066
Pick-to: 6.5
Change-Id: If4f437ce9379282c3d60b0272845a975794883de
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2023-01-06 16:42:45 +00:00
Joerg Bornemann
16d0e59ea0 Add CMAKE_MACOSX_RPATH to -rpath entry in configure/CMake mapping
Change-Id: I2c507f138c2e6aa283167c60425832d73bd95ee7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-01-06 17:42:45 +01:00
Marc Mutz
4225116260 QJniHelpers: replace some Q_GLOBAL_STATIC with QBasic* statics
For both QMutex and QAtomicInt, we have QBasic{Mutex,AtomicInt}, which
are PODs, and therefore constant-initialized. Q_GLOBAL_STATIC, otoh,
forces dynamic initialization, so don't use it.

Raw pointers don't need Q_GLOBAL_STATIC, either.

Patch up users. Instead of adding &'s to QMutexLocker arguments, port
directly to qt_scoped_lock, which takes by reference.

Change-Id: I1a13db2a5e88a52d4338a174a80522a3f5e58fa2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2023-01-06 16:42:45 +00:00
Ahmad Samir
fe7a0c19a6 QFileSystemModel: add lastModified() overload that takes a QTimeZone
This is useful when sorting by time and using QTimeZone::UTC, since
native filesystem API uses UTC, that means less conversions, which is
potentially faster.

Use UTC internally except for strings that are going to be shown in a
GUI to the user, these should be in QTimeZone::LocalTime.

[ChangeLog][QtGui][QFileSystemModel] Added lastModified() overload that
takes a QTimeZone, this is useful when e.g. comparing file timestamps
and all that's needed is time in UTC (this is faster as no time zone
conversions is required). QTimeZone::UTC is used internally when sorting
by time (using the sort() function), which should ideally make it
faster too.

Task-number: QTBUG-100349
Change-Id: I0e58f8eb7856b8da7d55db86ddd2c009ff83d970
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-01-06 17:52:07 +02:00
Kai Köhne
eeb469869e Fix deprecation of QApplication:setActiveWindow()
The method is now deprecated in Qt 6.5, not Qt 6.4.

Also, keep the documentation for now, but mark it as
deprecated there, too.

This amends  2436e259ce.

Pick-to: 6.5
Change-Id: Iff3e2c170a8fdb8834c0283de9554b503ed3aca4
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-01-06 15:00:57 +01:00
Sona Kurazyan
9e61cc4f72 Fix crash when cancelling a QFuture that has continuation with context
To support cancellation of continuations attached via the parent future,
we store a pointer to continuation future's data in parent. This
requires preserving the lifetime of continuation future's data while the
parent is still alive (see 24dedaeaa1).
This is achieved by capturing the promise in the continuation's lambda,
which is only cleaned up after the parent's data is destroyed. This is
already the case for continuations without context, but was overlooked
for continuations with context: they transfer the ownership of the
continuation promise to lambda passed to QMetaObject::invokeMethod(),
which destroys the lambda's context after it's run. As a result, the
continuation's promise (and data, if there are no other copies of it)
is also destroyed, leaving the parent pointing to deleted continuation
data.

To fix this, capture a copy of continuation future's ref-counted data in
the continuation's lambda. This will guarantee that the continuation
data remains alive until the parent is destroyed and the continuation
is cleaned up.

Fixes: QTBUG-108790
Pick-to: 6.5 6.4 6.2
Change-Id: Ief4b37f31e652988d13b03499505ac65c7889226
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-01-06 14:00:56 +00:00
Santhosh Kumar
f9aaa3e163 Update base line test case for widgets
Added baseline test case for menu (popup), combobox, command link and
lcd number.

New API takeScreenSnapshot() has been added for screen capture and
it serves to capture pop up windows

Change-Id: I5c1e46df270d94faf5c53431cddbd07532c256ee
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-01-06 14:51:29 +01:00
Øystein Heskestad
e088e01ace Accept U+2212 as minus sign in negative year unit test
Not all locales use ASCII hyphen-minus U+002D as minus sign. On macOS
using the nb_NO locale the U+2212 character is used instead when
displaying negative years. Verify that one of the two characters is
found.

Fixes: QTBUG-109853
Change-Id: I424539cc8d427ac199b4528e44bef98e45312d07
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-06 14:51:05 +01:00
Andy Shaw
cac325fdc1 SQLite: Update SQLite to v3.40.1
[ChangeLog][QtSQL][SQLite] Updated SQLite to v3.40.1

Pick-to: 5.15 6.2 6.4 6.5
Change-Id: Ic17019f65083b24238025fe6ea6ee9872ac783fe
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2023-01-06 12:24:13 +00:00
Jannis Xiong
80f44954f6 Fix cache maybe invalid while the signal is actived from queue
with default QObject::connect signal may active from next message loop. invalide cache will hit while accessibility interface is called from windows. Invalide cache will lead to a crash

Fixes: QTBUG-106653
Pick-to: 5.15 6.2 6.3 6.4
Change-Id: I5359672bcd60ed6cfb2edf238645225164cb1b88
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2023-01-06 14:24:13 +02:00
Mikolaj Boc
5c98ffdfef Only set the deprecation define once for test batch
Change-Id: I215f7a0dbb0078be9fdeadb1f941304071a575fa
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2023-01-06 12:37:35 +01:00
Alexey Edelev
fdeaf3054c Avoid full optimization of syncqt if QT_USE_DEFAULT_CMAKE_OPTIMIZATION_FLAGS is set
Skip adding full optimization flags when compiling syncqt if
QT_USE_DEFAULT_CMAKE_OPTIMIZATION_FLAGS is set.

Pick-to: 6.5
Task-number: QTBUG-109792
Change-Id: I585a459f3ca014cbeb3398b4f55d1da393c3c7d1
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2023-01-06 12:02:39 +01:00
Leon Zhang
0d251afdda Add resetTransform to see also of setTransform in QGraphicsView
Pick-to: 6.5 6.4
Change-Id: I4a38d44f2109f8b92069651c23717da02f5b3091
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-01-06 10:02:16 +00:00
Christian Ehrlicher
65a5efae69 SQL: more documentation and test cleanups
Remove some stuff no longer supported and refine others.

Pick-to: 6.5
Change-Id: I29730d5acfcf4a7ef3f569f101d3a4f72dd8b3aa
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-01-06 05:42:01 +00:00
Amir Masoud Abdol
2b2065bf35 Slow Deprecation of FILENAME_VARIABLE, replacement by OUTPUT_SCRIPT
As discussed in the latest CMake API Review, we are deprecating the
FILENAME_VARIABLE variable name everywhere, and replacing it with
OUTPUT_SCRIPT.

[ChangeLog][CMake] The FILENAME_VARIABLE option of
qt_generate_deploy_script and qt_generate_deploy_app_script is now
deprecated, use OUTPUT_SCRIPT option instead.

Change-Id: Ic8be33eefbc48540166ea0fcf1d1948b052d4b8a
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2023-01-05 21:56:21 +01:00
Axel Spoerl
812666fe7c Document QGtk3Storage
Add internal documentation to header and implementation of
QGtk3Storage.

Pick-to: 6.5
Change-Id: I8e12dad57c2458dea4446cddc8df1ceef59c070c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-01-05 19:09:20 +00:00
Eirik Aavitsland
7eccd7ac1c Fix potential corruption with image format conversion on arm neon
For tiny scanline lengths, even the initial offset to align on 16
bytes may overflow.

Fixes: QTBUG-109477
Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I198c6fa5a2551a951893515f905bb7cc35479608
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2023-01-05 20:09:20 +01:00
Ahmad Samir
2ed4e5d37d Fix two compiler warnings
Comparing singed/usigned ints.
Use override keyword.

Change-Id: I03d2c4359e0600360ebcfece593a3b125e5c9c53
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-01-05 21:01:22 +02:00
Alexey Edelev
6f7d09677a Change the RUNTIME_OUTPUT_DIRECTORY for configure-time executables
Set the RUNTIME_OUTPUT_DIRECTORY for configure-time executables so
executable will be located inside the QT_BUILD_DIR. This allows to
re-build syncqt and make sure ithat ts binary is replaced and located
in the libexec directory.

Comment on how to rebuild syncqt. Configure-time tools reserve the
original tool name for the imported executable. To re-build syncqt use
'syncqt_build' target.

Task-number: QTBUG-109792
Change-Id: Id7d912b1d75d18d82cb2a69fbd62b89440120d78
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2023-01-05 20:01:21 +01:00
Marc Mutz
91f18c92d7 Android: requestPermissionsInternal(): use more makeReadyFuture()
Only use an actual QPromise when the calculation will be async.

Change-Id: I5900c6498f56721dd04c4da204c0270492f52eee
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2023-01-05 19:01:21 +00:00
Alexey Edelev
5761f254a0 Add configure-time tools to the 'host_tools' target
Rebuild configure-time tools within the 'host_tools' meta target.

Pick-to: 6.5
Task-number: QTBUG-109792
Change-Id: I1bd69c8e71185b6ec236c0f32064ba8f2c9f5ab0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2023-01-05 20:01:21 +01:00
Jaishree Vyas
aae855bd6f Link update for Data Input Output in the save game example
Pick-to: 6.4 6.5
Change-Id: I2a886766d59b9e75f42e401fca9c258fcbe02809
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2023-01-05 15:22:00 +01:00
Timur Pocheptsov
6128a92e07 TLS backend SecureTransport: properly clear SSLContextRef
Simply calling SSLClose on context is not enough. Properly clear
the context by calling 'reset' member-function.

Pick-to: 6.5 6.4 6.2 5.15
Change-Id: Ic6a32f6e4193bb19809d1cce184651b78d6273a7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2023-01-05 15:13:54 +01:00
Julian Greilich
b832a5ac72 Android A11Y: Only access the main thread when it is not blocked
When the qtMainLoopThread calls QSGThreadedRenderLoop::polishAndSync(),
it waits for the QSGRenderThread.

In the QSGRenderThread, QAndroidPlatformOpenGLWindow::eglSurface()
calls QtAndroid::createSurface() and waits for the "android main
thread" to return a valid surface.
When the "android main thread" now calls "runInObjectContext" (e.g. by
calling QtAndroidAccessibility::childIdListForAccessibleObject()) it
waits for the qtMainLoopThread and the program is stuck in a deadlock.

To prevent this, we protect all BlockedQueuedConnection from the
"android main thread" to the qtMainLoopThread by acquiring the
AndroidDeadlockProtector.
When QAndroidPlatformOpenGLWindow::eglSurface() already acquired the
AndroidDeadlockProtector we abort the current A11y call with an emtpy
or default value.

Note: b8a9527544 already tried to fix
this by checking "getSurfaceCount() != 0", but there are situations,
where a new surface is being created while an old surface is still
present.

Task-number: QTBUG-105958
Pick-to: 6.5 6.4 6.3 6.2 5.15
Change-Id: Ie40e8654c99aace9e69b0b8412952fa22c89f071
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-01-05 15:09:50 +01:00
Marc Mutz
0ba063f436 Enable QT_NO_AS_CONST globally
All current modules are free of qAsConst, make sure new ones will be,
too.

Change-Id: Iae3c67bca86eddf62ae664b00ff39a9b513d7290
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-01-05 15:09:49 +01:00
Alexey Edelev
90806123e9 Allow specifying CMakeLists.txt as the argument for qt-cmake-standalone-test
qt-cmake-standalone-test uses add_subdirectory call when evaluating the
project. This leads to an error if users try to use path to
CMakeLists.txt as an argument, instead of directory when configuring
standalone tests with qt-cmake-standalone-test. It makes sense to check
if the user-specified path points to CMakeLists.txt and cut the
filename part when calling add_subdirectory.

Pick-to: 6.5 6.4 6.2
Change-Id: I6b9ac0ca8323eaf11f219eb1e6bed3057120a231
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2023-01-05 15:09:49 +01:00
Paul Wicking
f10ae4b887 Doc: Drop link to deleted page
The standard accelerators page was deleted, drop the link to it.

Pick-to: 6.5 6.4
Change-Id: I2fa9a94200d0e5f8895bb8c6981c73b3e9dd159e
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-01-05 15:09:46 +01:00
Ahmad Samir
b5701ca5a2 RCCFileInfo: get lastModified file time in UTC directly
These are time stamps, and they use toMsecsSinceEpoch(), no point
getting the time in Local time zone then converting it.

Change-Id: I2db2db5f9ebc062e65514a592fa7fa00cf1d179d
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-05 14:46:38 +02:00
Ahmad Samir
a608744c90 Docs: adjust docs after the QLatin1String to QLatin1StringView rename
Unify wording as "{Latin-1,UTF-16} string viewed by \a str".

Drive-by change: Fix a grammatical error, it's "a US-ASCII", not an
(because it's pronounced by the letter name "U" which is pronounced
like "you", so "a" not "an").

Task-number: QTBUG-108711
Pick-to: 6.5
Change-Id: Iff763f4008341c35317bb3d7a2a228767ff6a648
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2023-01-05 14:46:38 +02:00
Axel Spoerl
d18f142062 Document QGtk3Interface
Add internal documentation to header and implementation of
QGtk3Interface.

Pick-to: 6.5
Change-Id: I3e6e970afa0c2ab26e0ce9efe6285cad1edfdb94
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2023-01-05 13:33:07 +01:00
YAMAMOTO Atsushi
d05e75ade4 Tweak comment about QCocoaWindow
Remove duplicate 'for', and unify the article of NSWindow to "an".

Change-Id: Iccf762ac54e90816f61634404fb88c9fdd1a43e1
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-01-05 11:52:20 +00:00
Axel Spoerl
f05aee7628 Fix unused variable compiler warning in slider example
The example overrides QWidget::resizeEvent() without using the
QResizeEvent * argument. This results in a compiler warning.

This patch marks the argument unused.

Pick-to: 6.5
Change-Id: I647d0eda7d895e70ed6f232960aec992f5e37b6c
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2023-01-05 05:21:43 +00:00
Laszlo Agocs
f486d1f4d2 rhi: metal: Add enablers for pre-querying window stuff on the gui thread
Pick-to: 6.5
Task-number: QTBUG-97518
Change-Id: Ia8fb5128149c9f91ebedfa914d1fe3e3d49774dc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2023-01-04 19:22:16 +00:00
Volker Hilsheimer
a2e38207da Blacklist the QAccessibility::focusChild test on the wayland platform
Task-number: QTBUG-109763
Change-Id: I2ef258a34743568dbbb90a802ea387e52c8cc613
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-01-04 18:38:00 +01:00
Ahmad Samir
41867c25f8 Use QFileInfo's file times in UTC for file timestamps
This is inherently faster than getting it in UTC from the underlying
native API stat call, then converting it to the Local Time Zone just to
compare them. The same goes for any use-case where you get a QDateTime
then the first thing you do is call t.to{Msec,Secs}SinceEpoch().

Change-Id: Ic13bcfd99b937c9f10f102ea7741832950a553c6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Kai Köhne <kai.koehne@qt.io>
2023-01-04 19:15:52 +02:00
Marc Mutz
7eff78e8a5 Android: checkPermission/s(): use makeReadyFuture()
... instead of manual QPromise handling.

QtFuture::makeReadyFuture() is both more efficient and more readable.

As a drive-by, replace size() > 0 checks with !isEmpty().

Change-Id: I299fbe8e6be10d8f65b8f86fcc6b586ac3cbd9d2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sona Kurazyan <kurazyan.sona@gmail.com>
2023-01-04 16:55:35 +00:00
Marc Mutz
080e1b6011 QAndroidExtras: release mutex earlier in requestPermissionsInternal()
The g_pendingPermissionRequestsMutex protects only the
g_pendingPermissionRequests QHash, so we can drop it immediately after
the QHash::insert() call. In particular, we don't use reference into
the QHash afterwards, and the following runOnAndroidMainThread() call
is internally synchronized, anyway.

Change-Id: I66a0e402e9ed1edb5fd9fec14e85f9371cc4fc36
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2023-01-04 17:55:35 +01:00
Tor Arne Vestbø
7e7bae35f7 macOS: Include text in key events triggered by insertion key-bindings
In 705665957b we started relying on the
input method to decide whether a key event should include the resulting
text or not, based on the assumption that text insertion would happen
via the insertText:replacementRange: selector.

But the NSStandardKeyBindingResponding protocol includes several other
commands for inserting content, including insertTab:, insertBacktab:,
and insertNewline:.

  https://developer.apple.com/documentation/appkit/nsstandardkeybindingresponding

We explicitly handle the latter, but for any command we didn't handle,
we concluded that the input method didn't want us to insert text, and
sent the key event without text, which broke tab character insertion
in text edits.

As long as we're not handling these commands explicitly, we adjust
the logic to treat any command starting with "insert" as an unhandled
request to insert text, and forward it as a key event with the text
included, as before 705665957b.

Fixes: QTBUG-109754
Task-number: QTBUG-106393
Pick-to: 6.4 6.5
Change-Id: I4a164bc809c3606b43f267514a66ff017efeb4af
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-01-04 17:05:19 +01:00
Ahmad Samir
96708cf161 QDateTimeParser: use a local var instead of multiple str::at()
Better readablility.

Change-Id: I936a915d50222c644cda493e01dccfe223a881bd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-01-04 16:49:12 +02:00
Tor Arne Vestbø
ba639edd27 Reflect QStyleHints in AA_DontShowShortcutsInContextMenus
There are two ways to override whether shortcuts (key sequences) should
be shown in menus, QStyleHints::::showShortcutsInContextMenus() and
the Qt::AA_DontShowShortcutsInContextMenus application attribute,
but only the latter is checked by our own menu implementations.

This was confusing, as overriding the style hint had no effect.

It makes sense for the QStyleHint to be based on the platform style
hint, but since we also allows overriding it, the logic in QGuiApp
that initializes Qt::AA_DontShowShortcutsInContextMenus should be
based on the QStyleHint.

Note that the inverse relationship is not maintained, as the app
attribute should not affect the style hints.

This creates a somewhat awkward situation in terms of when you need
to override the behavior, so we might consider deprecating one of
the options.

Fixes: QTBUG-109590
Task-number: QTBUG-69452
Change-Id: I366c17ff00fd8ae10553bbfb88d162ffd2c8040f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2023-01-04 15:49:11 +01:00
Yuhang Zhao
9af5a70c55 Update the documentation of QScreen::name()
Task-number: QTBUG-109569
Pick-to: 6.5 6.4
Change-Id: I24ed586e9094e7cd2277c6289ffbd4210dd6e430
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2023-01-04 21:26:25 +08:00
Alexey Edelev
f071421558 Check if "-stagingDir" is passed from the command
Check if "-stagingDir" is passed from the command line before trying
to copy files to it.

Pick-to: 6.5
Change-Id: Id39882e4e955bd54328c8e747377b9d49f977378
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-04 13:42:07 +01:00
Alexey Edelev
ad7ad62d17 Avoid breaking version script generator state
Pass every line to parseVersionScriptContent to not break the
version script generator state. The parser doesn't collect characters
from comment block, so the line containing the 'ignore-next' ELFVERSION
tag produces empty buffer for the further parsing process. Call the
parseVersionScriptContent function even on empty buffers to make sure
that 'ignore-next' counts lines correcly.

Pick-to: 6.5
Fixes: QTBUG-109790
Change-Id: I5f77893462d397f6738a5da1af6ed8dd8a2df70a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-01-04 13:42:06 +01:00
Volker Hilsheimer
fb8701cb8b QListView: Prevent infinite loop when wrapping text of item with null-icon
If an item in a list view has a null icon, then the decorationSize gets
calculated as -1, -1. The style would then try to wrap the text to a
lineWidth of -1, ending up in an infinite loop in viewItemTextLayout.

To prevent that, don't set the HasDecoration flag of the style option
when the icon is null, and don't fall back ot the decorationSize unless
the flag is set.

Add a test for this particular item configuration. This also fixes the
widget baseline test with styles that don't provide all standard icons.

Pick-to: 6.5
Change-Id: I691db6abede9a9b2ad300f3ee7fbfdae5fb6097f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
2023-01-04 13:42:06 +01:00
Eskil Abrahamsen Blomfeldt
84a68ef75c Fix assert when resizing text table with percentage widths
Since Qt 6.3.x, qBound() has started asserting that max > min.
This caused a crash in the QTextDocumentLayout code for assigning
widths to table columns that were sized using percentages, which
depended on previous qBound() behavior of just snapping to the
minimum size if max < min.

There are some specific conditions for this to happen: First
of all, the available width in the table must be too small to
fit all minimum widths (which is calculated based on content).
In addition, the requested widths have to be given as
percentages of the table width, and these have to add to
something lower than 100%. With these conditions, you may get
a case where the calculated percentage width of a column is
larger than the minimum width, but lower than the remaining
width in the table, causing the assert in qBound().

We simply accept the minimum width as the rule in these cases,
which matches behavior without the assert and which looks
correct when resizing the window to be smaller than the table.

Fixes: QTBUG-108183
Pick-to: 6.4 6.5
Change-Id: I16d18dd9b2e7a77fe86d1a353b426075b5050b8e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
2023-01-04 13:42:06 +01:00
Joni Poikelin
7584871f4d Fix a warning about extra semicolon in qstylepainter.h
Pick-to: 6.5 6.4 6.2
Change-Id: I104037ff58ade4b2ceffd73687355a5d237ab571
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-01-04 07:36:05 +00:00
Eirik Aavitsland
b1bb732639 Doc: note QWindow::winId() will cause platform window creation
Worth it to emphasize this, as such a side effect from a const
accessor may well be unexpected.

Change-Id: I0b70d81927e0b66799cbe736ce5d488e2ec77ce0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
2023-01-04 00:09:50 +01:00
Eirik Aavitsland
f091026be1 Fix deletion order in QImageReader/Writer destructors
The device would be deleted before the image format handler, and hence
be a dangling pointer that could easily cause a crash if the handler
or codec would access it on destruction, e.g. for cleanup.

Pick-to: 6.5 6.4 6.2 5.15
Change-Id: I51d16b1feddc5945955ac75a2e8701233dba7b82
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2023-01-04 00:09:06 +01:00
Axel Spoerl
df62cefdcb Skip tst_QWidget::optimizedResizeMove and ..._topLevel on wayland
Wayland omits optimizations tested in tst_QWidget::optimizedResizeMove()
and optimizedResize_topLevel() under certain circumstances, e.g. on
Ubuntu 22.04 / Gnome. This makes the test functions fail.

This patch skips the test functions on wayland platforms, if an
omission is detected.

This amends 2ec7a6322f.

Fixes: QTBUG-109746
Pick-to: 6.5 6.4
Change-Id: If0df6b1cf451a7f0dccfc1bb7411e895d7ae29a3
Reviewed-by: Liang Qi <liang.qi@qt.io>
2023-01-03 19:21:39 +00:00
Tor Arne Vestbø
3b60534ab9 macOS: Limit cursor update workaround to Monterey and below
The AppKit issue has been fixed in Ventura.

Change-Id: Ic2c0a0ed4ad52ef2d52410ec2c8ba061907cbe8e
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2023-01-03 19:06:17 +01:00