1. Make some global constants constexpr.
2. Make some file-scope global constants static.
3. Use QStringLiteral instead of plain const char*
4. Add "u" to QStringLiteral's content.
Change-Id: Icbc105366ba40e970b256fe3da41231a6fb5064b
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit ad06099b93d79a954d133d6822517d4d0a10adbc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 7c3723b2a93d7b0263109c0872a61307cd13a7ed)
CE_ComboBoxLabel did not apply any attributes if the render rule has no
box. Remove the check.
Fixes: QTBUG-131761
Change-Id: I603ae6c459303f0d3a5bcc9572f12acca32bc575
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit a77a7c157d5cdcc88bf0a02caed2aa5ff8850d06)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
- prev pointer never can be null here, so the check can be deleted.
Ammends 948599e7b7
Change-Id: Ie194f5f0432f6da5f6471328193112c970f623b6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit d991572a45b2bbdcd43e59586f88487837a2927c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 609d34d7023a4d9339238fe90bf4da2288d14cdb)
These functions iterate through the parent hierarchy until the widget
given as argument is found. If never found, the code would assert (in
debug mode) or just silently crash (in release mode).
No need to bring down the entire application just because some widget
coordinate calculation is off. Instead, just emit a qWarning and
return cleanly.
Task-number: QTBUG-132072
Change-Id: I4d13f46037cdcf855f76e040f941a8a7050ab12b
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 73221d263823d50e525858d613ce93769698454a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 49cf61f6416573809f8a095fa0d4aa65890b8218)
There is no fromSecondsAfterUtc(), I was thinking of
fromSecondsAheadOfUtc().
Pick-to: 6.5
Fixes: QTBUG-131913
Change-Id: I6a89a27d678d23043819b93d5e4120d01002da4a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 2bdce97480ed66f0e8e9528fbc8f4f9c3d8487bf)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 66da88f4289083fcee8e42bd759828bd88812df8)
QSpan docs use \target commands together with the section headers, to
simplify linking to certain parts of the docs. This approach has its
own drawbacks, though, because the \target link is rendered as-is.
This patch improves usage of the \target commands, making the links
look better.
It does the following changes:
* Moves the \target commands before the related \section2 commands, so
that the section header is visible when following the \target's link.
* Replaces the \target links with the actual section names in the \sa
and other places of the docs where the links do not have the custom
text, because otherwise the target names are actually visible in the
docs instead of the section headers.
Amends 03e78e5d62,
70dc8d3103fade380caec96f7531432cd8e8adb6, and
ef5ac956c755daa9ea84dabfa1314d104e5c62e4.
Change-Id: I045824683f342079e33e89e3ee6f8e2e27a0acf5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 10c844f0533daf657a1cbbbb96651e20e5d603ec)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit d0a3db5d93abe32e2744843ce0ab6e6c104b080d)
The lack of this was hidden by other rules (redundant with it) until
CLDR v45, but v46 prunes the redundant rules, breaking this. So
include the missing rule and tweak the code that assumed likely
sub-tag rules preserved language, since this one doesn't. Rework the
tail of withLikelySubtagsAdded() to correctly use this rule, now that
we have it. (The prior comment about there being no match-all was
wrong: CLDR did have it, but our data skipped it.) Amended one test
affected by it (when system locale wasn't en_US).
On picking to 6.8, uiLanguages() needed some coaxing to avoid
duplicate C locale entries in tests of qualified C locale.
Task-number: QTBUG-130877
Change-Id: I2a415b67af4bc8aa6a766bcc1e349ee5bda9f174
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 303863170c3ea7d1ee1b7188f507ad432ed3f860)
The alternate base color in darkmode was wrongly set to the accent color
instead of a lighter color. This patch overrides the alternate base
color for the QWindows11Style.
Fixes: QTBUG-131976
Change-Id: Ie8f50b0042ca7bf746224275abc0cd255df7a4ad
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 79aa4269bcbbedef8206d79318c199df7c8a3c9f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 1a737083f1db32da9f5af45256a3e26b6029d2e3)
The issue the combination of:
- 300+ XML nesting level
- Small stack size, by default on Windows (1 MB)
- Unexpected and unexplained large stack frames with MSVC (3.5 kB)
The described factors combination leads to the stack overflow on
Windows + MSVC.
To fix the problem, I got rid of the recursive call from
QDomElementPrivate::save() and removed QDomNodePrivate::save()
implementation.
Instead of those I added the method that iterates through the tree not
using recursion.
[ChangeLog][QtXml] QDomDocument::toByteArray() now iterates the
nodes of the document instead of recursing into subnodes. This avoids
a stack-overflow crash that used to arise with deeply-nested document
structures.
Fixes: QTBUG-131151
Change-Id: Ib74aaef1422716f2aafcb89dfc8c05ef334e2a54
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 387633a6069a5e0e9b976971691b1b82725b6132)
... and link to it from function documentation blocks that mention
"variable-sized" or "fixed-size".
Change-Id: Iae9f3538e751859c9d95442951da3c675d99d552
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit ef5ac956c755daa9ea84dabfa1314d104e5c62e4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
... and link to it from function documentation blocks that differ
materially between the two.
Add another section to avoid non-const/mutable contents to fall into
the new section. This other section doesn't appear to require linking
from anywhere. Give it a \target nonetheless.
Change-Id: I11426f22f0cfd77ffcc55c545f5c2b7f48b5af52
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 70dc8d3103fade380caec96f7531432cd8e8adb6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If one wants to access the event list itself, they have to lock the
postedEventList mutex, so none of these probably need any more ordering
than Relaxed. I've left most of them in Acquire/Release because we don't
have time to reason whether Relaxed suffices (the one exception is a
loadRelaxed() that calls a function that does loadAcquire()).
Amends commit ba6c1d2785.
Change-Id: I35810f961b96aaf63d74fffd1eda73b3e059583d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit d7c9619a815af74a988770c2d2e5d1116f2769fb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Cone of shame, they should've been marked as such since day 1.
Change-Id: I9aaf6567e183e4ece5443f4fbf12eb3a251501d5
Pick-to: 6.5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 091bb2f997c2bbe4e44d66527f13c435288e0562)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The call to the const `empty()` didn't do anything, because its results
were unused. Since this code has not been touched for some ~13 years,
just drop the call. (Probably clear() was intended, however doing that
change makes the corresponding autotest fail.)
Aggressively cherry-picking because I want to also cherry pick
[[nodiscard]] on empty() (which would've found this bug N years ago.)
Change-Id: I801d0c364a7122bb26d407c23ae99278939c50ff
Pick-to: 6.5
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 95c55d6f3216bfeb6d802fb70e455849b8c3567f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As previously noted, this backend uses the legacy zone.tab file, which
only gives one territory for each entry, where zone1970.tab gives
several. Until we switch to using the latter, we thus don't know all
the territories in which an IANA ID is used. However, we do have such
data from CLDR and deploy it in the default backend to filter the list
of all available IDs. As a result, the TZ backend lacks some results
of filtering by territory that the base-class would get for it,
because the CLDR data associates more territories with some IDs.
It implements the overload because its lookups in a hash are
potentially more efficient than generating its full list in order to
iterate it while intersecting with a CLDR-derived list of candidates.
Leverage that hash also to do efficient intersecting with the
CLDR-derived list, which lets us avoid duplicates almost for free, to
make the subsequent union with the directly-derived entries from
zone.tab efficient. This incidentally resolves a TODO about handling
of QLocale::AnyTerritory. In the process, add more notes to the
zone{1970,}.tab details.
Restructure the base-class implementations of filtered available IDs
to separate their generation of a CLDR-derived list of candidates from
the intersection of that with the available IDs. For the territory
overload, this lets the TZ backend share the CLDR-derived list; for
symmetry, do the same to the offset-filter, too. (This also makes each
function responsible for fewer things.) Similar treatment may also be
needed for the ICU and chrono::tzdb backends, since the former also
overloads the territory filter and both overload the offset filter.
However, leave those for now (with comments added on the possibility)
until we have evidence they actually do need this.
On picking to 6.8, the chrono::tzdb backend part is gone, as that's
new in 6.9. QTZP_p.h also had a trivially-resolved conflict due to
adjacent 6.9-new content sharing the new protected: block. The initial
pick's conflict in tst_qtimezone.cpp is resolved by picking onto the
correct parent.
Task-number: QTBUG-130877
Task-number: QTBUG-64941
Change-Id: Ibb347df88dd14b55f8f580bb4c9e37e5c56a533a
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit 54c2d6ded779c3b9843fa18535b79ababa0d1a74)
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fix support for systems with several X11 screens (or "virtual desktops"
i.e. DISPLAY=":0.0" and ":0.1"). Namely, call
QWindowSystemInterface::handle*() only after we settled on which screen
will be primary. Also cleanup some code logic, particularly, make sure
that QXcbConnection::m_screens is stores screen in a reliable order:
- Primary screen for primary virtual desktop
- Other screens for primary virtual desktop
- Screens for other virtual desktops (primary screen is first)
Pick-to: 6.5
Fixes: QTBUG-110898
Fixes: QTBUG-130714
Change-Id: I3e78e56466998dff4d7da83db45f0ed61463f041
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit 64590233aff4f7e9797f37484dbdd6d8465a1ea9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit 2b94453cbd.
This caused a crash when d&d text and etc cross xscreens from qt
application.
Pick-to: 6.5
Task-number: QTBUG-110898
Task-number: QTBUG-130714
Change-Id: Ie272ee96cdd963491bcf37f5448c3f4af3fd6aa7
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 45b33133c1c4b6dbabd48fda1c68c25a400fd482)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The dictionary was accidentally not closed by `>>` due to a typo,
which made the PDF invalid.
Change-Id: Ibb8ab05cf291070d48aa067d550b5696f636e47c
Pick-to: 6.5
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 6a5e2c6f9b0418f9bb8f0ac1abe39ec157c381f4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is in addition to 10b5b4cbba,
where we made m_helper QPointer to make sure it was still valid
before accessing it. There is one more place in completionHandler
where we need the same check.
Fixes: QTBUG-131880
Pick-to: 6.5
Change-Id: Id51d2c68db23b897b145ad25dd1c73b3f5eb9cc1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit a794f957c4c17fbcb12a4b78f58240d109c150d5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add a family of qdoc macros to document the various qHash() overloads
we have.
This patch does not change the \relates of the qHash() functions, they
remain as inconsistent as they have been. Created QTBUG-129815 to
clean things up. Since this author expects the \relates to change in
the future, there are different \qhash commands, and all except
\qhashbuiltin take the class name as an argument, for use in a
centrally-choreographed fix for QTBUG-129815.
As drive-by's, fix:
- missing documentation about Key having to support qHash() in the
associative Qt containers
- drop noexcept and default arguments from \fn lines that needed to
have their argument names changed
- move the QStringView overload from qhash.cpp to qstringview.cpp
(as it \relates to the former)
Fixes: QTBUG-129574
Pick-to: 6.5
Change-Id: I8e8c2edc27422cbe5823f56baf3a24d7f7050836
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
(cherry picked from commit 906aa1533f2267b091615d21c2d31e1742f0a520)
Force the mentioned QIODevice flags to be links.
Use fully qualified name for the first flag mentioned,
but use the short form for the following ones for
better readability.
Mark true and false to be written in code style.
Task-number: QTBUG-131484
Change-Id: I988ba66341b811c815953e5fd6d067204bdaae6c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 5a6a9b1d5aa4a9314c09dcbc85dcc9c863ace7f5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QTest injects a message handler to redirect messages to the loggers
and resets the message handler on shutdown.
This currently causes a race condition if the application thread resets
the message handler while at the same time it is called by a worker
thread:
Application Thread Worker Thread
qWarn() ->
calls messageHandler
stopLogging()
-> restores message handler
stopLogging()
-> clears loggers
messageHandler accesses loggers
This use-after-free scenario can be prevented by extending the lifetime
of the message loggers during the invocation of the message handler.
Fixes: QTBUG-129722
Fixes: QTBUG-130630
Change-Id: I404145f5e13a0f0e9e7500e7c24900dd31ddc18a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit a0303cc7c590ff17fb5b0a5975bff98669e42942)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Qt adopted UIScene lifecycle in Qt 6.8. As part of that switch,
the application URL delivery also changes to scene-specific, and the
previous QIOSApplicationDelegate URL handling callbacks aren't invoked
anymore.
This commit adds the URL handling to these scene-based callbacks:
willConnectToSession, openURLContexts, and continueUserActivity.
The older callbacks are removed as unnecessary.
With these additions, the application is capable of handling
custom-uri-schemes and https universal links, both when it's already
running, and when it needs to be launched.
Amends: 76ebf51bc0
Fixes: QTBUG-131741
Change-Id: Icacd76e9769f0a559b2052dfb60466a871187321
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit c81f805817c82018e133ca140183f7ecee9d6130)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The AnyTerritory entries in the zoneDataTable are derived from
territory="ZZ" entries in the upstream CLDR data; the World ones from
territory="001". The latter give the default IANA ID for each MS ID,
the former give an (often legacy) IANA ID for the MS ID, that is not
based on geography. Some of these are being removed at CLDR v46.
The documentation said the ZZ entries have "no known territorial
association", hinting that there may be some (unknown) territorial
association; however, CLDR's inclusion of them is as entries with a
known non-territorial association, so revise the phrasing to reflect
this.
Also document that windowsIdToDefaultIanaId() returns empty when
there is no territory-specific value, and callers can use the
territory-neutral call to get a suitable value in that case. (They
may, however, wish to distinguish this case, to treat it differently,
so I decided not to just return that in place of empty in any case.)
The upstream CLDR tables do have entries for territory 001, so we
should report these if asked for World as territory. Amend the
available zone ID lookup and mapping from MS to IANA functions that
take a territory to duly handle World via the default-data that was
derived from 001 data in CLDR, instead of from the territory-varying
table, from which those were effectively filtered out when generating
the two tables. Update docs to mention this handling of World, for
contrast with that of AnyTerritory.
In the process remove a spurious split-on-space from the MS to default
IANA lookup, asserting there is no space (in a field now stored in the
table for single IANA ID entries, instead of the one for space-joined
lists of them in which it used to be stored, before I noticed it's
always only one ID). There is a matching assertion in the cldr.py code
that extracts the data. Added an assertion to this last, that each
default IANA ID given by CLDR's MS data does in fact also appear as
one of the IANA IDs for at least one territory (potentially ZZ), and
comment in C++ code on why this means we don't need to scan the
windowsDataTable in a few places, where it would just produce
duplicate entries.
On picking to 6.8, removed the timezone_locale addition, only relevant
on 6.9 and later.
[ChangeLog][QtCore][QTimeZone] Corrected handling of QLocale::World
and clarified in docs how QLocale::AnyTerritory is handled when
QTimeZone selects zones by territory.
Task-number: QTBUG-130877
Change-Id: I861c777c68b0cb73a194138fe23fbff839df49e6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit e23dc7c420297fb62db9834a17c59bbf5992dad7)
Reviewed-by: Mate Barany <mate.barany@qt.io>
The QTZP::availableTimeZoneIds() overloads taking a territory or
offset to select on were building a list of QBAs, allocating copies of
static data to do so, and then taking their intersection with the
no-parameter overload. Since the latter is of QBAs and the
intersection code used its begin() and end() for the first pair of
parameters to std::intersection(), from which the results are drawn,
we can use a QBAV list for the second pair of parameters (with whose
range the first pair's range is intersected), thanks to QBAV entries
in the list being comparable with QBA.
This saves allocating copies of the static data, when we can make do
with simply building a list of views of that data.
Belatedly picking to 6.8 as a prerequisite of a later change.
Change-Id: I42de4a91273e23fb394f9ae7a86f7f3fadf95be3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 67fb5dcfcd1bac5d5b30723a4ebba84acda58902)
Reviewed-by: Mate Barany <mate.barany@qt.io>
Use the depthStencil format to check multisample support when the
pipeline doesn't have color attachments.
Fixes: QTBUG-131505
Change-Id: I8fec8383ed854a581586213e3dbd401bb457cefc
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit f6d67ed9b760e87af3e032ea49e5babc6951ef91)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If a substring for a fallback engine spanned multiple characters,
we would only assign the first of the characters to a glyph in
log clusters. This could cause the log clusters array to become
non-monotonic (you could get an array like [0, 1, 2, 0, 3, 4]).
In turn, this would confuse the text layout algorithm which
depends on the indexes always increasing, and we would sometimes
hit an assert in addNextCluster() if we were unlucky.
To rectify this, make sure all characters in the substring are
mapped to the same cluster.
Fixes: QTBUG-131731
Pick-to: 6.5 5.15
Change-Id: I93415a58351349ead6eb7a016b32b09f274e6fe4
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 40e364172f001ce7dd6e4e72716e9c17c9d29b9e)
Because I forgot in the original commit
Fixes: QTBUG-131801
Change-Id: I597673b13e01fdfa22ae178dd1a82671e52794c1
Reviewed-by: Lena Biliaieva <lena.biliaieva@qt.io>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Mate Barany <mate.barany@qt.io>
(cherry picked from commit fd923ad6e900593d56b6b0f84e8e796a9d8e4ed7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The standalone build of the sqldrivers plugin never called the SBOM
project begin and end functions.
This cause an error in qt_internal_add_plugin which tried to read the
SBOM project name.
Replace the calls to qt_prepare_standalone_project and
qt_print_feature_summary with qt_build_repo_begin and
qt_build_repo_end.
This ensures the SBOM project is setup, as well as many other
behaviors that a standalone internal build of a module is expected to
have.
Additionally we need to tell the SBOM project where to find the
licenses for the standalone build. This is done by setting the new
QT_SBOM_LICENSE_DIRS variable to the qtbase license directory.
Fixes: QTBUG-131799
Change-Id: I2e31ecffdff28561d1c4a6b8fbcd8125188d2c48
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit df30953228f0e364e9a3915d97f522efd8e67489)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
According to the CMake documentation we should use the add_dependencies
command to add dependencies on other targets for targets created
using the add_custom_target call.
Adjust the code for the Android targets.
Task-number: QTBUG-131653
Pick-to: 6.5
Change-Id: Iec9a3036f34f065f067568ecfca838345d35ff93
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 312717d821aea191bd61285b2bf21ef11c509318)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Added a qdoc dependency on the qtnetwork module to resolve links to
QNetworkAccessManager.
Change-Id: If625c63fc0a2ecc9cfea9f467796bf8388478c1c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 7a473ca3224d5517c5f09cc14a4047da06112bb2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The snippet referred to had a duplicate identifier to an earlier snippet
in the snippet file, causing that one to be quoted instead.
Change-Id: Id46f6da807806f874291cd5d4c25b8884e511cfc
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit d2c9982a568181d55a9043c8646a4ee88b635fc7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add entries for the cmake 3rd party files, as well as mimetypes
and gradient gen.
Task-number: QTBUG-122899
Task-number: QTBUG-131477
Change-Id: I22f243798d66422a0b52aa37532eba2b3210c98d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit cecff9ec41ca9387386215540cb851ca8b65e2a6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We want to avoid caling toMSecsSinceEpoch() since it's expensive for
LocalTime (which is presumed to be the common case). We can do so when
both sides have the same offset from UTC (and this can cheaply be
determined) but that's no help for two local times months apart, one
in DST the other not. However, in this case, the difference in millis
is big enough that no plausible difference in offset can overcome it,
so we can again avoid toMSecsSinceEpoch() and simply compare millis.
This should make some previously-expensive comparisons cheap.
Add test-cases to the QDateTime ordering test that verify this doesn't
lead to mis-comparison at the biggest offset-difference known.
Fixes: QTBUG-131491
Change-Id: I1afd5d058c8663c908f898d4c50d0837549b87db
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit ef540d77751e24fe0b345694f43cdafca3434c68)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When the messageHandler is called without loggers, we used to simply try
to restore the old message handler. This is not ideal and the assertion
seems to be wrong.
The situation of not having any loggers can occur during teardown, if
the message logger is called from a worker thread, while the application
thread stops logging (compare QTBUG-129722)
In this case, we simply forward the message to the original message
handler, which should simply print the message.
Change-Id: Ic8147f7ab6317f1ceb4f52c79ce298464a94de30
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 56106d1bd770c474bc15df47ae6aa64d37ea3d20)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Avoid double lookups to QRenderRule::styleHints by simply checking if
the returned QVariant from styleHint() is default-constructed.
Change-Id: I4ca657662c2af66582fb4fc7c2ed1b77258ab050
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f1fd15b4549a740dbd0abff44a43b551eef12d31)
Since 6.8, QML has popupWindow. When in popupModeMode,
it does not necessarily have a popupWidget.
Not checking whether popWidget is nullptr will cause the
program to crash.
Fixes: QTBUG-131664
Change-Id: I624b62ef7185f0ab35215c2c34b0d6e9c80539a0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 706d54eefee22e2feb16a7a7717c0a48ff270460)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A checked QToolButton should be drawn similar to a checked QPushButton.
As a drive-by avoid calculating the paint rect twice and make the code a
little bit more readable.
Fixes: QTBUG-129439
Fixes: QTBUG-129700
Fixes: QTBUG-130822
Change-Id: I573132e804f26b9fa41112267a9f685680cf0864
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b3c0b08eb040bbd76b81a7c6172e3846e8ec0000)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Surprisingly, moc had no awareness of constexpr at all. This would still
mostly work, as we were just skipping it, except for the case where
constexpr appears as the last keyword – in which case we'd pick it up as
the type name.
Fix this by adding constexpr as a known token, and add it to the list of things we ignore in testForFunctionModifiers.
Pick-to: 6.5
Fixes: QTBUG-122609
Change-Id: I0ae0c0477e611ff83fbb841233035bea52216be2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 984ad9019a62a9a130647dbd765e38ee2e6250c1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The file is used only in the local scope so no need to have it
as a pointer. As a pass-by, use WriteOnly open mode.
Change-Id: I9999f4aed0f888af9a3e08ed6c3573432c29d195
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit 7539b659d9ffbb3c44e45bdb7d9669a6df8915c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's good to give a hint about what changed, and it helps behavior of
QQmlDelegateModel when that is used in the view.
Fixes: QTBUG-131487
Change-Id: I8478eaf1e8294e101f3fedc285e44f83e600c566
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit bf714c246b5e45d259a07cf19b668f091fa396a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There doesn't seem to be any reason that it should require an instance
of QApplication. However, given that the model is by design
asynchronous, it does need to live in a thread that runs an event loop.
Add a note about that to the "Caching and Performance" section, and
apply some drive-by editing.
Amends fb9ec8ad44
Task-number: QTBUG-66177
Change-Id: Ibe3095e0264ce033732d1c724f59a871e2a0d3b8
Pick-to: 6.5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 22bde5209a7a3c510d4b90b9eaee413f3ba3dee4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Documentation of QMetaProperty mentions deprecated members, which
includes type(). Added link to the metaType() to avoid confusion.
Fixes: QTBUG-131446
Change-Id: I8d96bcf712c78ca2b9ce609e511d275053cf6cbf
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 07c5ff8246b568f2d89e8b0e8236b1ec517e16b5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When drawing an indeterminate progress bar, QPainter::drawLine() is
called very often. Avoid it by first calculating all lines and then call
QPainter::drawLines() once with all lines to draw.
Change-Id: I51ce23236b945b30da649fd06aad60676321e403
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0eedffa01daed077aba4781b240068929cf768be)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Cleanup drawing of PE_IndicatorToolBarSeparator - there is no need to
call QRect::topLeft/bottomRight() and then only use x or y. No need to
stress the optimizer that much.
Change-Id: I477dcea6c9bebd981777fdc1eb53963074257e01
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9fa471f9c7b4f2218109fa4bd17d66cf5b24101d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Move common tasks into a lambda to improve readabilty and avoid
copy'n'paste errors like it happened for SC_TitleBarContextHelpButton.
Task-number: QTBUG-130673
Change-Id: I5cb198b976d459b73e339d066def92d70b71ade5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 9a97e78d8310c13212aacd578f5529b5521e395a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The logging category now silences QtWarningMsg and below by
default, so we can be more granular in our logging.
Use info logging category for registering/unregistering, to allow
filtering out the detailed debug logging while still seeing when
devices are registered/unregistered.
Log the number of buttons for pointing devices, if there are any.
Log the device for wheel events.
Change-Id: Ie046fee1659fc3967caf7eafbaf46f3ed22be5bb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
(cherry picked from commit 1ad00d3878271450cc55eb84d4c5f3cddd460b8b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We will need these checks in the qcomparehelpers.h header, so move
the code there.
As a drive-by, use QtOrderingPrivate namespace instead of QtPrivate,
and also mark the constexpr bool variables as inline.
This is required for the follow-up patches.
Task-number: QTBUG-127095
Task-number: QTBUG-120305
Change-Id: I1ea827ecf68b6bffa347dae22ddac25c059b53a9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 678e9f614bc5a05d2ff16cf916397998e7cdfca1)
548351 changed QWindowsIntegrationPlugin and
QWindowsDirect2DIntegrationPlugin so that their CMake targets link
directly to UIAutomationCore.lib/.a instead of loading
UIAutomationCore.dll dynamically at runtime; however, it did this by
first locating the library via `find_library()` and then using the
absolute path to the DLL import library found. If Qt was built
statically, this would cause that absolute path to be added to the
INTERFACE_LINK_LIBRARIES of their export targets, breaking the build
if moved to another machine where the location of that lib differed.
Instead, simply list uiautomationcore as a library link by name only,
which shifts responsibility of locating the .lib/.a when consumers
build to the linker, as is done for all other Windows system libraries.
This ensures that the library is found correctly regardless of which
system Qt was built on.
Currently this only applies to MSVC due to limitations with
uiautomationcore.a when using MINGW, where the lib is still dynamically
loaded.
Pick-to: 6.8.1
Change-Id: I20011a51935af4093de83fff75efe2141da0655b
Reviewed-by: Zhao Yuhang <2546789017@qq.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit da367d0bffcd58a3217af937d767cf4f392d3c15)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Move one AND operation out of the loop, as it is only needed in the end.
Change-Id: I48adcd18c900654830a84813f26c95eee579b49d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit fc947593ef78c92b67811ac14dae200b45b480ea)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Emojis would sometimes get an outline in a seemingly
random color. This was because the color run is not
initialized to the first layer. MoveNext() should be
called on the initially to move it to the first layer, so
the first layer we rendered would end up being a
monochrome version of the glyph with a random palette index.
[ChangeLog][Windows] Fixed an issue where emojis would sometimes
get an outline.
Pick-to: 6.5
Fixes: QTBUG-131587
Change-Id: I42c2828d66c6149cdb62c2b6271dfd49ca002db0
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 51b584e6062e83e24950d5eccd826ea5a5b8af6f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This comes at a price and it does not really make sense for
emojis.
Change-Id: I57148bff48a48bb81a03203626df25646c9acb6a
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit fd9c9788f73cb088229701dd92443aa04005a4a3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The C++ standard forces¹ us to overload the hidden friend qHash()
implementation instead of defaulting `seed` to zero. That doesn't mean
we need to reflect that technicality in the docs, esp. if it forces us
to deviate from the standard phrasing of qHash() functions to say
something about the default value of `seed` (which would, for a
defaulted argument, be shown in the docs).
Present the qHash() function in the canonical form to QDoc. This is a
(forwards and backwards) BC way to solve the issue. Going forward, the
correct fix should be to have qHash() functions call a private
hash(seed) member function instead, to fulfill the pointless
requirement of [1].
¹ [dcl.fct.default]/4, last sentence
Amends c2310f8e03.
Task-number: QTBUG-129574
Change-Id: I7890a0df092c9780601fc4c25e23d70d92db47e1
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 27d792869b30721cecf493a54d89e9df6e75a6fa)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QAction object returned by QDockWidget::toggleViewAction() is owned by
the QDockWidget. QAction object is deleted when the QDockWidget is
destroyed.
Fixes: QTBUG-70171
Pick-to: 6.5
Change-Id: I279366209228c88241e3bf70c17c117a2bf91f40
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit f5e127c842f4fad459d8abdfea8ae45025b6107f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We had input handling enabled as a precondition for setting focus.
This is wrong, we need to have the focus for toggle buttons
and other non-input things as well.
(Also toggle buttons act on spacebar).
Also selects a new active window if the window
that is active (i.e a dialog) is deleted.
Also shift + tab did not always work, fixed
to emit Key_Backtab
Fixes: QTBUG-130371
Change-Id: I3b36a3e200ba9d4b0791865e75235ddfb72bcaa5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit ef8bf4c2cf3d86a869ff8a555d4e390168864144)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
87d8ee755b changed the logging behavior
on Android to use the category as tag. But it was missed that
`formatLogMessage` only fills the fields given in the messagePattern.
Our default messagePattern includes the category but on Android it
is never filled since this change.
So we change the default messagePattern on Android to omit the category
and only use the category as tag when the category is not given in the
messagePattern.
Pick-to: 6.5
Task-number: QTBUG-94708
Change-Id: I80f65d0f7f8c0ca9c2fff2dcd63d4599848b6e2b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 709bc29a1d2abf40bf3f1c067fe3b96b6e0c09d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
As a drive-by replace calls to QList::append with emplace_back,
to avoid repeating value_type.
Task-number: QTBUG-115841
Change-Id: I027d82706f3545dd63c6b8ba89ba66ae938e07f9
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 6ed725b3b93d15a45501fecb6f1fa711ef65e17e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Briefly sketch the new features in std::chrono and how Qt now provides
access to them.
Task-number: QTBUG-128837
Change-Id: I99a94ac9d0ed292ec9e3b0057ba6a9e2092200ed
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 856aaa4c0c4992b3be57c0a6c5ccb81dd6ea8b86)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We've encountered that under some circumstances DecryptMessage may
return undocumented SEC_E_DECRYPT_FAILURE status. It's probably a bug
in Schannel on Win 11, as there is no such problem on Win 10.
In such cases, since we didn't handle this specifically, we can end
up in an infinite loop in TlsCryptographSchannel::transmit() when
`intermediateBuffer` is not empty and `bytesRead` is 0.
To fix this, we just add SEC_E_DECRYPT_FAILURE status handling and
will disconnect from the host and emit the error respectively.
Change-Id: I340669a967be420c74cb01296629f94c4720c958
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit ed0eb386dad22b0984151b92168dcbf9b57c381b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There were some syntax or links that javadoc doesn't
recognize and throws an error about, this fixes all of
them.
Change-Id: I301ec22bc14c2e41e3253222efbb38c3c2c9eeba
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit 1fa1ceeadc7bd0db051e82429bf8791d9a82c4e0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It takes some time to display the keyboard. For this reason, in case the
keyboard was not displayed yet - we could wrongly assume that the
keyboard is hiding. To avoid this situation, there is a new check.
In case the keyboard has just been opened and it is not displayed yet,
the execution of HideKeyboardRunnable is postponed to give time for the
keyboard to be displayed.
Fixes: QTBUG-130000
Change-Id: Iee1310c777ebbb807990bf3cec39e6d07481dfad
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 4de9b94042dd173c6db31a4641a1513a9b319a79)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Move implementation for checking if keyboard is displayed on the screen
from QtInputConnection to QtInputDelegate.
The QtInputDelegate class is responsible for showing/hiding the keyboard
and handling its visibility. Moving mentioned implementation there seems
reasonable. Also, this implementation will be used internally by
QtInputDelegate in the future.
Task-number: QTBUG-130000
Change-Id: I47cf8e8fb2ee9bea535b9e009dd4b43b28f19b80
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 229cff37c0b6f822e9c22734e66d8ce117723d22)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
For Android above API 30 we can directly just check if the keyboard is
visible. We do not need to calculate it size. This is useful as
floating keyboard has wrong size.
Task-number: QTBUG-130000
Change-Id: Ia91d8b9ddefc97f8d65a657aa7e75bb146feb00e
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
(cherry picked from commit d97bfafa86e752cc3a739d8efb749ddea2120ca5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This part of code seems to be really old.
Unfortunately in newer device the Navigation Bar is bigger than 100.
So when Navigation Bar is visible - we assumed that keyboard is visible.
That is why this part of code is "dead" for devices with higer resolution.
To make this solution more flexible, we need to rely on the screen size.
Task-number: QTBUG-130000
Change-Id: I387fe58b4c6d22de83394cc8f51c75e7a55e72a1
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
(cherry picked from commit 34d184911eac07c97f44e87de27f7e37a4ebda81)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We get a local reference from New*Array, and then construct a QJniArray
from that, which will create a new global reference, without deleting
the local reference.
Instead, go through QJniObject::fromLocalRef, and release the local
reference also in case of failure.
Change-Id: I88108315240133369efab30e55fdbea17a17a26d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Zoltan Gera <zoltan.gera@qt.io>
(cherry picked from commit 37638c84efaf2810ad49da0b987f19287d8c4ad6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Other functions that creates QString instances from buffers document
that the size argument represents the number of characters to copy. This
patch adds this statement to QString::fromWCharArray too, but makes it
explicit that the size represents the number of code units.
Change-Id: If3c0ebe299281a3c0ffc2d9e609b89df2578811d
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit a315a9e70e69e36cef0e51058faad048773040e1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
You *should* be using LTO if you want performance, but these functions
are trivial enough that it makes sense to inline them.
The !QT_CONFIG(thread) support seems wrong and is probably leaking
memory for the QAdoptedThread for the main thread. But since that only
happens because the program is exiting anyway, it's a case of "leak" in
quotes and one I don't care about.
Change-Id: I2bb6e519239ea33cc521fffd71f57574f940ed62
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 278d2255e25d659ce5be08d2b81226556b1dfee2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's highly unlikely you're going to have more than 2 billion pending
events for a thread, but this is the right thing to do.
Change-Id: Ia162b024815c3b970d71fffd3bc022621b2e07b4
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
(cherry picked from commit 67a71d71093b50d0db172b92aa1b548a1a2bd959)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Fixes
(Alt + '~') + 'a' -> ã
(Compose) + '\'' + e -> é
A key change is to look at "isComposing" for events
Related bugs:
QTBUG-107139
QTBUG-124932
QTBUG-117096
Fixes: QTBUG-130887
Change-Id: I0d4641d89952e0b4117226994a91e40039ad8a03
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit efa0d60fe465542c8233b1e6d9ed35806967c86c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Print an error log when the build command fails that make it clear
that the build has failed and not necessarily the test.
Also, it seems according to the code, that if the build command fails
and --skip-install-root is set, the build command is run again.
Prepare the build command after parsing the args considering all the
other args and simply run the final build command in main() to simplify
things.
Change-Id: I2f5a9d26bcea78349e1ef1cec4f717c37afd0225
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit fe672c3db87b4f0d33d13987024f7c3603b1184a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Looks like this was an oversight from Qt4 times where there was no
QCoreApplication. But nowadays the plugin loader only needs a
QCoreApplication instead a QApplication.
Change-Id: I878ee157968ca0cd45314f955fc732d0f00b11ab
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 011081998703569a1dfcd17edcb65b27e1f9a8f9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
A lookup to QHash<QString,...> works perfectly fine for a
QLatin1StringView so no need to create a QString first.
Change-Id: I4cd5f3c0bab8f9af696e8ae2d3eefad77f2e8722
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 55c1630e92914110c7c58f966650d4fe40cfc58c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
With an openglcompositor, only first QEglFSWindow is set
with a flag, HasNativeWindow and when it is destroyed,
the openglcompositor is destroyed, too.
For now, when using openglcompositor, Qt will not check
HasNativeWindow for its nativeWindow because it is not
possible to add a HasNativeWindow flag in an existing
window. And the openglcompositor will be destroyed after
the all the QEglFSWindows are closed.
Fixes: QTBUG-129576
Pick-to: 6.5
Change-Id: I620a904a03d29e8db1738d9392f716b3ebf5b553
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 39bcd4287a6146e6deba9c6a9fdb70298deed427)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There is the same return-statement right before.
Pick-to: 6.5
Change-Id: I7890c386e50733aefbba57ed9f6df09763c54bc3
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit 19bce49aaa510e6d10647a71dc2ef36537e51847)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Link to the newer permission API and note that the private
API can still be used for permission types not covered by
QPermission.
Fixes: QTBUG-130372
Change-Id: I093edd72bc50372eba3b06105087ccd4884b0bac
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
(cherry picked from commit d2a8a0dc29b15a4076ff055e0b500a1d9207c5d7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
There is a potential race condition on Mac that can lead to crashes
when destroying `QNetworkConnectionMonitor`. This issue arises when
`QNetworkConnectionMonitorPrivate` has already been destroyed, but is
still being accessed through `QNCMP::probeCallback()` from another
thread.
To fix the issue, a reference counter is used.
This counter indicates whether the callback is being used in monitoring.
It increases when information is retained (when we set the callback,
the info retains to 1) and decreases when information is released
(the info releases to 0, when QNCMP object is not used in monitoring).
A waitCondition is used to notify all threads when the reference counter
reaches zero. The QNCMP::reset function waits until
the probeCallback is disconnected and the reference counter is zero.
This indicates that the info resource is free,
allowing us to safely destroy the QNCMP object.
The conditional variable protects
the QNetworkConnectionMonitorPrivate object and ensures
that the callback is disconnected properly.
Fixes: QTBUG-130552
Pick-to: 6.5
Change-Id: I1259c429e92bc20c382604192243d6d8fadb5c25
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Vladimir Belyavsky <belyavskyv@gmail.com>
(cherry picked from commit 8a535cc1049c4304754b380daaefdece3a7c2e5b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On some platforms and setups, the multi-threaded implementation of this functionality is not desirable. Allow disabling it at runtime by setting the environment variable QT_NO_GUI_THREADPOOL.
Task-number: QTBUG-129650
Change-Id: If089ecb3b335defc06f14749841bf9f6041e6f5e
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
(cherry picked from commit 7a8cefd6fb66e6bc6880aaf5a938194611278bed)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When a corner widget in a QTabWidget is hidden then the space is not
reclaimed for the tabs. Check whether the corner widget is visible before
laying out the corner contents.
Fixes: QTBUG-18068
Change-Id: Ib07ad15a7317e37101dde87c6f80c91c6c4ac6d3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit c7a8cbd272b7ffce1d5da604881ed8f66a632444)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Says GCC (e.g.):
qabstracteventdispatcher.h:122:9:
warning: ‘virtual int QAbstractEventDispatcherV2::remainingTime(int)’ was
hidden [-Woverloaded-virtual]
122 | int remainingTime(int timerId) final;
| ^~~~~~~~~~~~~
qeventdispatcher_glib_p.h:47:14:
warning: by ‘virtual QAbstractEventDispatcher::Duration
QEventDispatcherGlib::remainingTime(Qt::TimerId) const’
[-Woverloaded-virtual]
47 | Duration remainingTime(Qt::TimerId timerId) const override final;
| ^~~~~~~~~~~~~
The usual way to fix this warning, adding `using base::func;`, doesn't
work here, because (the int overloads of) the functions in question
are made private in QAbstractEventDispatcherV2, so the `using` fails
with "is private in this context" errors.
Since this situation is temporary (until Qt 7, when the overloading
stops), simply suppress the warnings manually.
Found that the Windows dispatcher doesn't inherit from V2, yet, and
created QTBUG-129170 to track the issue.
Amends f8da484d57.
Task-number: QTBUG-126219
Change-Id: I0da821f08364f97fb7a17c9019586064ae58b0b5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 222cf3145ede99d1919fe7f388a9101f2c576255)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The QCupsPrintEnginePrivate::closePrintDevice() function expects the
cupsOptions string-list to have an even number of elements, because it
iterates in steps of two and doesn't check the size of the container
while in-between steps.
Print a qWarning() in setProperty() when the option value string-list
has an odd number of elements in it, and append an empty entry to
maintain the expected format for closePrintDevice(). This is the
least-intrusive way to fix the problem, hopefully defining previously
undefined behavior without other user-visible effects.
Amends f70924e9cc, which, however, may
have merely moved the code around.
[ChangeLog][QtPrintSupport][QCupsPrintEngine] Fixed a bug where setting
a value string-list with an odd number of elements as the
PPK_CupsOptions value would read uninitialized data.
Pick-to: 6.5 6.2 5.15
Change-Id: I38ed8de6da00f17fa8fe9138d54db3699943f3b1
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 7ae959e00ae4385215ab8bde0781255f36b8bd59)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In the line break algorithm, we try filling characters and
objects onto a text line until we see an overflow. We then
keep the state *before* the overflow as the current line and
move to the next.
However, for inline images we would store its height to the
current state before checking if it overflowed. So if the
inline image did cause an overflow it would be counted
towards the height of the preceding line in addition to the
line where it actually ended up.
[ChangeLog][Text] Fixed an issue which could cause the
height of a word-wrapped text line to grow if the immediate
line after it began with an inline image.
Pick-to: 6.5 5.15
Fixes: QTBUG-130980
Change-Id: I68494b49059e5e35349cbde77aefc64abeb69697
Reviewed-by: Lars Knoll <lars@knoll.priv.no>
(cherry picked from commit 7b024cc1749494114fffc3c434b58846707a64af)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
These files use errno constants such as EACCES, while relying on
this header to be included implicitly.
If building with the latest libc++ versions, configured with
_LIBCPP_REMOVE_TRANSITIVE_INCLUDES=1 (which removes unnecessary
transitive includes from the public headers), one runs into this
error, where errno.h no longer is implicitly included through
other headers.
Prior to 762017f03c, these functions
were in separate files that explicitly did include errno.h.
Change-Id: I7b02f2ffa35b86606f6c173bf6a6d2917dbdc151
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 9f429468326e3d857c84276c4acb86d2e8e83279)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The change adds CPE and PURL keys to all qt_attribution.json files in
the repo.
In case if no sensible CPE or PURL exists, a "Comment" field is added
with the text "no relevant CPE or PURL found". If only one of them
does not exist, it is written as such in the Comment field.
This allows filtering for files that haven't had the information added
yet vs those that were looked up but no relevant information was
found.
For sources that are not hosted on github, a generic PURL is used with
a download_url fragment pointing either to the exact location where
the sources can be downloaded, or to the homepage of the project.
The generic package name was chosen based on the 'Id' key of the
attribution entry where it was present, and is not authoritative.
For PURL github packages, the 'git tag' name was specified into the
'version' part of the PURL, rather than the 'version number', because
SBOM processing tooling handle that better than the version number.
For example for the freetype package, we specify the string
'VER-2-13-3' rather than the tag name '2.13.3'.
We might revisit this in the future.
[ChangeLog][Third-Party Code] Added PURL and CPE information to the
attribution files of 3rd party sources.
Task-number: QTBUG-122899
Task-number: QTBUG-129602
Change-Id: Iad126242cafc3ea0b678c5c36b26f857039b1dbd
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 36dca3c04f759449f74008a3e79021a179b0f35e)
Clang warning:
.../qproperty_p.h:666:58: warning: declaration shadows a local variable [-Wshadow]
666 | if (QPropertyObserverPointer observer = d.firstObserver())
| ^
.../qproperty_p.h:660:46: note: previous declaration is here
660 | if (QPropertyObserverPointer observer = d.firstObserver()) {
|
Fix by abbreviating the variable name in if statement.
Change-Id: I7905de08f15124466f8aa587691b2880c889199f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 2fc5735f60e0bcd7b7b451a32fd999f2d36a33c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Commit 1ed0dd88a3 ("QThread/Unix: make
QThreadPrivate::finish() be called much later") introduced this problem.
Commit 4fabde349f16b59f37568da2a4c050c6dd53a34e split the thread
termination in two phases, but did not fix this.
This re-applies commit 950b35cf97 ("Clear
the current thread data for the main thread"), which was reverted in
commit 7dc622290b ("Make sure QThreadData
and QAdoptedThread object is destroyed at app exit"), both from Qt 5.1.
Between Qt 5.1 and 6.7, the responsibility of clearing the
QAdoptedThread for the main thread was split: it could occur either in
~QCoreApplicationData if exit() was called in that thread or in
~QThreadData() if it wasn't (e.g., when the Qt "main thread" is not
main()'s thread):
* frame #0: 0x0000000101db8a28 QtCore`QAdoptedThread::~QAdoptedThread(this=0x000060000176c070) at qthread.cpp:139:1
frame #1: 0x0000000101db81eb QtCore`QThreadData::~QThreadData(this=0x0000600002468000) at qthread.cpp:82:5
frame #2: 0x0000000101db8379 QtCore`QThreadData::~QThreadData(this=0x0000600002468000) at qthread.cpp:57:1
frame #3: 0x0000000101db841c QtCore`QThreadData::deref(this=0x0000600002468000) at qthread.cpp:108:9
frame #4: 0x0000000101f4ec79 QtCore`destroy_current_thread_data(p=0x0000600002468000) at qthread_unix.cpp:104:11
This commit centralizes and gives ~QThreadData() the exclusive
responsibility. That requires not resetting QThreadData::threadId so
~QThreadData can know it is theMainThread.
Fixes: QTBUG-130895
Task-number: QTBUG-129927
Task-number: QTBUG-129846
Task-number: QTBUG-130341
Task-number: QTBUG-117996
Change-Id: Ie3f3cbdc5523837b505cfffd95fba5e6498b5069
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 65093a84c2b94b1543fd4593bc45d491951d28d4)
The jerk with QProgressBar occurs when setTextVisible(false) is used.
Condition exists to handle repaint when text visibility is true but not
handled when text visibility is false.
Usage of auto leads to type confusions.
Add the logic to repaint for every 1 pixel change in the value when
text visibility is false.
Avoid using auto when type is obvious.
Fixes: QTBUG-45048
Change-Id: I0fdc62c7aabdaef52bc4bdc20e82141a4a7d29d5
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 913b98d4120b56487a14eb96b5e5252fdd939603)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The code tells that it's deprecated in 6.2, while the docs were
mentioning 6.1. Update the docs to use the correct deprecation version.
Amends 1bf48c16b166c80d208f130fb4f8130f63ef741c.
Pick-to: 6.5 6.2
Change-Id: I4ec3b8e840ec5aa534ea1f2687a23584178bb4a6
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit 0b34a205cc3ab6985efa705d066e85167ce0181c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It's already automatically added as part of the license iteration code
in _qt_internal_sbom_begin_project which globs
${PROJECT_SOURCE_DIR}/LICENSES/LicenseRef-*.txt and adds those.
Adding it a second time manually is unnecessary, and breaks conversion
to SPDX 3.0 with the spdx java preliminary tool.
Task-number: QTBUG-122899
Change-Id: Id42a02c6f2e536880b37a0ed773cf62426b46b97
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit b11aaf066eaf1491a1661dd8f3baa66acfbd46f6)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Avoid lint exception for dependency updates in
the developer build so we do not miss updates.
Change-Id: I7856a2773e49258c6497ae5d4978a4ea519e9a04
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 6bb3feffd56424d0990b1345f343012a60e3351e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add a note on how timestamps are handled for the different database
drivers.
Task-number: QTBUG-130118
Change-Id: I1bad480fa18b5b719870635db1444c8db8c7d966
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit d63f14473345cdb83c2da00a19892f57e661a5d0)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QCoreApplicationPrivate::mainThread() asserts that there is a main
thread, which means we can't use it to detect after the main thread has
been unset (late destructor-on-exit).
Change-Id: Iedcd0827d1e659f3de35fffd60cac0b47cc496bb
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 9bac90db46913ae70fd29676cb22890b4ac9aaa4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Partially reverts commit 65953e05d3 (the
rest will be addressed in the next commit) now that we have an atomic
access to the QCoreApplication instance.
This thread-affinity check code was there because the code had a data
race in accessing QCoreApplication::self. It ensured that we only read
that variable if the receiver was in the main thread, because if a
receiver is not in the main thread, then it can't be QCoreApplication.
Change-Id: I09618961cca80fef2dc1fffdab65316164023207
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit a90349aa2141767147498d8f6a6d69dc25af89bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We use it from many places in Qt that may run before QCoreApplication
has been created (officially not supported but it happens) and after it
has been destroyed. In particular, we have code in QtDBus that runs in
another thread after QCoreApplication has been destroyed and uses the
event system. Accessing QCoreApplication::self anywhere but the main
thread was a race condition in those conditions.
Change-Id: If4ad1af9301dca98ba69fffdf88c63b220db53ac
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 7d92ecd9173a5ce4af8eb6ac05d6e7648d433db4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Only the ADL swap was documented, but this class has member-swap, too
(albeit deprecated), so document it.
Pick-to: 6.7 6.5 6.2
Change-Id: I71a6636172170387c9e4a264d2d118c2a9ce6f91
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
(cherry picked from commit 1bf48c16b166c80d208f130fb4f8130f63ef741c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The CMake copy_if_different command, which copies the android target
library to a libs/<arch> directory could be executed in different code
paths which caused a multiple access to a same file in a filesystem.
Avoid doing this and depend on <target>_prepare_apk_dir target for the
depfile code path too.
Pick-to: 6.5
Change-Id: Ib62cf24ecc69a17ce1b52cd1f001aeff866051cd
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
(cherry picked from commit 76fef03f19ab2a41ec9fdc9a72a08b5e1ea80a95)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Avoid casting an event to a type it does not have. Instead use a static accessor class.
Task-number: QTBUG-99563
Change-Id: Ideb11779b1510cd10a27fb8bc40bcc8e4849bf15
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit acc3ef6653c710b509e9321663986910f88ac3b4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This should keep gcc from complaining that they're unused const
variables. Pick to 6.8 required conflict resolutions in non-generated
code and qlocalexml2cpp.py due to dev's updates to handle time zone
name L10n; regeneration of data took care of the other conflicts.
Fixes: QTBUG-128930
Change-Id: I4d0bccc5f158dfc72e4cf38a085b90cb562dc185
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 08ef4d232df82c056d4f5fda636b62b65fc054ad)
If a menu contains no or only invisible actions, then its sizeHint might
become invalid (depending on style), resulting in an invalid geometry.
In that case, return early from popup(). Otherwise we try to show popup
window with an invalid size, which results in unpredictable behavior,
depending on the windowing system.
To minimize possible fallout from this change, don't return early from
QWidget::show (or QWindow::setVisible), but fix this locally in QMenu.
The QMenuBar test used empty menus to confirm that hovering over other
menu bar entries would highlight the menu bar entry under the mojuse,
and close the currently open menu. This can be tested better and more
reliably with menus that are not empty, which is (probably) also going
to fix the test on wayland.
Fixes: QTBUG-129108
Change-Id: Icc52528e89baefea04b3b27e6f02674bf74162b2
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 353ce5344fbde5a6cecbdd2c131e1cf0f4b7f383)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Add PE_IndicatorBranch so the correct arrows are used instead the
windows 10/vista ones.
Change-Id: I5328a91b883078b4564890729f73dbfc573cbf00
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 02bf12072feee46f3b5f966a88f5094c55553b48)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Amends commit 41f84f3ddb - in which I
neglected QDTE. It just needs to set defaultCenturyStart to its old
initial year to match the prior behavior.
Fixes: QTBUG-126698
Task-number: QTBUG-46843
Change-Id: If1edafe25778ad064f8f4393c8b1b3bbf5c957dc
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 130e066868634f4663b4640ee1923eece1c171b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is a Qt dependency that the user cannot influence.
Pick-to: 6.8.1 6.5
Change-Id: I6efbfefb5901588f4c99b4edfa05b21b68ab01a7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit cfefce57a4ff446305cd1f839e7c5203bac7a6c5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Make the sort indicator arrow drawn in PE_IndicatorHeaderArrow a little
bit smaller (the same size as for PE_IndicatorBranch.
Change-Id: I34035a845b1a0f5ebdb1257d802360ce3df7e703
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
(cherry picked from commit 8945f7d6eb6c370ab5992d6250194f7b2c9df969)
We have some patterns for how to document certain functions, but we
also vary the sentences a lot, and you have to look up one
documentation piece and copy it, essentially. If we ever want to
change them, we end up with shotgun surgery.
So apply DRY to the documentation and start a collection of macros to
help with repetitive C++ class documentation tasks.
The first macro is for member-swap(), and this fourth patch is for
documentation that used to be \internal. But the classes are public,
so don't hide the swap() member functions, document them.
Task-number: QTBUG-129573
Pick-to: 6.7 6.5 6.2
Change-Id: Id81b5ace05a7ccaf2a2194ebd56af10e8a98d7be
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 5a9bd64366b2ce2757843db0358cd48e4369b3d7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We have some patterns for how to document certain functions, but we
also vary the sentences a lot, and you have to look up one
documentation piece and copy it, essentially. If we ever want to
change them, we end up with shotgun surgery.
So apply DRY to the documentation and start a collection of macros to
help with repetitive C++ class documentation tasks.
The first macro is for member-swap(), and this third patch is for
documentation that used a non-standard phrasing for documenting
member-swap(). By using the macro, the documentation automatically
conforms to what the documentation team picks as the \memberswap
expansion going forward.
As a drive-by, fix doc block indentation to the Qt standard of 4
spaces (only in changed lines), and add a few blank lines where they
were missing before.
Fixes: QTBUG-129573
Pick-to: 6.7 6.5 6.2
Change-Id: If007602d7690572fcbb848a8d0235416c908cfd2
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 82058367923ce164024885854c139ee5e0d89949)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We have some patterns for how to document certain functions, but we
also vary the sentences a lot, and you have to look up one
documentation piece and copy it, essentially. If we ever want to
change them, we end up with shotgun surgery.
So apply DRY to the documentation and start a collection of macros to
help with repetitive C++ class documentation tasks.
The first macro is for member-swap(), and this second patch is for
documentation that used the simplified phrasing ("Swaps this X with \a
other."), which this patch adopts as the text for \memberswap, too,
because it doesn't repeat the macro argument, making it easier to find a
grammatically-fitting argument than in the traditional phrasing.
This doesn't change the documentation, except as follows:
* standardizes on simpified instead of traditional phrasing for docs
that already use the \memberswap macro
* adds the "very fast and never fails" blurb, if it was missing
* changes the function's argument name to `other`, as required by
the macro.
Task-number: QTBUG-129573
Pick-to: 6.7 6.5 6.2
Change-Id: I1123e783ce0da76c5997ff74007d77504ac5b334
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 5627e113793df3df24742d7af502a075c2c9e95d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
We have some patterns for how to document certain functions, but we
also vary the sentences a lot, and you have to look up one
documentation piece and copy it, essentially. If we ever want to
change them, we end up with shotgun surgery.
So apply DRY to the documentation and start a collection of macros to
help with repetitive C++ class documentation tasks.
The first macro is for member-swap(), and the first patch is for
documentation that used the traditional phrasing ("Swaps the X \a
other with this X.").
This doesn't change the documentation, except as follows:
* adds the "very fast and never fails" blurb, if it was missing
* changes the function's argument name to `other`, as required by
the macro.
Task-number: QTBUG-129573
Pick-to: 6.7 6.5 6.2
Change-Id: Ib494bd218334724b3b43796ba6f71fb52b83aa94
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 3ccb4ce781463f1b8e0cb4c9283b3067fe92a32e)
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The code in QMenu::popup relies on
QGuiApplicationPrivate::lastCursorPosition being up to date to decide
on the final position of the popup being shown. As cursor movements
outside of Qt windows do not trigger an update of that position, we have
to do a forced update of it in QWindowsSystemTrayIcon::winEvent.
Fixes: QTBUG-130832
Pick-to: 6.5
Change-Id: I45523688e21e294819337c69ad5b48eba5178446
Reviewed-by: Wladimir Leuschner <wladimir.leuschner@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
(cherry picked from commit 922369844fcb75386237bca3eef59edd5093f58d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
And use from macOS and xcb platform plugins.
Change-Id: I84a2d933551a59cf220ecb6841d8d756e58724a0
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
(cherry picked from commit 9d8744c77b03eb091061976dd084cb0ca3f6252b)
On VxWorks 24.03, the `AT_FDCWD` wasn't defined, which happened to
branch to the correct branch. VxWorsk 24.09 TP does define the
`AT_FDCWD`, which causes the preprocessor directives to branch to a
branch where moving files to trash would be supported.
In a sidenote, VxWorks doesn't define `renameat`, `O_DIRECTORY` nor
`O_NOFOLLOW`.
Task-number: QTBUG-130629
Change-Id: I2b850813aeff6f925ab91932efd7aeb13f753f69
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 039b0c6b9b94eb7601fa3b652e8b668d32251f7e)
Ensure we don't end up calling methods from a null m_imm object
inside runAction(), the code was guarded outside the call but not
inside where it can still happen.
Fixes: QTBUG-129684
Change-Id: I41d7e64a028f551bb53d177e16a77e7ae512a84e
Reviewed-by: Tinja Paavoseppä <tinja.paavoseppa@qt.io>
(cherry picked from commit 33ef9330f67dd3c6603fb222e1556c31591f1fd9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The rect of an empty widget (i.e. 0 width/height) will, after adjusting
by -1, be invalid as it will have a width/height of -1. In turn, calling
contains(p) on that rect can return true even though the rect is empty.
Fixes: QTBUG-131001
Pick-to: 6.8.1
Change-Id: I604f5942589f1c1079cae90bd0d3b104344d2c55
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
(cherry picked from commit 1731d8af741a0a6cc6cd293be4aef52103d0899b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QFileDialog::show()/exec() can be called without having any parent
at all, so the check for 'winGuard' in authorization callback
would prevent image picker from being presented. In the end
we don't need this parent and using 'presentationWindow()' instead.
Check before asking for authorization that we indeed have/no
a parent window.
Fixes: QTBUG-130973
Change-Id: Ie3ba285dfff82ac3f53245a032e133bc26763883
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 6026a5aa21d1c11a87ce76a18e497b9547213e27)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Call d->deleteExtra() in dtor of QWidget to make sure it's cleaned up
before QWidgetPrivate calls it which might access the already deleted
QWidget through deleteTLSysExtra() /
QWindowContainer::toplevelAboutToBeDestroyed(q).
Amends 006cbf658ea1f5986bbe1baafa7c146780320661.
Pick-to: 6.8.1
Task-number: QTBUG-130932
Change-Id: I9109072a457cc01abd5d1b4e844a3ed3309d942b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 482c41fb6187f3ee1df11e7936fb60f65d12995a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The current implementation of QTabWidget::clear is quite poor because it
deletes the tabs from first to last. When I was playing around, I found
out it's much faster to delete from last to first (with a lot of tabs it
goes from two seconds to 200 milliseconds in my testing). I assume this
has to do with the redrawing of all remaining tabs for each removeTab
call, while this is not necessary when removing in the reverse order.
Also, disable the stack widget's layout while we remove all tabs to
avoid unnecessary event posting, and disable updates of the stacked
widget as well as the tab bar.
Change-Id: I04972de05ab71f98da7f74412aaadc69a36efc32
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 8717c1752f9b72ac7c028b722f0a068e84e64eca)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The assert assumes that we are calculating the transformed bounds
of a glyph with exactly the same parameters as the image of the
glyph is later transformed.
However, when calculating the new bounding box of the glyph in
alphaMapBoundingBox, we do:
t.mapRect(QRectF(gx, gy, gw, gh))
And then round the width and height up.
When we transform the image of the glyph, we do:
t.mapRect(QRectF(0, 0, gw, gh)).toAlignedRect()
Note the origin is at origo and we align the rect. This can lead
to the actual transformed image sometimes being larger than what
is returned from alphaMapBoundingBox().
We could change alphaMapBoundingBox() to match the behavior of
the image transform, but it has a risk of missing some corner cases,
especially given that the same code paths are used for scalable
bitmap fonts.
In the end, just removing the assert is safe, since there is a
qMin() protecting against buffer overruns later, and there does
not seem to be any visual difference from actually calculating
the correct bounds.
[ChangeLog][Freetype] Fixed possible assert when transforming
bitmap fonts.
Pick-to: 6.5
Fixes: QTBUG-130930
Change-Id: I0406e6f45e0d436a5248dd986703bb3a9288b9f4
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit fd75a66f3f65f6c8e8bfb933260676b5c18f2df1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
6ba003f732 fixed transforming
bitmap fonts for the case where 8 bit antialiasing is used.
This is the case when a transform is set on the painter by
the user, but for some reason it is not when high-dpi is
enabled, triggering QTBUG-111796.
An attempt was made at fixing this by drawing the
untransformed glyphs into the cache and then transforming
them as they were put on the screen. This worked with
Qt Quick, but the raster engine does not support this and
instead falls back to QPainterPath rendering in that case.
So b492582b9c caused a
regression and was reverted.
A simpler fix which works for both Qt Quick and QPainter
is to draw the pre-transformed image of the glyph into
the cache for 24-bit AA, same as for 8-bit AA.
In addition, this changes the transformation to nearest
neighbor instead of interpolating, because bitmap fonts
are typically intended to look crisp and it also matches
how native rendered fonts are scaled in Qt Quick.
Fixes: QTBUG-111796
Change-Id: I2d9fd9d98d32820e677916c3d1c744331a72175b
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit b6247ced7e83af4d51ba20be8068f28cc8c006bc)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
With MinGW, GCC and Clang `[=, this]` is acceptable in C++20 mode, but
MSVC on the CI still builds with C++17. So use `[&]`, the other two
variables used inside the lambda are (const) built-in types, taking by
reference is the same as taking by copy.
Amends a90d99d8da9b2be2e6b8e981cd9dabfb1641e985.
Change-Id: Ib1c746ccf1c02b2ee3891eca5bddd7e47f559dc5
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit bac7f20acd37911813bd774afea55823b8320aa2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This will allow running the finalizer properly for Android tests in a
qtbase built with in-tree tests.
This is similar to what we do with the
_qt_internal_add_qml_deploy_info_finalizer for the Qml module.
Task-number: QTBUG-93625
Task-number: QTBUG-112212
Change-Id: I233ce229054b5ce15783cf06b9a69aaa68eb8847
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit a72dacce214e394da33529f2501e14c21b13c763)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
QWinRegistryKey::stringValue is more readable than
key::value<QString>().value_or(QString()).
This patch also adds developer documentation for the function.
Change-Id: I6a760db77a50ca9fa810196e14af14068df8aee3
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 16ca13e148445b5a18ea768c096dfedfbacce3c4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QWinRegistryKey::value<T> returns an optional<T> which can make code a
bit more readable than the std::pair<DWORD, bool> return value from
QWinRegistryKey::dwordValue.
This implements part of the "TODO: Remove once all usages are migrated
to new interface." comment in QWinRegistry class because it allows us to
remove the QWinRegistryKey::dwordValue function.
Change-Id: If568de4e31778e91ce7aadadb4aac90e41222826
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 7a63a25ef71fbbe7b3eaa6ecb9a26c3e497e582a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Android allows to explicitly chose the 24h format even when the selected
locale would not usually use that.
Change-Id: I6181d343a12d8d264c369341ef753d872f573121
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit e1f83e0ffbbd079b41e5a903e35d6cd6a62e6f99)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Remove an outdated paragraph which mentions some 'important inherited
functions' - the list is outdated and therefore wrong, and no other class
has such a paragraph.
Fixes: QTBUG-130916
Change-Id: Ia1d98da35564d542ca2758070cc1d5b5525b6faf
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 423496dcfbcd3a779653a4186a3b49ef8b5d2d7f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The size calculation for CT_SpinBox was out-of-sync with the rects
calculated in subControlRect() for SC_SpinBoxUp/Down.
Fixes: QTBUG-115451
Change-Id: I140346fa1980e0cf95e0a07499f43467b721f01e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 60c665d0b320324affa76702b5e5de3d37117809)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Don't load the pixmap used for PE_FrameGroupBox on every call to
drawPrimitive(PE_FrameGroupBox, ...) but store it in the QPixmapCache.
Change-Id: I5be6ce8a18cfc17c72dd5217efd5f446ba10ea64
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 12e8a7173569d03a98fcd47c593a09e55a96801d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The implementation checks the state and returns without storing the
exception when its canceled or finished.
Add tests for both situations.
Done-with: Ivan Solovev <ivan.solovev@qt.io> (analysis and phrasing)
Pick-to: 6.5 6.2
Fixes: QTBUG-128405
Change-Id: I4610a022ea12e1bc9ce24cb17b972b5b9e051f0a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 6efec3850da188d3bba075185aa6e5c264c815eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QCocoaDrag stores the last NSView that received an input event, which
becomes a dangling pointer when the NSView gets destroyed. Inform the
QCocoaDrag when NSView's destructor runs, so that it can reset the
pointer (and reset the NSEvent pointer as well) when the destroyed
NSView is the stored one.
With this change alone we'd end up triggering the Q_ASSERT later on in
QCocoaDrag::drag, as m_lastEvent is now nil so the NSWindow will be nil
as well. QCocoaDrag::drag cannot do anything useful if m_lastEvent is
nil, so exit early.
Pick-to: 6.5
Fixes: QTBUG-116554
Change-Id: I5949d728d05adcf3d4a32c91f7e181393bef0422
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 720ce9b97b767fdf36eaf78107b23bd017e191f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
CMake 3.31 introduced CMP0177 that warns if an install destination is a
not-normalized path. Fix this by normalizing the offending paths before
using them.
Change-Id: I1586bf192a4fd26108aa0448431f19e69df8aacd
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 14fc7f0852903109fed8357e2df9edc851f31b65)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The QComboBox dropdown doesnt render when its added to a
QGraphicsProxyWidget and any QGraphicsEffect is added to it.
Fixes: QTBUG-128916
Fixes: QTBUG-128329
Change-Id: I7f9b7ceea9afa819fcd4785250859ea7b7c85f69
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 5fc968ade3120fe7f9d0d01988254fd1fb855262)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The usage in manifest was accidentally removed in
963a31c0f4. To avoid this warning
more explicitly we add "tools:ignore" to the XML files. This
is a false positive because we use it in
src/android/jar/src/org/qtproject/qt/android/QtActivityBase.java.
Pick-to: 6.5
Change-Id: I2fe1d0930b81b3c33e7b6b1ad6f6e152dc3e0740
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 709eb77ff0f32792beb18d3edea9e0aa4436f481)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Re-shuffle the way logcat is handled, so now fetch the logcat by
default after the test run, then manually filter out the test pid
logs. Then try to look in the logs for potential ANR cases, if
found, add also logs belonging to the system_service pid which are
responsible for printing ANR details and usually the reason for the
ANR as well. At last, look for logcat crash marker that ndk-stack uses
and pass only that portion of the logs to ndk-stack command.
Fixes: QTBUG-130818
Change-Id: I162d9d884a977e8f66a3253e33eebad4453c95cb
Reviewed-by: Petri Virkkunen <petri.virkkunen@qt.io>
(cherry picked from commit 5c68af9e1481f56fae962e865a9600dc64c465b1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Remove string "unsupported_android_version" from string.xml. The
resource `R.string.unsupported_android_version` appears to be unused.
The usage was removed in b8e404f6d0631e04d30a864dc68b0574bfca90f1.
Pick-to: 6.5
Change-Id: Ifc936c070dabe4bc31d45bbb6b261890d5c2e536
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 0534a566a7d79a674931aefa6cc96a8e9343a1b3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Instead of removing group separators after conversion, we can omit them
using QLocale. The decimal point and group separators can be the
same character, if the user configures the system locale accordingly.
Add a test that compares the text shown by the spinbox with what the
locale would do. Since the C locale sets the OmitGroupSeperator number
option by default, cover several cases to verify that we explicitly
set the correct number options based on the QDoubleSpinBox property,
and implement a customized system locale that returns the same
character for group separator and decimal point.
Fixes: QTBUG-77939
Change-Id: I257ea44ed988c70cb4fc0cfc81c3b366c0a431eb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 34b5e43e6259c6362c642a244ceb26d482f35b82)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The drawing of QRadioButton in QWindows11Style was performed with
overdrawing, leading to problems with the transparent background color
for QGraphicsWidgets. This patch draws the ring of the RadioButton using
QPainterPath, to avoid overdrawing.
Fixes: QTBUG-130828
Change-Id: I4b278f7f720b55e11c550977b666410d85b65382
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 57361de3a9814808bb575f8d01c1b12cbed9dbe9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The AT-SPI2 XML spec for all signals/events [1] that Qt emits
specifies the DBus arguments signature as "siiva{sv}".
Qt however was incorrectly sending arguments with an "siiv(so)"
signature instead, by sending the QSpiObjectReference as last
argument.
Fix this by sending the events with the proper signature, using an
empty QMap<QString, QVariant> for the properties (that translates
to an "a{sv}" type for DBus).
[1] 33b45aea12/xml/Event.xml
Fixes: QTBUG-130843
Change-Id: If023763626be3d17b091466b17829d62d29fdede
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit fdf87fdce1c8b926b1c1ee9254aa4b0fc1840d82)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This code predated the existence of the currentThreadId() and
isCurrentThread() functions. Our implementations are slightly faster.
Change-Id: Id2b20a7f06e0c2a1bc35fffd4fb4dcf3f20769cd
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
(cherry picked from commit 8a8e91a7c141994c331d2b9da7d9c5e2129c70b9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This is a corner-case scenario but valid because we tell users they can
destroy the QThread object right after finished() has been emitted. But
emitting finished() does not mean the launched thread has actually
exited: it may still be in Finishing state for an arbitrarily long time.
Completely aside from what else may run from other libraries, we only
destroy QThreadStorage and the thread's event dispatcher after
finished() has been emitted.
This commit avoids the unnecessary mutex unlocking in the destructor,
then QThread::wait() locking again, only to unlock yet again so that it
can perform the necessary low-level wait calls. The same for the return
path: wait() locked again to check the state, then unlocked, only for
the destructor to lock again. Now, QThreadPrivate::wait() is responsible
for returning with a locked mutex.
Change-Id: I87adffb89f275accea18fffd6b4293861ea7cf39
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit 6bd271cf74d6d57816531f688c82c51d29f1be91)
Reviewed-by: Ahmad Samir <a.samirh78@gmail.com>
Commit 1ed0dd88a3 moved the finish()
functionality from immediately after run() returns to the time of
thread-local destruction, to make sure that user destructors didn't run
after our cleaning up. But as a side effect, it made other user code run
too late, after some thread-local statics had been destroyed.
This is a common practice, which causes the destructor for worker to run
too late:
worker->moveToThread(thread);
...
QObject::connect(thread, &QThread::finished, thread, &QObject::deleteLater);
QObject::connect(thread, &QThread::finished, worker, &QObject::deleteLater);
This commit splits the cleanup in two phases: QThreadPrivate::finish(),
which runs immediately after run() and will call back out to user code
(finished() signal and delivery of deleteLater()), and cleanup() that
cleans up the QThread{Private,Data} state and destroys the event
dispatcher. That destruction is the only call out to user code.
I've removed the complex mix of pre-C++11 pthread_setspecific() content
and C++11 thread_local variables in favor of using one or the other, not
both. We prefer the thread-local for future-proofing and simplicity, on
platforms where we can verify this C++11 feature works, and because it
allows us to clean up QThreadData and the event dispatcher as late as
possible. (There's some code that runs even later, such as pthread TLS
destructors, used by Glib's GMainLoop)
Unfortunately, we can't use it everywhere. The commit above had already
noticed QNX has a problem and recent bug reports have shown other
platforms (Solaris, MUSL libc) that, 13 years after the ratification of
the standard, still have broken support, so we use pthread for them and
we call cleanup() from within finish() (that is, no late cleaning-up,
retaining the status quo from Qt 4 and 5). See QTBUG-129846 for an
analysis.
Drive-by moving the resetting of thread priority to after finished() is
emitted.
[ChangeLog][QtCore][QThread] Restored the Qt 6.7 timing of when the
finished() signal is emitted relative to the destruction of thread_local
variables. Qt 6.8.0 contained a change that moved this signal to a later
time on most Unix systems, which has caused problems with the order in
which those variables were accessed. The destruction of the event
dispatcher is kept at this late stage, wherever possible.
Fixes: QTBUG-129927
Fixes: QTBUG-129846
Fixes: QTBUG-130341
Task-number: QTBUG-117996
Change-Id: Ie5e40dd18faa05d8f777fffdf7dc30fc4fe0c7e9
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 4fabde349f16b59f37568da2a4c050c6dd53a34e)
As pointed out in the qcocoadrag.h header, we need QCocoaDrag to record
the original event and view when handling an event in QNSView. For that,
NSView's handleMouseEvent implementation called setLastMouseEvent.
This was not done for tablet or touch events, although both of those
event types might initiate and participate in drag'n'drop operation. Do
that consistently now, and rename the setter accordingly to
setLastInputEvent.
Task-number: QTBUG-116554
Pick-to: 6.5
Change-Id: I9646adbec3a2301ebca123f0f25328db63c782a8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 0a40266788021aaa2f501aeef6db2e222669c6e9)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Windows that have only set the WS_POPUP style do not take the WORKAREA
into account and maximize to fullscreen geometry. This patch maximizes a
WS_POPUP window to the size of the current working area, which can be
smaller than the screen geometry.
Fixes: QTBUG-129791
Fixes: QTBUG-130865
Pick-to: 6.5
Change-Id: I4c5beb0cd69c7ea4c585785a579a9d66bab12cc6
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
(cherry picked from commit 90be6609bdfc14df6aec52cbbba6adb4a610301e)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Those files are read by reuse to complement or override the copyright
and licensing information found in file.
The use of REUSE.toml files was introduced in REUSE version 3.1.0a1.
This reuse version is compatible with reuse specification
version 3.2 [1].
With this commit's files,
* The SPDX document generated by reuse spdx conforms to SPDX 2.3,
* The reuse lint command reports that the Qt project is reuse compliant.
[1]: https://reuse.software/spec-3.2/
Task-number: QTBUG-124453
Task-number: QTBUG-125211
Change-Id: I01023e862607777a5e710669ccd28bbf56091097
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 4c83657448f66ac0ee46900aff2e5a230eda49b0)
When calendarPopup is enabled, a QComboBox instead a QSpinBox is drawn
but the size hint for QSpinBox was used which resulted in a too small
width for the widget (depending on the underlying style). Therefore use
the size hint for CT_ComboBox in this case as it was already done for
mac.
Fixes: QTBUG-11967
Change-Id: I817bdc99ae5d1189b9f0451a857022abe64b3bf8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 0a1c1711453697a88eee7fdb6f4cf082bfd433e2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
On log-in this may be disabled and only enabled later; that prevents
clients like plasmashell to enable a11y features.
We need to watch changes to the org.a11y.Status properties and enable
the a11y integration on-demand.
As the in-line comment said, qdbusxml2cpp does not generate NOTIFY
signals for DBus properties, so use the raw PropertiesChanged signal
to receive those notifications.
Downstream bugs:
- https://bugs.kde.org/show_bug.cgi?id=495096
- https://bugs.kde.org/show_bug.cgi?id=495098
Pick-to: 6.7
Pick-to: 6.7
Change-Id: I4d0adf61af875464d3cd47759631d2a3aac664f0
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
(cherry picked from commit 38251c36edf11316a2467169b1d491bf13520fd3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It is, because it only compares a pointer and a string, both of which
are nothrow_equality_comparable.
Also remove the unused (even in C++17 mode) inequality operator
instead of marking it noexcept, too.
Pick-to: 6.5 6.2
Change-Id: I0ce62df02ffc98252d17cef659cc6dc2a90ae2cf
Reviewed-by: Rym Bouabid <rym.bouabid@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit 3fce04157dbba1232d96821dbb166c6a5dc467a8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
After 3ca615d9735f7ddb8e2ae5c13e5effd419a56300, the style sheet style
will not draw rows unless the item has a border. Otherwise, it will
assume that the item drawing later on will fill the background anyway.
We also never painted the background for empty rows.
However, if the item's background is semi-transparent, then the row
needs to be drawn first, so that the correct background shows through.
And for empty rows, we need to draw just the background. This is
especially important for trees with alternate background colors.
Add baseline test case for this particular combination. This will result
in a minor change to the results of the existing
transparentBackgroundNoBorderForBranchIndicator test case, where now the
background is drawn behind the indicator area when the item's background
is semi-transparent. I don't think this is a bug though.
Fixes: QTBUG-123632
Change-Id: I2cd4efb748aaefc03a3b576458b750ee47479e97
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
(cherry picked from commit b780eaf6a063a7efe03417cf6b7008a188e222a4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Remove some unused variables in CE_TabBarTabShape - they are not used
since the initial Qt4 import.
Change-Id: I2ec4ee8ac9bfdde9d40587c50eb6d57bf38419ac
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 4c0b45553862d3eff35906d02ea5e2afd9252bbd)
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
If a popup (such as a context menu or combobox) is open, and the user
presses any mouse button outside the popup, Windows users expect the
mouse event to be sent to whatever is under the mouse, while the popup
closes. (So the popup must close on press, not on release.)
QPlatformIntegration::ReplayMousePressOutsidePopup requests this
platform-specific behavior in general, and the WA_NoMouseReplay
attribute can disable it on specific widgets.
e4ef0f03e6 removed this feature which was
added to Qt 5 in 1f456b4cbb, based on
doubt that we really needed it: and if we did, maybe we would need it in
QtGui. But so far it seems the main excuse for doing it this way is that
popups are sometimes opened with exec(). If the nested event loop
handles the mouse press completely, and the QPA event is discarded, the
outer loop has no chance of seeing it after exec() finishes.
In Qt Quick, we don't use exec(); so let's assume that this continues to
be needed only for widgets.
At least we don't use extern sharing of a global bool in this version.
Fixes: QTBUG-130138
Change-Id: I95b5d24ee9bc8608655ed5c585d1d91a891fbad3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
(cherry picked from commit 601924cce57ee564ec149a170f1987b13924e0ee)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Negligent omission, since empty() is constexpr, and so is everything
else in the QSpan API.
Amends 03e78e5d62.
[ChangeLog][QtCore][QSpan] Fixed isEmpty() to be constexpr (empty()
already was).
Change-Id: If1e1e72422d68b0c35c37354067098332e6e4e10
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
(cherry picked from commit 0576c2b7266003d8f17e9af896de15cf7184b858)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Replace usage of QPointerDevice::setType to constructor.
Fixes: QTBUG-129981
Change-Id: I757ec3cde7815363539b8cfe3fd7ae46993ce33e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit cc24213bdb286b200ad1c637ed244c48a2a32495)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This fix addresses a customer suggestion to clarify the QThread()
documentation. It now states that started() is emitted by the newly
started thread, so any slots connected to it will occur by queued
invocation. For clarity purposes, an additional sentence has been
added to state that whilst the event may have been posted before
run() is called, cross-thread delivery of the signal may still
be pending. A link to 'Signals and Slots Across Threads' has also
been added.
Fixes: QTBUG-112221
Pick-to: 6.7 6.5
Change-Id: Id502eb4bf48b745af4d9906d7cd05de73d2b6418
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
(cherry picked from commit 371872af23c1c9f9b3b56dd191fb13f850615dd4)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
In 438837ce27 commit, we stopped to copy
all dependent libs that are kept in plugin directory. This change sounds
reasonable, as we do not want to deploy unused libs.
Due to the mentioned change, when dependencies.xml contains *.so
libraries, they are not copied at all now. They are added to localLibs
(later pasted into libs.xml), but are not shipped with the apk.
So at the end we have dependencies in libs.xml on some libraries that
were not delievered.
This commit cleans up the localLibs to not add dependencies to the
libs.xml file as they will not be satisfied
Fixes: QTBUG-129946
Change-Id: I7157e2e65cb928adbe9d7c077e50b2ebcac94490
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
(cherry picked from commit 7499fd0229d63f969bf6ca58d3b764b96395bed2)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Sync the rect used for painting a CE_ComboBoxLabel text with QLineEdit
which is used for an editable QComboBox.
Task-number: QTBUG-130824
Change-Id: I9f3a31d68c6abed7e9cba4235847df3fa0d51ad1
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit dc1ae86bad0b4eaa83909f663777c09fb2f2376b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This reverts commit b492582b9c.
The fix made Qt Quick applications work correctly, but it caused
all text in bitmap fonts to disappear on Qt Widgets. This needs
a deeper investigation, and until a proper fix is found we will
revert.
Transformed layouts with bitmap fonts will still look incorrect,
but they will at least have text.
Fixes: QTBUG-130586
Change-Id: I7429ddd183527f2ed5d1c00009a0c3df0e3246c8
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
(cherry picked from commit 2f9b02acd4cbca5d8c0d7504df4c9e7bcbbb03ba)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The size hint for QComboBox relied on the vista style but the painting
was completely different. Therefore swith to the base windows style and
add the extra margins used in the windows11 style.
Fixes: QTBUG-130824
Task-number: QTBUG-11967
Change-Id: Ic533140793cdd4e640c49f6d73e9bb73bcbb83da
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit b6ca35f65372cc8519a418d6a5291cafd809f7c8)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Simplify converting a QUuid to a rfc4122 representation by using the
built-in toRfc4122() function and don't allocate a temporary QByteArray
when converting it back from rfc4122 to a QUuid.
As a drive-by make sure to not detach when converting a QByteArray to a
blob.
Change-Id: Ib8fc7744952377d14ef39c0d901a6a8419eb018d
Reviewed-by: Fredrik Ålund <fredrik.alund@mimer.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
(cherry picked from commit 814e4e1cbe6e4a625625942c70b394aa6455fb19)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If the size or DPR of the window we're drawing to with QOpenGLContext
changes we need to call [NSOpenGLContext update] to recreate the backing
texture.
We were doing this in QCocoaGLContext::makeCurrent(), based on the
assumption that clients would always call makeCurrent() before drawing,
which is a documented requirement of QOpenGLContext:
"To be able to support certain platforms, QOpenGLContext requires
that you call makeCurrent() again before starting rendering a new
frame, after calling swapBuffers()."
However RHI doesn't follow this rule, and skips makeCurrent() from
QRhiGles2::ensureContext() if the context is already current.
This was causing issues when moving a window between screens with
different device-pixel-ratios, as we were correctly rendering to
the window with the updated DPR, but we had not resized the target
texture to match.
Changing QRhiGles2::ensureContext() might be an option, but nowadays
we have QPlatformOpenGLContext::beginFrame(), which is guaranteed
to be called (by RHI, not by generic QOpenGLContext clients).
To cater for RHI we now call [NSOpenGLContext update] also from
the beginFrame callback.
Fixes: QTBUG-114873
Pick-to: 6.5
Change-Id: I9461135109fb1473ef9965f72f52beeb41b03680
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit 48c176e1b891428af504087b117a72bcaa806930)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
If the window that the sheet (as created for a modal dialog) lives in
has already been destroyed by the time the sheet is hidden, then we used
to trip an assertion. Instead, always use the sheetParent, which is
still alive.
Add a test case that asserts without the fix.
Fixes: QTBUG-128302
Change-Id: I4c399b73e2552bab79358c5505f403efa8e4f80b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 332f49f2d8c5675bab8bde6acfb377d567961d4a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Create a script that allows running an app or a test easily similar
to running on host. This improves development workflow and time by
allowing quick runs without having to manually call the various adb
commands to launch, get a pid of the app and then print the logcat,
let alone passing parameters or environment variables.
For normal apps, the app package name is retrieved by the script, run
and live logcat is printed as long as the app is still running.
For tests, the script calls androidtestrunner, allowing test parameters
to be passed to the test.
For CI debugging, this would save quite a lot of hussle and frustration
trying to run or debug a test app.
One other benefit for this is enabling running Android tests from Qt
Creator's testlib plugin without big changes to Qt Creator to support
androidtestrunner explicitly.
Because file(GENERATE) would fail if called twice for the same file,
I use file(WRITE). This is used because at the time of calling the
target executable finalizer, we don't know if the target is a test
or not, so we rely on writing the script first as a normal target,
then call it if the target is a test where it overrides the script.
For this also, parameters passed to the runner or androidtestrunner
can't handle generator expressions.
[ChangeLog][CMake][Android] Add wrapper scripts to run Android apps and
tests with ease from the host.
Task-number: QTBUG-129889
Change-Id: I84e85ce2bbf6944c8aa20bdc2c2b6d7b956bc748
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit a905d26f14da1cf86b8490331c0cc41c2a45b283)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Add doc_tools and install_doc_tools custom targets.
These are meant to build and install documentation and code generation
tools that participate in documentation generation.
Such tools should be annotated with the IS_DOC_TOOL option to their
qt_internal_add_tool call.
In qtbase, such generator tools are qdbusxml2cpp and qvkgen.
Task-number: QTBUG-91243
Task-number: QTBUG-128730
Change-Id: Idebffc6f50d8547ce76c1102a20d60d436e44cfd
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 3066e9e38deada5f99a47449e4ef84eebc5219f5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
QScrollbar is a widget and not a window, therefore there is no need to
set the FramelessWindowHint
Fixes: QTBUG-128518
Pick-to: 6.7
Change-Id: I687c708cd4f59c6f09d0ad3c2d3ddcf62c33b11a
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
(cherry picked from commit 7b146e530adc913a1ed49b4d2ba17de787089261)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Changed the number, which caused the problem of showing the snippet.
Two of the same numbers were given to the different snippets.
Fixes: QTBUG-130565
Change-Id: Iba738a1bdaf5821df48bf5e222bee911c5ddf1fc
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
(cherry picked from commit b3e5b134eeaae85025879cd0309664ce0ba1f6de)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
When applying an "obliquen" transformation with Freetype, this
applies a 12 degree horizontal shear on the control points of the
glyph you have loaded.
However, any other transformation we set on the glyph will be
applied when loading it. So if you have e.g. a rotation on
the glyph as well, then this will be applied first and the
rotated glyph would be obliquened instead, now along the wrong
arbitrary axis in the rotated coordinate system.
To fix this, we detect the case where a transform is applied and
multiply in the obliquen in advance. It means we have to duplicate
some code from FT_GlyphSlot_Oblique() which might get out of
sync (if the slant angle changes in a newer version for instance).
We limit this to the cases that are currently broken so that we
avoid messing with any working use cases.
[ChangeLog][Text] Fixed an issue where artificially obliquened
text would look incorrect when other transformations were also
applied and the Freetype backend was in use.
Pick-to: 6.5
Fixes: QTBUG-97436
Change-Id: I61c5d007e9ea9be2beb283a8b8abbed7723bab38
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit db8230715aa115dc2da5177bb1824fb40c5f2569)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
The patch that introduced the deprecation lost '!' at the beginning of
the comment block. As a result, the documentation for the deprecated
method was not generated at all.
Amends cbc6ee0eb9.
Change-Id: Ief2f4aae7e21363224fa44ef42847aa132ea769a
Reviewed-by: Jaishree Vyas <jaishree.vyas@qt.io>
(cherry picked from commit 4ce7235fdd6183478eebfcf2f1d6058a172b285a)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
It was duplicated across a few public API.
Splitting it will also allow it to be be reused in a future change
in another function.
Also add the ability to use the poor man finalizer approach for
CMake 3.16, but only via an opt-in that will be set by the qt build
process, so that the finalizers can be used for tests in a future
change.
Task-number: QTBUG-93625
Task-number: QTBUG-112212
Change-Id: I097faf5e3db98457acfdfb3ae2011efb6640f35e
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
(cherry picked from commit 2bbc0bda30e0c34ea63f0b6836c34c765a06e049)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>