If a font is synthetically condensed / expanded, we need to scale
the advances as well as the bounding boxes for the glyph cache.
The logic is adapted from DirectWrite font engine, where the same
scaling is already in place.
[ChangeLog][macOS] Fixed a bug where synthetically stretched fonts
would get the wrong advances and sometimes glyphs would be clipped.
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-103838
Change-Id: I09fc87b245d1f2de980c10ad9253b9a83571f714
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When Qt was configured with -no-harfbuzz, we would get overlapping
glyphs, because we skipped the shaping step but did not set up things
correctly before that. Instead, we force the PreferNoShaping code path
when there is no shaper available.
[ChangeLog][Text] Fixed font layouts when Qt was configured without
Harfbuzz.
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-100361
Change-Id: I1c54dbc457dbb235548b9d70324d607a0ee6d501
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Traces can contain only a few types; for now, enums have to be converted
to int. Amends 6d323c0b22
Task-number: QTBUG-102862
Change-Id: If129d03b13e723350bac987c6e35d471aa6c17e2
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Rafael Roquetto <rafael.roquetto@qt.io>
The section is already called Transformations. Making
it a target just causes issues in other contexts.
Pick-to: 6.4
Change-Id: I8dc65bd3254238e51a649f926cd066dfcbe9500d
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
This reverts commit b9cce12e76, which
broke
function_ref<void(int)> f = [](int i) { return i; };
ie. swallowing of return types.
We could maybe implement the same without invoke_r, with the same
manual if-constexpr that invoke_r has, but it would be a pointless
duplication across the two thunks we have, so just use invoke_r.
Add tests.
Pick-to: 6.4
Task-number: QTBUG-103739
Change-Id: I6034f05d813c06a25e8058ded5b6b62f3ca858b4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Use the QByteArrayView overload instead.
Deprecated since 6.3, so backporting:
Pick-to: 6.4 6.3
Change-Id: I529104cad59260eed371cedb1ae84a7e9086bbf6
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
We implicitly checked it, because, in C++20 builds, the non-equality
relational operators are synthesized from it by the compiler, and we
test those, but we didn't check that <=> returns strong_ordering.
We now do.
Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-104108
Change-Id: Ieb19a2d4cb2d600d884f4e2e89e98c6187e23872
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This one came up on a tsan build, but not on an asan/ubsan one!?!:
qbytearray.cpp: In member function ‘QByteArray QByteArray::toBase64(Base64Options) const’:
qbytearray.cpp:3884:42: error: array subscript 1 is outside array bounds of ‘const char [1]’ [-Werror=array-bounds]
3884 | chunk |= int(uchar(data()[i++])) << 8;
| ~~~~~~~~~~^
qbytearray.cpp:37:24: note: at offset 1 into object ‘QByteArray::_empty’ of size 1
37 | Q_CONSTINIT const char QByteArray::_empty = '\0';
| ^~~~~~~~~~
cc1plus: all warnings being treated as errors
Fix, as so often, by caching the size().
The code in 5.15 is different, but similar, so picking all the way.
Pick-to: 6.4 6.3 6.2 5.15
Task-number: QTBUG-103923
Change-Id: Iac30e964c8d7d367620d16db65ceeaade33ee6b4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This was last used in 2011, before Qt 5.0 release, when QPA was yet
another windowing system, not the only option.
Change-Id: Ia4a094014ddb48cc9f6dfffd16f83aad1b7109e7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
They weren't flags. They were the version of Qt that was used in
compiling the application itself. The protection against rollback isn't
necessary any more, since qversiontagging.h, which applies to everything
and not just the main application binary. And using them to make
decisions on functionality or behavior is misguided (see previous
commit).
This commit does not deprecate the front-end classes' argument. In the
future, we may find some need for them.
Pick-to: 6.4
Change-Id: Ia4a094014ddb48cc9f6dfffd16f83a7b58ff95d3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
It's not used for anything, so remove the temptation of trying to use it
to make decisions at runtime about a behavior. It's the wrong tool for
the job: it might tell you the version of Qt the *application* was
compiled against, but not the version any of the Qt-using libraries
were.
Pick-to: 6.4
Change-Id: I175efddd75f24ae59057fffd16f70b77dd87faf4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Snippet [22] was unused and the example using snippet [21] neglected
to show how its oldCategoryFilter got initialized, which is what [22]
does. But it turns out the example code was crashy in any case, as it
left the oldCategoryFilter uninitialized (albeit probably null) until
the call to installFilter() had returned, and installFilter() calls
the new filter, so the new filter needs to check oldCategoryFilter
before calling it. The doc also failed to explain why it's OK to not
defer to the prior filter in these calls during installFilter(), so
revise the doc and example so that the latter behaves sensibly and
readers of the former are likely to use the function safely.
This amends commit 8f0654ceb8 which
added the snippets and the use of one of them, but not the other.
Fixes: QTBUG-49704
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: Iddb8d97b0bef417d8f16e7910730cfa59ea3e715
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
A QRect is unambiguous, and easier to parse than a custom rect format.
Change-Id: If8c197a5e522744b9629d5d89536df5c0da7308c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Apple Silicon Macs no longer expose display information through IOKit.
Luckily we can use the 10.15 localizedName property on NSString to
resolve the name.
Pick-to: 6.2 6.3 6.4
Change-Id: Ie75430df1a80808cb7b23d97d1e440d1f3bf75d6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Accessing a display that's offline may cause crashes,
so to be on the safe side we skip update requests in
this situation.
Task-number: QTBUG-102021
Pick-to: 6.2 6.3 6.4 5.15
Change-Id: I6b48b6722bccde628e510c538943d14f2b0271e5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This reverts commit 69e8a89358.
Reason for revert: the header is not present in all MSVC installations.
Change-Id: Ib809e59291ef30b9cbf6b4d61e27ea162e5d40b4
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
On Android 13, currently in beta, android triggers a warning because it
is using a deprecated getDrawable function.
The patch changes it to use the non-deprecated alternative as suggested
in the warning.
Fixes: QTBUG-103568
Pick-to: 5.15 6.2 6.3
Change-Id: I3e629e7b75044bfb51874256895be0ec7e1088f8
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
The code incorrectly tried to ensure that the firstVisible tab was a
valid index, even though there might not be any visible tab left after
removing the last visible tab.
The same logic didn't exist of the lastVisible tab, so we tripped the
assert in qBound, as max (being -1) ended up smaller than min (0).
Fix this by removing the wrong correcting of firstVisible to be always
valid. Make sure we emit currentChanged with -1 when no visible tab is
left after removing the current tab.
Add a test.
Fixes: QTBUG-104003
Pick-to: 6.3 6.2
Change-Id: I27e6438a02d0a0f1ac4d0e0160cee4f33b3f3766
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
More specifically, if either minimum or maximum size are updated, make
sure that the current window geometry is updated so that it is within
the minimum and maximum sizes.
Previously, these constraints was only respected by the window manager
when the user resized the window.
For widgets this already worked, because a top-level widget will take
care of respecting these constraints if they are changed.
Since QWindow::setMinimumSize and QWindow::setMaximumSize started to
share so many common things, a new function (setMinOrMaxSize_helper())
is added.
Task-number: QTBUG-102771
Change-Id: Ia4b2680dcf865f84a3cf6424187f9a6036b76386
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When the submenu is about to exceed the screen,
set the position of the submenu to the left border of the main menu
Fixes: QTBUG-104050
Change-Id: I8935f1bfceb93cfa1097391689f4233991394978
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
If we replace the bullet character with a UC checkbox character, it
looks ok in a browser, and the HTML parser can recover the BlockMarker
attribute from the css class.
[ChangeLog][QtGui][Text] Checkbox list items can now be read and written
in both HTML and Markdown, including conversions.
Task-number: QTBUG-103714
Change-Id: Ic6b74512075cd4ac16d6f80fdf55b221447491a9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
We're in 2022. A 11-year-old C standard probably suffices, especially
since we require C++17 anyway.
Pick-to: 6.4
Change-Id: Ibcde9b9795ad42ac9978fffd16f3555327097ded
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The file no longer exists, so the entry is redundant.
Amends f08038fca7
Change-Id: I366a6bd34c7dee57bdd151ee6ecdb76c6c5c095a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
It would not compile on my Linux box due to using QVariantMap, but not
actually including QMap itself. Using gcc 9.3.1 on CentOS 7.
Pick-to: 6.3 6.4
Change-Id: I808a270c814a906030cb34b197d3a2a85ba384e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
On finishing/terminating a thread, when processing posted events,
we need to consider QThread's own data instead of caller thread's data.
Otherwise we can get into unexpected situations such as double
destruction of an object, premature destruction, etc.
Fixes: QTBUG-103922
Pick-to: 6.4 6.3 6.3.1 6.2 5.15
Change-Id: Idf77221ebbaa0b150ee2d0c296b51829ae8dc30e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In Conan's case, the qtbase installed package directory lacks a qml
directory. We pass that as a valid qml import path via CMake ->
deployment json file -> androiddeployqt -> qmlimportscanner
which causes the qmlimportscanner to fail with
qmlimportscanner: No such file or directory:
"~/package/some_sha_1/qml"
Invalid json output from qmlimportscanner.
which in turn fails the androiddeploqt build step.
Make sure to only pass qtbase_install_dir/qml if it actually exists.
Amends 4ef3da04c3
Amends c08b9a49ba
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-104056
Task-number: QTBUG-88519
Task-number: QTBUG-89588
Change-Id: I4310eb4e265ae8d3e3f09e1e1dbed79210e23de6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This will hide the configuration summary and cmake feature summary and
found packages output upon reconfiguration.
Pick-to: 6.2 6.3 6.4
Task-number: QTBUG-104128
Change-Id: I42270b99e45076052ec176df4652661cae10ac0c
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
or when feature changes are detected, even when the log-level is set
to NOTICE (which is the default for non-developer-builds).
We want to show the summary during the first configuration so we don't
force users to look into the config.summary file.
We want not to show the summary upon reconfigurations, to keep regular
reconfigurations as quiet as possibe, so it's easy to notice any new
warnings.
Amends e2a0ddbb69
Amends 384dfceb53
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-104127
Change-Id: I506f33b4bae9da8957e04bb69c206bf00e3f7b0e
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
If we are going to append an else clause, keep it on the same line as
the closing brace.
Change-Id: Idfa0eec49240086dc24268aebbf610d64a2f53d0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Cross-builds already were out-of-source.
Move non-cross-builds to out-of-source as well.
Fixes: QTBUG-82820
Fixes: QTBUG-96513
Change-Id: I5bef08f18a16e51fe2c501565699494b46546f84
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
FindWrapSystemHarfbuzz.cmake relied on pkg-config to find system
harfbuzz. This patch makes it find system harfbuzz even if pkg-config
is not available or disabled.
Pick-to: 6.2 6.3 6.4
Task-number: QTBUG-103894
Change-Id: I2a8fc64c738c7604f47de89f387002e40a9fa5e0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
We need to check whether pkg_check_modules returns success before
setting up target name etc.
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-103894
Change-Id: I12702639683723d976e93be95443099b88885869
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Turning off pkg-config with the configure flag -no-pkg-config did not
work. There are different defaults for FEATURE_pkg_config on different
platforms (e.g. Linux: ON, Windows: OFF). The existing code that
calculated the initial FEATURE_pkg_config value assumed that the default
is OFF and never turned the feature off.
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-104123
Change-Id: I33b9687c55c60d4ec9224324951a8838741ee976
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
It's easier to remember what "SIGSEGV" means instead of "11".
GNU libc has offered sigabbrev_np() (non-portable) since 2.32; for older
libcs, we'll be happy with a hardcoded list.
Selftest updated to match... though it didn't seem to be necessary.
Pick-to: 6.4
Change-Id: I5ff8e16fcdcb4ffd9ab6fffd16ebc66ecf6e9465
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Fixes warnings such as
qtbase/src/corelib/text/qlocale_tools.cpp:321:5: warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead. [-Wdeprecated-declarations]
from AppleClang.
Pick-to: 6.4 6.3
Change-Id: Ief10e99abfa0a56c24622ac79db719dde58a4210
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Give this a chance to ever succeed by not using undefined variables in
the test code.
Found by a KDE unit test observing changes in inotify behavior between
Qt5 and Qt6.
Pick-to: 6.2 6.3 6.3.1
Change-Id: Iceb743d88dfa093c02d76ce32ea5c8ced24bfc5b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Two patches applied to upstream release.
Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-103732
Change-Id: Id64b65c4567433806047a2a34fa85ab5f260e6cc
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
It's disabled now, so can be deleted
Pick-to: 6.4 6.3 6.2
Change-Id: I0d548327e7ef42bbca9ed88556bf9f8456038cc7
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>