Commit Graph

56912 Commits

Author SHA1 Message Date
Laszlo Papp
ca11725659 QCOMPARE: Fix a typo in the documentation
Change-Id: If21359397ef7873592b94838647aee121b84b33a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-07-01 13:29:59 +01:00
Alexandru Croitor
dd1030a450 CMake: Record used package version for each target dependency
When recording which package version to look for in
QtFooModuleDependencies.cmake and other files like it,
instead of using PROJECT_VERSION, use the version of the
package that contains the dependency.

For example if we're hypothetically building the qtdeclarative repo
from the 6.4 branch, against an installed 6.2 qtbase, then
the Qt6QmlModuleDependencies.cmake file will have a
find_package(Qt6Core 6.2) call because qtdeclarative's
find_package(Qt6Core) call found a 6.2 Core when it was configured.

This allows switching the versioning scheme of specific Qt modules
that might not want to follow the general Qt versioning scheme.

The first candidate would be QtWebEngine which might want to
follow the Chromium versioning scheme, something like
Qt 6.94.0 where 94 is the Chromium major version.

Implementation notes.
We now record the package version of a target in a property
called _qt_package_version. We do it for qt modules, plugins,
3rd party libraries, tools and the Platform target.

When we try to look up which version to write into the
QtFooModuleDependencies.cmake file (or the equivalent Plugins and
Tools file), we try to find the version
from a few sources: the property mentioned above, then the
Qt6{target}_VERSION variable, and finally PROJECT_VERSION.
In the latter case, we issue a warning because technically that should
never have to happen, and it's a bug or an unforeseen case if it does.

A few more places also need adjustments:
 - package versions to look for when configuring standalone
   tests and generating standalone tests Config files
 - handling of tools packages
 - The main Qt6 package lookup in each Dependencies.cmake files

Note that there are some requirements and consequences in case a
module wants to use a different versioning scheme like 6.94.0.

Requirements.
 - The root CMakeLists.txt file needs to call find_package with a
   version different from the usual PROJECT_VERSION. Ideally it
   should look for a few different Qt versions which are known to be
   compatible, for example the last stable and LTS versions, or just
   the lowest supported Qt version, e.g. 6.2.6 or whenever this change
   would land in the 6.2 branch.
 - If the repository has multiple modules, some of which need to
   follow the Qt versioning scheme and some not,
   project(VERSION x.y.z) calls need to be carefully placed in
   subdirectory scopes with appropriate version numbers, so that
   qt_internal_add_module / _tool / _plugin pick up the correct
   version.

Consequences.
 - The .so / .dylib names will contain the new version, e.g. .so.6.94
 - Linux ELF symbols will contain the new versions
 - syncqt private headers will now exist under a
   include/QtFoo/6.94.0/QtFoo/private folder
 - pri and prl files will also contain the new version numbers
 - pkg-config .pc files contain the new version numbers
 - It won't be possible to write
   find_package(Qt6 6.94 COMPONENTS WebEngineWidgets) in user code.
   One would have to write find_package(Qt6WebEngineWidgets 6.94)
   otherwise CMake will try to look for Qt6Config 6.94 which won't
   exist.
 - Similarly, a
   find_package(Qt6 6.4 COMPONENTS Widgets WebEngineWidgets) call
   would always find any kind of WebEngine package that is higher than
   6.4, which might be 6.94, 6.95, etc.
 - In the future, if we fix Qt6Config to pass EXACT to its
   subcomponent find_package calls,
   a find_package(Qt6 6.5.0 EXACT COMPONENTS Widgets WebEngineWidgets)
   would fail to find WebEngineWidgets, because its 6.94.0 version
   will not be equal to 6.5.0. Currently we don't pass through EXACT,
   so it's not an issue.

Augments 5ffc744b79

Task-number: QTBUG-103500
Change-Id: I8bdb56bfcbc7f7f6484d1e56651ffc993fd30bab
Reviewed-by: Michal Klocek <michal.klocek@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-07-01 10:50:57 +02:00
Alexandru Croitor
74d8321771 CMake: Don't show the incompatible version warning when not needed
If a find_package(Qt6Foo) call has the QUIET option passed, don't
display the incompatible version warning.

Also if the find_package call has the EXACT option passed, and the
searched for version does not match the package version exactly,
there's no point in showing the warning because find_package
will reject the package anyway, even if we set
PACKAGE_VERSION_COMPATIBLE to TRUE

