A case where the accessing the clipboard is done when the application
does not have the input focus. Android does not allow access in this
case and returns null on the getPrimaryClip. This happens on some
examples like Analog Clock. Does not happen on autotests.
Fix was adding a test for null.
Fixes: QTBUG-107926
Change-Id: I685594545e5ae8102c257c033fffbcc4f20cef9a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
In bootstrap mode, we don't build qsimd.cpp and don't check for CPU
features, but specifying -maes in the compiler command-line can still
enable the AES hash support in qhash.cpp. This has probably been broken
since Qt 6.4 with commit 4be85491e0.
qhash.cpp:(.rdata$.refptr.qt_cpu_features[.refptr.qt_cpu_features]+0x0): undefined reference to `qt_cpu_features'
Pick-to: 6.4
Change-Id: I07ec23f3cb174fb197c3fffd17216241cfd1ab19
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Removes a warning in the build.
Pick-to: 6.4
Change-Id: I07ec23f3cb174fb197c3fffd17215c40b40333cb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
QSystemLocale is now defined for QT_NO_SYSTEMLOCALE builds (bootstrap),
but no implementation will be present. That's just to get the enum
declarations.
Pick-to: 6.4
Change-Id: I3c79b7e08fa346988dfefffd171fa00fde8ab080
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
I don't think I understood what this does when I coded it. It wasn't
needed with the Linux kernels of the era.
[ChangeLog][QtTest] Specifying attributes with the -perfcounter command-
line option for Linux performance counters is deprecated. QtTest will
ignore the colon and any attributes listed there, though future versions
of QtTest may reintroduce attributes if needed.
Change-Id: I3c79b7e08fa346988dfefffd17202684fc2cf650
Reviewed-by: David Faure <david.faure@kdab.com>
The kernel has become more paranoid since 2013, when I originally wrote
this code. The kernel.perf_event_paranoid sysctl controls the paranoia
level[1]:
=== ==================================================================
-1 Allow use of (almost) all events by all users.
Ignore mlock limit after perf_event_mlock_kb without
``CAP_IPC_LOCK``.
>=0 Disallow ftrace function tracepoint by users without
``CAP_PERFMON``.
Disallow raw tracepoint access by users without ``CAP_PERFMON``.
>=1 Disallow CPU event access by users without ``CAP_PERFMON``.
>=2 Disallow kernel profiling by users without ``CAP_PERFMON``.
=== ==================================================================
Since the default is 2, we QBenchlib has been failing with EACCESS:
PASS : tst_MyClass::initTestCase()
QBenchmarkPerfEventsMeasurer::start: perf_event_open: Permission denied
[ChangeLog][QtTest] Fixed support of Linux performance counters for
QBENCHMARK, which used to fail with "Permission denied" errors in
default configurations. Now, QtTest will automatically fall back to
profiling only userspace, like the perf(1) tool does.
[1] https://github.com/torvalds/linux/blob/master/Documentation/admin-guide/sysctl/kernel.rst#perf-event-paranoid
Pick-to: 5.15 6.2 6.4
Change-Id: I3c79b7e08fa346988dfefffd171f897be7794935
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: David Faure <david.faure@kdab.com>
Each module now identifies its actions during the configuration by a
prefix, e.g., `[QtBase]`. In addition,
- I have slightly modified some of the `message()` commands to get
a more coherent output.
- `syncqt.cpp` prints its output as WARNING if any
Change-Id: I3922d75a668d94f402068f4121751b7fcb6522b4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Just to make sure it is not broken and will not break.
Change-Id: I947f8225027d6b6744eb8b774058b7e4d923b61d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Pick-to: 6.4
Change-Id: I9504b41b743b9874fcc6324d98b66a9c5160e845
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The purpose of warming up is to get all code paths executed, so any lazy
function resolving is processed, statics are allocated, etc. There's no
reason to run it more than once -- if you're trying to train the Branch
Predictor Unit, you'd want to do it another way anyway. This is useful
when benchmarking with -iterations N, because QBenchlib currently runs
2*N iterations because of the warm up. That just wastes time.
Change-Id: I3c79b7e08fa346988dfefffd172030c889b31a1f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
From CMake 3.7 both flavors of `cmake_parse_arguments` are natively
available in CMake, and loading the
`CMakeParseArguments` module is not needed anymore.
Fixes: QTBUG-107574
Pick-to: 6.4
Change-Id: I7c8a6c5871cdb2f92a4aa43932b6f2ee99e1f57f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
As stated in `QtBuildInternalsConfig.cmake`, `cmake_minimum_required`
versions should be synced with `qtbase/.cmake.conf`, but it wasn't at
the moment.
Change-Id: I8100370778707d46abe973b681fd4aba182a7513
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Avoid using top-level ${target} variable in the function. Align the
module's '_header_check_exceptions' file name, so it should use
_qt_module_interface_name property, but not the qt_module_include_name
proeprty as the prefix.
Amends b89d63515b
Task-number: QTBUG-87480
Change-Id: I1a3ceee1a29f2f4a7cb727310b4fdac63d8144e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When building Android multi-ABI application in source tree the
ExternalProject_Add call generates a ninja rule that looks as
follows:
cd <BINARY_DIR> && cmake <CMAKE_ARGS> <SOURCE_DIR>
In general case the rule works correctly unless SOURCE_DIR contains
CMakeCache.txt. In this case the cmake call uses the existing
CMakeCache.txt as the reference and tries to reuse the build directory
of the main ABI. It leads to the inconsistency for multi-ABI builds
and rewriting CMakeCache.txt. Passing both '-B' and '-S' arguments
explicitly avoids using CMakeCache.txt from a main build/source
directory and fixes in-source multi-ABI builds.
Fixes: QTBUG-107843
Pick-to: 6.4
Change-Id: I010b47bff81052401aebe459e7893838a9b99bc1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
MinGW-clang warns(-as-error) that the overridden functions are not
marked noexcept like in the original class.
Pick-to: 6.4 6.2
Change-Id: I7c5663b82e0f4449e27fd3842f7b37015fd5f4ea
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Adds a consteval QPropertyBindingSourceLocation::fromStdSourceLocation
to make sure the QPropertyBindingSourceLocation is created at compile
time.
This is a workaround for what seem to be bugs in MSVC 2019 and 2022,
which otherwise don't regard
QPropertyBindingSourceLocation(std::source_location::current()) as a
constant expression.
Fixes: QTBUG-106277
Pick-to: 6.4 6.2
Change-Id: Ic2379987b278cc0c43c1eb929120c99f5cd95fdf
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
The `rcc_PREFIX` will be set to `/` if it is not passed to the
function and it is not defined in `QT_RESOURCE_PREFIX`.
I also removed an unnecessary check of the `rcc_PREFIX`.
[ChangeLog][QtCore][CMake] The `PREFIX` parameter of the
`qt_add_resources` is now optional. If not passed, and
`QT_RESOURCE_PREFIX` is not defined, `/` will be used as the path
prefix.
Fixes: QTBUG-104938
Change-Id: I6524ab5dc54f035272e4c2e3154eb67591efb650
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
With -no-feature-sql, CMake would error out because the target Qt6::Sql
didn't exist. Fix this by checking if the target exists.
Task-number: QTBUG-102480
Pick-to: 6.2 6.3 6.4
Change-Id: I411631acfd336ea699833954f86711067d160c04
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
While the strlen() calls don't raise warnings themselves, it seems like
they were artifacts of indexOf() returning int instead of qsizetype.
Task-number: QTBUG-103527
Pick-to: 6.2 6.4
Change-Id: I32fbf69feca38a5977dde084bef9993f24843ccf
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Recent versions of Emscripten may abort if module_property()
is used to look up specialHTMLTargets, which makes run-time
checking impossible. The abort is implemented on the JS property
getter on the Module object, which means that it's not possible
to bypass this by using e.g. EM_ASM instead of the C++ API.
Disable usage of specialHTMLTargets on emsdk > 3.1.14 for now,
until we can add API (or find some other means) for opting in.
This commit also adds functions for comparing Emscripten
versions.
Pick-to: 6.4
Change-Id: Ibe5d1a82f267fa95dd62cdfc66595bc23036933f
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Move install paths from CoreConfigExtras.cmake to a separate file
for the easier usage. This specifically can be useful to detect
read required paths for android deployment in multi-ABI builds.
Change-Id: Iacdf3a8d3ae7615ac6669a067e6f12bdf5043d5a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Many applications offer shortcuts for quick interaction with the
application. It is also common in such applications to offer a shortcut
editor in the preferences or separately in a dialog.
However, even though this is a fairly common use case for applications
with more than a couple of shortcuts, there is no good and comprehensive
official Qt example how this could be achieved.
This change is an attempt to bridge the gap.
Change-Id: Ic01a404e6157bda1b0a75a0b792cbfe5d910d48f
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
All *deployqt tools are user-facing and should have a versioned link in
the installation prefix.
Change-Id: I26dde529657da0a68401e4fd721926d9978eb879
Reviewed-by: Amir Masoud Abdol <amir.abdol@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Interesting on its own just because it exercises stencil testing,
unlike any of the other existing manual tests.
In addition it serves as a base example for how outlines could be
done, it is one possible approach at least. (render with stencil
write, then render again slightly scaled up with a solid color with
testing against the stencil buffer content)
Change-Id: I0c845a9004136f229cab037f6f0aab2f772bdd76
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Locally I cannot build Qt with the default ld linker.
Only enabled bfd and lld because mold and gold is not available
for Windows.
Pick-to: 6.4 6.2
Change-Id: Ib57562b07219acc47f53fe5b0944f54d9c2a6ba6
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
With c++20 doing operations between different enums is
warning(-as-error).
Declare operator-overloads for a particular pair of enums to make this
compile again. Requires giving one of them a name as it was previously
unnamed.
Pick-to: 6.4 6.2
Change-Id: I23296117b6d9a84273da6639582e075d631e5602
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This introduces a new helper function accessibleIdForAccessible
(inspired by Windows' automationIdForAccessible) to synthesize an id out
of the objectNames of the accessible parent chain. The id is then
exposed via the GetAccessibleId D-Bus function for consumption in a11y
tools.
Change-Id: If72b86c5864c43f4ca842aa11423dd8aea0dde4a
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
Asyncify is a scoped object within emscripten runtime main function.
Use of EM_JS seems inevitable at this point.
Change-Id: I4852a7054a5e01583139cb54a0e14f604ac8ed13
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
In androiddeployqt we try to add all plugins that belong to the Qt
modules that Android application links. This works in case if all the
plugin dependencies are linked to the Android application explicitly
or implicitly using a build system linking mechanism. But plugins may
have dependencies that should be resolved implicitly by
androiddeployqt. The following situation is handled by this change:
App1 links QtLib1.so
QtLib1.so promotes its plugin plugin1.so to be included to an apk
plugin1.so links QtLib2.so
In the described example App1 expects that plugin1.so with all the
dependencies is deployed to an apk without the need of linking
QtLib2.so explicitly.
There is a negative side effect of this change. plugin1.so is added to
apk unconditionally so there could be a situation when the plugin is
unused. So QtLib2.so with its dependencies will be included to an apk
without necessity and will increase the size of the apk significantly.
Cleanup forward declarations in androiddeployqt's main.cpp by moving
them to the top of the file.
TODO: Need to add the API which allows to exclude such plugins from apk
or to specify the list of essential plugins that are used in the
Android application. See QTBUG-107634 for details.
[ChangeLog][Android] All plugins that belong to the Qt modules that are
linked to the Android application are now deployed with their
dependencies. androiddeployqt tries to find and resolve plugin
dependencies implicitly instead of skipping plugins with dependencies
that are not resolved explicitly in the user project.
Fixes: QTBUG-107589
Fixes: QTBUG-106035
Change-Id: Ib6d9abd74ae5e21e856d7ccd02789a7a65602f40
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
On Windows 11, the UXTheme API draws both MBI_PUSHED and MBI_HOT in the
exact same color as the icon grove. For menu items with icon, but with
no explicit "On" icon, that makes it impossible to see whether the item
is checked.
Work around this problem by drawing the background in a light version of
the highlight color, which simulates the style on Windows 10.
Note: In modern Windows 11 menus, checkable items with icons render both
the checkmark, and the icon next to each other.
Pick-to: 6.4 6.2
Fixes: QTBUG-98354
Change-Id: I830eca5cdb3317f69dd5c863586e0b0eaa8774d2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Amends cf42a0fe5e.
As a drive-by, reflow the documentation, and mark some code segments
with \c
Change-Id: Id644e841f9990dd7aec2d7ce74efad8b4472b93a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
This exposes the same objects that were ere available through
QPlatformNativeInterface except egldisplay for which we may find
a better place.
[ChangeLog][QtWaylandClient][QGuiApplication] Add
QNativeInterface::QWaylandApplication
that allows to access central native wayland objects.
Task-number: QTBUG-94729
Change-Id: I8611522a4c9bddec3afbb5f183ffa68565f61f68
Reviewed-by: Aleix Pol Gonzalez <aleixpol@kde.org>
This fixes a typo in the name of the variable, `arg_BIG_RESOURCES`, as
it should be `rcc_BIG_RESOURCES` instead, because `rcc` is the prefix
given to the corresponding `cmake_parse_arguments`.
Fixes: QTBUG-107575
Change-Id: I1ef276ed90f8603121d1dc6e117c02ff821900ef
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We currently don't have any machinery for qmake or CMake to map
translations declared via TRANSLATIONS += or qt_add_translations
to the Info.plist CFBundleLocalizations key.
This results in macOS and iOS falling back to the development region,
CFBundleDevelopmentRegion, as the only supported localization of the
app, which is in most cases set to 'en'.
Unfortunately this doesn't work well with the behavior of iOS 11+
and macOS 10.13+ where the OS will set the locale of the app to
the best match between the app's supported localizations and the
user's preferred language.
https://developer.apple.com/library/archive/qa/qa1828/
Since we only support a single localization, the development region,
the locale always ends up as 'en_<REGION>', which after QTBUG-104930
is also reflected in the QLocale's uiLanguages(), resulting in the
QTranslator machinery always picking English translation for the app.
As long as we don't explicitly declare CFBundleLocalizations we need
to opt out of the system's behavior of finding the best match between
the app's declared localizations and the user's preferences, which we
can do via the CFBundleAllowMixedLocalizations key.
Fixes: QTBUG-63324
Pick-to: 6.4
Change-Id: If7586d342148cbbb1d2a152cef039aad4448b13c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The name of the variable that handles the qm file is qmlFile.
Change-Id: I873c73cd8f96ff821fe3d2e633e84fef8c687875
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The GUI scale factor was taken into account twice, once in
QBackingStore::resize and then again implicitly in
QWasmBackingStore::resize, through window()->devicePixelRatio(),
which contains it as one of its multipliers.
Fixes: QTBUG-80992
Pick-to: 6.4
Change-Id: I75ac8d85c14230207379b789834256de4254811b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
I don't see anything using them in any unit test or other Qt module, and
they are marked internal.
Change-Id: I3c79b7e08fa346988dfefffd172028dae6d9e1ba
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It was probably part of the original design to have an intermediate
measurement to determine whether the results were acceptable or not, but
it was never used. So just remove.
Change-Id: I3c79b7e08fa346988dfefffd1720281b2512b8c1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Commit 8995045c62 forgot to remove this
portion.
Pick-to: 6.4
Change-Id: I3c79b7e08fa346988dfefffd17202b19665ddc8a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Avoids the special case in the code and removes the need to run a large
number of iterations to get any useful result, plus makes it's more
readable:
From:
0.00002125 msecs per iteration (total: 2,125, iterations: 100000000)
To:
22.082 nsecs per iteration (total: 22,082, iterations: 1000)
Pick-to: 6.4
Change-Id: I3c79b7e08fa346988dfefffd171facc98af9e9fc
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
QTreeView draws the different sub-rects of an item's background over
multiple calls to drawPrimitive(PE_PanelItemViewRow). The item row is
not separately stylable, but the item might have a styled background
property. To get a consistent background, we must use the item's
background rule when filling the item's row background.
To fix that, delegate the filling of the branch background to
drawPrimitive(PE_PanelItemViewRow), and implement PE_PanelItemViewRow
handling to render the rule for the ViewItem pseudo element if there is
a background rule defined for it.
Add a baseline test stylesheet for this scenario. Note that the selection
in an item view is better styled via the selection-background-color
qss property.
Task-number: QTBUG-73251
Task-number: QTBUG-106227
Pick-to: 6.4 6.2
Change-Id: I5d0c170f78009fe5015dd749975e6df27485b3b8
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The fix for QTBUG-73251 in f4976f86cd
resulted in QTBUG-106227. Add baseline test coverage for the respective
configuration to make sure we don't regress.
Refactor mapping of index to configuration to make accessing of subitems
more robust.
Task-number: QTBUG-73251
Pick-to: 6.4 6.2
Change-Id: I530ecd67fa5663f219884f641bc5e25c7ac5fe73
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>