This example is useful but not a typical starting point for an
application.
Task-number: QTBUG-110647
Pick-to: 6.5
Change-Id: Ic4af8ed648c587b91110a7403fa80c619549289d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This example is removed because what it does is already covered by the
other XML examples.
Task-number: QTBUG-110647
Pick-to: 6.5
Change-Id: If33e3fc55dcd9c7c10cfdfa86405f8bcf5cb6187
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
It is essentially the same as the other mainwindow examples, showing
how to create a text editor. The only special code here is the tiling of
the different main windows, which - without any documentation or
explanation - is neither very helpful, nor relevant in 2023.
Pick-to: 6.5
Change-Id: I48b92b1cf057f586e0d2842d1c0a3312154e9a13
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
This let's us get rid of an out-parameter.
Task-number: QTBUG-108873
Pick-to: 6.5
Change-Id: Ifc08d3905932f28ecdfdf3a7de1499700cc7e606
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
showHelp was already in use, but not showVersion.
Return 0 in both cases, even if it's unreachable.
Task-number: QTBUG-108873
Pick-to: 6.5
Change-Id: Iba820e89d7de066130163e7829f75bbfcfa3f7dd
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
By using .compare(~~~, Qt::CaseInsensitive) instead of .toLower()
Task-number: QTBUG-108873
Pick-to: 6.5
Change-Id: I60e1fdc0a54450e7385e90f84fd509e62b82d2c9
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Their use of QtNetwork is already covered by the HTTP example.
While showcasing that QNAM easily deals with multiple simultaneous
requests, waiting until finished() is emitted to write anything is not
exactly idiomatic.
And managing your own queue to only have one request running at a time
is a weird example for an asynchronous framework.
In this regard, having an example for a complete download manager
(with a GUI) would be interesting, but may ultimately be very
time-consuming to make for limited gain.
Task-number: QTBUG-110643
Pick-to: 6.5
Change-Id: I6b2c1546b85fa89ab7ce1ff5565b0293b5710b74
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
This is to fix the warning
qregion.cpp:3582:12: error: ‘ET.EdgeTable::ymax’ may be used uninitialized [-Werror=maybe-uninitialized]
Because the previous code in PolygonRegion() was:
Q_ASSUME(Count > 1);
But Q_ASSUME is becoming a no-op with GCC 12, so when this disappears,
compiler rightly considered Count < 2 as a valid input. Therefore, when
CreateETandAET() was called and had
if (count < 2)
return;
The compiler again rightly concluded that it was a valid condition
(after all, you're checking it!), leading to ET.ymax being used
uninitialized.
Since that Q_ASSUME really meant the condition of Count < 2 was not
permitted, we may as well upgrade to Q_ASSERT in both places.
Change-Id: I7f354474adce419ca6c2fffd1748119ef0092fa4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Make them templates, for two reasons:
- so they can accept std::pmr types and, in general, any basic_string
with custom allocators and char_traits
- to break overload ambiguities with the Qt string view types
Also, add the missing C++20 char8_t overloads.
Also, avoid creation of a QString in the sizeof(wchar_t) == 2 case
(Windows). Add a comment to optimize for the sizeof(wchar_t) != 2 case
later.
Found in API review.
Pick-to: 6.5
Change-Id: I30139520f582a38863a0936f8eca4b1ed33e37c8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
template <typename T> qReturnArg(T&&) is an unconstrained perfect
forwarder, and will "win" for everything for which `T&` is not an
equal match. e.g. a volatile T.
Restrict the deleted overload to actual rvalues. We don't need to use
`const volatile T&&`, because rvalues never bind to `T&`, we just need
to get off using a universal reference, and adding const does that.
As a drive-by, change the deleted overload's return type to void, to
mimic std::as_const(), the prototype for rvalue-deleted function
overloads.
Pick-to: 6.5
Change-Id: If4fbc311677b993488859b2c4e226b94daed71fe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Found in API review.
As per "chrono first" initiative[1], implement the int overload via the
chrono one, not vice versa
[1] https://lists.qt-project.org/pipermail/development/2023-January/043563.html
Pick-to: 6.5
Change-Id: I65fe7039ad8ae5f9eb21d9c59a46b9c5c152fac3
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
QGlyphSet is Q_DISABLE_COPY()'d.
Marking it also as Q_RELOCATABLE_TYPE incorrectly allows Qt containers
to use realloc() or memcpy() to relocate a type that was explicitly
designed not to be copied (or moved).
Amends 2c47d53249.
Pick-to: 6.5
Change-Id: I053f6bb25d4d6e2359f43f0dbf9c19667dfff170
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
It's been a while since we had a single Tutorial for all of Qt.
Pick-to: 6.5
Change-Id: I7317291c445c09b0bf728513670b6a575dd536bc
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The wiggly example is gone, but tetrix shows how to use QBasicTimer
as well.
Pick-to: 6.5
Change-Id: Iaad78b0d7e2136ef41d98f634d0680e6f7f3c4e1
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The 'sdi' example is a candidate for removal, so point at the
spreadsheet example instead, which is not.
Pick-to: 6.5
Change-Id: I4405f2421db8be79898a38ca4f3fa1ea5fe0280b
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The \brief of a class documentation needs to end with a full stop.
Change-Id: Ia609d7bc6695e785207c0bf4e570a5edeaeaf460
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: <safiyyah.moosa@qt.io>
otherwise there is no way to synthesize a "click" through the a11y API.
toggleAction only leads to a toggled() signal but the user may be more
discerning and only listen to clicked() (or QAction::triggered) to react
to **user** events not all toggle events. as such pressAction is always
superior to toggleAction when user input is meant to be synthesized
through a11y tooling.
Change-Id: I7f024d57087b545d3cfd1805026ea538b0b3e166
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
From the review, timespecS are trivial and small, so they get passed in
registers anyway.
Change-Id: Iedf1f17af1fd58643a0c103230b1fea3c2fe1e49
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Having the Prealloc > 0 assertion only in the QVLA(qsizetype) ctor
makes no sense. Prealloc > 0 is mandated by the class as a whole, not
that particular ctor, so we shouldn't delay the assertion to the
instantiation of this ctor.
Move it to class scope instead, alongside the assertion for
nothrow-destructible.
Pick-to: 6.5
Change-Id: I0225a4533841e5b433a3d9781b2642c084f775ab
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Use a template alias instead of C++98-style inheritance.
Saves one template instantiation.
Pick-to: 6.5
Change-Id: I95ee9cf1e5eac1db5fc8e05cd95f5e745134214d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Found in API review. It's not BC-critical, but let's get this into 6.5
to minimize the diff to our future LTS.
Pick-to: 6.5
Change-Id: Iaa63afad1d31f6edef29e1185897d925f47a094d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Partially revert e1440dd7bc for Android
versions below 11 which could take advantage of the manifest
flag android:requestLegacyExternalStorage. And for other newer versions
avoid returning them while adding a note to the docs about this
behavior.
Pick-to: 6.5 6.4 6.2 5.15
Fixes: QTBUG-108013
Fixes: QTBUG-104892
Task-number: QTBUG-81860
Change-Id: I10851c20e2831bddaa329164c941e2ae71f0a497
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Remove the claim from the QKeySequence documentation, fixing the
respective qdoc warning.
Amends f10ae4b887.
Pick-to: 6.5
Change-Id: If234cfb0a6b7dc20fb10e623cc3ee2ec167f22c9
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
C++20 doesn't like arithmetic with enums anymore. While this hasn't
caused immediate pain, yet, fix it pro-actively for an imminent patch.
As a drive-by, fix the missing space at start of comment.
Pick-to: 6.5 6.4 6.4.3 6.2
Change-Id: Id08bb227c587bc7b900c593a7b6d2655ca32eefd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Also add one for types that are neither copy- nor move-constructible.
In contrast to resize(n), the QVLA(n) ctor worked for such types, so
make sure it stays that way.
Pick-to: 6.5 6.4 6.4.3 6.2 5.15
Change-Id: If54fbc9dd6a4808175c4bcb0ffb492b33c879746
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The Find Files example is gone.
Pick-to: 6.5
Change-Id: I63bc33c3b9db7c8bfcf07fbcee0182a492c01dbd
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
This is equivalent to the corresponding relation types defined
in the IAccessible2 spec [1] (IA2_RELATION_DESCRIPTION_FOR,
IA2_RELATION_DESCRIBED_BY, IA2_RELATION_FLOWS_FROM,
IA2_RELATION_FLOWS_TO) and for AT-SPI on Linux [2]
(relation types ATSPI_RELATION_DESCRIPTION_FOR,
ATSPI_RELATION_DESCRIBED_BY, ATSPI_RELATION_FLOWS_FROM,
ATSPI_RELATION_FLOWS_TO).
User Interface Automation (UIA) on Windows also has corresponding
properties for 3 of them [3]: UIA_DescribedByPropertyId,
UIA_FlowsFromPropertyId, UIA_FlowsToPropertyId.
This commit adds the new flags and implements the mapping for
the AT-SPI case.
Note that the relation type is conceptually always "inverted"
when comparing Qt and AT-SPI (or Qt and UIA)
as clarified in afbfe30093.
"QAccessible::Description" instead of "QAccessible::DescriptionFor"
would align better with the naming scheme of the other relations, but
that is already used in the Text enum.
[1] https://accessibility.linuxfoundation.org/a11yspecs/ia2/docs/html/group__grp_relations.html
[2] https://lazka.github.io/pgi-docs/Atspi-2.0/enums.html#Atspi.RelationType
[3] https://docs.microsoft.com/en-us/windows/win32/winauto/uiauto-automation-element-propids
[ChangeLog][QtGui][QAccessible::RelationFlag] Added new relation
flags DescriptionFor, Described, FlowsFrom and FlowsTo.
Fixes: QTBUG-105864
Change-Id: If2d46099eeea75e177358c821d1ae833a553bd0e
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Use it in a few places.
[ChangeLog][QtCore][QMessageAuthenticationCode] Added
QCryptographicHash-style resultView().
Change-Id: I745d71f86f9c19c9a9aabb2021c6617775dab1cf
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Document that the operation is not supported.
Pick-to: 6.5 6.4 6.2 5.15
Task-number: QTBUG-98974
Change-Id: I1faacb7af7e11943d6da62313ed104fda063d30d
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
It's possible since Windows 10 1903 to set the active code page
to UTF-8 using the manifest. In that mode, QString::toLocal8Bit
converts to UTF-8 and the legacy programs not using UTF-8 codepage
can't interpret the value.
We can detect whether the UTF-8 code page is used, and in that case
only provide data as CF_UNICODETEXT. Windows will then synthesize the
CF_TEXT format when the clipboard data is consumed, using the right code
page for the target application.
https://learn.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page
Pick-to: 6.5 6.4 6.2
Change-Id: Ie024a618556d9bb5b5c7ac70507d279b959ff6db
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
As pointed out in review, somewhat contradictory advise.
Rewrite the section to be more active, focus on the user and
their application, and a bit more consistent.
Pick-to: 6.5
Change-Id: Idbbf29d3033d32ade553290a2e89bd778876224c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Since 6.0, these functions all return QString, to cope if the
character is outside the BMP so surrogate-encoded, and it has lately
come to light that some of them are, in any case, multi-character
tokens. Now that the code correctly handles that, update the docs to
paint a more faithful picture of what these tokens are.
Fixes: QTBUG-107801
Change-Id: I0a364432408a166fae86666f8e5de4f59622b2a3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... telling the compiler all there is to know about block.size(), so
it hopefully vectorizes the function well.
Pick-to: 6.5
Change-Id: Icb3d5c983402e52a65c72af15f806f3a3fe6411f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... by checking that for each algorithm, that the algorithm's result
size is not larger than the algorithm's block size.
Pick-to: 6.5
Change-Id: I4daf7900e72766d180954b15edb06687a57f939f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add more API to QSmallByteArray:
- const op[] overload
- copy construction and -assignment from QSmallByteArrays with smaller N
(for implicitly converting a HashResult into a HashBlock, incl. a
static assertion that it always fits
- STL-style assign()
This allows us to use HashBlock for the key, instead of a QByteArray.
To make-it-cool®, add a method that xor's all bytes in a
QSmallByteArray with a given value and returns the result. We use that
algorithm twice in the implementation, and the code simplification at
the call sites is amazing.
Pick-to: 6.5
Change-Id: I7fbc11538544b4a8d1771dc8ad025be154d446df
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Also adds a file to patches which is a required modification
to the update in order to make it compile.
Pick-to: 5.15 6.2 6.4 6.4.3 6.5
Fixes: QTBUG-111536
Change-Id: Iaabc1b7736cfd98217a8aff2b7f9bc65402d0451
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Note: 6.4.x update has to be done in a separate commit
because it did not get the update to 6.0.0, so the
cherry-pick will not apply.
Pick-to: 6.2 6.5
Task-number: QTBUG-111535
Change-Id: I9d4aae98f8267827ec983ca89b1310006c6aee78
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Both QTimer's and QObjectPrivate's destructors print a warning if the
current object lives on another thread and has an active timer:
QWARN : tst_QTimer::moveToThread() QObject::killTimer: Timers cannot be stopped from another thread
QWARN : tst_QTimer::moveToThread() QObject::~QObject: Timers cannot be stopped from another thread
This timer is used to ask the thread to quit, which in turn allows us to
destroy this QObject without a cross-thread warning. Because it's
already fired once and done its duty, we can make sure it's not active
by simply making it single-shot.
Pick-to: 6.4 6.5
Change-Id: Ieec322d73c1e40ad95c8fffd17465067b27c044b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Avoid the creation of a temporary buffer by using QVarLengthArray
instead. Normally GetRegionData() only returns one rect (~48bytes) so it
will fit into the QVLA without a memory allocation
Change-Id: I279693e17e2f9f2c1c75504c3e5c1de3d45084ec
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Avoid a memmove (and replace it with a memcpy) by not using
QString::prepend() but create a completely new string object instead.
Change-Id: Ibdb4a9c6b15b96f1743d47e158ff0fb9b2048221
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Use QDateTime::toString("ttt") which is available since Qt6.5 instead
own implementation
Pick-to: 6.5
Fixes: QTBUG-111275
Change-Id: I41676d3a327c5aaabdeb4f54b9d169e228c482e1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>