Pick-to: 6.2 6.3 6.4
Change-Id: I78ef95cf4a045034fc50853465f3ba1db84bba63
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-07-01 10:50:55 +02:00
Richard Moe Gustavsen
3b12305575 IM: Don't let all widgets support IM by default
A new property Qt::ImEnabled was added in Qt 5.3.
Since the already existing widgets with IM support
(3rd party included) didn't implement this property,
QWidget got the fall back logic that if a widget
was queried for Qt::ImEnabled, and the returned QVariant
was invalid (the widget didn't implement it), we
would, for backwards compatibility with Qt 4, return "true"
(meaning that the widget supports IM).

But a side effect from this fallback logic, is that now
any widget that doesn't implement ImEnabled (or input
methods at all) report that they support IM. This will
confuse platforms like iOS, which uses ImEnabled to decide
if the input panel should show, and if text selection tools
should be enabled. The result is therefore that if you click
on a QPushButton, the input panel will open.

This patch will implement a more careful strategy to check if
a widget implements IM, if ImEnabled is missing. Rather than
saying that all widgets that don't implement ImEnabled supports
IM, we now require that the widget also returns a valid QVariant
for Qt::ImSurroundingText. We assume then, that a widget that
doesn't do so will anyway not be in need of input method support
from the platform.

Fixes: QTBUG-104527
Pick-to: 6.4 6.3 6.2
Change-Id: Ib391fd1daae92c4325e9ccb59730fbdd7c9328fc
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-07-01 10:47:17 +02:00
Giuseppe D'Angelo
1ffe49dd19 QWindowPrivate::setMinOrMaxSize: port to function_ref
The "callbacks" passed to setMinOrMaxSize are not stored and
outlive the callee. Therefore, don't use std::function to pass
them (by value (!)); instead employ the recently-added function_ref.

Change-Id: I37eea020920a76c063265e667c99a6040394d645
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-06-30 10:29:01 +02:00
Mikolaj Boc
d0eba2449a Create a promise wrapper for C++ and port existing uses
Currently, to use a promise from C++ we either have to use an ASM block
(which does not work well with dynamic linking) or declare exports in
the EMSCRIPTEN_BINDINGS block, which is cumbersome and cannot be chained.
This solution makes it easy to use js promises by introducing the
WebPromiseManager which dispatches callbacks to appropriate callers when
available.
This is a preliminary patch for FileSystem support, which will heavily
use async APIs.

Task-number: QTBUG-99611
Change-Id: I368a8f173027eaa883a9ca18d0ea6a3e99b86071
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-06-30 01:20:28 +02:00
Tor Arne Vestbø
97665c9615 Windows: Don't rely on top level QWindow to scale children on DPI change
The native size of a QWindow on Windows is the logical size of the window
times the window's device pixel ratio. We manage this relationship
for top level windows via the WM_GETDPISCALEDSIZE message, and during
WM_DPICHANGED we then applied the same scale to child windows.

This is problematic in the case where a child window does not have
a QWindow parent, so instead of scaling all children when the parent
gets a WM_DPICHANGED message, we scale each individual child in the
child's WM_DPICHANGED_AFTERPARENT message.

Task-number: QTBUG-103383
Pick-to: 6.4
Change-Id: Ia0845aa19a3bb97b7bc9e7d9554ac02b95ca65a5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-30 00:28:35 +02:00
Thorbjørn Lund Martsum
54f328f0e8 Fix QDockWidget move between screens with different dpr
When partly moved back and forth between screens
with different dprs (device pixel ratios)
unexpected jumps and size changes could occur.
(See the linked issue for details)

This patch maps global coordinates to native ones
and vice versa (in QDockWidgetPrivate::mouseMoveEvent()),
so that the calculated position is the right coordinate
on the right screen.

Pick-to: 6.4 6.3 6.2 5.15
Fixes: QTBUG-104205
Change-Id: I0e59792a946e0444fed2e2b857f2f8b140afc9b7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-06-29 19:33:29 +02:00
Alexey Edelev
c7231177df Forward COMPILER_LAUNCHER to the ABI-specific external projects
This allows to speed-up the build of external projects.

