Fix indentation in tst_qlockfile and remove QtTest include in
tst_qcheckbox.
Change-Id: Idf630c6337859dbcc8f644010b941bfe55bb0633
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Previously it only worked when isNull() was false, which is true for
very short lines, even though length() may be non-zero.
[ChangeLog][QtCore][QLineF] QLineF::setLength() will now set the
length if the line's length() is non-zero. Previously, it was
documented to only set the length if isNull() was false; this is a
fuzzy check, so isNull() could be true for a line with non-zero
length().
Fixes: QTBUG-89569
Pick-to: 6.0 5.15
Change-Id: I803e622ad09c85815dde25df8dd3ba6dfcba0714
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
QAbstractItemView::selectionCommand() returned the wrong SelectionFlags
when no event is given since c4366ff018.
Therefore re-add the call to QGuiApplication::keyboardModifiers() when
no event is given and add a unittest for them so it's not removed again.
Fixes: QTBUG-89711
Change-Id: I107357df08c4ff1b1a14d49523401c5e7b428f56
Pick-to: 6.0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Just to avoid validation warnings on systems where the sampling
a D32 texture with linear filtering is not supported.
This is likely not a problem elsewhere: Qt Quick 3D for example
samples the depth texture only with Nearest filtering already.
Fixes: QTBUG-89761
Pick-to: 6.0
Change-Id: I80bf5b7ecfcb3365f4010daa17f2ef00bb206b74
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Even though there is no D3D-specific logic in the windows platform
plugin, meaning a QWindow with either OpenGLSurface or VulkanSurface
(or anything really) is DXGI/D3D-compatible, it now looks like it is
beneficial, and more future proof, if there is a dedicated surface
type.
As the linked report shows, there are OpenGL-specific workarounds
accumulated in the platform plugin, while not being clear if these
are relevant to non-OpenGL content, or if they are relevant at all
still. (and some of these can be difficult/impossible to retest and
verify in practice)
When D3D-based windows use the same surface type, all these are
active for those windows as well, while Vulkan-based windows have
their own type and so some of these old workarounds are not active
for those. To reduce confusion, having a dedicated surface type for
D3D as well allows the logic to skip the old OpenGL workarounds,
giving us (and users) a more clear overall behavior when it comes
to OpenGL vs. Vulkan vs. D3D.
The change is compatible with any existing code in other modules
because any code that uses OpenGLSurface for D3D will continue to
work, using the new type can be introduced incrementally.
Task-number: QTBUG-89715
Change-Id: Ieba86a580bf5a3636730952184dc3a3ab7669b26
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
[ChangeLog][QtCore][QProcess] Added support for
setStandardOutputProcess() with startDetached().
Change-Id: I61278cdb7084127f583c8c017688da392017b44c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
[ChangeLog][QtCore][QProcess] Added support for QProcess::MergedChannels
mode with startDetached().
Change-Id: I953ad2063322015332269522a297f8e2842e438c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
In 1947, Germany had not only a summer time but also a
"Hochsommerzeit", a high summer time. This patch adds a test
creating a QDateTime in the time gap at the beginning of this
Hochsommerzeit on May 11, 1947.
Pick-to: 6.0
Change-Id: Ib81a23914965f092c3e3195e4c7258e5a4e0b30e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Blacklist qfont tests that don't work correctly with qemu.
Task-number: QTQAINFRA-3836
Change-Id: I7f5d4b07428febb0adb82d38203226b5c56a2ad5
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Complete search and replace of QtTest and QtTest/QtTest with QTest, as
QtTest includes the whole module. Replace all such instances with
correct header includes. See Jira task for more discussion.
Fixes: QTBUG-88831
Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44
Pick-to: 6.0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Avoid possible memory leaks by creating the checkbox on the stack, adopt
coding style.
Change-Id: I25f8b9048c8318d2897fd942492254a036c3a706
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
After 6be398 few tests fail/crash with qtcharts.
Fix issue on reallocateAndGraw and avoid accessing
flags on invalid header.
Data::allocate can return invalid header and dataptr,
which takes place if capacity is 0. In code before 6be398
clone method checks if header is not null before resetting
flags. However after b76fbb4 resetting flags is no longer
needed since it is done in allocateGrow.
Task-number: QTBUG-89092
Pick-to: 6.0
Change-Id: I2fde781dad7a0694a5f17ab716f647c2e35f4ff0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
It has been failing consistently, recently.
Pick-to: 6.0
Change-Id: I71b2e8857c3d5ce86ad17864c95aac7265ed9a8a
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
This adds functionality for marking properties (QProperty and related
classes) manually as dirty. This facilliates the integration of bindable
properties with non-binable properties and makes it possible for
bindable properties to change due to external events.
Fixes: QTBUG-89167
Change-Id: I256cf154d914149dacb6cadaba92b13c88c9d027
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
SIOCGIFNAME is now supported on QEMU.
This reverts commit 42b3ed763f.
Change-Id: I79caa371dc798464ab76851d2ea3189ec9eb0c57
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Remove a second argument to the setSocket(qintptr, bool) function as
it makes the API harder to understand.
Change-Id: Ib1852a4e9d96adde35bfbf0fe03b386d9ded395a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Amend aa136d46e1 that changed qRound()
implementation to use __builtin_round() functions on ARM64 which do
not fail "round largest representable float less than 0.5" test,
unlike the simple version of qRound() used elsewhere.
Change-Id: Ic66cb0f826d91cd6a85ad72b646c79ded1c0eeca
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Fixed the following warnings:
- empty expression statement has no effect; remove unnecessary ';'
to silence this warning
- zero as null pointer constant
- no previous extern declaration for non-static variable
- use of old-style cast
- integer conversion warnings
Change-Id: Ieb31b127ce8e3b543aaf88a8e8fc463dcc8bc4e3
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Apparently some library definitions went overboard, link them directly.
Pick-to: 6.0
Change-Id: I009737f7e3edff5619241b700a627dc4e25e6018
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
After f08492c6fd was
merged this bug would manifest as an entry appearing twice
in the chain when a updating an existing entry (insert with
an existing key). This could sometimes result in crashes later
as the list filled up and the list was used in trim() to remove
various entries.
Fixes: QTBUG-89176
Pick-to: 6.0
Change-Id: Ide80160fb4317dc0aefe79eec5dce7ec6813e790
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Historic QDateTime behavior when being asked to create a
QDateTime in the DST gap was to interpret the given date
as if it was in the time before that gap, mapping it to a point
in time after the gap. This has changed with
a04411119e .
Since then, the given date is interpreted as if it was in the
time after the gap, thus being mapped to a point in time
before the gap.
This patch restores the historic behavior.
This was not caught by Coin because machines ran in timezone
"Atlantic/Reykjavik" which does not have DST since 1967.
This patch changes tests to always run in "Europe/Oslo".
Driveby: Test function "findSpring" did some operations in
local time, even though being asked to work in a specific
time zone. Fixed that.
Fixes: QTBUG-86960
Fixes: QTBUG-89208
Pick-to: 6.0 5.15
Change-Id: Iecce5898bf9711a10e7dfc0a25e4bbeaed1c8ade
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Technically, having a single constructor limits the use-cases for this
class. We should take into account that:
- an opened socket descriptor must be available at the moment of
construction;
- the constructor unconditionally enables the notifier (the possible
solution
notifier = new QSocketNotifier(...);
notifier->setEnabled(false);
is suboptimal due to heavy operations inside the event dispatcher);
- for these reasons, QSocketNotifier most often cannot be a member of
another class (we have an extra allocation and indirect access).
This patch addresses this shortcoming by making it possible to set the
socket descriptor at a later point:
[ChangeLog][QtCore][QSocketNotifier] Added setSocket() and an additional
constructor which requires no socket.
Change-Id: I2eb2edf33ddafe99e528aac7d3774ade40795e7a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Added overloads of .then()/.onFailed()/.onCanceled() which take a
pointer of a context object, and invoke the continuations in the
object's thread.
Task-number: QTBUG-86794
Change-Id: I0f3cbb0500695673fc4087af5d4b96b416e3e1ce
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
QTableViewPrivate::heightHintForIndex()/widthHintForIndex() did not
honor spans and therefore returned too big values.
Fixes: QTBUG-89116
Change-Id: I52948902b7eaaa27c092ed39da68950c3840e8e4
Pick-to: 5.15
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
/dev/zero and /dev/null are expected to always be present in any system
(even containers). Unlike /dev/null, you *can* read from /dev/zero so
test that QIODevice doesn't think it is random-access because of that.
/dev/tty is also always present but has an interesting semantic. Could
also try /dev/full, /dev/random and /dev/urandom.
Change-Id: Ia2aa807ffa8a4c798425fffd15d84b60573f2c26
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
This is the most basic way to represent custom transfer functions.
Change-Id: I529fb647ece82c03e85ef77b056d9daf13fe5a61
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Otherwise, it would report that lastIndexOf of an empty pattern
in an empty string doesn't exist. Next commit adds extensive autotests;
for now, disable a broken autotest (which already features a comment
about why it's broken).
Change-Id: I9a0e5c0142007f81f5cf93e356c8bd82f00066f7
Pick-to: 5.15 6.0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
There's an assertion. Found by Google fuzz scan of CBOR data.
Pick-to: 6.0 5.15
Change-Id: I55083c2909f64a1f8868fffd164f1ff3af71605b
Reviewed-by: David Faure <david.faure@kdab.com>
There is an off by one in the implementation of count(): a match
must be attempted even at the very end of the string, because
a 0-length match can happen there. While at it, improve
the documentation on the counter-intuitive behavior of count(),
which doesn't merely count how many times a regexp matches
into a string using ordinary global matching.
[ChangeLog][QtCore][QString] Fixed a corner case when using
QString::count(QRegularExpression), causing an empty in the
last position not to be accounted for in the returned result.
Change-Id: I064497839a96979abfbac2d0a96546ce160bbc46
Pick-to: 5.15 6.0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
test_QFINDTESTDATA is a test which is built and run in the source
tree. It tests usage of relative paths of the Ninja generator, which
only occurs when building in the source tree, so this test cannot
be done outside of the source tree.
Developer's expectation is, however, that an out-of-source build
does not change the source tree. Having "git status" showing
differences after running the tests is irritating. This patch removes
the in-source build files after executing the test.
Change-Id: Ia9fd368c9d54b97a415b63254b45e17bc95ecf45
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
When an eager binding triggers a setBinding call, we end up with a
special kind of binding loop:
setBinding() -> evaluate -> notifyObserver
^ |
| /
----------------------------
We now catch set condition, and set the binding status to BindingLoop
(with a distinct description).
Task-number: QTBUG-87153
Task-number: QTBUG-87733
Pick-to: 6.0
Change-Id: I9f9915797d82eab820fc279baceaf89d7e5a3f4a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
tst_QLineEdit::QTBUG13520_textNotVisible checks that text is visible
if a QLineEdit is set to Qt::AlignRight. To do that, it writes
some text into a line edit and checks afterwards that the first
character is in the left half of the window. This fails if the window
is larger than twice the length of the text used and thus might fail
in multiple situations where Qt is not in full control over the size
of the windows created, as is the case with tiling window managers.
This patch changes the test to not check for the first character in
the left half of the window, but instead check for the first character
be approximately at the expected position.
Pick-to: 6.0
Change-Id: I18f6de356ea20f4744f3a58cd2b1d76f6a9545a4
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
cborlargedatavalidation.cpp:93:60: warning: format ‘%llx’ expects argument of type ‘long long unsigned int’, but argument 2 has type ‘qsizetype’ {aka ‘int’} [-Wformat=]
93 | QTest::addRow("bytearray-too-big-for-qbytearray-%llx", v)
| ~~~^ ~
| | |
| | qsizetype {aka int}
| long long unsigned int
| %x
The cast to size_t is required to make the 64-bit not complain due to
the long vs long long difference.
Pick-to: 5.15 6.0
Change-Id: I00b01c01a66748508ea1fffd164a9add2a2650cf
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
I don't know which of the previous commits caused this: as far as I can
tell, this test should never have passed.
Pick-to: 5.15 6.0
Change-Id: I55083c2909f64a1f8868fffd164e7e8c24eec1f8
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Because CBOR strings are encoded in UTF-8, it's possible that the string
that won't fit a QString in UTF-16 would still fit QByteArray in UTF-8
(e.g., anything US-ASCII and most Latin text).
The previous solution was an improvement because we used to read into a
QByteArray then convert the QByteArray to QString, thus using 3x the
amount of memory (1x in QByteArray, 2x in QString). The previous commit
skipped the middle allocation and made the regular readString() function
do the decoding either directly on source memory or by reading in small
chunks (16 kB).
Future improvement for Qt 6.1: add readStringChunk(char16_t *, qsizetype)
so we can do the validation / skipping at O(1) memory.
Pick-to: 5.15 6.0
Change-Id: I7b9b97ae9b32412abdc6fffd1645458c655cc566
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>