In one of the three calls to customConstruct() -- QVariant::detach() --
we've already checked that the type is valid, so don't re-emit the
warning there.
Change-Id: I3859764fed084846bcb0fffd1703a3c7c0fb3164
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We can implement the trivial {default,copy,move} construction outselves
inside qmetatype.cpp and qvariant.cpp, simplifying the QMetaType
interface object, removing up to three relocations per QMTI.
This adds the testing for QMetaType::isXxxConstructible and
isDestructible that couldn't be added before.
Change-Id: Ic44396b31ba04712aab3fffd16ff0a28f541d507
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This also rewrites QMetaType::id() on top of the helper, with the benefit
of calling a member static function, so QMetaType doesn't need to be
spilled onto the stack. In some upcoming changes I need to ensure that
QMetaTypes are registered so they can be found by name and I'd like to
have a dedicated function name for that, instead of calling .id().
Since I needed to add docs for the new function, I've updated for the
old one too.
[ChangeLog][QMetaType] Added QMetaType::registerType() and an overload
of qRegisterMetaType() taking QMetaType (the two functions do the same
thing). These two functions ensure a given QMetaType is registered with
the Qt global registry, so they can be found by name later. Using
qRegisterMetaType<T>() also accomplishes the same thing, but is slightly
better for completely generic code because it will avoid emitting the
registration for built-in types.
Change-Id: I3859764fed084846bcb0fffd170351d606034c22
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
It's not registered until an ID is assigned.
Pick-to: 6.4
Change-Id: I3859764fed084846bcb0fffd17034f5b369c5b4d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The cause is that the first EXPOSE event comes with the window not
having focus yet. See QTBUG-105177.
Also remove processEvents() as events are always processed when doing
qWaitFor...().
Task-number: QTBUG-105177
Change-Id: I2260d1885388bbf7091c423bc9b4c16e2ed0090f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Previously the failure was been ignored because of the very generic
"linux" entry in the BLACKLIST file
Task-number: QTBUG-105201
Change-Id: I6914fe350f78266fc18541eb8fcd881f5a4ac511
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
+ I could not reproduce the flakiness on OpenSUSE Tumbleweed.
+ No significant flakiness can be seen for this test in our testresults
statistics.
+ Ubuntu-16.04 is no longer part of our CI
Change-Id: I7a18fc3fe2e58af8533171ebae0457b08424e810
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The cause is that the first EXPOSE event comes with the window not
having focus. See QTBUG-105177.
Fixes: QTBUG-67254
Task-number: QTBUG-105177
Change-Id: I04789d0a173979d9a60893989f76566b617c6576
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
There was an explicit int cast in fromBase64Encoding() which was never
ported to qsizetype and therefore truncated the result.
Fix by removing the int cast.
Add a test, optimize it for as low memory usage as possible, given we
need to work in input and output data each in excess of 2GiB.
Fixes: QTBUG-104985
Pick-to: 6.4 6.3 6.2
Change-Id: I9c0924957e62e5cb3003132cd811b8b0315d8ac1
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The skipcleanup and failcleanup tests were actually testing skip and
fail in cleanupTestCase(), not in cleanup(). Add almost-duplicate
tests and clean up so that we now have {fail,skip}cleanup(,testcase}
tests to cover all four cases. Generated expected output. The new
tests (with old names) get their fail or skip - during cleanup() -
reported against the test instead of the cleanupTestCase function.
(Results for {init,cleanup}TestCase() are always reported, even when
these slots are not defined, as no-op passes.)
Pick-to: 6.4
Change-Id: I0988d1696b50c0e2f30c45ddc25e1bd0bfd2151a
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
So long as you only ask us to copy it. Copying is mandatory, though.
I'll firm up the warning in a later commit, which may not get cherry-
picked as far back.
Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-105140
Change-Id: I3859764fed084846bcb0fffd170432abf65dc197
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Before a recent fix it would happen occasionally that
lastNormalizedPositions.at(0) would segfault because the list was
empty. The cause of the flakiness was fixed, but make the test more
resilient anyway by checking first the list is correctly populated.
Furthermore on some platforms this check fails:
qAbs(leftWidget.lastNormalizedPositions.at(1).x() - 0.8) < 0.05
So instead of QVERIFY use QCOMPARE_LT to print the values when it fails.
Task-number: QTBUG-104268
Change-Id: Id5430eb53c133cf5d23647cfd9749f01f266efce
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Sometimes XCB_EXPOSE event is being propagated twice, once before and
once after qWaitForWindowExposed(). But the window has focus only after
the second expose event. Changing it to qWaitForWindowActive() fixes the
issue.
Fixes: QTBUG-104268
Pick-to: 6.2 6.3 6.4
Change-Id: Ibc78dd4958ed1a4a8d0967b29d2a53457ab9ae8b
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
And fix all the new warnings.
Task-number: QTBUG-104857
Pick-to: 6.4 6.3 6.2
Change-Id: I2a5791f495575d71d2344429aca3363f9922e31b
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
The QTextFormat::FontFamily enum is deprecated since Qt 6.0, however it
is still used in the code.
To retain backward compatibility with the old data stream formats, we
introduce a new internal QTextFormat::OldFontFamily enum value, which
has exactly the same value as QTextFormat::FontFamily, and use it
instead.
Task-number: QTBUG-104857
Pick-to: 6.4 6.3 6.2
Change-Id: Ibf5258b621c2b0aa507005dfe2c1e80c26ddb0d4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
... when QT_DISABLE_DEPRECATED_BEFORE is past the deprecation version.
This commit actually stops using the deprecated signals when we build
Qt with QT_DISABLE_DEPRECATED_BEFORE >= 0x060000. Otherwise we will
get a compilation error because the signals will be removed.
Task-number: QTBUG-104857
Pick-to: 6.4 6.3 6.2
Change-Id: Ie513ecc9451bf2d88f80857cf19f3d2b4958d022
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
When the method is wrapped into
if QT_DEPRECATED_SINCE(MAJ, MIN)
we also need to add QT_DEPRECATED_VERSION_[X_]_MAJ_MIN macro right in
front of the method declaraion, to actually trigger a deprecation
warning.
This patch does that for QCursor's deprecated methods, and fixes all
related compilation warnings in QtBase.
Task-number: QTBUG-104857
Pick-to: 6.4 6.3 6.2
Change-Id: Ic8d059e8c852d4b2dee55e7ea94f4fc7a402cdf4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
If the metatype does not support copy and default construction, then it
it unsuitunsuitable for use in QMetaType. We cannot prevent users from
passing in such metatypes (as we have e.g. a ctor taking QMetaType), so
verify this in customConstruct, and make the variant invalid in that
case.
Pick-to: 6.2 6.3 6.4
Change-Id: Ib1f0149c8fb9a1cce0049fd0311980754cc85d1b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
- add move special member functions (docs copied from QHostInfo)
- add member swap
- use move-and-swap, not pure-swap, because these objects hold
resources (handles) other than just memory
- Q_DECLARE_SHARED (it's not implicitly shared, but explicitly)
- adds ADL swap and Q_DECLARE_TYPEINFO
[ChangeLog][QtOpenGL][QOpenGLBuffer] Added member-swap(), move
constructor, move assignment operator.
Change-Id: I22dc92108bdd393fff4361db23e94eaf3d7ea9cc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The tst_QByteArray test redefines the QCOMPARE macro to check the LHS
to be NUL-terminated. Because the code was never ported from int to
qsizetype, it fails for QByteArrays of size > 2GiB.
Fix by porting to qsizetype.
Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-104985
Change-Id: Ib3951b0efed5f734ae1324ea2d455bb7762fb9c4
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Or the previous limit, 10.
The test has a flaky and failing history, esp on macOS. Trying to
provoke race conditions with more threads than we have cores has little
value.
Pick-to: 6.4
Change-Id: I99dd2b5a6f64faa83963c279c84fc547416f914f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
That test has a very flaky history on Windows 11, presumably because
there are even more fade-in/out effects. Wait longer for those to
finish.
Fixes: QTBUG-102239
Pick-to: 6.4 6.3 6.2
Change-Id: I1d59f4422469e60a8c4dc5a52c48f0344e954491
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
OpenSSL v3 fails to set server's certificate, complaining that
"md is too weak".
Pick-to: 6.4 6.3 6.2 5.15
Fixes: QTBUG-49205
Change-Id: Ib21b10ff13bc2621ae2aaaab962efaaf77a854bc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
a61bf508e3 reduced the tolerance from 4 to
3 in one case, making the test more rather than less flaky on systems
with a device-pixel-ratio of 1.
Pick-to: 6.4 6.3 6.2
Change-Id: I245443f0dcb1aa40176c127025501b63f12f161b
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Amends 1d961491d8. We modify the resolve
mask after making a shared copy of 'other', so we must detach. Call the
setter designed for that purpose.
Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-98762
Change-Id: I4f45223e74764a341378992172787fae73efb8b7
Reviewed-by: JiDe Zhang <zhangjide@uniontech.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Deal with the case that the object gets deleted between a call to
moveToThread and the start of the thread by removing the object from the
list in that case.
Fixes: QTBUG-104014
Pick-to: 6.4
Change-Id: Ib249b6e8e8dfbc4d1332bb99a57fa9d3cff16465
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
We set Qt::X11BypassWindowManagerHint on the view, which regularly makes
the test fail on X11 systems in the
QVERIFY(QTest::qWaitForWindowActive(dummyView.data()))
check.
If the view fails to show, skip the test instead of failing, we are not
testing anything X11 specific here, running this test on other platforms
will be good enough.
Pick-to: 6.4 6.3 6.2
Fixes: QTBUG-98921
Change-Id: I46dbcddf51ee1e92eb3bbb29bb57fcc314266bea
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The test already accepts an error margin for coordinate mapping. It is
still flaky, so make that margin larger if the DPI of the widget >1.
Pick-to: 6.4 6.3 6.2
Change-Id: I0a598e5e94ac82c551cbeb935e2fa08cad048f84
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
If the cached font has a different DPI than the one used in
QPainter, we need to treat this the same as if other font
properties have changed and redo the layout.
This happened when running the QStaticText test on Wayland,
because the default dpi was 100 and the QPixmap we ended up
drawing to was 96. This caused the pixel size of the font to
be calculated differently when doing drawText() (using 96 dpi)
and drawStaticText() (using the cached 100 dpi).
Pick-to: 6.4
Fixes: QTBUG-100982
Change-Id: Ie4270341bb8a64b6458eb67ba460a282c65dc26b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Running this test on Wayland passes for me, so maybe something
has magically improved.
Change-Id: I161b697c5be96af48938228267cb405048c78852
Reviewed-by: Inho Lee <inho.lee@qt.io>
This example connects an echo server running behind
WebSockify, on localhost.
For example, start websockify with
websockify 1515 localhost:1516
to accept a webscoket connection on 1515 and forward
to echo_server at 1516.
Pick-to: 6.4
Change-Id: Id71364e4ab8c46d3482b515fcd1b991b61d7404b
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Use a signal spy to watch for the relevant signal from the file system
model and wait for that before checking whether the completer responded
to that signal by showing (or not showing) the popup.
If the file system model doesn't fire within the default timeout of 5
seconds, skip the rest of the test.
Fixes: QTBUG-46113
Pick-to: 6.4 6.3 6.2
Change-Id: I9becfe19a220bdb178ed8275c327d55ea19aa342
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The test has timed out when run on ARM in qemu. We start more threads
than the ideal count, which is likely too much for the emulator when not
running the native architecture.
Pick-to: 6.4
Change-Id: I42e11945070646551e77c10618df762a4bffc8ba
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
For built-in types, this is a compile-time assert - we should not have
any types in Qt for which we have neither debug streaming nor a
QTest::toString specialization implemented. A build of most of Qt
submodules passes with this change, after minor modifications to some
tests. We cannot declare QSizeHint::Policy as a metatype after the
QMetaType has already been instantiated for it, and the QDebug stream
operator for QElaspedTimer needs to be correctly declared within the
namespace.
Add a self-test function for a custom type, and update reference files
of the self-test.
Task-number: QTBUG-104867
Pick-to: 6.4
Change-Id: I2936db5933f4589fce45f47cf2f3224ed614d8c9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Wayland does not support window activation, so rather than skipping
tests based on platform name, we can use the platform capability
(which will also cover future platforms with the same issue)
Pick-to: 6.4
Task-number: QTBUG-104241
Change-Id: Ibf5f8968f3979b789ef68f92768419bef4500fb3
Reviewed-by: Inho Lee <inho.lee@qt.io>
If we create a QThread from QThread::current(), we want it to have a
correct value for its bindingStatus. Thus, initialize bindingStatus in
the ctor of QAdoptedThread.
Task-number: QTBUG-101177
Task-number: QTBUG-102403
Pick-to: 6.4 6.3
Change-Id: I3ef27ed62c5dc25eed05d551c72743a1b8528318
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Connects to echo_server via websockify, like the async version.
Pick-to: 6.4
Change-Id: I9ed560cd388cfddbd0d284d8d40fb7ddf964ba96
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Use QThread::idealThreadCount instead. This requires that we use
QVarLengthArray, as MSVC doesn't allow us to allocate arrays with a
non-constexpr size on the stack.
By using as many threads as the system has cores, we are more likely
to detect race conditions reliably. On systems with fewer cores (in
particular on qemu platforms like QNX, where this test has been
failing a lot), we'll less likely end up with false negatives due
to timeouts.
Pick-to: 6.4 6.3 6.2
Change-Id: Ie8631aef544ca7b53c06a0729d05459016745486
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Some of the offsets are already quint32 in the API (vertex input
attributes, dynamic offsets, offsets in draw calls), matching the
reality of the underlying 3D APIs, but many buffer-related functions
use int as of now, simply because that used to be the default choice,
and the same goes for sizes (such as buffer or range sizes). This is
not quite consistent and should be cleaned up if for nothing else then
just to make the classes consistent, but also because no 3D API use a
signed type for offsets, sizes, and strides. (except OpenGL for some)
When it comes to strides (for vertex inputs and raw image texture
uploads), those are already all quint32s. This is straightforward
because most of the 3D APIs use 32-bit uints for these regardless of
the architecture.
Sizes and offsets are often architecture-dependent (Vulkan, Metal),
but there is at least one API where they are always 32-bit even on
64-bit Windows (UINT == unsigned int, D3D11). In addition, we do not
really care about buffer or texture data larger than 4 GB, at least
not without realistic use cases and real world testing, which are
quite unlikely to materialize for now (esp. since we still have the
width/height of 2D textures limited to 16 or 32K in many cases even on
desktops, whereas 2GB+ buffers are not guaranteed in practice even
when an API seemingly allows it).
In any case, the important change here is the signed->unsigned
switch. A number of casts can now be removed here and there in the
backends, because the offsets and sizes are now unsigned as well,
matching the underlying API reality. The size can be potentially
increased later on with minimal effort, if that becomes necessary for
some reason.
Change-Id: I404dbc365ac397eaeeb3bd2da9ce7eb98916da5f
Reviewed-by: Inho Lee <inho.lee@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Allow specifying the Java class on which to set/get the field via its
corresponding C++ type, removing the need to explicitly provide the
Java type string.
Those were missing from a085a14d76, which
was noticed when porting QtConnectivity over to the new template APIs.
Pick-to: 6.4
Change-Id: I8f324c9fcc486b4c6c2f2b9051f7eca0cbec0e91
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
The iBridge interface is used for the keyboard touch bar, and the Apple
Wireless Direct Link interfaces are used by Apple for various purposes.
Setting up a server on these interfaces does not work.
Only the tst_QTcpServer::linkLocal unit test on macOS is affected by
this change.
Fixes: QTBUG-103892
Change-Id: I29701ce51d5e40dff6c59547a8639c1fba330d36
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QMetaTypeInterfaceWrapper tries to find the metaObjectFunction using
the MetaObjectForType template. Using SFINAE, for a QObject, it should
resolve to a suitable specialization.
Such a specialization doesn't yet exist. It had to be created.
The following path returns nullptr for registered meta types:
auto metatype = QMetaType(typeId);
requestedTestType.metaObject() -> returns nullptr since a bad template
argument is fed to MetaObjectForType<T> in
QMetaTypeInterfaceWrapper<IneritingFromQObject>::metaType's static initializer.
Change-Id: I8b31c51e12cb19c333e00480b0177354b910ce1e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>