Pick-to: 6.3 6.4
Change-Id: I3bbdbd6ec5b0920c9e912cb59a6e16c5a8efa0ec
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-06-29 18:32:06 +02:00
Alexey Edelev
f2d9e76451 Use the main ABI's CMAKE_MAKE_PROGRAM in ABI-specific external projects
Pick-to: 6.3 6.4
Change-Id: Ie35b6a334be419d3182fe77f9d70153cd1fd8a51
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-06-29 18:32:06 +02:00
Joerg Bornemann
7ce82225f6 CMake: Let qt6_add_plugin accept sources
The commands qt6_add_executable and qt6_add_library both accept a list
of sources that get automatically added to the created target.
Extend qt6_add_plugin to also accept sources for consistency.

Fixes: QTBUG-104189
Change-Id: Iad5d8c5b31551663be155d068d55e770e1a91b27
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-06-29 18:32:05 +02:00
Joerg Bornemann
c155734bfc Doc: Clarify qmake's c++latest CONFIG value
Fixes: QTBUG-104631
Change-Id: I1d2b7de0f76de9c6ba4b7e47de7e777fedc7bd30
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-06-29 18:32:05 +02:00
Morten Johan Sørvig
122aa530d6 wasm: add qtwasmtestlib
qtwasmtestlib supports writing asynchronous tests for
the web platform.

Asynchronous test functions differ from normal test
functions in that they allow returning from the test
function before the test has completed:

void TestObject::testTimer()
{
    QTimer::singleShot(100, [](){
        completeTestFunction(); // Test pass if we get here
    });
}

Currently one logging backend is supported which
writes the results to an html element. See the README
file for further documentation.

Change-Id: Ia633ad3f41a653e40d6bf35dd09d62a97c608f84
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-06-29 15:09:02 +02:00
Pekka Gehör
c27cca5c34 Android: fix wrong position of cursor handle and editpopup menu in split screen
Use activity location in the Window to handling a cursor handle and editpopup menu
in Multi-Window mode. No effect when using full screen.

Fixes: QTBUG-58503
Pick-to: 5.15 6.2 6.3 6.4
Change-Id: I17f3119be4c3dda2fca50156bf62c1260c2ea1f6
Reviewed-by: Samuel Mira <samuel.mira@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-06-29 16:02:55 +03:00
Pekka Gehör
526d62ee90 Android: Fix the offset of the EditPopupMenu
Fix the offset of the EditPopupMenu on application window.
Issue caused by a5bb7b3ca5

Fixes: QTBUG-71900
Pick-to: 6.2 6.3 6.4
Change-Id: Ib95e1544fe91c273bc5317bd338a50a74fb1090a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-06-29 16:02:33 +03:00
Fushan Wen
7b2ae3faab Drop call to setPlatformScreen in QHighDpiScaling::setScreenFactor
Drop call to setPlatformScreen since the only affected variables are
logicalDpi and geometry. Replace setPlatformScreen with updateLogicalDpi
which handles global scale factor changes in QScreen.

Call updateGeometriesWithSignals() to check if there are any changes
in geometry or availableGeometry, since the geometry or availableGeometry
can also change when setting a scale factor.

Move setPlatformScreen to QScreen ctor as the function is not used
elsewhere.

Pick-to: 6.4 6.3 6.2
Change-Id: I7acf40bf0643e89a1d9177674d66dc503829f98f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-06-29 20:44:32 +08:00
Volker Hilsheimer
9fcd5f0790 Don't trigger qBound assert in QExpandingLineEdit
Ignore the original width if it's larger than maximum.

Fixes: QTBUG-104383
Fixes: QTBUG-104565
Pick-to: 6.4 6.3 6.2
Change-Id: Id86d4f5bd1d50304d95c4711f1989f4dae416b69
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-06-29 07:24:54 +00:00
Thiago Macieira
688e8f63a2 moc: fix const-init for Windows
References to __declspec(dllimport) is not a constant expression on
Windows, so we can't have a direct reference to a staticMetaObject.
Commit 9b8493314d fixed the Q_OBJECT parent
link (added in 5.14, kicked in for 6.0 with the ABI break), but commit
656d6f2a9b added links for Q_GADGETs too
without taking the need for Windows DLLs into account.

This change is a no-op everywhere but Windows. On Windows, since we
store the pointer to the indirect getter function, now you may get non-
null pointers from QMetaObject::superClass().

Pick-to: 6.4
Change-Id: I6d3880c7d99d4fc494c8fffd16fab51aa255106e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-28 15:07:41 -07:00
Thiago Macieira
9af59838d7 moc: move the qt_static_metacall below the staticMetaObject
Just so we have data structures and functions grouped together.

