I.e. tryLock(chrono::milliseconds) shouldn't call the int overload as
that truncates the timeout (milliseconds is typically int64_t).
Add a note to the tryLock(millisecons) docs that passing
milliseconds::max() will make it wait forever to obtain the lock.
Task-number: QTBUG-110059
Change-Id: Ib48d9b1b117ce816348625331543d6ba8a788973
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QCompleter::setPopup() sets window flags, focus policy, parent, focus
proxy, item delate and installs an event filter, before the popup
argument is assigned to d->popup.
In the QCompleter::eventFilter override, QObject::eventFilter is called
(under more) if d->popup is nullptr.
If a custom class is inherited from QCompleter and it overrides
QObject::eventFilter(), this causes an infinite loop.
This patch re-factors the method.
- early return is added if the new popup != d->popup
- remembering the existing widget's focus policy is constified and
moved ahead of the delete secion.
- assignment of d->popup to popup argument is moved after the delete
section.
- after assignment, the argument variable is no longer used.
The refactoring eliminates two issues:
- potential risk of double-installing event filter due to missing
early return.
- inifite loop if inherited class installs another event filter.
The patch adds a test function to tst_QCompleter, which implements an
inherited class, installs an event filter on a popup and checks if a
ChildAdded event hass been recorded.
Fixes: QTBUG-111869
Pick-to: 6.5 6.2
Change-Id: I3f7a2434a11476077a5260e7686a912da9f6c60d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Some of the mockplugin tests needed to be excluded from the unity build
manually. In addition, MSVC's complain about include <QtCore/QString>
instead of <QString> was addressed here since it was breaking the unity
build as well.
Some other independent executable and libraries have to be excluded
manually as well.
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I1f21f8484b4d3b1c399e2118ab3a71e682a3006a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Previous setup of the test was failing in minimal static build if built
using the unity build because of the explicit inclusion of the qtcore
source files. In order to resolve this, I removed the inclusion of
qtcore's headers and made the test private.
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Id1c7b3b65ca2078354c235a718ff3e93a65362e6
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
When possible, I replaced add_executable with
qt_internal_add_executable.
Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: I643d2e27f0d880fe9b6cec7af790e4c99227fb0c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
All the other overloads are implemented using the new one.
Windows change relies on the pre-check in the code review making sure it
compiles.
[ChangeLog][QtCore][QThread] Added sleep(std::chrono::nanoseconds)
overload.
Task-number: QTBUG-110059
Change-Id: I9a4f4bf09041788ec9275093b6b8d0386521e286
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This is expected to be temporary and to be investigated afterwards.
Task-number: QTBUG-108844
Pick-to: 6.5
Change-Id: I0a571dad2b99ceaa0fd48e5cdd81057e49e55ddf
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Add support for MYSQL_TYPE_BIT. Since the bitfield can be max 64bits,
store it in a uint64_t. Writing such a value as MYSQL_TYPE_LONGLONG
works as expected but receiving it needs a special handling.
[ChangeLog][SQL][MySQL] Added handling for Bit-Value Type - BIT.
Fixes: QTBUG-21326
Change-Id: Id20e3316caf6703b3bec8a828144494a20693fd8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Add a helper class which makes sure that the used table does not exist
before usage (e.g. due to leftovers from previous tests) and is properly
cleaned up on exit. This also allows to remove all usages of
safeDropTable().
Change-Id: Iefeffbd10e2f2f67985183ea822d7b6dd2b80be7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
E.g. tst_qprocess_and_guieventloop uses write-read-write.
This is useful e.g. when not building all of qtbase, but only a specific
unittest while hacking code.
Change-Id: Id97c6c09c180ba35554d75877a434cb258a6243d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Add a function QHostAddress::isPrivateUse to test
for IPv4 private networks and IPv6 unique local unicast addresses.
Task-number: QTBUG-111211
Change-Id: Ic8abefa7aa974fa83118aeb9f2506a5713f79f0d
Reviewed-by: Tasuku Suzuki <tasuku.suzuki@signal-slot.co.jp>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
250ca8d5f8 changed the qConvertToNumber
to have a std::optional return instead of a boolean out-argument.
In doing so a code path that was supposed to report a failure (string
could not be converted to an integer) accidentally starting reporting
success (and converting the string to 0).
The problem is that the `ok` check from QString::toLongLong was
accidentally dropped in the refactoring; previously the function set
`ok` to false and returned 0, now the function just returns 0.
Instead, amend that return to return nullopt (because the conversion has
failed).
Change-Id: Iaedef5463f3ec500a97bd4c9bbddf977f66df61a
Pick-to: 6.5 6.5.0
Fixes: QTBUG-111867
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Change-Id: I3087bff60e77c0eaa5818a5405c97628ce7f6b79
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
state->rate is always larger than or equal to state->bitsInQueue;
when bitsInQueue == rate the queue is consumed and bitsInQueue is set to
0 again.
Done-with: Marc Mutz <marc.mutz@qt.io>
Pick-to: 6.5.0 6.5 6.4.3 6.4 6.2 5.15
Change-Id: I56d268a19fb3cd542cc027edc962253f09d97a14
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
In most QObjectPrivate-subclasses, the Q_DECLARE_PUBLIC macro is used in
the private segment of the class declaration. In that case, the q_ptr
becomes a private member of the private class, and then the
QObjectPrivate::connect function can no longer be used, as it needs to
access the d_ptr.
Fix this by declaring QObjectPrivate, and the static-assert-helper, as
friends of the class using the Q_DECLARE_PUBLIC macro.
Adapt the QObject test by moving the Q_DECLARE_PUBLIC macro into
the private section of the test-private, and add a compile test.
Pick-to: 6.5 6.5.0
Change-Id: Ifc04be3b305221e138b1e08bb3a3838d871f4fcb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
And fix coding style a little bit around the change.
Change-Id: Idfc232a751ccc08d0680351d48d4a68f09f18c1f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Fix coding style, replace QVERIFY(a == b) with QCOMPARE, use nullptr,
use a lambda for a local slot, and wait for the test widget to go away
so that it doesn't break following tests.
Change-Id: I1a4f790084b92301444a96a1449c84bf3317b88a
Reviewed-by: Santhosh Kumar <santhosh.kumar.selvaraj@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
... to make large data usable from other test functions.
Pick-to: 6.5 6.5.0 6.4 6.4.3 6.2
Change-Id: I302070121a8bb49f373c7711bc3ab9e6418874ef
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
QAIM::match() supports different matching modes. The wildcard match mode
was never meant to be specifically a filepath globbing wildcard, but
rather a generic one -- something like "*" should match into a
string like "a/b/c". This is a regression from Qt 5, where
QRegExp::Wildcard was ported to only allow for path globbing
rather than generic matching.
[ChangeLog][QtCore][QAbstractItemModel] QAbstractItemModel::match()
now uses more generic wildcard matches rather than file path globbing.
Please refer to the documentation of
QRegularExpression::wildcardToRegularExpression() for more information
about the differences.
Change-Id: I28b8a76b01fdd9c5dd8f99528fac1c7b704564bc
Fixes: QTBUG-104585
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Amends 76c63936d3 by adjusting the test case.
We still just test that we can open a file based on a filename that we came
up with ourselves.
Also, update usage documentation and make the snippet a bit more relevant.
Change-Id: I5bf00210d74e2a73d5a71a09a5beb1b3f6f8e225
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
QTemporaryFile is not designed to promote temporary files
to non-temporary files. So, it, quite importantly, does not
care if the content of the files are flushed to disk before
renaming it into its 'final' destination. This is what
QSaveFile is for.
This was much more time-consuming than intended since I had to debug
this quirk about calling size().
Pick-to: 6.5 6.4 6.2
Fixes: QTBUG-111397
Change-Id: I15b300f6a5748ad3a0be983545ea621269a12ecd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add support for shader input output interface blocks in Metal
tessellation pipelines. This feature is builtin to other rhi supported
tessellation backends (OpenGL/Vulkan).
Metal tessellation is implemented as compute pipelines for vert and
tesc, and a render pipeline for tese and frag. The shader conversion
from GLSL is handled by SPIRV-Cross, which has a particular way of doing
things. Rhi must setup the vertex inputs for the tese - frag render
pipeline to read from buffers written by the tesc compute pipeline,
following SPIRV-Cross conventions. This includes ensuring correct
memory alignment per MSL Specification.
In order to enable input output interface blocks, reflection of struct
members of QShaderDescription::InOutVariable is required. Reflection of
QShaderDescription::BuiltinVariable array dimensions is also required to
support variable size tese builtin input gl_ClipDistance.
An acompanying patch to QtShaderTools is required.
Change-Id: Id94e86caef211485afc187bb79fe3d0619d02cf0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
QPropertyAlias might be deprecated, but using it should still not fail
to compile.
Pick-to: 6.5
Fixes: QTBUG-111735
Change-Id: I486cddb424b60cd3e5c539e26afca3726e29bb09
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
If a composite widget is put behind one of it's contained children via
QWidget::setTabOrder, then our logic might replace the composite widget
with the contained child. In that case, we'd end up with a broken tab
chain, possibly resulting in incomplete clean-ups and triggering asserts
when shutting down the UI.
Handle this by stopping the last-child searching logic at the respective
other widget, and by not allowing both widgets to be the same.
Augment test case, and apply some minor refactoring to the code.
Pick-to: 6.5 6.2
Change-Id: I7d97dfa85315b6c01daa283253025d94a1727048
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
The choice of whether to show a message again is per message,
so when showing a new message we need to reset the check box
back to its default checked state, otherwise the user might
mistakenly dismiss more than the indented message.
[ChangeLog][Widgets] QErrorMessage will now reset the check
box for showing a message again for each new message shown,
as each individual message has its own suppression state.
Pick-to: 6.5 6.5.0
Change-Id: I86d4bb5eabdb5b7a478c03516108a5edf87fcbe3
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The parameter names were previously "lhs" and "rhs", which is incredibly
abstract for a testing framework. One of the parameters will tend to be
a baseline value to compare against while the other is the result of
some action we want to test. Thus I suggest they be renamed "computed"
and "baseline".
This way we can, hopefully, retain the semantic that the 'left'/first
argument is the computed ('actual' in QCOMPARE) value while the
'right'/second argument is the baseline ('expected' in QCOMPARE.)
Change-Id: I3e0fdce2a3f1faca06fdf7184ef6e0eb9724d990
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
A glob pattern has different semantics depending on whether
it's used in "filepath mode" (FNM_PATHNAME) or not.
QRegularExpression only implemented the former, but the latter
is also useful, and possibly more "intuitive" for certain use
cases (e.g. offering users a simplified version of regexps that
however still need "*" to match a "/").
Add this support. The problems highlighted by QTBUG-111234 have
not been addressed, I've just amended a bit of documentation
relating backslashes.
[ChangeLog][QtCore][QRegularExpression] Support for non-filepath
wildcards has been added to wildcardToRegularExpression().
Fixes: QTBUG-110901
Task-number: QTBUG-104585
Task-number: QTBUG-111234
Change-Id: If9850616267980fa843bda996fcb4552b5375938
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Not relevant for the CI as that does not run with any real Vulkan
implementation. (and Lavapipe works if that's used)
As the investigation in the Jira issue shows, there is no proper
conclusion yet on why rendering to a slice of a 3D texture breaks
the content of other slices that have image data written to them
before that render pass targeting the slice. It would seem that
transitioning to COLOR_ATTACHMENT_OPTIMAL has some unexpected
consequences for slices that are not targeted by the render pass
with Mesa on Intel.
(NB rendering to a given 3D texture slice works via
VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT; and how often this is needed
in practice is unclear, typical volume rendering cases will anyway
likely just upload data to the slices of a 3D texture, not rendering
to them)
The problem is still clearly visible in the tex3d manual test (when run
on affected Linux machines), this we keep unchanged for the time being
so that the issue can be examined further. However, the autotest is
changed to prevent the issue from occurring (render to slice first,
then upload to other slices) since it causes confusion when the test
is run locally on various developer machines.
Pick-to: 6.5
Task-number: QTBUG-111772
Change-Id: I4dc4c2413f8c518f377a33065992ad786a5ff44f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Separate 1D mipmap generation support from rendering into an 1D texture.
Those are two independent features, so have a separate feature flag for
both instead of using just one.
This will then be symmetric with the 3D texture features, where now we
have a new flag to report support for generating mipmap for 3D textures.
(whereas 3D texture as a render target is already covered by
RenderTo3DTextureSlice)
Change-Id: Ie5e1f056a7d1c341d90cd7fc522877a3f2da3290
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
The polyfill for file input on WASM now makes use of the supplied
filter list.
Some changes were introduced in the abstraction for filters so that
they are usable both for the new file API and the legacy file input.
Change-Id: Id6341be4d6a1647e17382d13da7be42491cfaf80
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
The note that QSqlDatabase::exec() is deprecated was added more than 12
years ago so it's time to also mark the function as such.
Change-Id: Ic5e7c31b3ff5b21e16e2640548cba1a4baaeeb1c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Apple lets us know that:
warning: 'sprintf' is deprecated: This function is provided for
compatibility reasons only. Due to security concerns inherent
in the design of sprintf(3), it is highly recommended that you
use snprintf(3) instead.
Pick-to: 6.5
Change-Id: I3130b3c7b636466b5e77adc5cb05ad4ce1faee11
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We test moc's support for [[deprecated]], so don't warn about it.
Pick-to: 6.5
Change-Id: Ifda2b81c14cb9802db4bb1d0a1eb17d978ad492a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
remove toHex() as it's not used at all and qTableName() with two params.
Also remove some SQLite 2 specific stuff
Change-Id: If285febdfbee5833f7174d70f386bd54674bd539
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Use a scope guard to print debug info in case of an early return.
Silences clang warning about sprintf being unsafe and deprecated.
Change-Id: Idcbfde1a6f2eb1143f51c1e5ecedbf3fe90d8ec8
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
The doc said positive values for a negative range were intermediate
but the code actually rejects them if the value has an overt plus
sign, so make clear that intermediate is only for the case without a
sign. Incidentally comment on a test where it might not have been
obvious to the reader that a space is the locale's digit-grouping
chracter.
Pick-to: 6.5 6.5.0
Change-Id: I3edab74fe8c2cbe8448c0e523676f1fd0d0d8a9f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
From the manual page:
Note: modern applications may prefer to use the interfaces
described in utimensat(2).
Change-Id: Ib20d8b9b50626233852ca351452ce90841a39603
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Make sure to properly close the cloned database connections and allow
one test for sqlite
Change-Id: Ia4eb4a684a3c432844e4b2a77bff69655b53f9b2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@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>
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>
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>