- Moved the modal window resolution to
QWasmWindow::requestActivateWindow so that multiple async activation
events are not issued in unpredictable patterns.
- Request activation on added windows and on stack top in case of
window removal
Pick-to: 6.4
Change-Id: I6f02cf1b7e83abb7961caf311ffc83e91c8bf810
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
If restoring a QHeaderView state from a data stream with version Qt_5_0,
check alignment and resize mode properites for out-of-bound values.
If out of bounds, try QDataStream version Qt_6_0, which is used by KDE
apps compiled with 5.15.2 or 6.2.3.
QFileDialog stores settings in the same settings file across different
Qt versions, using different QDataStream versions. That makes
QFileDialog vulnerable to the issue (QTBUG-104962). A respective auto
test is added with this patch.
Fixes: QTBUG-104962
Pick-to: 6.4 6.3 6.2
Task-number: QTBUG-104425
Change-Id: I666207fca7ab837ad27a247e504a40757ee8afab
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
CUPS has a feature called printer instances that allows saving
different sets of default options for a single print queue,
s. section "Creating Saved Options" at [1].
A printer instance can be set up using e.g.
lpoptions -p printer/instance -o name=value
The printer instance is then listed with the print
queue name and the instance name separated by a slash
in the 'lpstat -e' output.
Qt also supports CUPS printer instances and displays
them using the same as printer names.
However, tst_QPrinterInfo::getPrintersFromSystem was
previously truncating the printer name at the slash,
so the comparison of printer names on a system that
has CUPS printer instances set up would fail e.g. as follows:
********* Start testing of tst_QPrinterInfo *********
Config: Using QtTest library 6.5.0, Qt 6.5.0 (x86_64-little_endian-lp64 shared (dynamic) debug build; by GCC 12.1.0), debian unknown
PASS : tst_QPrinterInfo::initTestCase()
QDEBUG : tst_QPrinterInfo::testForDefaultPrinter() Test believes Default Printer = "PDF"
QDEBUG : tst_QPrinterInfo::testForDefaultPrinter() QPrinterInfo::defaultPrinter() believes Default Printer = "PDF"
QDEBUG : tst_QPrinterInfo::testForDefaultPrinter() QPrinterInfo::availablePrinters() believes Default Printer = "PDF"
PASS : tst_QPrinterInfo::testForDefaultPrinter()
QDEBUG : tst_QPrinterInfo::testForPrinters() Test believes Available Printers = QList("Canon_MX390_series", "PDF", "PDF", "PDF-5cm-margins", "dummy", "dummy-ricoh-c3000", "tofile-hp-officejet-8600", "tofile-ricoh-aficio", "tofile-ricoh-mufu", "tofile-samsung-m2875", "tofile-test-tdf106963", "tofile-xerox-phaser-6510")
QDEBUG : tst_QPrinterInfo::testForPrinters() QPrinterInfo::availablePrinters() believes Available Printers = QList("Canon_MX390_series", "PDF", "PDF-5cm-margins", "PDF/myinstance", "dummy", "dummy-ricoh-c3000", "tofile-hp-officejet-8600", "tofile-ricoh-aficio", "tofile-ricoh-mufu", "tofile-samsung-m2875", "tofile-test-tdf106963", "tofile-xerox-phaser-6510")
FAIL! : tst_QPrinterInfo::testForPrinters() Compared values are not the same
Actual (qtPrinters.at(i)) : "PDF-5cm-margins"
Expected (testPrinters.at(i)): "PDF"
Loc: [/home/michi/development/git/qt5/qtbase/tests/auto/printsupport/kernel/qprinterinfo/tst_qprinterinfo.cpp(232)]
Fix this by adding the slash character to the regex.
[1] https://www.cups.org/doc/options.html
Change-Id: Id0dc27a8b4c592847ed364cebf277e988039cad4
Reviewed-by: Albert Astals Cid <aacid@kde.org>
Q_DECLARE_EXPORTED_LOGGING_CATEGORY is available from 6.5 only, hence
cherrypicking this solution fails.
Change-Id: Ib3351a8846bb5cf6047cd2d13c9f7cd242df9c93
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
If an included header brings in MacTypes.h it will cause issues,
so rename the enum to be on the safe side.
Pick-to: 6.4 6.3 6.2
Change-Id: I29ec795be74a65d4f2267d8121a514bf192cf969
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
The QObjectPrivate::declarativeData member is stored in a union with
currentChildBeingDeleted. The QObject destructor always sets the
currentChildBeingDeleted member of the union. It also sets the
isDeletingChildren bool, which is the only way to find out which union
member we can safely access.
While the QObject destructor is deleting children and isDeletingChildren
is set, we must not access the declarativeData member of the union.
Add a test case that initializes the function pointers for the
declarative handlers and constructs a situation where an object
emits a signal while it is destroying children.
Fixes: QTBUG-105286
Pick-to: 6.4 6.3 6.3.2 6.2 5.15
Change-Id: Iea5ba2f7843b6926a8d157be166e6044d98d6c02
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Otherwise new clients will not be handled when they try to connect
Amends 29a1fe72a0
Pick-to: 6.4
Change-Id: Ifff052d1bf27682df2782faa285a257c9b41d86f
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The new name describes the behavior in a better way.
[ChangeLog][Build System] The QT_DISABLE_DEPRECATED_BEFORE macro is
renamed to QT_DISABLE_DEPRECATED_UP_TO. The old name is deprecated, but
is still recognized if it is defined during configuration and the new
name is not defined.
Task-number: QTBUG-104944
Change-Id: Ifc34323e0bbd9e3dc2f86c3e80d4d0940ebccbb8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This fails on Android 12 in CI.
Task-number: QTBUG-105739
Pick-to: 6.4 6.3 6.2
Change-Id: Ibf3deb6b84564f12b5172f2522875fe70f8ce87b
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This fails on Android 12 in CI.
Task-number: QTBUG-105738
Pick-to: 6.4 6.3 6.2
Change-Id: I94fcefae3d88087cd96f4043b015f9469ed629a9
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Android kills this test case which tries to use too much memory,
or it times out.
Pick-to: 6.4 6.3 6.2
Task-number: QTQAINFRA-4748
Change-Id: Ifce92533d50f4c463ee10fe80e7654ad16172a35
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
The default camera to plane distance is 1024, when rotating a big image
along the x or y axis, some areas of the screen may move above the
camera, causing the rotation to fail. A new rotation interface has been
added to allow users to specify the distance from the camera to the
plane themselves when rotating the QImage. Also, this support has been
added to QMatrix4x4::projectedRotate.
[ChangeLog][QtGui][QTransform] Added overloads to rotate() and
rotateRadians() that allow specifying of the distance to the rotation
plane.
Fixes: QTBUG-105088
Change-Id: I81f629916ddd9b6ab84e0282191e4284a88a85f5
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Windows VMs are provisioned with shared folders that are available as
\\${COMPUTERNAME}\testshare(writable)
so we don't need to access a remote SMB server over network anymore just
to test whether our string-parsing code handles UNC paths correctly.
Add a QTest::uncServerName() helper function to the shared filesystem.h
header and use that instead of QtNetworkSettings::winServerName. The
latter is now only used in tst_NetworkSelfTest::smbServer().
Pick-to: 6.4
Change-Id: Id0da66369ad0f4a980d612de2a31a391f1192253
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Not just the ones we added to the pending sockets list
Pick-to: 6.4
Change-Id: I0a0016fe39df7ca2fc3f0c4e4111195bc6d90198
Reviewed-by: Konrad Kujawa <konrad.kujawa@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
If a client doesn't send any data then we would leave the socket open
for as long as it needed, wasting resources. Add timeouts to limit the
amount of time this can happen for.
Since there is a limit on number of sockets that the server will have
queued, having idle sockets stick around forever is a vector for ddos.
Pick-to: 6.4
Change-Id: Ida6251c92c625eeadf2065861b840b14255654b8
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
SecureTransport ignores any content that comes in until it is large
enough to be a handshake. So a plaintext client may be left hanging
while it is waiting for a response.
Pick-to: 6.4
Change-Id: I501ae61d89d516765c7ba5f0d916d9246fde5d4d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Build a simple widgets qmake project when targeting iOS in the CI.
This ensure we don't introduce basic regressions in the .pri / .prl
file generation.
Make sure to target the ios simulator, so we don't require any
code signing or provisioning profiles.
Pick-to: 6.4
Fixes: QTBUG-96058
Change-Id: I1a5564e838a5ce3cac89a37a5a4ddee74d3400f3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
And use the new overloads in examples and tests.
[ChangeLog][QtXml][QDomDocument] Deprecated the old setContent()
overloads in favor of the new ones that take ParseOptions and
ParseError.
Task-number: QTBUG-104507
Change-Id: I61b37eba2fe3002c03bddc90f6877676d539f7ec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add a runtime test for asyncify availability; skip tests
if asyncify is not available. Add new build target which
builds with asyncify enabled.
Change-Id: Idaeff0a24aa01525927b012af2a0ba135c7839c3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
We're not looking to skip faulty tests, but there are cases
where we would like to indicate that a test function exists
but can't run because some precondition is not met.
Pick-to: 6.4
Change-Id: Ifaaafcfa7a55beaaf56d8b25fabbe3dc2566350f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
Emscripten's option for enabling asyncify (-sASYNCIFY) is a link-time
option, which means there is no requirement to have a separate asyncify
build, at least for static builds.
Replace the current QT_HAVE_EMSCRIPTEN_ASYNCIFY compile-time option
with a run-time option which checks if the asyncify API is available.
Keep support for configuring with "-device-option QT_EMSCRIPTEN_ASYNCIFY=1"
for backwards compatibility and for the use case where want asyncify
support to be on by default for a given Qt build.
Enable asyncify for the asyncify_exec example.
Pick-to: 6.4
Change-Id: I301fd7e2d3c0367532c886f4e34b23e1093646ad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Includes:
- setting a custom Info.plist
- Bundling non-image assets
- Bundling image assets using asset catalogs
- Bundling app icons
- Bundling a launch screen
Projects added for both qmake and CMake.
The executable uses testlib to check that non-image assets,
icons and asset catalogs were successfully bundled upon deployment
to a device.
Task-number: QTBUG-104519
Change-Id: Iaab6112e31e1098dcd2548e18b58bed5b64e6f83
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Couldn't reproduce flakiness on OpenSUSE KDE/X11 and can't see any
history of flakiness in the last 3 months in our testresults database.
Task-number: QTBUG-62967
Task-number: QTBUG-63262
Change-Id: Id50291798eda922283e04b45205ae9105e9fdab2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Window activation is not working reliably on X11 when combined with
X11BypassWindowManagerHint, see QXcbWindow::requestActivateWindow().
The test itself counts repaints, so qWaitForWindowExposed() shouldn't be
needed.
This way we don't need to QSKIP() the test if window activation fails.
Fixes: QTBUG-98921
Change-Id: I849b7261c757fb7cbcde73f11bbe1a74a862cb9c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Removed entries that do not reproduce on OpenSUSE and that are no
longer flaky in our CI according to our testresults statistics database.
Adjusted entry for resizeAnchor testcase which has been seen flaky in
RHEL-8.4 and cursor2 which is very flaky on macOS.
Task-number: QTBUG-105249
Task-number: QTBUG-105247
Change-Id: I3e258f81d6bbf540a4b3dec763fdfd4bdc511847
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Can't reproduce in OpenSUSE, and no flakiness has been seen in the past
6 months in our testresults statistics database.
Task-number: QTBUG-63260
Change-Id: I465aa4b9f82726e9685f64b0dc235d3235c4bd9c
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Executing the tst_qgraphicsitem::sorting() testcase individually always
fails on my KDE/X11 desktop. The window never seems to have focus and
the call to qWaitForWindowActive() returns error after a few seconds.
It seems qApp->setActiveWindow(&view) never succeeds in giving focus to
the window containing the widget.
Fixes: QTBUG-105221
Task-number: QTBUG-74760
Change-Id: I148dab09d0fb592376b3902e4ed10799f9a52274
Done-with: Axel Spoerl <axel.spoerl@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
This led to an infinite recursion in case the annotation was completely
missing. Instead of trying to fix that, I'm simply implementing the
"### Qt6" request from c62f717226 .
[ChangeLog][qdbusxml2cpp] Removed the old compatibility code that
accepted "In" annotations for signal argument names, introduced in Qt
5.8.
Pick-to: 6.4
Fixes: QTBUG-104722
Change-Id: Ie4bb662dcb274440ab8bfffd1709bfc3daf0846d
Reviewed-by: David Faure <david.faure@kdab.com>
The old stack structure used to keep track of windows has been improved
to conform to the actual windowing assumptions: there shall be one root
window, which is always at the bottom. The first created window
immediately becomes the root window. Should the root window be removed,
all windows are non-root, i.e. any of them can become the top-level window
Fixes: QTBUG-105094
Pick-to: 6.4
Change-Id: Ic553244fa9f5bc3ee590b702935e66cfc62d5f8f
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Running tst_qrhi -platform eglfs will pass on RPi4 / Mesa 22.
This does not test Vulkan of course since the platform plugin cannot
create a Vulkan instance.
Running tst_qrhi -platform vkkhrdisplay will enable Vulkan but will
still try OpenGL since the autotest does not query the platform
integration about OpenGL support. Make this nicer by skipping most of
the GL test if the platform integration we have cannot handle OpenGL
stuff anyway.
For some tests the data-driven approach has to be removed since doing
QFETCH without any rows will crash. These two OpenGL-specific tests
now check OpenGL support directly and QSKIP if needed.
While we are at it, fix up the Vulkan instance API version as well.
Pick-to: 6.4
Change-Id: I2891c04540bc2dfd0ccf475629bd23542bff15f5
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
It purports to be a list of those named in QDateTime's tests, but was
a bit out of date. In the process, sort them into somewhat coherent
order (to make it easier to verify whether one is missing next time I
check) and reformat.
Pick-to: 6.4 6.3 6.2
Change-Id: I16e7ded6f8b00e226513bd06d6174a79f7a0c675
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The _data function is useless without its test function (and it's not
used in other _data functions).
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I7aa6006ed1a9d89008577b750af4ea717dae237f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
If a font family has several instances from different foundries,
we disambiguate this by adding the foundry name in brackets behind
the family. But QFontDatabase::hasFamily() would only check for
families().contains(familyName). So if the database contains e.g.
Foo [Bar] and Foo [Baz] then a check for hasFamily("Foo") would
fail.
So we need to actually check for the family name instead. In
doing this, we also skip the extra step of building the list
and then searching it, but just go directly to the source.
This removes the BLACKLISTing of Ubuntu and also introduces a
QSKIP on Unix-based platforms without fontconfig, since there
is no way to know which default fonts are acceptable on those
platforms.
Pick-to: 6.4
Fixes: QTBUG-86967
Change-Id: Id8ad80a1671daf1c14fbad8bb8f4c51ee1c59709
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The caveat being having to manually create HLSL versions of the hull,
domain, and geometry shaders in parallel with the Vulkan GLSL ones,
while keeping the interfaces intact (stage inputs and outputs, cbuffer
layouts, binding points/registers). This is not always trivial but
typically doable in not very complicated case after inspecting the
SPIRV-Cross-generated vertex/fragment code in the .qsb files. Once
written, the HLSL files can be injected into a .qsb file with qsb -r.
or the corresponding CMake syntax. Conceptually this is no different
from how samplerExternalOES support is implemented for Multimedia.
(there the problem is that the shaders cannot be compiled to SPIR-V
to begin with, here it is that we cannot translate from SPIR-V, but
in the end the workaround for both problems is effectively the same)
The manual tests demonstrate this, both the tessellation and geometry
apps work now with D3D out of the box.
On the bright side, the implementation here in the the D3D backend of
QRhi does not need to know about how the shaders got there in the
QShader. So none of the implementation is dependent on this manual
process. If some day qsb would start translating to these kind of
shaders as well, it would all still work as-is.
Change-Id: I32d9ab94e00174e4bd5b59ac814dfedef9f93ad1
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
As discovered in the expanded testing of QTRY_COMPARE() using the same
class, the timer needs a context object and a slot to call.
This amends commit 35ad157d88
Pick-to: 6.4 6.3
Task-number: QTBUG-104441
Change-Id: I41fc23de84ce8c7d6608db0005276a2071974494
Reviewed-by: Jason McDonald <macadder1@gmail.com>
In the process, simplify the latter while adding some actual
time-variation for the QTRY_* loop to navigate round - based on the
extendedcompare test's ClassWithDeferredSetter. Testing remains
primitive, but is at least a bit more thorough.
Pick-to: 6.4
Change-Id: I40be8fb485f3f18f0a4f4bc62ad36cccac691979
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Jason McDonald <macadder1@gmail.com>
These contain output only ever sent to stderr, which tst_selftests no
longer looks at; it merely verifies stderr is empty for all tests
except those expected to produce stderr output, and ignores the stderr
output for these last.
Change-Id: I50fee445d84c2d125e6db5303fc389e87746455e
Reviewed-by: Jason McDonald <macadder1@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
The way the Qt 6.0 QMetaTypeInterface was designed, using a static
inline variable in a template, would normally require the linker and
dynamic linker to merge all copies and choose a single copy as the
official one. But because of hidden visibility and of Windows DLLs,
QMetaType already copes with multiple copies NOT getting merged. So we
may as well ask the linkers not to bother and use simpler, local
relocations to find those symbols.
They are all supposed to still be equivalent and it's an ODR violation
if they're not.
The Apple ld64 linker complains if you use this type of global
relocation:
ld: warning: direct access in function
[...]
to global weak symbol
'QtPrivate::QMetaTypeInterfaceWrapper<int>::metaType'
Fixes: QTBUG-93471
Pick-to: 6.3 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16f98a10aa719434
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Because of the template shenanigans. This is just to make sure.
Pick-to: 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16f989e7d555894f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
QFileDialog::saveFileContent, QFileDialog::getOpenFileContent are now
using local file APIs to access files on any browser that passes a
feature check.
The feature is thoroughly tested using sinon and a new mock library.
Task-number: QTBUG-99611
Change-Id: I3dd27a9d21eb143c71ea7db0563f70ac7db3a3ac
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This fixes the flakiness seen in OpenSUSE KDE/X11 desktop.
Fixes: QTBUG-70590
Task-number: QTBUG-105177
Change-Id: I7c2431e58b2a60ea04e26d4e70c0f2867d544ff2
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Reviewed-by: Axel Spoerl <axel.spoerl@qt.io>
Use activateWindow() that is documented as the right way to raise a window.
Task-number: COIN-892
Change-Id: Ic9aadee0d3a526fd8e46e5b1099b5b0861700207
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
I can't reproduce the test failing after hundreds of iterations on
OpenSUSE, and the test hasn't flaked at all in our CI in the last 6
months according to our dashboards.
Fixes: QTBUG-70612
Change-Id: I2397f3db5caf97f674de7d75fd99bd14c14166a4
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
I can't reproduce the issue after hundreds of iterations on OpenSUSE,
and the test hasn't flaked at all in the last 3 months according to our
dashboards.
Task-number: QTBUG-66371
Change-Id: I9c4daf851e09fbcb47a6ab39418e7b213ccd9dfe
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
ownMethodIndex works for all kind of methods, also for constructors.
Therefore, remove the assertion there (that checks for non constructors)
and add a test in qtbase so it does not happen again.
The test broken by the assertion is in qtdeclarative:
tst_QJSEngine::newQMetaObject().
Also rename QMetaMethodPrivate::ownConstructorIndex() to
ownConstructorMethodIndex() as the previous naming implied that
ownMethodIndex() could not be used for constructors.
amends b73ab954df
Task-number: QTBUG-105360
Change-Id: I0244993ed79bee055645b5443f5d02e1c089a6c6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Those were workarounds to passing a comma to a macro, but there are ways
around it. The simplest is to just use variadic macros; another, which
has been applied to Q_DECLARE_METATYPE for a long time, is to define an
alias to the thing you're trying to use.
Change-Id: Ie4bb662dcb274440ab8bfffd17097fbf0c53eabc
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
[ChangeLog][CMake] The target-based variant of qt6_add_resource gained
the option BIG_RESOURCES. This can be used instead of
qt6_add_big_resources, which is not target-based.
Fixes: QTBUG-100268
Change-Id: Ib3fa783cbfbfd10f59c2f952bc88508a91f25e26
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The intialSize bug has been fixed in Qt Wayland Client, and thus
this test will now start XPASSing.
Pick-to: 6.4
Task-number: QTBUG-66818
Change-Id: I4b9cb8bd9306a67f04295eb23f09574dad0e97f7
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Fairly minimal for now, just enough to verify a bug and serve as the
sign of success when it's fixed. Tests fail in ways they shouldn't,
for now; see expected_eventloop.* for details, notably "Earlier test
failed to clean up" messages.
Pick-to: 6.4 6.3
Task-number: QTBUG-104441
Change-Id: I59be4aa5f21fed23b19a0593a8c2f6c9956507df
Reviewed-by: Jason McDonald <macadder1@gmail.com>
We need to skip the exifReadComments test case if reading text from
image has been configured off, like in webOS's Yocto recipe for QtBase.
Fixes: QTBUG-105393
Pick-to: 6.4
Change-Id: If45872ca7ed26620fa38bc6b47132363d661acdc
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Using convertDoubleTo() to get a whole number, from which to determine
the number of digits we're allowed before the fractional part, fails
if the double isn't a whole number, which lead to the skip being
checked. Use qFloor() of the double (as this should have as many
digits as the double had before its decimal point, which is what we
care about; qCeil() might round up to a power of ten).
This amends commit ff6d2cb0d5
Fixes: QTBUG-105341
Pick-to: 6.4 6.3 6.2
Change-Id: I4e0105d4602682c59e9830ec9a37556c96db884e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Add basic tests for timers and event processing, for
different use cases such as on the main thread, on
a secondary thread, and with asyncify.
Pick-to: 6.4
Change-Id: Ie0f82b5de97f639867b1e65dbb0ab8b11db86f85
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
The vast majority of in-tree users pass simple and short C string
literals as the value. By porting to QByteArrayView, we document that
we'll accept non-NUL-terminated data, and do the NUL-termination
internally, using SSO'ed std::string, saving memory allocations in the
common case of short strings.
I didn't bother to check which direction std::string takes for
nullptrs these days (there was a change accepted in that area for
C++20 or 23), so play it safe and protect against them.
Follow-up to
Task-number: QTBUG-105302
Change-Id: I2369acc62f1d5cbc26135396cfe0602d8c75300c
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
See also QX11EmbedWidget::QX11EmbedWidget() in src/gui/kernel/qx11embed_x11.cpp in qt4.
https: //github.com/qt/qt/blob/4.8/src/gui/kernel/qx11embed_x11.cpp#L475-L477
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I47504a2d8f3e33c367f092d01ee5d7e1b16b5106
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
All linux CI machines have gtk3 installed. And Python GTK things
are too complicate to setup.
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I3c0d967f61aebea508784df79569b9d0064f66e2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The logging category lcQpaDockWidgets was explicitly declared in
tst_QDockWidget. That failed to complile on static builds.
This patch replaces the explicit declaration with
Q_DECLARE_EXPORTED_LOGGING_CATEGORY(lcQpaDockWidgets, Q_WIDGETS_EXPORT)
Pick-to: 6.4 6.3 6.2
Change-Id: I1cad0e672313be84297eeddf992f6cafe9a35977
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The old code assumed that a QByteArray's data() is always
NUL-terminated. Due to the conflation of owners and non-owners in
QByteArray (but also in case we ever get efficient substringing), this
is not always the case, e.g. QByteArray::fromRawData() does not ensure
NUL-termination.
From QString::utf16(), we learn that the condition to check for is
QArrayData::isMutable(). After working around the fact that
QByteArray::data_ptr() doesn't exist for const QBAs and that empty
QBAs always refer to QByteArray::empty_, which is !isMutable(), we can
detect this situation and re-allocate without introducing new API.
This is the fix for Qt ≤ 6.4. For Qt 6.5, we'll port the function to
QByteArrayView.
Pick-to: 6.4 6.3 6.2 5.15
Fixes: QTBUG-105302
Change-Id: I3416535ab09d601e0e87b2767f2c024ba1217e64
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Explicitly running the install step would fail in a non-prefix build.
Do it conditionally on the no_prefix feature.
Pick-to: 6.4
Change-Id: I78cd63f51c499a0df451b08290c6dfc84e52666c
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Says Clang 10:
tst_qfocusframe.cpp:73:28: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
QTRY_VERIFY(focusFrame = window.findChild<QFocusFrame *>());
~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[...]
tst_qfocusframe.cpp:73:28: note: place parentheses around the assignment to silence this warning
QTRY_VERIFY(focusFrame = window.findChild<QFocusFrame *>());
^
(
tst_qfocusframe.cpp:73:28: note: use '==' to turn this assignment into an equality comparison
QTRY_VERIFY(focusFrame = window.findChild<QFocusFrame *>());
^
==
Amends f1812aad89.
Pick-to: 6.4 6.3 6.2 5.15
Change-Id: I3920ab0da725b76fb6c19bbc7cde7920f351af4a
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
The std::boyer_moore_searcher is buggy for older verions of Microsoft's
STL, and missing in AppleClang's libc++ with an inefficient fall back.
Fixes: QTBUG-100236
Change-Id: Ic3cc916946546d2ef78456cd15e1425d957b989d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Added a parse option that can be passed to setContent(), to specify that
spacing-only text nodes must be preserved.
[ChangeLog][QtXml][QDomDocument] Spacing-only text nodes can now
be preserved by passing the ParseOption::PreserveSpacingOnlyNodes option
to setContent().
Fixes: QTBUG-104130
Fixes: QTBUG-89690
Task-number: QTBUG-90003
Change-Id: Id43730ce5b79a856c4b434d1f1d4dd7c49c25f31
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Since 6.3 these use Qt::UTC as time-spec but I neglected to take that
into account in QDateTimeEditPrivate::init()'s construction of a
QDateTime from the QDate or QTime. This amends
commit c00ee2f310.
Fixes: QTBUG-105322
Pick-to: 6.3 6.4
Change-Id: I11dec9808a54cf7da401b1734a9a2812f5fd2e63
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Change to match how QDateTimeEdit()'s overloads taking a QDate or
QTime work, substituting a default value in place of an invalid one.
This fixes one surprising anomaly in a recently-extended test, so that
it now only fails the way I expected.
Task-number: QTBUG-105322
Change-Id: Ied4da6160b7efe70990f956798fb826b5b36d8bb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The constructor_qdate() and constructor_qtime() tests only tested
QDateTimeEdit with a QDate or QTime. Extend them to also test
QDateEdit and QTimeEdit constructors, respectively. This revealed one
surprise; the QDateEdit constructor doesn't replace an invalid QDate
with the usual start-date, as the QDateTimeEdit does. It also serves
to reproduce a bug reported in Qt 6.3, see Task-number. These are
all marked XFail for now.
Task-number: QTBUG-105322
Change-Id: Ifafb40a9b78d9314b74ca9a1710d362b9a3cb18d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
It makes no sense to pass, as parameters, values that can't vary
between test data rows, so eliminate m{in,ax}imum{Dat,Tim}e
columns. There were no parameters used to control how those would be
set, so they were always going to be the type's defaults.
The displayDateTime was only needed for the invalid test, in which its
value is known and fixed; for the normal test it was necessarily
implied by the parameter used to initialize the QDateTimeEdit. While
the QDate and QTime tests do have to supplement that construction
information, the other part is again known and fixed. We can check the
data-tag against "invalid" to determine which known and fixed data to
use, saving the need for a data table column.
Change-Id: I3754ba1a6a127a4a872a7f4a3e7edad9a5ff0ec0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We already had code to handle attributes on funtcions, but we didn't
handle them correctly for classes so far.
Fix this by simply skipping over the attribute.
Fixes: QTBUG-105310
Pick-to: 5.15 6.2 6.3 6.4
Change-Id: Ic4149f940e74820de4f2fa9540d9dc5b4e626a3a
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Added new setContent() overloads, that:
- take parameter of new ParseOptions enum type for specifying the parse
options that can be used for enabling namepsace processing and, in
future, whitespace-only text nodes, etc.
- use ParseResult for returning the information about error message,
line and coulmn number, instead of three parameters for each.
- use QAnyStringView for a QString input data.
To avoid ambiguities when calling setContent() with one argument,
removed the default argument for errorString from all the overloads.
[ChangeLog][QtXml][QDomDocument] Added new setContent() overloads that
allow specifying different parse options through ParseOptions flags.
These overloads use a new ParseResult struct for returning the
information about an error, and QAnyStringView for passing string input.
[ChangeLog][QtXml][QDomDocument][Potentially Source-Incompatible Changes]
setContent() overloads that take only one argument now return
ParseResult instead of a bool. ParseResult explicitly converts to bool,
so the expressions calling setContent() with one argument will continue
compiling, if they are contextually convertible to bool. If an implicit
convertion is required (e.g. bool b = doc.setConetnt(data)), the result
needs to be explicitly converted to bool first
(e.g. bool b = bool(doc.setConetnt(data)).
Task-number: QTBUG-104507
Change-Id: If6a78f8c9b1458f0e3ae719bfd3703a0b965449c
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
When tst_QDateTime::fromStringStringFormat_localTimeZone_data() skips
due to feature timezone being undefined, it should report that as the
issue, rather than claiming the system doesn't support the particular
zones used in the test.
Change-Id: I9837ac95c6d92317fbec7fcca184f7b7e6f81441
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Also document the (seldom helpful) handling of over-long repeats of a
format. Add test to QDateTime and amend QLocale test.
[ChangeLog][QtCore][QDateTime] Doubling the 'z' format in a date-time
or time format string now produces the same output as a single 'z'.
Previously, this would have produced two copies of the milliseconds
field (eliding any trailing zeros in each). Contrast with 'zzz', which
produces the full milliseconds field, including any trailing zeros.
Change-Id: I4c60462b062fee4079370096d745c191c1939506
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Microsoft recommends to use CoInitializeEx()
and SetWindowLongPtr()/GetWindowLongPtr() in new code.
Use COINIT_DISABLE_OLE1DDE to avoid overhead of
initializing and using obsolete technology.
Pick-to: 6.4
Change-Id: I9d16943e864d4487dd4f46fd9325579c298c52b9
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
CMakeLists.txt and .cmake files of significant size
(more than 2 lines according to our check in tst_license.pl)
now have the copyright and license header.
Existing copyright statements remain intact
Task-number: QTBUG-88621
Change-Id: I3b98cdc55ead806ec81ce09af9271f9b95af97fa
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Add an option to limit the number of tests for building and testing
Android multi-ABI configurations in CI. Currently only Core tests
supposed to run.
Change-Id: Ibb8a41d60d108259ef2675ec54bde2482f87c8b2
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
The rewrites in a1c34d8bd0,
0f76e55bc4 and in commit
b73ab954df didn't do this right, though no
problem ended up happening. In particular, the constructor one failed to
check if there were even more parameters.
Change-Id: I6f936da6f6e84d649f70fffd1706f827ba635584
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Commit 3695b35dfc accounted for pointer to
other incomplete types, but pointer-to-void was missed. This caused an
inconsistency in the stored metatype for void*, which is a built-in type
(QMetaType::VoidStar) but no pointer was recorded.
The test in tst_moc hadn't been enabled because the functions in
questions weren't extracted by moc. That is fixed in this commit.
Change-Id: I6f936da6f6e84d649f70fffd1706f613517a75fb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
...by removing the entire adjustedFormat() helper.
Qt Quick has never used this, which indicates it is not that
useful. Same goes for Qt Multimedia or Qt 3D. Ensuring depth and
stencil is requested is already solved by using
QSurfaceFormat::setDefaultFormat() or by adjusting the formats
everywhere as appropriate.
The helper function's usages are in the manual tests that use it as a
shortcut, and in the GL backend itself. Remove it and leave it up the
client to set the depth or stencil buffer size, typically in the
global default surface format. (which in fact many of the mentioned
manual tests already did, so some of calls to
window->setFormat(adjustedFormat()) were completely unnecessary)
By not having the built-in magic that tries to always force depth and
stencil, we avoid problems that arise then the helper cannot be easily
invoked (thinking of widgets and backingstores), and so one ends up
with unexpected stencil (or depth) in the context (where the GL
backend auto-adjusts), but not in the window (which is not under
QRhi's control).
It was in practice possible to trigger EGL_BAD_MATCH failures with the
new rhi-based widget composition on EGL-based systems. For example, if
an application with a QOpenGLWidget did not set both depth and stencil
(but only one, or none), it ended up failing due to the context -
surface EGLConfig mismatches. On other platforms this matters less due
to less strict config/pixelformat management.
Pick-to: 6.4
Change-Id: I28ae2de163de63ee91bee3ceae08b58e106e1380
Fixes: QTBUG-104951
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Problem description:
--------------------
Assume we have two properties, P1 and P2. Assume further that we assign
a binding to P2, so that it depends on P1. Let the binding additionally
capture some (non-QProperty) boolean, and only create the dependency to
P1 if the boolean is true.
The state afterwards is
P1:[p1vaue|firstObserver]
|
|
v
---[p2binding]
/
P2:[p2value|binding]
If the boolean is set to false, and P1 changes its value, we still
correctly re-evaluate the binding and update P2's value. However, during
binding evaluation we will notice that there is no further dependency
from P2 on P1, and remove its observer.
The state afterwards is
P1:[p1vaue|firstObserver=nullptr]
---[p2binding]
/
P2:[p2value|binding]
Then, during the notify phase, we traverse the observer's again,
starting from P1's firstObserver. Given that it is nullptr now, we never
reach P2's binding, and thus won't send a notification from it.
Fix:
----
We store a list of all visited binding-observers (in a QVarLengthArray,
to avoid allocations as long as possible). After the binding evaluation
phase, we then use that list to send notifications from every binding
that we visited. As we already have a list of all bindings, we no longer
need to recurse on binding-observes during the notification process;
instead, we only need to deal with static callbacks and ChangeHandlers.
The pre-existing notification logic is still kept for the grouped update
case, where we already have a list of all delayed properties, and should
therefore not encounter the same issue. Unifying its codepath with the
existing logic is left as an exercise for a later patch.
Fixes: QTBUG-105204
Task-number: QTBUG-104982
Pick-to: 6.4 6.3 6.2
Change-Id: I2951f7d9597f4da0b8560a64dfb834f7ad86e757
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Sami Shalayel <sami.shalayel@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
We pass a pointer to uninitialized memory to QMetaType::create().
There's no harm because we're using the invalid QMetaType, but GCC is
actually right to complain for any other type.
qtestcase.h:54:25: warning: ‘buf’ may be used uninitialized [-Wmaybe-uninitialized]
qmetatype.h:454:11: note: by argument 2 of type ‘const void*’ to ‘void* QMetaType::create(const void*) const’ declared here
Pick-to: 6.3 6.4
Change-Id: I3859764fed084846bcb0fffd1703eb7967acf0d7
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
QRegularExpression::match (and globalMatch) is currently overloaded
for QString and QStringView. This creates a subtle API asymmetry:
QRegularExpression re;
auto m1 = re.match(getQString()); // OK
auto m2 = re.match(getStdU16String()); // Dangling
This goes against our decision that every time that there's a possible
lifetime issue at play, it should be "evident". Solving the lifetime
issue here is possible, but tricky -- since QRegularExpression
is out-of-line, one needs a type-erased container for the input
string (basically, std::any) to keep it alive and so on.
Instead I went for the simpler solution: deprecate match(QStringView)
and introduce matchView(QStringView) (same for globalMatch). This
makes it clear that the call is matching over a view and therefore
users are supposed to keep the source object alive.
Drive-by, remove the documentation that says that the QString
overloads might not keep the string alive: they do and forever will.
[ChangeLog][QtCore][QRegularExpression] Added the matchView()
and globalMatchView() functions that operate on string views.
The match(QStringView) and globalMatch(QStringView) overloads
have been deprecated.
Change-Id: I054b8605c2fdea59b556dcfea8920ef4eee78ee9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Use the QMetaMethodPrivate::invokeImpl() function we added in the last
commit, without recreating the method signature. Instead, only do a
comparison on the method name and allow invokeImpl() to decide whether
this method can be called with the given arguments. This will allow
invokeImpl() to have more flexibility in deciding if the arguments match,
using the stored metatype information.
Change-Id: I36b24183fbd041179f2ffffd17021a86484bfab6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This adds an internal method to QMetaMethodPrivate to do the work of
actually placing the call on a given meta method. This rewrite should
make the code clearer, but make no otherwise perceptible difference in
behavior.
The next commit will rewrite QMetaObject::invokeMethod to use this new,
internal function to avoid doing a lot of string allocations.
Change-Id: I36b24183fbd041179f2ffffd170219c0deaaf7f5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The certificate was updated recently and doesn't have the same
deprecated hash functions and small key size as the old one did.
Change-Id: I301ad50a96a30483b92a6e30f61e78e8d6b955ca
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This is in use in tst_qdbusinterface.cpp, so let's have it here to make
sure it works:
QVERIFY(QMetaObject::invokeMethod(&iface, "ping",
Q_RETURN_ARG(QDBusVariant, retArg),
Q_ARG(QDBusVariant, arg),
Q_ARG(QDBusVariant, arg2),
Q_ARG(QDBusVariant&, retArg2)));
Change-Id: I36b24183fbd041179f2ffffd170271424c048292
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
We should fail to even find the method. `QString' and `QString&` are not
compatible.
Change-Id: I36b24183fbd041179f2ffffd170259bcf07fd459
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The type MyUnregisteredType needs to be only forward-declared for the
trick to work. The issue is not about registration, because since commit
fa987d4441 ("MetaObject: Store the
QMetaType of the methods"), we will record the meta type of the type
anyway, which will eventually allow the meta object to actually find
this type.
Instead, the tests are valid for a type that is only forward-declared.
Change-Id: I36b24183fbd041179f2ffffd1702182746f7c1b2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
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>
Port the constructor and addData() method to QAnyStringView, but keep
the overloads taking a QByteArray to avoid extra copies when actual
QByteArray is passed. These overlaods need to be Q_WEAK_OVERLOADs, to
avoid ambiguities (e.g. for const char * arguments).
Additionally, add a test to make sure the patch doesn't break parsing
from a QLatin1StringView input.
[ChangeLog][QtCore][QXmlStremReader] Added constructor and addData()
overloads taking QAnyStringView.
Change-Id: I0efaab82a2123271c88407e380f3c67d1099a4a6
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Since wasm doesn't like filesystems that well, we omit this test in
tst_qchar for wasm, this allows us to still run the test without the
case where it needs to read the normalization file.
Change-Id: I37e54d97e119f94e1a9ca53917d0b93183321899
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>