Pick-to: 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16fa171f6e1caf2b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-06-28 15:07:41 -07:00
Thiago Macieira
3335b541e7 qmetatype.h: remove unnecessary specialization
Commit 5db3fd29b4 removed the expansions
that likely needed this.

Pick-to: 6.3 6.4
Change-Id: I6d3880c7d99d4fc494c8fffd16fbbe8dcde4a1b1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-28 15:07:41 -07:00
Thiago Macieira
c474825945 QMetaType: move the built-in QMetaTypeInterfaces to read-only segments
The presence of the mutable causes the const object to lose its
constness, so declaring as const wasn't helpful. But we can't drop the
const wholesale for MSVC right now because it mangles the variable's
type in the external name.

For all other compilers, we drop it for user-defined types, which is a
no-op but is semantically correct because QMetaType needs to modify
those objects. Aside from a few const_cast (marked with comments),
nothing else changes.

For types with built-in type IDs, however, the QMetaTypeInterface is now
fully const... or would be if it weren't full of relocations. It does
move the lot from the .data section to the .data.rel.ro section. After
this change, QtCore and QtGui have:

                QtCore  QtGui
.data.rel.ro       57     23
.data, exported    17     39
.data, private     94    193

sizeof(QtPrivate::QMetaTypeInterface) = 112 on 64-bit platforms
(but GCC issues ".align 32", so they effectively occupy 128 bytes)

Change-Id: Id0fb9ab0089845ee8843fffd16f9a35bfafebf77
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-28 15:07:41 -07:00
Thiago Macieira
dbf58407cb QMetaType: extern-template the built-in Core types' QMetaTypeInterface
This *should* make no difference in behavior, it just prevents the
instantiation of the QMetaTypeInterface and all the lambdas used in it
in every compilation unit, with a copy in every library. Now, a simple
function like:

  QMetaType f() { return QMetaType::fromType<int>(); }

produces only a single function, with a reference into QtCore:

_Z1fv:
        movq    _ZN9QtPrivate25QMetaTypeInterfaceWrapperIiE8metaTypeE@GOTPCREL(%rip),%rax
        ret

The code above *does* work on Windows, producing:

_Z1fv:
        movq    __imp__ZN9QtPrivate25QMetaTypeInterfaceWrapperIiE8metaTypeE(%rip), %rax
        ret

However, it breaks the staticMetaObjects' metatype listing, because
getting the address of a __declspec(dllimport) variable is not a
constant expression (it lacks data relocations). So this is disabled on
Windows.

This change also broke the INTEGRITY build. I've simply disabled the
optimization there without attempting to understand why it fails.

Task-number: QTBUG-93471
Pick-to: 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16f97748a00b4d64
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-28 15:07:40 -07:00
Laszlo Papp
b6a953bb93 QKeySequenceEdit: Finish editing when losing focus
Do not wait for the timer to time out. When losing the focus, finish
editing immediately since we cannot really edit it further without
focus.

Pick-to: 6.4
Change-Id: If42926ef9b06fbea7592a294f48ea5e99ef57ef8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-28 22:07:40 +00:00
Liang Qi
ef94aeef64 xcb: update xkb_state mask as much as possible
Though we can get xcb_xkb_state_notify_event_t for the change, but
it looks like not enough, especially when a new usb barcode
scanner was used, it should be a slave keyboard, and Qt only uses
core_device_id for now. It should be enough to update xkb_state
mask when we get key event.

See also https://xkbcommon.org/doc/current/md_doc_quick_guide.html .

Fixes: QTBUG-95933
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: Ie1e82c19edd777630c7f9057a3b2b8b7cad59e38
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-06-28 20:26:29 +00:00
Kai Köhne
c2505751de Doc: Document missing methods in QDropEvent
Fixes: QTBUG-104484
Pick-to: 6.2 6.3 6.4
Change-Id: I20068bb9e641545edad67910b4586aa38aec093b
Reviewed-by: Kevin Keating
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2022-06-28 19:52:43 +02:00
Dimitrios Apostolou
d23dcc0542 qtestlib: exit with error if a test is invoked with unknown data tag
Previously trying to execute a test function with an unknown data tag
would print an error message but exit with 0.

