If a QFont is moved to a different thread (B) than where it belongs (A),
and the font cache is then purged on thread A, the last remaining
reference to the engine will be on thread B. When this QFontEngine is
later replaced with one created on B, we end up deleting A's QFontEngine
on thread B.
This caused QFreetypeFace::release() to be called on the wrong thread and
the face would never be removed from the thread-local Freetype cache in
A. Hence that cache would contain a dangling pointer to the freetype face
which we would later end up fetching.
To avoid this, we make sure the thread-local cache itself increases
the ref count of the face. That way, the only time it will be deleted
on a different thread is when the cache has been destroyed because the
thread has shut down.
If the last reference (except the cache reference) to a face is cleared
on a different thread, we keep it in the cache until later. It will
then be in a "deferred delete" mode and will be deleted as soon as
possible. This is done either when the thread shuts down, when a lookup
causes the "deferred delete" face to be returned, or when release()
is called on any font on the thread (at which point we will purge all
faces that only have the single cache reference.)
Pick-to: 6.7
Fixes: QTBUG-118867
Change-Id: Ifa07a9cb6f4cd3e783e12a73d8b283e70d6fb474
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Since https://gitlab.kitware.com/cmake/cmake/-/merge_requests/8919 is merged, `qtbase` should be updated accordingly. If `CMake` is equal or greater than `3.29`. `timestamp_$<CONFIG>` is used instead of `timestamp`.
This commit reimplements 8041bfba47 which is reverted with 4b1d96ea1b
Change-Id: I335e3855c1a11c404202ae7b74f0c356b8fe53bd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
QSystemLocale is setting the global window.onLanguageChanged
property which may cause conflicts in cases where there
are more than one Qt app instance on the same web page.
In addition the QSystemLocale destructor never runs,
which breaks also for repeated QLocale instantiations
on the same page (for example for the QLocale auto-
test)
Pick-to: 6.7
Change-Id: I85af0587527b2922804fc866c83864f677700e6d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
For use in QtGRPC.
There is some duplication between this code and the code in
QHttp2ProtocolHandler. But let's not change the implementation of
the protocol handler after the 6.7 beta release. Nor do I think we
should do it for 6.8 LTS. So let's just live with the duplication
until that has branched.
Pick-to: 6.7
Fixes: QTBUG-105491
Change-Id: I69aa38a3c341347e702f9c07c27287aee38a16f2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Search full icon name from hicolor before dash fallback
Pick-to: 6.7 6.6
Fixes: QTBUG-121030
Change-Id: I3e3ee142c33466203639f32857fce3ea1946a9f7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Multi-part extensions such as "tar.gz" are not natively supported by
macOS, e.g. one can not create a [UTType typeWithFilenameExtension:]
for such an extension, and this goes all the way down to Foundation.
As a result NSSavePanel gets confused when assigning a multi-part
extension to allowedFileTypes, because it's using NSString operations
such as stringByDeletingPathExtension or pathExtension, which also
lack support for multi-part extensions.
We've worked around this in the past by reducing these extensions to
their last component, e.g. "tar.gz" reduced to "gz", but this results
in the save panel turning the input file name "foo" into "foo.gz" if
the user doesn't provide the full file name.
Various attempts at working around the lack of multi-part extension
support by breaking allowedFileTypes into ["tar.gz", "gz"], or doing
selectively toggling of allowedFileTypes in panel:validateURL:error,
have all proved to have corner cases and shortcomings of their own.
As a last resort, we now treat multi-part extensions manually, by
disabling the allowedFileTypes filter, and doing our own validation
in the panel:validateURL:error callback.
This requires us to also manually handle automatic extension for
file names without extensions, as well as overwrite confirmation
in the cases we do add an extension manually.
The overwrite dialog and error messages for incompatible extensions
have been modeled after their native macOS 14 counterparts, using
translated strings from AppKit.
Task-number: QTBUG-109877
Pick-to: 6.7
Change-Id: I6b7ce3c44b4c3b24802aa1f66f4593457ae4c929
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
We map QFileDialog name filters to NSSavePanel.allowedFileTypes, for
example turning "Text Files (*.txt)" into allowedFileTypes = @[@"txt"].
In this case, the NSSavePanel will automatically add the extension to
the user's file name, if they just type "foo".
When a filter allows all files, we reset the allowedFileTypes to nil,
but this does not reset the automatically added extension, so if the
user switches from one filter (*.txt) to another (*.*), the file name
will still have a .txt extension.
This is problematic when the save panel's file name field does not
show the extension to the user, which can happen automatically if
the user types an initial file name without an extension, overriding
what we've asked by setting extensionHidden=NO. When that happens,
the user is shown "foo", but the actual file name is "foo.txt".
To mitigate this confusing situation we do a round-trip via the
UTTypeDirectory content type, which is a valid type without any
extension. This forces the save panel to remove any extensions
added automatically by previous filters.
Pick-to: 6.7
Change-Id: Ia17a8c2734eff656116ef77a9813113a5076e9cc
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The panelSelectionDidChange callback is only called when the user selects
a directory in the save panel, as all other files are not selectable.
And when that happens, the reported selection is not the directory,
but the current file name (which may be based on clicking an exsiting
file, but that doesn't cause selection changes).
To avoid this confusing and inconsistent behavior we disable the signal
entirely when showing an NSSavePanel.
Pick-to: 6.7
Change-Id: If706b8faa7027ca284ec8398f5c6e2a110e01f91
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Fusion style is missing clip region for the title in
QFusionStyle::drawComplexControl().
Without that region, the top line of the frame will be visible behind
the vertically centered title.
Fixes: QTBUG-121041
Pick-to: 6.7 6.6
Change-Id: I3daf5854195e28a5ee3cb50343e2dd56e66ed940
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
If we are trying to unregister a metatype with an ID that belongs to a
different metatype, then something is very wrong.
Change-Id: I3191557883b69030f91c3aca7f359acf2dde66e7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The gradient we are using now, makes slider almost invisible in 'Dark' theme
(non-transient scroll bar). Instead of using gradient for non-selected
and non-pressed state, use the same color as in pressed state.
Fixes: QTBUG-120971
Change-Id: I1a7e4aefa4483e8095e59d82be3d0c1c3526b28f
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
When the swap chain is destroyed, we reset the swapchain’s layer
(set it to nullptr). However we were not resetting the proxyData which
would still point to the window’s (NSView) layer. This starts to become
a problem in the cases where the swapchain’s associated QWindow is
closed (NSView gets destroyed) and reopened (a new NSView will be
created) because when the swap chain is recreated again, since the
proxyData already exists and points to the invalid old layer,
QRhi::updateSwapChainProxyData is never called. This led to an invalid
value being assigned to the swap chain’s layer.
To fix the issue, make sure to reset the swapchain’s proxy data when
destroy() is called.
Task-number: QTBUG-113498
Pick-to: 6.5 6.6 6.7
Change-Id: I02996ecf69ad9d183cac31c9188717ec36742531
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
IBus added the ClientCommitPreedit property to handle
preedit in case.
If this writable property is set,
ibus_engine tells the client whether current preeditText
should be committed or not in the client side when
focusOutEvent.
(Qt's old behavior is always committing in the client side.)
Fixes: QTBUG-109576
Fixes: QTBUG-58005
Pick-to: 6.7 6.6 6.5
Change-Id: I6bb78921ce04cdd3197cba9e2fb00376d5e0ac8b
Reviewed-by: Liang Qi <liang.qi@qt.io>
Initialize surface container type to TextureView to
make sure it's set also for embedding containers.
Additional checks for embedding containers when
setting parent or changing visibility.
Pick-to: 6.7
Change-Id: Iba07bfbb9e8f16804627efbdfe78559ac2580e41
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Normally, the app's main library's name is read from a metadata field
in the AndroidManifest.xml file, which is filled out by
androiddeployqt.
Add a protected variable in QtLoader for the app main library name
that can be set to provide the library name without the metadata field.
This is useful in cases where we don't have a manifest file filled
by androiddeployqt, for example when embedding QML to an existing
Android app.
As a side effect, change the name of existing variable for the main
library and the method to access it to make it more explicit they refer
to the library's absolute path.
Pick-to: 6.7
Change-Id: I869547818f4d0272668a1052d7bc6916b7bf5a98
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This is useful for example the embedded QML case, where we want to
make sure everything from Qt side is ready before we start to create
Qt windows.
Pick-to: 6.7
Change-Id: I8148405e35cc8ebb89110f05e07cef06f8ff3709
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
All we need are the APIENTRY and WINGDIAPI macros, as those are used
in the gl.h header. Define those locally for the time we need them.
Use a QT_APIENTRY macro instead of hijacking APIENTRY for when we
declare OpenGL functions with the stdcall calling convention.
A few build fixes needed in tests that used Windows types without
explicitly including windows.h first, or that (incorrectly) included
one of the sub-headers of windows.h (like winuser.h).
[ChangeLog][Potentially Source-Incompatible Changes][OpenGL]
On Windows, the public qopengl.h header no longer includes windows.h.
Pick-to: 6.7
Fixes: QTBUG-120687
Change-Id: I3770ac8eaeee5bcf4e7234e5a2539935a8aa5a7d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
We don't recommend foreach anymore, and have in fact
adapted two snippets already to use for(), but missed
the documentation text.
In any case, it feels a bit weird to give an example
how to iterate over QStringList in each of these methods,
so we might as well just remove this part.
Pick-to: 6.6 6.7
Change-Id: If8744e48961661ad518f5f24781c38f371d981bc
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Otherwise, Xcode will auto-generate schemes for all targets, including
internal targets such as foo_autogen and build-only targets such as
ZERO_CHECK and ALL_BUILD, choosing one of them at random when opening
the project for the first time.
If multiple targets get a scheme they will be sorted alphabetically.
We could prioritize them by generating a xcschememanagement.plist
file, but that would require teaching CMake about that feature.
This aligns the CMake behavior with qmake, where we also generate
schemes explicitly.
Pick-to: 6.7 6.6 6.5
Change-Id: I3756fced37a4ff7792370da10fc49169cc271ae8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Including/excluding plugins of the platforms type did not work, since
windeployqt was only ever looking for 'qwindows'. Keep the default
behavior of deploying 'qwindows.dll', but also allow users to
add/remove platform-type plugins.
Pick-to: 6.7 6.6
Change-Id: I4062a71939224d1462896d95a2541e8caced399d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Allows us to hide them in a separate folder in Xcode and Visual
Studio projects.
Pick-to: 6.7
Change-Id: I5ce7884ce50198c3b0c9654bb188f38a8a679be0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
As long as the surface type of the child window is the same as the one
owning the backingstore we can flush it through the same code path as
for the top level window.
This code path was already exercised by QWidgetRepaintManager::flush(),
by calling rhiFlush() directly, but we now support it in those (rare)
cases of non-Widgets windows using a single QBackingStore for a full
window hierarchy.
A future improvement would be to decouple the RHI configuration from
the backingstore, so that we can flush child windows with different
surface types through the same backingstore. This is relevant for
platforms that rely on QRhiBackingStore exclusively (iOS and Android),
as in widgets we currently only switch the top level widget surface
type when enabling RHI based flushing, leaving all child windows
with QWindow::RasterSurface. This could potentially be solved by
teaching widgets to re-configure all QWidgetWindows, including
children.
Task-number: QTBUG-119309
Change-Id: Ifa3fe6125493ac1becd2538ba84f3b4a5e3a5d71
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
With some HighDpiScaleFactorRoundingPolicy, going fullscreen can end up
not filling the whole screen. In this case, ignore the rounding (only for
the window size, not its content).
Fixes: QTBUG-115954
Pick-to: 6.7 6.6
Change-Id: Ie87196358ef28dbe2fcbc180b1740ed9f784b4a0
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
tst_qsslsocket checks for system CA certificates, which VxWorks doesn't have out of the box, which causes a lot of testcases to fail.
As VxWorks doesn't provide default directory structure, directory with ssl certs is provided by setting a variable.
Task-number: QTBUG-115777
Change-Id: I5c93933ee5fbcafd6ffd76b574d8793fe75dbdbc
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This describes how qt_import_plugins works for dynamic plugins.
Pick-to: 6.7 6.6 6.5
Task-number: QTBUG-118829
Change-Id: I7b30060c11c0d8c4a1fbae6782a047737ba7d454
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
When using one of the non-Unix makefile generators ("NMake Makfiles JOM"
or "MinGW Makefiles") then it possible to trigger an error when running
qmltyperegistrar: ..._metatypes.json: illegal value
We create the metatypes JSON file initially empty and then "fill" it
with a custom command. This command is not triggered when using Makefile
generators. See CMake upstream issue #19005.
Our work-around for that issue was only triggered for the generator
"Unix Makefiles". Now, it's triggered for all makefile generators.
Fixes: QTBUG-120317
Change-Id: I329cb0d3e9ba0997d618821e7bcbc20284561419
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Make sure to pass the widget to QStyle::pixelMetric() as some styles
might use this (e.g. the new windows styles) to determine the correct
pixel metric.
Pick-to: 6.7 6.6 6.5 6.2
Task-number: QTBUG-1857
Change-Id: I5c32f5af8b284749732b610e56b4e3d8c8ed1946
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
When windeployqt had hard coded module information, it had
result.directlyUsedQtLibraries, and result.usedQtLibraries. The latter
was meant to add in the modules that weren't defined. Since we now read
available modules directly, there is no need for result.usedQtLibraries
since it should always be identical to result.directlyUsedQtLibraries.
Pick-to: 6.7
Change-Id: I60e38c176b11626c1ef5a844e80bc701a9eed189
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Added QDuplicateTracker to keep track of used tags, rather than looping
through QTestTablePrivate::dataList for every added tag.
Removed method `hasRow`, instead calling `QDuplicateTracker::hasSeen`
directly in `newData`.
Pick-to: 6.7
Task-number: QTBUG-118619
Change-Id: Idaab70d8c94227f75620924e0f1ead477f93b27a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Fix indentation, split too long lines.
Amends f9f1272e7c
Found in 6.7 API Review
Pick-to: 6.7
Change-Id: I3e9e3647afbe1a49fe78258177aff5cb878ce030
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Commit db9fa4a617 excluded
qelapsedtimer_mac.cpp from the unity build. The necessary patches have
been merged, and we can remove this exclusion from 6.6 on.
Pick-to: 6.6 6.7
Change-Id: I85b353b202af1fd8eeea43753e5dc5ce18357d19
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Return bool for the dynamic linking stub, like the
actual function.
Change-Id: I0e0daeac3d647055fecb7930f9ed8e6f9f574bb5
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
QAndroidInputContext::showInputPanel() assumes that any window with
focus must be a native window, but sometimes the focus window will be
an offscreen window, like in the case of using OpenXR where there is no
native window to be focused. In that case the 2D input method overlay
doesn't even make sense, since there is no window space to even map back
to. This patch prevents crashes when trying to focus on text in Android
VR/XR applications.
Change-Id: I16ac1a07f0a86ec9786f09a2f416387c1885bde0
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Windeployqt has a pull all in approach to plugins. This can require some
modules to be deployed despite being unrelated to the application's
dependencies. An output is added to provide information to better reflect
what windeployqt is doing in this regard.
Task-number: QTBUG-117910
Pick-to: 6.7 6.6 6.5
Change-Id: Iabf89e0faca862a90c0fcd46e5675dd43655be1d
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Don't loop over the list of event filters twice, do it once with a
combined predicate.
This code is still has a big impedance mismatch: the removeIf() will
always leave empty space at the back while prepend() needs it at the
front. We should fix this by reversing the meaning of the order of
event filters to mean back()-is-applied-first, so new filters can be
append()ed, but that is for another patch.
Done-with: Jarek Kobus <jaroslaw.kobus@qt.io>
Pick-to: 6.7
Change-Id: I08324697229a54c8f66c6c320cf7232d707a08f1
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
We can't have duplicated filters installed,
so break the loop when removing event filter after we
have found the matching one.
Pick-to: 6.7
Change-Id: Idda87f3090954e020b27bf3fab62677128607f03
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Found in API review.
Amends b7657ddccb.
Pick-to: 6.7
Change-Id: Ibdab7f51be09036659475bd76af28e8692235b9c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
If we for some reason can't look up AppKit, or if the table or
string within that table is not found we will end up using the
key as is.
Pick-to: 6.7
Change-Id: I5d574288e421e586458266899ffdff90eeadec8f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
There's several ways to compare HTTP headers, and arguably
the need for it is not very high. For the time being users can use
different accessors and compare in ways that make sense for
their use cases.
Consequently since HTTP headers are no longer trivially comparable,
it makes also comparing the request factories more 'moot' because
headers are a central piece of request information. So removed
comparison from request factory as well.
These comparisons can be restored later if a clear understanding
on it's need, and on how it should be best done, emerges.
Resulted from API-review
Pick-to: 6.7
Change-Id: Idb5ab3710268b52a8e59656db8cc7de82f0ae511
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
It is used to indicate resolveFilePaht() should be called, making it a
named variable makes the intention clearer.
Change-Id: Ibf1c88b9dacc59775afdf76bab3a8c86a52d5c72
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>