The WASM platform populates a family asynchronously, so we can't
assume that a family will be populated straight after calling
ensurePopulated().
By adding a bool return to the function we can teach all the call
sites to behave as if the font family does not exist yet if the
font was not populated.
The WASM platform will then invalidate the font database when the
populated font's data comes in asynchronously, and then be ready
for another call to ensurePopulated, which this time will succeed
to populate the family.
Change-Id: I4e0e6211c10e5c1123beebd77aca28ac82ba7186
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Aleksandr Reviakin <aleksandr.reviakin@qt.io>
QFreeTypeFontDatabase allows registering fonts either by filename,
ending up with FT_New_Face, or via raw data, resulting in a
FT_New_Memory_Face. We then register the font with QFontDatabase
using a custom FontFile handle, where store the filename.
When then getting a callback to QFreeTypeFontDatabase::fontEngine
we would pull out the filename from the handle and call
QFontEngineFT::create with this filename.
This meant that if a font was registered with raw data, the font
engine creation would only work if there was a corresponding valid
file name/path. The only reason this works for addApplicationFont
is that QFreetypeFace::getFace() has a hard-coded workaround for
:qmemoryfonts where it uses qt_fontdata_from_index to get at the
original data.
Luckily for us QFontEngineFT::create already takes a QByteArray
data argument, which is plumbed to QFreetypeFace::getFace as well,
so all we need to do is fix the first part of the plumbing by
adding the original data to the FontFile handle and passing it
on in QFreeTypeFontDatabase::fontEngine.
This would potentially allow us to remove the hard-coded logic
for qmemoryfonts, but this has not been further investigated.
QPlatformFontDatabase also has another fontEngine overload that
takes a QByteArray directly, but this code path is only used by
QRawFont for now. A future improvement would be to unify some
of this logic.
Finally, it's unclear why the FT font database uses a custom
FontFile as a handle, instead of the original FT_Face that was
already created in addTTFile(). As a result of the current
approach we end up creating the face both when registering it,
and when creating a font engine for it. Investigating this is
left for later.
Change-Id: I7e01820a82d2664e8f34c3553bdcebe6a7afa078
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
As a drive-by, remove the unused include for std::bad_alloc from
qglobal.cpp.
Task-number: QTBUG-99313
Change-Id: I4b26b4413e6fe7ac3b1e285d0db5b81b429a4713
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
For other modules that wrap invokeMethod and equivalent, like
qtwebchannel.
Task-number: QTBUG-105596
Change-Id: Ic6547f8247454b47baa8fffd170bbca806b04d8f
Reviewed-by: Arno Rehn <a.rehn@menlosystems.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
There are seemingly no differences in how the menu operates and this
fixes WASM without asyncify hanging on menu open attempts.
Fixes: QTBUG-104963
Change-Id: If4364f08acb75947e03ecced85d77af9af0498ba
Pick-to: 6.4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This looks like a remnant of previous WIP code and was
added in commit 8e1ff45e74
("Add Linux Accessibility Bridge").
Change-Id: I8fab2c3554af101ed134715a4d4a494bdb01fc98
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Only return a string for the attribute value
(an empty string if the attribute is not set).
The previous implementation was based on the incorrect
signature in the XML spec for the AT-SPI Text interface from
before the AT-SPI commit that removed the extra out params [1]:
commit 8786849ce6e9914383aa766ff9ce7e00f5b2178d
Author: Patryk Kaczmarek <patryk.k@samsung.com>
Date: Mon Sep 28 14:23:15 2015 +0200
Fixed atspi_text_ functions
* atspi_text_get_text_attribute_value
Fixed dbus signature in _atspi_dbus_call function
and add missing argument for string.
* atspi_text_get_default_attributes
Receiving return value by reference from hash table
https://bugzilla.gnome.org/show_bug.cgi?id=755731
[1] 8786849ce6
Fixes: QTBUG-105752
Pick-to: 6.4
Change-Id: I66d3c484ecc4b469684635723242c915e4365e6a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This adds support for setting parent window for GTK dialogs on Wayland
using the new API added for portals
Change-Id: I29085c926ce4338ff2ad75728d566ec843d3aa5a
Reviewed-by: Liang Qi <liang.qi@qt.io>
We currently build Qt for simulator using X86_64, even
on ARM based macs. This results in the simulator running
on ARM, while the app is running inside it using Rosetta.
And with this combination, the event.timestamp, which is
documented to be in seconds, looks to be something else, and
is not progressing in sync with a normal clock.
Sending out mouse events with a timestamp that doesn't follow
normal clock time will cause problems for mouse-, and pointer
handlers that uses them to e.g calculate the time between a
press and release, and to decide if the user is performing a tap
or a drag.
For that reason, we choose to ignore UIEvent.timestamp under
the mentioned condition, and instead rely on NSProcessInfo.
Note that if we force the whole simulator to use Rosetta
(and not only the Qt app), the timestamps will progress normally.
Fixes: QTBUG-105810
Pick-to: 6.4 6.3 6.2
Change-Id: Ib4e60593cac3230567ebc53d634f434fcefc98d0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
This fails on Android 12 in CI.
Task-number: QTBUG-105739
Pick-to: 6.4 6.3 6.2
Change-Id: Ibf3deb6b84564f12b5172f2522875fe70f8ce87b
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This fails on Android 12 in CI.
Task-number: QTBUG-105738
Pick-to: 6.4 6.3 6.2
Change-Id: I94fcefae3d88087cd96f4043b015f9469ed629a9
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Android kills this test case which tries to use too much memory,
or it times out.
Pick-to: 6.4 6.3 6.2
Task-number: QTQAINFRA-4748
Change-Id: Ifce92533d50f4c463ee10fe80e7654ad16172a35
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Clarify that the hyphen is the actual character that one can use.
The way the documentation was written might have been misleading.
Pick-to: 6.4
Change-Id: I55a9ede9903a8ac5bd33d8e138b3a0a21a820406
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
The default camera to plane distance is 1024, when rotating a big image
along the x or y axis, some areas of the screen may move above the
camera, causing the rotation to fail. A new rotation interface has been
added to allow users to specify the distance from the camera to the
plane themselves when rotating the QImage. Also, this support has been
added to QMatrix4x4::projectedRotate.
[ChangeLog][QtGui][QTransform] Added overloads to rotate() and
rotateRadians() that allow specifying of the distance to the rotation
plane.
Fixes: QTBUG-105088
Change-Id: I81f629916ddd9b6ab84e0282191e4284a88a85f5
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Windows VMs are provisioned with shared folders that are available as
\\${COMPUTERNAME}\testshare(writable)
so we don't need to access a remote SMB server over network anymore just
to test whether our string-parsing code handles UNC paths correctly.
Add a QTest::uncServerName() helper function to the shared filesystem.h
header and use that instead of QtNetworkSettings::winServerName. The
latter is now only used in tst_NetworkSelfTest::smbServer().
Pick-to: 6.4
Change-Id: Id0da66369ad0f4a980d612de2a31a391f1192253
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Not just the ones we added to the pending sockets list
Pick-to: 6.4
Change-Id: I0a0016fe39df7ca2fc3f0c4e4111195bc6d90198
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
If a client doesn't send any data then we would leave the socket open
for as long as it needed, wasting resources. Add timeouts to limit the
amount of time this can happen for.
Since there is a limit on number of sockets that the server will have
queued, having idle sockets stick around forever is a vector for ddos.
Pick-to: 6.4
Change-Id: Ida6251c92c625eeadf2065861b840b14255654b8
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
SecureTransport ignores any content that comes in until it is large
enough to be a handshake. So a plaintext client may be left hanging
while it is waiting for a response.
Pick-to: 6.4
Change-Id: I501ae61d89d516765c7ba5f0d916d9246fde5d4d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Then we don't have to do a 'global' disconnect() on the socket object
just to disconnect the QSslServer from the socket.
Pick-to: 6.4
Change-Id: Ie3c9680db2717e21a0c548c74374a58d533534fe
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Build a simple widgets qmake project when targeting iOS in the CI.
This ensure we don't introduce basic regressions in the .pri / .prl
file generation.
Make sure to target the ios simulator, so we don't require any
code signing or provisioning profiles.
Pick-to: 6.4
Fixes: QTBUG-96058
Change-Id: I1a5564e838a5ce3cac89a37a5a4ddee74d3400f3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Uses CMake's add_test and fixtures to call qmake and make,
thus allowing to create tests that ensure that building qmake projects
works.
Pick-to: 6.4
Task-number: QTBUG-96058
Change-Id: I6f03c4389896f9571bb4f9551f93295075c3d8e1
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
It's needed for creating qmake build tests.
CMake / CTest has a limitation of not allowing to create single-config
tests when using a multi-config generator using the add_test(NAME)
signature.
Using add_test(NAME) forcefully creates per-config tests, which means
that it's not possible to just run ctest to execute tests, without
specifying a -C parameter, which we do in the CI.
qmake tests need to use the add_test(NAME) signature
to specify the WORKING_DIRECTORY option.
Because of the above limitation, a work around is to not use the
add_test(NAME) signature, but instead delegate the working directory
assignment to a generated cmake script, which
_qt_internal_create_command_script can already do.
Pick-to: 6.4
Task-number: QTBUG-96058
Change-Id: I6f439165994671724157f0edb7a71e351271e329
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
QAccessibleTableCellInterface provides everything
needed to support the AT-SPI TableCell interface [1].
Therefore, expose that AT-SPI interface and implement
handling of the corresponding methods.
[1] https://gitlab.gnome.org/GNOME/at-spi2-core/-/blob/master/xml/TableCell.xml
Fixes: QTBUG-104793
Change-Id: Ie7068c029eaf911186daf3956f11cfd4eb2800a6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
... fixing a int/qsizetype mismatch in the process.
As a drive-by, replace SESE with an early return.
Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-103525
Change-Id: I961728ba818c4cb43c0e2c9056c70c8f37ad042e
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
It takes qint64, not int.
This is not public documentation, so not picking to older branches.
Task-number: QTBUG-103525
Change-Id: I4303af326bb6054ae0cccd87aa337354ad11209b
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Allow building iOS tests in other repos, if DisableTests is not
specified.
The reordering in coin_module_build_template_v2.yaml is done to match
the same order that's in coin_qtbase_build_template_v2.yaml.
The change in coin_module_test_template_v3.yaml is just cosmetic.
Amends 80705298ca
Pick-to: 6.4
Task-number: QTBUG-96056
Change-Id: Ic69ef938cb9319fa9a0eb063046b009de34bebc1
Reviewed-by: Toni Saario <toni.saario@qt.io>
And use the new overloads in examples and tests.
[ChangeLog][QtXml][QDomDocument] Deprecated the old setContent()
overloads in favor of the new ones that take ParseOptions and
ParseError.
Task-number: QTBUG-104507
Change-Id: I61b37eba2fe3002c03bddc90f6877676d539f7ec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Esp. on Windows, it can be desirable to deploy an application and its
DLLs directly in the install prefix, without a bin directory. To do
that, one must set CMAKE_INSTALL_BINDIR to ".", but that resulted in a
faulty prefix entry in the generated qt.conf.
Check for this case when generating qt.conf to write the correct prefix.
Fixes: QTBUG-105583
Pick-to: 6.3 6.4
Change-Id: I0e8295c70b48b991c19f58f6b3f2ed132112dd29
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The focused state exists in both, Qt
(QAccessible::State::focused) and AT-SPI, so forwarding
changes to that state is straightforward.
However, so far, changes to the focused state in a
QAccessible::StateChanged event were just ignored
and not forwarded to the AT-SPI layer.
While announcing focus changes to Qt's own widgets works
without that because it uses events of type QAccessible::Focus
instead of QAccessibleStateChangeEvent with the focused
state set, this is not exactly the same and just ignoring the
focused state in QAccessible::StateChanged events e.g. turned out to
be one cause for the Orca screen reader not announcing UI elements
when they received focus in the Qt-based UI variant of LibreOffice,
which uses QAccessible::StateChanged with the focused flag
set (s.a. LibreOffice commit [1]).
[1] https://git.libreoffice.org/core/commit/8c3e8af0e60865ec6d38e2117efdb4ed2f10a20c
Change-Id: If226af28960048c56af32979477605d6860e30e9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
It seems QWindow here is only for making the dialog modal,
but QDialog already handles that and this makes two modals
block each other depending on the order they created with
Task-number: QTBUG-98988
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I6847cfab480395f62eaa0ebf79acf8b024192178
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Reviewed-by: Liang Qi <liang.qi@qt.io>
Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
With NTLM/Negotiate we delete the context used to generate replies once
we get SEC_E_OK. Due to some faulty logic in the http backend we could
end up trying to generate another response. Qt would then pass
references to some offsets of nullptr into the API calls causing it to
crash. Add some sanity checks before the "sspi continue" calls to make
sure this won't happen, and update the condition in the http
backend to check that we have not already sent our credentials.
As a drive-by: correct the initialization of the handles to use
SecInvalidateHandle instead of memset to 0.
Pick-to: 6.4 6.3 6.2 5.15
Fixes: QTBUG-102359
Change-Id: I884ff8fc70609fe8746b99a1d56eeafcda9d2620
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
When the xsettings value of relevant style hints is changed
we propagate it to QGuiApplication via handleThemeChange.
Change-Id: I316c90e776f52e92c1249aa4e1fcb3ced331f8f5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Just like for the "GetSummary" case, the argument in the
reply for this AT-SPI table method needs to
be wrapped in a variant.
Fixes this warning from the output of the client side
using libatspi:
> (accerciser:181933): dbind-WARNING **: 11:50:36.394: atspi_dbus_get_property:
> expected a variant when fetching Caption from interface org.a11y.atspi.Table; got (so)
Fixes: QTBUG-105520
Pick-to: 6.4 6.3 6.2
Change-Id: I18167359e4cd3bb14a94289ac7481f9e39a18ad0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
So far, only screen coordinates (`ATSPI_COORD_TYPE_SCREEN`)
and coordinates relative to the widget's top-level window
(`ATSPI_COORD_TYPE_WINDOW`) were supported.
In at-spi 2.30, a third coordinate type, describing
coordinates relative to the widget's immediate parent,
was added: `ATSPI_COORD_TYPE_PARENT` (commit: [1])
This commit adds the handling to convert to and
from that coord type as well and unifies the
existing handling to convert to/from screen coordinates
by introducing two static helper methods
(`AtSpiAdaptor::translateToScreenCoordinates` and
`AtSpiAdaptor::translateFromScreenCoordinates`) and
making use of those wherever conversion needs to
be done.
In addition, also add a check to only handle
requests using a coordinate type that is one of those
that is actually supported instead of returning
incorrect values (for the case that new coord types
should be introduced in AT-SPI in the future).
[1] 737c9853b6
Fixes: QTBUG-105313
Change-Id: Ia8752bd6a35328cc2de33ecad08f2964735f41ae
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Add a runtime test for asyncify availability; skip tests
if asyncify is not available. Add new build target which
builds with asyncify enabled.
Change-Id: Idaeff0a24aa01525927b012af2a0ba135c7839c3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We're not looking to skip faulty tests, but there are cases
where we would like to indicate that a test function exists
but can't run because some precondition is not met.
Pick-to: 6.4
Change-Id: Ifaaafcfa7a55beaaf56d8b25fabbe3dc2566350f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
State the problem and suggest possible solutions for the
app developer.
Pick-to: 6.4
Change-Id: I0484c4eb31020ec0016005f43f910f32a319b850
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Emscripten's option for enabling asyncify (-sASYNCIFY) is a link-time
option, which means there is no requirement to have a separate asyncify
build, at least for static builds.
Replace the current QT_HAVE_EMSCRIPTEN_ASYNCIFY compile-time option
with a run-time option which checks if the asyncify API is available.
Keep support for configuring with "-device-option QT_EMSCRIPTEN_ASYNCIFY=1"
for backwards compatibility and for the use case where want asyncify
support to be on by default for a given Qt build.
Enable asyncify for the asyncify_exec example.
Pick-to: 6.4
Change-Id: I301fd7e2d3c0367532c886f4e34b23e1093646ad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The call to this function was behind a broken #define and
was never enabled. It also does not work, so remove it.
This means that calling processEvents() in a loop (as opposed
to calling exec()) most likely does not work either, which
is something we want to revisit.
Pick-to: 6.4
Change-Id: I90802a69d3a48e7f2b5d0b657d89452c09d9571a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>