This patch stores a test failure, and continues trying to execute the
rest of the command line arguments, if any. In the end the process exits
with the usual exit code (number of failed tests) which is now !=0.

Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-24240
Change-Id: Id4d422035f173e01e77ca88028dfd94dc0f9085c
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-06-28 18:06:33 +02:00
Moody Liu
8a96c8a22c fix androiddeployqt with user application with in-tree QML modules
when deploying user applications with QML modules located under user's
subdirectories, (e.g. some third-party QML components used as git
submomdule). The qmldir for such QML modules will be, typically,
generated under BUILD_DIR/android-qml.

if a BUILD_DIR is under the source directory, androiddeployqt will skip
those QML modules incorrectly because they "appeared to be under the
QML root path so that seems can be imported", however without deploying
them, it's impossible to import those modules on an Android device.

this patch adds a check that also tests if a root path plus the module's
url can actually lead to the correct module path, so a QML module under
android-qml subdir would not pass the test, and thus won't be skipped.

Task-number: QTBUG-103593
Pick-to: 6.4 6.3
Change-Id: I8af76bd38cd55700e17794cf2fff0e50a90ac87e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-06-28 17:06:33 +01:00
Allan Sandfeld Jensen
aefb5c5a56 Avoid overflowing coverage in rasterizer
A single examined pixel might have sampled corners outside the logical
constraints, that needs to be ignore.

Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-92485
Change-Id: I105fd42d3388a48f3bb03c00d640832e8e99477c
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-06-28 17:16:47 +02:00
Eirik Aavitsland
3709bc3699 Ensure consistent cursor width under fractional scaling
Under fractional scaling, an N units wide rectangle can in general
cover either M or M+1 pixels, depending on placement. For a tall thin
recangle like the cursor, this difference becomes very visible as the
cursor moves from position to position. Avoid by instead painting the
cursor as a cosmetic line in such cases, since that keeps its width
independently of the current transformation.

Fixes: QTBUG-95319
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I31a31f89fe7eac3037694946aa452a9f2bd6e5be
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-06-28 11:04:10 +02:00
Ville Voutilainen
40ddf2c7f3 Fix an incorrect invocation of llvm-readobj
It's never been entirely sound or necessarily correct to use single-dash
options for long options. Various other things invoked by androiddeployqt
seem to provide only single-dash options, but llvm tools and GNU tools
always provide a double-dash option. Therefore we can just change the
--needed-libs option to use double-dash without any particular version
checks or differences.

Task-number: QTBUG-104580
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I5649b0f9565989157d934c802da1f3c4c43fca0f
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-06-28 09:03:52 +00:00
Alexey Edelev
d4b27d9b52 Avoid including qopenglfunctions header files if Qt is built with GLES2
Change-Id: I3a7a69f5eef604408713934811efb984e78d68dd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-06-28 10:52:23 +02:00
Laszlo Agocs
f814cc6a79 rhi: metal: Switch back to presentDrawable
This convenience should be, according to the Apple docs, equivalent to
calling present from a scheduled handler. (which on its own makes it
unclear why we switched in the first place)

In practice it seems the two approaches are not identical. It looks
like that once a frame is submitted earlier than the next display link
callback, the throttling behavior we implement in beginFrame()
(waiting on the semaphore for the completion of the appropriate
command list etc.) starts exhibiting unexpected behavior, not
correctly throttling the thread to the refresh rate. Changing back to
presentDrawable does not exhibit this at all.

The suspicion is that presentDrawable is probably doing more than what
the docs suggest, and so is not fully equivalent to calling present
manually from a scheduled handler.

Therefore, switch to presentDrawable now, which restores the expected
cross-platform behavior, but make a note of the oddity, and also
prepare the hellominimalcrossgfxtriangle manual test to provide an
easy, self-contained application to allow experimenting in the future,
if needed.

This allows Qt Quick render thread animations to advance at the
expected speed (because the render thread is correctly throttled to
the refresh rate), even if the render thread decides to generate a new
frame right away, without waiting for the next display link update.

Without this patch, attempting to get updates not via requestUpdate(),
but by other means (timer etc.) leads to incorrect throttling, and so
the triangle in the test app is rotating faster than expected - but
only with Metal. Running with OpenGL on macOS or with any API on any
other platform the behavior will be correct. Even if scheduling
updates without display link is not efficient, and should be
discouraged, not doing so cannot break the core contract of vsync
throttling, i.e. the thread cannot run faster just because it renders
a frame not in response to an UpdateRequest.

