The implementation for extracting a QMetaEnum from an enumeration
type was duplicated from QMetaType::fromEnum, just use that one.
Also add an explicit cast for the valueToKeys call.
Change-Id: I51b1a214dbab2101ae704954727acf0219eb1604
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
QT_TYPESAFE_FLAGS allows explicit casts only to QFlags<T>::Int, which
is either int or unsigned int. The cast to the resp. other type fails.
To fix, first convert to QFlags<T>::Int with toInt(), and only then
cast to int or unsigned int.
Fixes: QTBUG-101399
Pick-to: 6.3
Change-Id: Ie74d53adc601cdf19708265b040092780676058f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Lowering the architecture all the way to the i386 baseline without SSE2
was causing warnings about disabling SSE FP math. We don't need to go
that low for 32-bit.
Task-number: QTBUG-101198
Change-Id: Ibf4acec0f166495998f7fffd16d682d0f5beec11
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
That option makes printf() and some other functions become always_inline
functions with extent checking. Unfortunately, that also means GCC fails
to inline them when we're not compiling for the same target as
X86_BASELINE.
Fixes: QTBUG-101198
Change-Id: Ibf4acec0f166495998f7fffd16d682c7a7be94d8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
We set the default verbosity of configure output to NOTICE in
regular Qt builds.
To preserve the STATUS verbosity in CI runs, we now pass it
explicitly when configuring all repos / tests.
Pick-to: 6.2 6.3
Change-Id: Ib63739c05855cfd5951d38ce3f8a7fc8d1218cd3
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Only show the more verbose configure output when configuring
with -developer-build (which matches --log-level=STATUS)
Otherwise in a non-developer build, restrict the output
to NOTICE+ message (includes WARNINGs and ERRORs).
Developers can still pass a custom log level when configuring.
For example -DCMAKE_MESSAGE_LOG_LEVEL=STATUS or
--log-level=STATUS.
The former method will be cached, while the latter is only applied
to the current configure invocation.
Also show the build instructions hint message only when configuring
for the first time.
[ChangeLog][CMake][configure] The configure output verbosity of
non developer-builds of Qt is now reduced by default. Pass
"-- --log-level=STATUS" to configure to make it verbose again.
Pick-to: 6.2 6.3
Change-Id: I7583a9c92142e0b1d7c5411b06403f40d8ebaf20
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Our associative containers' iterator's value_type isn't a destructurable
type (yielding key/value). This means that something like
for (auto [k, v] : map)
doesn't even compile -- one can only "directly" iterate on the
values. For quite some time we've had QKeyValueIterator to allow
key/value iteration, but then one had to resort to a "traditional" for
loop:
for (auto i = map.keyValueBegin(), e = keyValueEnd(); i!=e; ++i)
This can be easily packaged in an adaptor class, which is what this
commmit does, thereby offering a C++17-compatible way to obtain
key/value iteration over associative containers.
Something possibly peculiar is the fact that the range so obtained is
a range of pairs of references -- not a range of references to pairs.
But that's easily explained by the fact that we have no pairs to build
references to; hence,
for (auto &[k, v] : map.asKeyValueRange())
doesn't compile (lvalue reference doesn't bind to prvalue pair).
Instead, both of these compile:
for (auto [k, v] : map.asKeyValueRange())
for (auto &&[k, v] : map.asKeyValueRange())
and in *both* cases one gets references to the keys/values in the map.
If the map is non-const, the reference to the value is mutable.
Last but not least, implement pinning for rvalue containers.
[ChangeLog][QtCore][QMap] Added asKeyValueRange().
[ChangeLog][QtCore][QMultiMap] Added asKeyValueRange().
[ChangeLog][QtCore][QHash] Added asKeyValueRange().
[ChangeLog][QtCore][QMultiHash] Added asKeyValueRange().
Task-number: QTBUG-4615
Change-Id: Ic8506bff38b2f753494b21ab76f52e05c06ffc8b
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Simplify a conditional to save some repetition, purge some spurious
parentheses.
Change-Id: I727d22ce81733e765c4ee951475ccdb599063399
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Apparently the class docs didn't get an update when systemTimeZone()
was added (at 5.5). Also add QCalendar to the \sa.
Prompted by Jaishree pointing out a typo ...
Pick-to: 6.3
Change-Id: If6d38040fff4badc3c0bb765889c1289c560c2b0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
[ChangeLog][Network][QNetworkCookieJar] It is possible to use
system's copy of publicsuffix database when it is available.
This behavior is enabled by default on Linux and can be
controlled using new command line switches -system-publicsuffix,
-qt-publicsuffix, -no-publicsuffix, and -publicsuffix=all.
Fixes: QTBUG-95889
Change-Id: I911e1a13c1422cdc35851953309fff064e7c5f26
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This works on iOS and Android, and Windows with touchscreen.
On Android, we need to listen to the input event
of a hidden text element and synthesize Qt keyboard
events from that in order to get input events into Qt.
On Windows, we need to be more creative about bringing the native
virtual keyboard up.
Because the entire canvas is contenteditable, we need to specify the
inputmode is set to 'none', otherwise the v keyboard pops up
when user clicks anywhere on the canvas. Therefore we set a hidden
element as contenteditable, which pops up keyboard when Qt
needs it for editable widgets. On Android, this is the same
element that is used to proxy the keyboard input.
[ChangeLog][wasm] Add support for native mobile keyboard
Done-with: Morten Johan Sørvig <morten.sorvig@qt.io>
Fixes: QTBUG-83064
Fixes: QTBUG-88803
Change-Id: I769fe344fc10c17971bd1c0a603501040fe82653
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The existing API of QFlatMap did not allow efficient removal of
elements:
- std::remove_if does not apply, because it works by moving elements
back in the range onto those that need to be removed, which doesn't
work in flat_map's case, because, like for all associative
containers, the key in value_type is const.
- The node-based erase-loop (over it = cond ? c.erase(it) :
std::next(it)) works, but, unlike in traditional associative
containers, is quadratic, because flat_map::erase is a linear
operation.
According to Stepanov's principle of Efficient Computational Basis
(Elements of Programming, Section 1.4), we're therefore missing API.
Add it.
I couldn't make up my mind about the calling convention for the
predicate and, despite having authored a merged paper about erase_if,
can never remember what the predicate is supposed to take, so be fancy
and accept all: (*it), (it.key(), it.value()), (it.key()). This means
that unary predicates can either not be generic or must be properly
constrained to distinguish between pair<const K, V> and K, but that's
not necessarily a bad thing.
There's no reason to supply a Qt-ified removeIf on top of the standard
name, because this is private API and doubling the names would do
nothing except double the testing overhead.
Fixes: QTBUG-100983
Change-Id: I12545058958fc5d620baa770f92193c8de8b2d26
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
... if there aren't any.
Pick-to: 6.3
Change-Id: I8531e0c1c3ca41d1b1a9d55c9d11782bd63b6f76
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
strlen() is not constexpr, use the QByteArrayView's
lengthHelperPointer() instead.
Change-Id: Ie49236edba3306e951402e6b776c15068cac0332
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
As a drive-by, fixed misleading wording used in docs.
[ChangeLog][QtCore][Potentially Source-Incompatible Changes][QLatin1String]
Added QLatin1String(std::nullptr_t) constructor, which makes
QLatin1String(0) call ambiguous. To fix the ambiguity, nullptr
must be passed instead of 0.
Task-number: QTBUG-98433
Change-Id: I2b888aa23469343d78aa640dc39a6028b77165dd
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Generally, all clicks that weren't in a window or weren't handled
should trigger a closing of all popups.
Fixes: QTBUG-90990
Pick-to: 6.3 6.2
Change-Id: I40e6351b265e95e0570e7c5d42f3d5b222538453
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
One should use Q_ENUM, not Q_FLAG, to mark an enumeration.
Q_FLAG should go on the respective flag type.
Change-Id: I16cd5c0d405c3db1951569b72805fdae18898c45
Pick-to: 5.15 6.2 6.3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The declaration was accidentally declaring the enumeration as
a flag type, not the actual flag type.
Change-Id: I515478b1628a6d72626da6d7e0061f1ea3d10c89
Pick-to: 6.3 6.2 5.15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Add the missing --no-zstd argument when generating resource artifacts
using binary or big resources or an existing .qrc file.
Task-number: QTBUG-101353
Change-Id: If930f0cb7ba3c89b21b01552aefd6c0e33fe5cb3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
[ChangeLog][Third-Party Code] libjpeg-turbo was updated to version 2.1.3
Pick-to: 6.3 6.2 5.15
Change-Id: I69ebd10641b07af324f6ae056cddb65cc0b5ce82
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
on Wayland
Task-number: QTBUG-100917
Pick-to: 6.3 6.2
Change-Id: I66c42bb0ceca83fd0531159c606d22c58b18b371
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
In QPainter, clipping can only be done on whole pixels. The various
ways of specifying a clipping rectangle to the QPainter API have been
inconsistent in how fractional rectangles (either specified directly,
or as a result of fractional scaling) are mapped (rounded) to integer
coordinates.
Also, the mappings have not made sure to keep the edge-to-edge
property of clip rects under scaling. This is particularly important
when scaling QRegions with multiple rects, as QRegion is designed on
the assumption that an area can be described as a set of edge-to-edge
rects.
The fix rounds a clip rect identically with a fill rect. (Indeed, a
followup plan would be to merge QRasterPaintEngine's
toNormalizedFillRect() with the rectangle rounding function in this
commit).
Notably, a QRectF clip is now interpreted the same as a QPainterPath
clip describing the same area.
This modifies d9cc149995
Task-number: QTBUG-100329
Fixes: QTBUG-95957
Task-number: QTBUG-100343
Pick-to: 6.3
Change-Id: Iaae6464b9b17f8bf3adc69007f6ef8d623bf2c80
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
We don't currently have a use for the extra parameters, but Samuel
Mira's fix to ensure we don't miss fatal signals on Android needs to
be able to call the prior handler, which may need these parameters.
In the process, check returns from sigaction() and use its nullptr
semantics to query first when detecting whether to restore the default
when done, rather than setting and then restoring if it turns out
we've been replaced in the meantime.
Task-number: QTBUG-97652
Pick-to: 6.2 6.3
Change-Id: If30a0db35946c3dceb409ae3f41aa437149472e6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We do not derive from them, and making QMimeXMLProvider final
avoids a warning about calling a virtual function from the
constructor.
Change-Id: I565c63eb555fabb3c98e7d284b54037b7a7194da
Reviewed-by: David Faure <david.faure@kdab.com>
tst_qxmlstream was disabled because it crashed. It does not any more.
But it extracted an input zip archive in-place, which is not
possible on Android. To resolve this, input files are
copied to a temporary directory first.
Also, input directories were given to rcc. rcc has a problem
with recursive directories. To circumvent this,
the file list is created in CMake and then given to rcc.
Task-number: QTBUG-87671
Pick-to: 6.2 6.3
Change-Id: I88bb823b9e5c085404e263d4a648d65c9cd6024c
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
QNX tests are run under QEMU so have the same problem as b2qt
Pick-to: 6.2 6.3
Task-number: QTBUG-100948
Change-Id: I2abc8a4bca9e8ba414197721301d493296e7ce0b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
This test crashed and prevents other testcases from execution.
The test requires a proper fix, but that's not trivial, so skipping
to enable more tests in the CI for now.
Task-number: QTBUG-101321
Pick-to: 6.3 6.2
Change-Id: I1bd4b1182cc868a36391a718457eae647675fc17
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
This test uses the cursor. However we have no cursor support on Android.
Skip the test instead of blacklisting it, because that is the correct
behavior.
Fixes: QTBUG-87389
Pick-to: 6.3 6.2
Change-Id: I1a2d2dd406b3d7da1bc70b51c2072a83d9a29ca5
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
This reverts commit c6958cbbd6.
Reason for revert: This implementation cannot generate digest noexcept, which is required by the QCryptographicHash API.
Change-Id: Iaf635d2738be378aa769b4631685163ba73c26e1
Task-number: QTBUG-71327
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
[ChangeLog][QtCore][QSettings] The INI file reader now supports
keys encoded with UTF-8, as well as the %-encoded format. Writing
the keys back to the INI file is still done using %-encoded format.
This change does not touch the way the *values* are handled - they
are both read and written in UTF-8.
Drive-by: remove misleading comments from the reading algorithm.
Task-number: QTBUG-99401
Change-Id: I6a83cbf24d919a499540403688615f93cb195e93
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
The array of metatypes should always contain at least one entry (for the
metatype of the current metaobject itself).
This prevents crashes in the case of a metaobject without meta-methods
and properties (as observed in Qt for Python).
Pick-to: 6.2 6.3
Change-Id: I7a6fb316eea48c4852b6f1c26e0a930aeba4c799
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
_qt_internal_android_executable_finalizer wraps Android-related
function that are needed to created an Android package.
The function is added to the INTERFACE_QT_EXECUTABLE_FINALIZERS
property in Qt Core so it's called implicitly for user projects.
Pick-to: 6.3
Change-Id: I140f53341691dcfdc6ae2ddea520818cf2834eb6
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Qt projects on Android were failing to correctly load the plugin lib.
The main reason is missing environment variables when the media
integration starts. To make sure that the variables are loaded, I have
change the setenv to be done in the java side instead of c++ side.
Fixes: QTBUG-100299
Pick-to: 6.3
Change-Id: Iba0b6af40574be2d88824ebdcfb1626335cecf09
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This reverts commit 6deded8bc4.
Reason for revert: The new SHA-3 implementation cannot generate digest noexcept, which is required by the QCryptographicHash API.
Task-number: QTBUG-71327
Change-Id: I9a49acd529090d479c7d5e9583dd25e0ec669806
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
To be used in a later commit.
As a drive-by, return early in the frameOnPrimaryScreen
overload to avoid calling GetWindowLong in cases we
don't need them.
Pick-to: 6.3 6.2
Change-Id: Ia69f4acbbf3e044073f818f357e614d4c6680d21
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Before this patch, the system menu will always appear on
the top-left corner of the window if the window doesn't
have the standard window frame. However, this doesn't look
very good on most situations, especially when the window
has a homemade title bar. This patch adds an extra check
for this kind of situations. This patch will automatically
apply an appropriate offset for the system menu if the user
is trying to use a self-made title bar for their frameless
or customized windows.
Pick-to: 6.3 6.2
Change-Id: I55e1c4ac26a4051ca48928d4a2ac3456dce117d1
Reviewed-by: André de la Rocha <andre.rocha@qt.io>