Previously hover effects had to be enabled manually due to not being
enabled in the platform style. This change enables them by default.
Pick-to: 6.4
Fixes: QTBUG-88799
Change-Id: I014e1f5dfcd9b15656f11e12ab75a77d42f4815c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Found by codespell
Pick-to: 6.4
Change-Id: Ie3e301a23830c773a2e9aff487c702a223d246eb
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This way, if you name several test functions on the command-line,
you'll at least get the ones that do exist run (and you'll be told all
of the ones that don't exist, rather than only the first).
Pick-to: 6.4 6.3 6.2
Change-Id: I14a515fcfacb6ca49e0470b236c05475b25db4f2
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
This change improves the loading speed of files stored in Android assets
folder by caching the information about files already opened.
Prior to the change, when creating a QFile or QFileInfo to an asset
file, the engine would first scan all the file's directory and parent
directories in order to cache all this in FolderIterator::m_assetsCache.
Due to the nature of Android assets, it might be very slow, depending on
the number of images in this tree.
In this patch, individual file accesses will stop using FolderIterator
and will simply open what is asked, caching the information about the
resource in order to avoid to have to call the expensive
AAssetManager_open if the file is accessed again (e.g. by QFileInfo).
Fixes: QTBUG-101161
Change-Id: Iaedf4cdf83d5116053b51895a6795d43bc60f942
Pick-to: 6.4 6.3 6.2 5.15
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
ffmpeg and nettle are different from other libraries, they use symbol
link as their inner module dependencies. Calling one more
install_name_tool can handle this case.
Fixes: QTBUG-100093
Pick-to: 6.2 6.3 6.4
Change-Id: I12cdd53bd5aa3120910070ba283178686deb3eb0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The QDateTime benchmark's toMSecsSinceEpoch() and
toMSecsSinceEpochTz() each iterated the 2010s and had 1950 and 2050
variants for two other decades. I want to also test some earlier
decades and do similar for create(), so combine the existing triplets
as three rows of a data-driven test for each triplet, add the new rows
and apply the same to create().
In the process, turn an enum used for qint64 constants into a set of
constexpr qint64 declarations.
Pick-to: 6.4 6.3 6.2 5.15
Task-number: QTBUG-104012
Change-Id: I2657346b65d96a7ef7503cd33c870b688ea5dbff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Enable by setting QT_WIDGETS_HIGHDPI_DOWNSCALE=1 and QT_WIDGETS_RHI=1.
This will make the backing store and painter operate at the next
highest integer DPR in cases where QWindow::devicePixelRatio() returns
a fractional value. The backing store image will then be downscaled
to the target DPR at flush time, using the RHI flush pipeline.
[ChangeLog][QWidgets] Added experimental support for always
painting at an integer device pixel ratio (rounding the DPR up if
necessary), followed by a downscale to the target DPR.Enable by setting
QT_WIDGETS_HIGHDPI_DOWNSCALE=1 and QT_WIDGETS_RHI=1.
Pick-to: 6.4
Task-number: QTBUG-86344
Change-Id: Id5b834a0e3499818b0b656161f5e0c38a6caa340
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The rhiFlush() implementation currently assumes that
QWindow->devicePixelRatio() is the correct scale factor for
transforming device independent window geometry to source geometry.
However, this assumption does not hold if/when we add support
for drawing to a rounded-up DPR, with a downscale later in
the rhiFlush implementation.
Fix this by adding a sourceDevicePixelRatio argument to rhiFlush(),
which is set to either QWindow::devicePixelRatio() or
QWidget::devicePixelRatio(), depending on from where it is used.
Change deviceRect() and friends in qbackingstoredefualtcompositor.cpp
to be scale*() functions instead which take a scale factor instead
of a QWindow. Update call sites to use srouceDevicePixelRatio
where that makes sense.
Pick-to: 6.4
Change-Id: Idb7b1e2f36816a201e00f0defe100d2dc079cb17
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Example:
Error "BadWindow" (3) is raised by the XCB backend when a mouse event
is processed on a resource that disappears between posting and
processing of the event.
That constellation is harmless and can occur in async environments.
As XCB errors point to coding issues, this patch changes their logging
behavior from qCWarning to qCDebug.
Fixes: QTBUG-56893
Pick-to: 6.4 6.3 5.15
Change-Id: Idee5ee80efaf9cd6686448779f76c68d5e4c9b63
Reviewed-by: Liang Qi <liang.qi@qt.io>
Xcode's legacy and new build system modes have different behavior
in how they bundle resource paths that start with lang_code.lproj.
Document how to bundle translation files for both legacy
and new build systems.
Pick-to: 5.15 6.2 6.3 6.4
Fixes: QTBUG-98417
Change-Id: I857ec76577f8244a751d4bf38fbe305fef614734
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
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>