Amends 98b60450f7 (effectively reverts
but keeps the code and the notes because we might want to clear this
up some day)

Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-103415
Change-Id: Id3bd43e94785384142337564ce4b2644bf257100
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-06-28 10:47:41 +02:00
Laszlo Papp
82309305a7 QStyledItemDelegate: Fix the event filter doc
The class actually also avoids filtering the tab and backtab keys for
the mentioned classes: QTextEdit and QPlainTextEdit.

So, the documentation needs to be extended to cover the hidden gems.

Pick-to: 6.4 6.3 6.2
Change-Id: Id993b055a105c6cfe5ee57be3863ce8bff448396
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-28 08:30:04 +00:00
Thiago Macieira
db342f42a4 CMake: update the x86 intrinsic checks
Merge all the existing checks into a single one, which is a simple pass
or fail, since all our supported compilers support all the intrinsics up
to Cannon Lake. The two I've recently added (AVX512VBMI2 and VAES)
aren't yet supported everywhere, so they stay.

For some reason, all intrinsics seem to be disabled on Android. It looks
like some support was missing during the CMake port and this was never
again looked at. I'm leaving it be.

As for WASM, discussion with maintainers is that the WASM emulation of
x86 intrinsics is too hit-and-miss. No one is testing the performance,
particularly the person writing such code (me). They also have some
non-obvious selection of what is supported natively and what is
merely emulated. Using the actual WASM intrinsics is preferred, but
someone else's job.

Change-Id: Ib42b3adc93bf4d43bd55fffd16c10d66208e8384
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2022-06-28 03:28:42 +00:00
Thiago Macieira
500c116ced CMake: disable the attempt to force SIMD on iOS simulator builds
This will stop working with the next commit, which merges all basic x86
SIMD intrinsics into one configure test. As a result, linking almost
anything graphical on iOS (which is almost everything) causes the linker
to fail with undefined references to SIMD-optimized versions that didn't
get compiled.

Change-Id: Ib42b3adc93bf4d43bd55fffd16c288f4104a6ccc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-06-27 20:28:41 -07:00
Laszlo Papp
dedf11a53b QAction: Fix the obsolete menu() doc
35ddf34988 added QMenu::menuInAction, but
the documentation added to cover it contains a typo.

The method added to replace QAction::menu() is menuInAction, not
menuForAction. It was probably just an oversight.

Pick-to: 6.4 6.3 6.2
Change-Id: I2a6ec846bbe7ac8dd9e0c285bc62dd7e08820459
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-28 00:39:35 +00:00
Thiago Macieira
159a52bf3e QDateTime: remove a few hardcoded values in favor of <chrono> constants
Change-Id: I6d3880c7d99d4fc494c8fffd16fb01b9d9480c67
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2022-06-27 17:39:35 -07:00
Thiago Macieira
5e67e7efaa FatalSignalHandler: print some more information from siginfo_t
The siginfo_t parameter allows us to show what process sent a signal or
the crashing address. Additionally, it allows us to determine if the
crashing signal was indeed sent due to a crash.

The selftest tst_crashes produces now:

$ QTEST_DISABLE_STACK_DUMP=1 ./crashes
********* Start testing of tst_Crashes *********
Config: Using QtTest library 6.4.0, Qt 6.4.0 (x86_64-little_endian-lp64 shared (dynamic) debug build; by GCC 11.2.1 20220420 [revision 691af15031e00227ba6d5935c1d737026cda4129]), opensuse-tumbleweed 20220428
PASS   : tst_Crashes::initTestCase()
Received signal 11 (SIGSEGV), code 1, for address 0x0000000000000004
         Function time: 0ms, total time: 0ms
[1]    201995 segmentation fault (core dumped)  QTEST_DISABLE_STACK_DUMP=1 ./crashes

The last line comes from the shell. The code isn't decoded, but on Linux
it's a SEGV_MAPERR. macOS prints exactly the same thing.

I've updated one of the expected_crashes_*.txt output that doesn't seem
possible (the "Received a fatal error" message does not appear in Qt
anywhere).

Pick-to: 6.4
Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16ebc8391234f0e2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-28 00:39:35 +00:00
Thiago Macieira
68a1f9582b QFont: don't detach the families list in family()
Pick-to: 6.3 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16f93a8b9306b89b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2022-06-27 17:39:35 -07:00
Thiago Macieira
5e60b2ab16 QProcess: re-enable pdfork() on FreeBSD
The forkfd_pidfd is a Linux feature, but we ended up disabling the
equivalent functionality on FreeBSD.

