The initial implementation and the commit
c00ab6f8ea was wrong:
* env->findClass() in fact returns a global reference, and in any
case we shouldn't be calling that, instead QJniObject would be
enough.
* The size param provided to env->RegisterNatives was wrong.
* A test for registerNativeMethods() is added to ensure such break
is not repeated again.
Task-number: QTBUG-89633
Pick-to: 6.1
Change-Id: I4d3a6a9270755f465c40add25521fb750dd4de0a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
A typical Qt application, such as a QML application, is a single full
screen QUIView, containing all of the granular controls of the UI.
The view accepts first responder status, so that we can pass on text
input to a possible text field inside the UI. That however triggers iOS
to bring up the editing interaction menu whenever the user taps with
three fingers, as iOS can't know that only parts of our view is suitable
for interaction.
To mitigate that we override the editingInteractionConfiguration getter
of the view, as documented, and dynamically report the correct enablement
based on whether we have an active focus object that accepts input.
This works because iOS queries the getter from the three finger tap
gesture recognizer, before showing the menu.
Change-Id: I0874340c42e437e1d7251896993f2eafe122f09e
Fixes: QTBUG-89735
Pick-to: 6.0 6.1 5.15
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Allow passing command line arguments such as -AppleLocale, that override
user preferences for the test process.
Change-Id: I9e58e91fcb01a36f9d6c64ef52369308be5e95b5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The system locale of a macOS application is not affected by environment
variables like LANG. Yet, we were reporting a name determined from
environment variables as the fallbackUiLocale(), rather than one based
on the language and country of the actual system locale.
This lead, via the usual CLDR likely-subtag fallback, to claiming the
system locale's name, language, script and country were those obtained
from these environment variables, even when they were at odds with the
actual locale being used by the system, which was being used for some
queries.
Worse yet, any data not supplied by these queries was being obtained
from the same CLDR locale as the name, making for an inconsistent mix
of locale data.
While we cannot avoid the likely-subtag fallback step for fallback
data, it is more consistent to use the actual system locale's name
as start-point for that fallback.
At the same time, add support for the language, script and country
queries, so that the QLocale::system() describes itself faithfully,
instead of claiming to be the locale that results from that fallback.
If we want to support LANG or other environment variable overrides,
they should be handled by the layer above the system locale, by
changing the default locale of the Qt application, as if the user
had called QLocale::setDefault().
[ChangeLog][QtCore][QLocale] QLocale::system() on macOS no longer
pretends to support LANG or other environment variables as overrides,
as this is not a feature that the system locale on macOS supports.
To override the locale of an application, use QLocale::setDefault(),
or pass -AppleLocale en_US.
Fixes: QTBUG-90971
Change-Id: Ibdaf5ff9a2050f61233a88eabf3c29094f7757f1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The standard user defaults are initialized from an ordered list of domains,
as documented by NSUserDefaults.standardUserDefaults. This includes e.g.
parsing command line arguments, such as -AppleLocale "fr_FR", as well as
global defaults. AppKit does this during [NSUserDefaults init], which in
turn initializes the locale returned by CFLocaleCopyCurrent() and
NSLocale.currentLocale.
If those functions are called before NSUserDefaults does its thing the
locale will already have been created, and the logic in NSUserDefaults
won't have any effect -- nor is there any way for us to set/override
the locale after this.
To ensure that the -AppleLocale command line override is available through
the lower level Core Foundation preferences APIs, we need to initialize
the user defaults as early as possible via the Foundation-API.
Change-Id: I906a5a8b05a7216e60020ec45f8da725b801d2c5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Previously the only test was that it produced no warnings,
if anyone paused to read the output to notice them.
Change-Id: I225ca99c7ec316186702c0fdb355585374c014a4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Normal Android apps require Qt::Gui dependency and since tests don't
need to handle any special cases for an app without Qt::Gui, let's add
it by default.
This also will allow us to remove some workarounds done on CI side to
run tests for Android.
Fixes: QTBUG-90870
Pick-to: 6.0 6.1
Change-Id: I845650c17a1b73e4c4977043f863ec44e50f06c3
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
We must not guess the compiler from the -platform argument if one of the
following holds:
- the CXX/CC environment variables are set
- the CMAKE_CXX_COMPILER/CMAKE_C_COMPILER variables are passed
Pick-to: 6.1
Fixes: QTBUG-90914
Change-Id: Iff7a0e7b8857f77333f1705f118d7952af5234ba
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
The attempt to call target_link_libraries on OpenSSL::Crypto failed when
this target was added as UNKNOWN library by FindOpenSSL.cmake.
Instead, set the INTERFACE_LINK_LIBRARIES property directly.
Pick-to: 6.1 6.0
Fixes: QTBUG-90925
Change-Id: Idbc1379c89480225fc7a8d417416ed20404a1122
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Lines smaller than 1e-12 would not be drawn even when scaled up.
Pick-to: 6.1 6.0 5.15
Fixes: QTBUG-75630
Change-Id: I8f261876c325b60f61e95ca2e5fde2cb227d4cba
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Qt CMake uses a fake_prefix as install dir when running tests instead of
the main qt install path, this will throw androiddeployqt off since it
expects the real qt install path which has gradle and java sources.
Fixes: QTBUG-88579
Pick-to: 6.0 6.1
Change-Id: I6580470840ae14d4a4a68a95f217b30408d7ab44
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
When a feature is set in qtbase and is later set to another value,
an error occurs and an error message is given. This patch
changes the error message to contain both the preexisting and the
new value
Change-Id: Ifa9fc1f06bfde40e8fd5dfdf30165d4393abbd28
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This prevented androiddeployqt from properly deploying libraries which
specify init class via the ":" delimiter.
Pick-to: 6.0 6.1
Change-Id: Ib9cfa7edc864d7d540577df22284ceb9714a2511
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Somehow QList::fill(t, newSize) introduced a regression in Qt6:
when newSize < QList::size() we should resize to the newSize.
This is aligned with QVector::fill() in 5.15 and std::vector::assign()
While 6.0 is already out, picking it to 6.0.x could save someone who
haven't migrated yet as well as fix some accidental bugs in Qt's code
[ChangeLog][QtCore][QList] Fixed QList::fill() regression introduced in
6.0: calling fill() with size < current list size wouldn't truncate the
list
Fixes: QTBUG-91042
Pick-to: 6.0 6.1
Change-Id: Ic166e2c5e42390b61df1030f7c705e344433f7f2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Keep the c++2a feature, but make it an alias for compatibility
purposes.
Pick-to: 6.1
Change-Id: I6f153109be84659806f1b7a57a88a187875166d8
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
PostgreSQL package delivers several header files such as pthread, zlib,
zconf, uuid, etc. within Windows installation package. The headers are
exposed to the compiler by PostgreSQL include paths and have different
versions. When compiling PCH of the QPSQLDriverPlugin plugin, MinGW uses
the pthread.h header from the PostgreSQL include paths, that cause an
error related to pthread implementation mismatch.
Disable PCH for the QPSQLDriverPlugin plugin, when using MinGW.
Fixes: QTBUG-90850
Change-Id: I0be91bbefe37731acb2658d679b5b644ef552b23
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
They cannot be built due to QTBUG-91033.
Task-number: QTBUG-91033
Fixes: QTBUG-88758
Pick-to: 5.15
Change-Id: I6f75cac1b20208c7813addd1ebe578c9edae295a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
gcc 9 consumed enourmous amounts of memory building the test, regularly
dying on a VM with 4GB RAM. Splitting it up helps.
As a drive-by, use inline static variables, and rename the header used by
other tests to tst_qmetatype_common.h.
Change-Id: Ib716d8e3506aac6c87845e57b04cb1a4f6c68387
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The text of QPlainTextEdit might change when it is invisible, so an
adjustment of scroll bars is needed when the QPlainTextEdit showing
up, otherwise the range of scroll bars might be incorrect.
Fixes: QTBUG-77937
Pick-to: 5.15 6.0 6.1
Change-Id: I45c686c7e09ca7b2944c36122e9157de0ec4f0e0
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Introduce the 'printsupport' feature to control whether the PrintSupport
module is built.
[ChangeLog][QtPrintSupport] Building of QtPrintSupport can be disabled
by passing -no-feature-printsupport to configure.
Fixes: QTBUG-90778
Change-Id: I8a9a4b7f8dd8f39a81565c8eb14ce1ae0839267d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Nodir Temirkhodjaev <nodir.temir@gmail.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Other affected rows have also been fixed.
Change-Id: Ie0a32f724bd2e40e7bfacfaa43a78190b58e4a21
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The default variation of the DATETIME class is to show the layout for
date and time. If either date or time is requested, then only set one
of them.
Pick-to: 6.1 6.0 5.15
Change-Id: I5178f5f80490b7b0d7e7011d11da402a316d164a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
sizeof(1) should be fine, but it looks weird, so let's just use the type
instead.
Change-Id: I543462a837b0214883ca389be0e7e6ba2057cdd0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Experiment with this once again, this time in a more forward looking
manner: move the code previously placed into eglfs's eglfs_viv backend
into its own plugin.
Move our attention to devices like the Raspberry Pi 4, where
VK_KHR_display has recently been introduced to the Mesa v3dv
backend. This is not in Mesa 20.3.3, the latest release at the time of
writing, but is available and functional when building master. This
serves as the reference system for testing the plugin, because it
looks like a fairly robust implementation.
The sole thing the plugin enables at the moment is creating a
QVulkanInstance and a QWindow with surfaceType VulkanSurface. This is
sufficient to run plain QWindow+QRhi (with QRhi::Vulkan), Qt Quick,
and Qt Quick 3D (with QSG_RHI_BACKEND=vulkan) applications.
One display and mode is chosen, by default the first in the
enumeration lists reported by the Vulkan extension. This can be
overridden with QT_VK_DISPLAY_INDEX and QT_VK_MODE_INDEX (modeled
after QT_VK_PHYSICAL_DEVICE_INDEX). The indices can be determined
based on the logs printed to the debug output. Changing the mode seems
to be working nicely with v3dv.
Multiple screen setups, where there would be more than one
VkDisplayKHR enumerated, have not been tested yet. Regardless,
multiple screens (reporting more than one QScreen, with a different
QWindow on each, eglfs style) are not currently supported. This may be
improved later (while keeping in mind that VK_KHR_display does not
have a fully-featured output management API).
Multiple (non-fullscreen) windows and especially raster windows
(QWidget) are not and will not be supported. Our single QWindow is
always forced to fullscreen.
When it comes to input, the level of support should match linuxfb and
eglfs. Note that while mouse input is fully functional, there is no
mouse cursor. (and this is unlikely to be implemented)
[ChangeLog][Platform Specific Changes][Embedded Linux] Introduced a
vkkhrdisplay platform plugin to run Vulkan-based applications in
fullscreen, without a windowing system, on systems where
VK_KHR_display and VK_KHR_display_swapchain are supported by the
Vulkan implementation.
Change-Id: I6388416f7fb2bfdc4b412a0a4971f25cc05d4668
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
QT_QPA_EGLFS_DEBUG=1 prints the attributes for the chosen EGLContext.
Make QT_QPA_EGLFS_DEBUG=2 print the same for all EGLContexts.
Pick-to: 6.1
Change-Id: Id161d04789fbd015e29e5a5a89a0901000096ea3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Based on the old bearer manager code!
A lot of the old code went away though since it had been deprecated
in the time since it was written.
Task-number: QTBUG-86966
Change-Id: I21a6db1d4ebd8367084355a8e3202f4c05d9dce5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit 8652493529a46a375c11bbaf16d2122ee8466c29)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
By default, qmake does not compile source files that are included in
other source files. The new CONFIG option compile_included_sources
disables this behavior.
Pick-to: 5.15
Fixes: QTBUG-90801
Change-Id: I60c997938895f3a743d32ea385efdbe6bcf315bb
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
This is supposed to be mapped to INSTALL_TRANSLATIONSDIR, not
INSTALL_TRANSLATIONDIR (without the s).
Pick-to: 6.0 6.1
Fixes: QTBUG-90946
Change-Id: Icec93ffc0dc80d9ac7cf6cf1b13824bc2a1e795f
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
It fails on 10.15 and 11, preventing those from being significant,
and the test is already marked as expect-fail based on QTBUG-20984.
Task-number: QTBUG-20984
Change-Id: I6911166a1c3e9173d6d36f2a3a68b37778fd3406
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Calculate the effective width of the hyphen better, and compare with
ceiled sizes.
Pick-to: 6.1 6.0
Fixes: QTBUG-90698
Change-Id: I7ed2eb44c54240ecb2f8a38e5acf1f32608b2bfb
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
The "2" is meaningless. We retain the old name as alias for source
compatibility, but we don't document it anymore.
Task-number: QTBUG-85064
Change-Id: Id10d58f6d39a0faaec042304b374ae6b23469362
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
The unquoted 'string(FIND ${toolchain_file_content} ...)' call fails for
multiline content of the variable toolchain_file_content, so add
quotes around, fixes:
[...]
CMake Error at cmake/QtAutoDetect.cmake:42 (string):
string sub-command FIND requires 3 or 4 parameters.
Call Stack (most recent call first):
cmake/QtAutoDetect.cmake:311 (qt_auto_detect_android)
CMakeLists.txt:19 (include)
[...]
-- Configuring incomplete, errors occurred!
in case the given toolchain file starts with multiple lines
in the first 80 characters, e.g. in the case of buildroot:
#
# Automatically generated file; DO NOT EDIT.
# CMake toolchain file for Buildroot
#
[...]
Task-number: QTBUG-90980
Pick-to: 6.0 6.1
Change-Id: I8e038e08d83016e8253f2e83b2efb8f06034c6cd
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Add support for opting in to PerMonitorV2 DPI awareness
on the command line:
-platform windows:dpiawareness=3
This mode is supported on Windows 10 and up. Setting it
requires using the new SetProcessDpiAwarenessContext
API, which can be resolved from user32.dll.
Task-number: QTBUG-68712
Change-Id: I37821e27a67e08c2e9fef25e494cfd7abed13314
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>