std::function does not have deduction guides in older libc++ (presumably older
than version 10). Omitting the template parameter isn't essential for the test,
so just give it.
Change-Id: Ia9bb91f961b0928203737ec976913effd06433e0
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Use QTRY_COMPARE in the flaky tests instead of waiting.
Change-Id: Ic18fc5fde3fa47f3b3ef21e6acd876bd6990981d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
(cherry picked from commit 0ae6803d39)
Show and activate the widget, otherwise we can't rely on geometry
and gesture event delivery. Use QTRY_ macros in a few more places.
As a drive-by, fix coding style.
Change-Id: If3a13732ae6b07a137fec89e78b7e6b39e066bed
Fixes: QTBUG-82947
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
DeleteLaterWidget is a main application window of the test. So, its
show() function should be called explicitly before starting the main
event loop. Otherwise, it remains hidden for the whole time, which
causes an incorrect emission of QApplication::lastWindowClosed signal
when a dialog window is closed in the middle of the test.
Also, fix synchronization between deferred deletion and timer event.
Change-Id: Id3ce5adbcd9e5e22508825c52025eeea70202354
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In particular, this changed the US currency formats for negative
amounts to be parenthesised versions of the positive amount forms,
rather than having a minus sign after the $ sign. Test updated.
[ChangeLog][QtCore][QLocale] Currency formats are now based on CLDR's
accounting formats, where they were previously mostly based (more or
less by accident) on standard formats. In particular, this now means
negative currency formats are specified, where available, where they
(mostly) were not previously.
Task-number: QTBUG-79902
Change-Id: Ie0c07515ece8bd518a74a6956bf97ca85e9894eb
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
This leads to "make benchmark" actually running the benchmark, which
would be nice, I think. Purged various CONFIG += release or -= debug
lines from the same configurations; those surely only configure how
the test code is compiled, which is more or less pointless; it's the
code under test whose debug/release state matters, and I don't suppose
that's affected by the build config of the test code.
In the process, reduce diversity of the ordering of lines within these
*.pro files and purge some dangling space.
Change-Id: Ia9f9f0ca4c096262de928806bdfa6ea3b9e7b9ba
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
- QPainterPath needs an explicit include now
- QTabletEvent::device() is deprecated
Change-Id: I2d1086847ee2cf5ed63e345c7c2d6eb43897f0e4
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Quit the event loop once the object is destroyed.
Change-Id: I6df1cfe867daacb6af56eb84646be91d98a2f545
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
The test can trigger timeouts in COIN, split into subtests.
Change-Id: I1fa5d52422275f89b2858d90c5979632aa7058e2
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
When doing a shift-select while moving the mouse then the start point
should be based on the start of the current selection and not the
pressed position. If there is no current selection start index, then
we can safely depend on pressed position as this will be the previous
index pressed on.
This resolves an issue introduced by
e02293a76d when fixing QTBUG-78797
Fixes: QTBUG-81542
Change-Id: Ia66c42b220452fdcbc8cfccc05dbc8a3911c3f5e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
QByteArray doesn't like it.
Apply the same protection to QString, which we know uses the same
backend but uses elements twice as big. That means it can contain
slightly more than half as many elements, but exact half will suffice
for our needs.
Change-Id: Iaa63461109844e978376fffd15f9d4c7a9137856
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
When drawing multiple distinct (unconnected) lines (e.g. from
QPainter::drawLines() or a QPainterPath with alternating
movetos/linetos), the dash pattern should not continue from one to the
next, as it should when drawing a connected line (e.g. polyline).
Both the cosmetic stroker and the full stroker does it right, but the
fast rasterizing codepath got it wrong.
Fixes: QTBUG-83048
Change-Id: I3d090f7121726755a0e53cb66b99a5563ac0e1c0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Increasing the sample size of randomly generated test samples reduces
the probability of small deviations from the expected uniform
distribution.
On my machine with the new values the test fails approximately once per
3000 consecutive runs, instead of failing once per 300.
Change-Id: I4d1815504c353290a2fb350b3fd1cbb802f8d559
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
A simple 16k file can produce deep enough recursion in Qt to cause stack
overflow. So prevent that.
I tested 4096 recursions just fine on my Linux system (8 MB stack), but
decided 1024 was sufficient, as this code will also be run on embedded
systems that could have smaller stacks.
[ChangeLog][QtCore][QCborValue] fromCbor() now limits decoding to at
most 1024 nested maps, arrays, and tags to prevent stack overflows. This
should be sufficient for most uses of CBOR. An API to limit further or
to relax the limit will be provided in 5.15. Meanwhile, if decoding more
is required, QCborStreamReader can be used (note that each level of map
and array allocates memory).
Change-Id: Iaa63461109844e978376fffd15fa0fbefbf607a2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
If we detected that the OS supports a version of system forkfd (Linux
pidfd, FreeBSD procdesc), the forkfd_wait() function was using only the
system waiting implementation, which of course can't work for file
descriptors created with FFD_USE_FORK. So just detect EBADF and attempt
again.
If the file descriptor is neither one of our pipes nor a system forkfd,
bad things will happen...
Fixes: QTBUG-82351
Change-Id: I4e559af2a9a1455ab770fffd15f59fb3160b22eb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
Currently depending if user uses QApplication
or QGuiApplication we end up in different behavior
when running post routines. For example QApplication
destructor calls post routines before stopping event dispatcher,
In case of QGuiApplication post routines are called
from QCoreApplication destructor, so no more event dispatcher.
This behavior is not consistent and creates troubles
when releasing resources of web engine.
Attached test will hang on windows with QGuiApplication,
however works fine with QApplication.
Task-number: QTBUG-79864
Change-Id: Ice05e66a467feaf3ad6addfbc14973649da8065e
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Use range-based for and fix deprecation warnings.
Change-Id: I54152b2598e9e4a7a3cc9db9b7072bbabcef7fcf
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Don't introduce another overload with two parameters. Users
want a simple signal to connect to, not another overload. Deprecate
the currentIndexChanged(QString) overload, usage of that can/should
get replaced by currentTextChanged().
This partially reverts commit 11dc7b35c8.
Change-Id: I5e7d16413f3d62b1a5a7a197f510af2c45cdfa55
Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io>
QDateTimeEdit very aggressively prevents user input that would result in
values that are outside the dateTimeRange. While keyboardTracking is on
this makes sense, as otherwise the dateTimeChanged signal would be
emitted after each section, with a value that is outside the range.
However, this prevented users from entering a date that is allowed, but
where sections of the date are above or below the respective section in
the maximum or minimum value.
If keyboardTracking is off, QDateTimeEdit only emits the dateTimeChanged
signal at the end of editing, when focus is lost or the return key is
pressed, and then it enforces that the value is within the range anyway.
This change makes the parser ignore the range during editing if
keyboardTracking is off, thus allowing the user to enter a date where
temporary values are outside the range.
The test makes sure that we don't get signals emitted with out-of-range
values, testing both with and without keyboard tracking.
Change-Id: I00fb9f1b328a3477163f890c4618b40878657816
Fixes: QTBUG-65
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Constantly re-reading the timezone information only to be told the exact
same thing is wildly expensive, which can hurt in operations that cause
a lot of QTimeZone creation, for example, V4's DateObject - which
creates them a lot (in DaylightSavingTA).
This performance problem was identified when I noticed that a
QDateTime binding updated once per frame was causing >100% CPU usage
(on a desktop!) thanks to a QtQuickControls 1 Calendar (which has a
number of bindings to the date's properties like getMonth() and so
on).
The newly added tst_QTimeZone::systemTimeZone benchmark gets a ~90%
decrease in instruction count:
--- before
+++ after
PASS : tst_QTimeZone::systemTimeZone()
RESULT : tst_QTimeZone::systemTimeZone():
- 0.024 msecs per iteration (total: 51, iterations: 2048)
+ 0.0036 msecs per iteration (total: 59, iterations: 16384)
Also impacted (over in QDateTime) is
tst_QDateTime::setMSecsSinceEpochTz(). The results here are - on the
surface - less impressive (~0.17% drop), however, it isn't even
creating QTimeZone on a hot path to begin with, so a large drop would
have been a surprise.
Added several further benchmarks to cover non-system zones and
traverse transitions.
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Task-number: QTBUG-75585
Change-Id: I044a84fc2d3a2dc965f63cd3a3299fc509750bf7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Keypad navigation within a group should work for auto-exclusive buttons,
or for checkable buttons that are in a button group. Since the code
already tests whether the button should be treated like an exclusive
(which implies checkable) button, use the result of that test when
finding the candidate button to move focus to, and not only when
actually changing the checked button and the focus.
Change-Id: I4dc41a90d51a8304483046252ceff0ebfe2a2e52
Fixes: QTBUG-27151
Done-with: david.faure@kdab.com
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Test fails on MinGW 8.1 x86, but not on MinGW 8.1 x86_64.
Task-number: QTQAINFRA-3304
Task-number: QTBUG-69947
Change-Id: Ie9a35bd6d5a8481028cd0ea426d1cf00bd7cf093
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Since the test was refactored and QCursor::setPosition() replaced
with QTest::mouseMove(), the test is completely crippled on macOS,
since it relies on the parts in widget's code, ifdefed with condition
!Q_OS_OSX and commented as "Cocoa tracks popups". Yes it does,
but not for "fake" events generated by QTest. The original test
was introduced when fixing different problems on non-Apple platform(s)
anyway. Let's make QSKIP message saying the truth.
Task-number: QTBUG-63031
Change-Id: If54f195ccc0d4409cc2e7f4ae0b0fbf43989b286
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
QSet and std::(unordered_)set were so far not treated as appendable, as
they lack a push_back method. We do however need support for this in
declarative to enable converting back from QJSValue arrays to sets.
We achieve this by testing for and using the insert method. While vector
has also such a method, it doesn't take a single value, but rather a
position or iterator + value, so the template specialization is not
ambiguous.
Task-number: QTBUG-82743
Change-Id: I74fc7b1b856d9bcd38100b274ba2b69578ea8bbb
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The call of _control87 would crash because of the previous test.
Change-Id: I254efe9c2e9892a473a02663e5ff7016791d5d6d
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
tst_QSocks5SocketEngine::simpleConnectToIMAP() is flaky. It may be
useful to log the socket error, to provide more info in case the
test fails again.
Change-Id: Ia5518dce13fd9da1fa5bfb3d5cf3a52a908b8698
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Sometimes this test would fail due to the session not actually being
reused. The cause of this was that the requests were sometimes being
completed 1-by-1, enabling the individual requests to re-use the
already-connected socket completely because it stayed connected.
Setting the Connection-header to close lets us be sure that
the socket cannot be re-used when the request is finished.
Fixes: QTBUG-82846
Change-Id: I5da8baa50a3a45fb60f1e1613e500e3e9c034fb0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
drawTree() does
QPoint hoverPos = d->viewport->mapFromGlobal(QCursor::pos());
d->hoverBranch = d->itemDecorationAt(hoverPos);
and itemDecorationAt does
const QModelIndex index = q->indexAt(pos);
which might very well be an invalid index.
Change-Id: I7db98871543bd7e1c57fcc475d2646757bf2bb42
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
qDecodeMYSQLType() did not handle FIELD_TYPE_GEOMETRY and therefore the
type for a POINT column was incorrectly treated as QVariant::String.
Even the type can not (yet) be properly decoded to a QPoint, treating it
as QVariant::ByteArray is the better option here.
Fixes: QTBUG-72140
Change-Id: I12e75b326ae3acb75cb36f2e650464528bd43c0e
Reviewed-by: Andy Shaw <andy.shaw@qt.io>