Pick-to: 6.3 6.4
Change-Id: I6d3880c7d99d4fc494c8fffd16fabfbc38865f94
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-27 17:39:35 -07:00
Mårten Nordheim
44927b801a QTest: switch some text-conversion functions to use qsizetype
To avoid potential narrowing.

Pick-to: 6.4
Task-number: QTBUG-104125
Change-Id: I37bfc5c49e7c919f5204a76a905758a92527d864
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-06-28 00:39:35 +00:00
Alexandru Croitor
3eaf6a4cad CMake: Remove Gui dependency of androidtestrunner
It doesn't use any Gui classes and thus shouldn't depend on Gui.
Also change PUBLIC_LIBRARIES to LIBRARIES, executables don't need to
propagate library dependencies.

Pick-to: 6.2 6.3 6.4
Change-Id: I9edae7e555e1d74d63b00afbf9e3931963b502c2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-06-28 00:52:38 +02:00
Fabian Kosmale
ba2ae1720a QString(En|De)coder: Remove noexcept from ctor taking name
It is necessary as the QStringConverter ctor is no longer noexcept, as
it can now allocate memory.
This change is ABI-wise safe, as the method was only changed to be
noexcept in 6.4.
Amends 122270d6be.

Pick-to: 6.4
Change-Id: Ifab4302d659524e27f38f0f90e5813a2c2a4a452
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-06-27 18:25:06 +02:00
Allan Sandfeld Jensen
a2501fff81 Avoid reading outside allocated buffer
Bound the inverse lookup result on the low end as well.

Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-104583
Change-Id: Id357fe1c39c88776075d737b08fc2864a2b6e829
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2022-06-27 16:16:20 +00:00
David Skoland
a0ecc14f30 Minor fixes for qt-configure-module
Put quotes around args var and add e and u flags, which
do the following:

e - terminates the script if an error occurs. This is
certainly desirable behavior. We don't want the script to chug
along with unpredictable behavior if an error occurred.

u - terminates the script if an undefined variable is encountered.
It is also desirable to terminate here because it might lead to
unexpected behavior.

Change-Id: Ia02196ef3eab64521e36771530d033a15bb40ecc
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-06-27 17:55:19 +02:00
Topi Reinio
4a14a9c014 Doc: Fix QJniObject::construct() documentation
Even though QDoc accepted the \fn signature without a class scope,
the documentation does not end up on the class reference unless we
mark construct() as a member of QJniObject.

Pick-to: 6.4
Change-Id: Icae44f8eb24aa6b269242084479e735f2637c312
Reviewed-by: Luca Di Sera <luca.disera@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2022-06-27 16:03:52 +02:00
Laszlo Papp
9521a07af2 QKeySequenceEdit: add a maximumSquenceLength property
At the very least, it would be important to have a single combination
key sequence. This is commonly seen in keyboard shortcut editors where
QKeySequenceEdit is very much applicable.

[ChangeLog][QtWidgets][QKeySequenceEdit] Added a maximumSquenceLength
property.

Done-with: Marc Mutz <marc.mutz@qt.io>
Change-Id: Id7fa5a8593eb150fa67d7e89308492c0a200ac36
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-06-27 12:02:47 +00:00
Mårten Nordheim
4d60ba61dc Fix QDBusInterface crashing with empty path on construction
On some machines having an empty path passed to QDBusInterface
would cause a crash.

This happened because the code created a QDBusMessage and manually
marked it as validated when it was not. The validation would not
pass for this object.

Change-Id: I496dd922fa64353399655a1e84996b99990f5879
Pick-to: 6.4 6.3 6.2 5.15
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-06-27 14:02:47 +02:00
Mårten Nordheim
2ba153dd5f QHttpHeaderParser: fix int/qsizetype nags
These values won't extend past MAX_INT but it may produce warnings
nonetheless.

Found by clang-tidy.

Pick-to: 6.4 6.3
Task-number: QTBUG-104452
Change-Id: Icd8aa80a318274be00a3b32ad26a92745903cecb
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-06-27 14:02:47 +02:00
Mårten Nordheim
f5138d3065 QHttpHeaderParser: fix clang-tidy nags
"use empty instead of checking size"
"no else following return"
"initialize your variables"

Change-Id: I4512471ec15a00f7ac1fccf88a3c87b8aa983ad7
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2022-06-27 14:02:47 +02:00