The test expects a very explicit list of events during show, but on
macOS we also get an InputMethodQuery event as a result of the window
becoming active. The test needs to be written significantly to support
these kind of platform differences.
Change-Id: I395c1e9e4e9baf7d9f88f0d067586fc15afb9a16
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
For some reason the firstChild gets the focus when clearing the focus.
This seems to be timing dependent, as removing the 30ms qWait 'fixes'
the issue. So does a processEvent call before minimzing. Both of these
require further investigation.
Change-Id: I62833a5541712f97dc24bc63384fa4c051096537
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
There's a timing issue that affects the position of the vertical
scrollbar when scrolling by pixels.
Change-Id: I29d73574785be539a5870b498a902b1aba887e9c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
It's not clear why this is failing, but we need to blacklist it so that
we can move over to testing macOS 10.14 and 10.15 in the CI.
Task-number: QTBUG-75786
Change-Id: I208d5af92406c5da8d0210e0188568466b78b2a9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
The combobox popup can overlap a little with the button, and that's the
expected behavior.
Change-Id: I245bfce85cb5ee661ceb51dbe0d844492878a2bc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
We were being inconsistent in how we handled this, some tests skipping
while others using QVERIFY. It makes more sense to skip the tests, since
the problem is a missing pre-condition of the test, not the test itself
being bad or exposing real failures in the implementation.
Change-Id: I20eacfe12dbce0b0d926e48cbe2d2772819fa4a5
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
An empty QTextDocument already contains a block; so when the formatting
is fully determined, if the document is still empty, then instead of
inserting a new block, we can set formatting on the cursor, which
affects the pre-existing block, before inserting text. This avoids
leaving a blank line (the default block) above the inserted content.
Fixes: QTBUG-81060
Change-Id: I14e45e300a602493aa59680417d74d4c2b25862d
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Use QStringIterator rather than indexed loops. This fixes handling of
non-BMP code points (which may be lower or uppercase, see the test).
Change also the semantics of the functions, adopting Unicode §3.13
definitions: a string is lowercase/uppercase if it's equal to its
own toLower/toUpper folding.
As a side effect, empty strings are now correctly reported to be
lowercase AND uppercase.
[ChangeLog][Important Behavior Changes] The semantics of
QString::isLower() and QString::isUpper() have been changed to match the
Unicode specification. Now lowercase (resp. uppercase) strings are
allowed to contain any character; a string is considered lowercase
(resp. uppercase) if it's equal to its own toLower() (resp. toUpper())
folding. Previously, a non-letter character would make the string not
lowercase nor uppercase, and the mere presence of an uppercase (resp.
lowercase) letter would make isLower() (resp. isUpper()) return false,
even if the letter wouldn't change under case folding. As a
consequence, now empty strings are lowercase and uppercase.
[ChangeLog][QtCore][QString] Fixed a number of bugs of
QString::isLower() and QString::isUpper(). Empty strings are now
correctly reported to be lowercase (resp. uppercase), and strings
containing code points outside the BMP are now correctly handled.
Note that the behavior of these functions has also been changed.
Change-Id: Iba1398279a072399a9f21295fe75f6e414f3f813
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The windows filesystemwatcher did not watch for attribute changes for
directories (e.g. hidden flag) so it was not in sync with other
backends. Fix it by adding FILE_NOTIFY_CHANGE_ATTRIBUTES to the watch
flags when watching a directory.
[ChangeLog][QtCore][QFileSystemWatcher] Fixed a bug that caused QFSW not
to watch for attribute changes on Windows. Now it will correctly report
when files and directories become hidden or unhidden, for example.
Fixes: QTBUG-80545
Change-Id: I31767a0da899963e3940b4f5b36d1d581e6aa57c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
The actual logging code, qt_message_print(), uses toLocal8Bit(), so
testing by comaring with toUtf8() isn't robust.
Change-Id: I7d6614e4af8c679674dbbf4ff47a88b2b75fc2dc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fix tst_QNoDebug::streaming() to use toLocal8Bit(), to match
QTestLog::ignoreMessage(), which uses fromLocal8Bit().
Change-Id: I65f7b995a582aeab7b7ba61781a229fecd1ed3c3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: David Faure <david.faure@kdab.com>
... in docs, comments, and warnings. Also adopt
some occurrences around there and in the snippets.
Change-Id: Icc0aa0868cadd8ec2270dda794bf83cd7ab84160
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Previously, there was only a Python compile test which triggers
only when PySide2 is found. Rename it to pythonCompile().
Extend the TestEntry structure by adding the base line file
and flags, which represent all special cases found in the code.
Check for the presence of a Python base line file in addition
to the C++ one.
Prototypically add one form. Further forms can be added
on the go.
Task-number: PYSIDE-797
Change-Id: Ic2983fa3cab2399a6809e244f93c663e0212f675
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
This amends a1f4321bbb as the font
families should take precedence over the font family set. If the font
family is already included in the families then it should keep its
placement. Otherwise it should be appended.
Task-number: QTBUG-80475
Change-Id: I0049189c88b6879e57619815ec780960e9c0a300
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
If a type has both a converter to QVariantList and to
QSequentialIterableImpl registered, we would have chosen the
QSequentialIterableImpl version. In the case of types like QJSValue,
this is more costly. With this change we therefore uses the direct
conversion if it has been registered.
The same applies to QAssociativeIterableImpl and
QVariantHash/QVariantMap.
Change-Id: I9c0b5068efe4bfbc5e0598a200e6db59201e9974
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
If the singular fontFamily() is given, then this is obviously the one to
be preferred over any plural fontFamilies(). Make sure it always ends up
first in the list of emitted font families.
Change-Id: I1e3b1ba29721c8298b1a0d4a1e1da49ba5b4e7ac
Fixes: QTBUG-80475
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
When QLocale::Country is set to QLocale::India numbers are written so that
after first three from the right and then after every second will be comma.
E.g. 10000000 is written as 1,00,00,000
Task-number: QTBUG-24301
Change-Id: Ic06241c127b0af1824104f94f7e2ce6e2058a070
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
Reviewed-by: Teemu Holappa <teemu.holappa@qt.io>
This method should not ignore accessibility objects without
corresponding widget. The widget may have parts with their own
QAccessibilityInterface and these can be also focused.
VoiceOver ignores them if they are not returned by focusChild().
QAccessibleTabBar::focusChild() has been implemented to demonstrate
the concept and make tab titles of QTabBar readable by VoiceOver.
Task-number: QTBUG-78284
Change-Id: Id7c62d86154bbd5d47d6bbee8cb7d05268c2e151
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
QItemSelectionModel::columnIntersectsSelection() should honor the parent
according to the docs. For rowIntersectsSelection() this was fixed a
long time ago but columnIntersectsSelection() was forgotten.
Sync the both functions and use range-based for loops as a drive-by.
Fixes: QTBUG-80644
Change-Id: Iaf08f85e2225204d1e6564fa4bb0bc826352ed53
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
This flag is used in QSequentialIterable and QAssociativeIterable to indicate
that the data pointer in VariantData should be deleted after the variant has
been constructed.
The use case for this is
https://codereview.qt-project.org/c/qt/qtdeclarative/+/284151, where we have
a proxy iterator and cannot easily return a pointer to already owned data, as
it is hard to manage its lifetime in the iterator. In contrast, it is clear
that we can release the memory in the QSequentialIterable functions, as it has
already been copied into the QVariant there.
Change-Id: I2b33497d991cd4f752153e0ebda767b82e4bb851
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
ISO date format doesn't allow spaces within a date, although 3339 does
allow a space to replace the T between date and time. Sixteen tests
added to check this all failed. So clean up the handling of spaces in
the parsing of ISO date-time strings.
[ChangeLog][QtCore][QDateTime] ISO 8601: parsing of dates now requires
a punctuator as separator (it previously allowed any non-digit;
officially only a dash should be allowed) and parsing of date-times no
longer tolerates spaces in the numeric fields: an internal space is
only allowed in an ISO 8601 date-time as replacement for the T between
date and time.
Change-Id: I24d110e71d416ecef74e196d5ee270b59d1bd813
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fix some tests in tst_QSqlQuery:
- make sure to use QSql::HighPrecision in tst_QSqlQuery::precision()
(needed for psql)
- remove outdated stuff for mysql 3.x
- psql_bindWithDoubleColonCastOperator: the placeholder are stored as
named placeholders in psql
- avoid some useless old-style casts
Change-Id: I54d29a7e24f17d853cce6baa09a67d9278098810
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
The platform window may create or destroy its surface from other entry
points than the QWidget API, in which case QWidget needs to sync up
its own state to match. In particular WA_WState_Created and the winId
needs to be recomputed.
Fixes: QTBUG-69289
Fixes: QTBUG-77350
Change-Id: I769e58ead3c2efcf8c451c363108848feade9388
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Windows apparently has special code to deal with those addresses. If all
your network interfaces are up and have acquired addresses, then the
link-local network at 169.254.0.0/16 is unreachable. I had never caught
this because both my Windows VM and my bare metal Windows have inactive
interfaces (like the Bluetooth PAN one) and, when inactive, Windows
assigns a link-local address. But in the CI, the interface(s) were all
up and running, causing this issue.
Unix systems don't treat IPv4 link-local any differently, so they always
worked, so long as any interface was up and there had to be one to reach
the network test server.
This commit reworks the test to add test addresses based on the
addresses found on up & running interfaces (see tst_qudpsocket.cpp). For
IPv4, we flip the bits in the local portion of the address. For IPv6, we
add a node with an address I generated randomly (non-universal), with
the same scope.
Fixes: QTBUG-65667
Change-Id: I568dea4813b448fe9ba6fffd15dd9f482db34991
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
In some cases when editing the text (for example when removing the
selected text, or pasting a text block) the text cursor position is
updated, but its visual x position is not updated. This causes the next
cursor movements to start from a wrong position.
Force the update for those cases.
Fixes: QTBUG-78479
Change-Id: Ia496be62beec58660f5e1695e5aafae09c79684e
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Cite RFC 3339 as basis for allowing a space in place of the T, too.
The RFC mentions that ISO 8601 accepts t and z for T and Z, so test
for them case-insensitively. Add a test for this.
Change-Id: Iba700c8d74d485df154d27300aab7b1958e1ccef
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
If milliseconds were followed by a space, the space was included in
the count of "digits" read as the fractional part; since we read (up
to) four digits (so that we round correctly if extras are given), a
harmless apce could cause scaling down by too large a power of ten.
Since QString::toInt() ignores leading space, we were also allowing
interior space at the start of the milliseconds, which we should not,
so catch that at the same time. Added tests, including one for the
rounding that's the reason for reading the extra digit, when present.
Fixes: QTBUG-80445
Change-Id: I606b29a94818a101f45c8b59a0f5d1f78893d78f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
QDateTime is a friend of QTimeZone, so can access its internals; but
it must check the zone is valid before doing so.
Expanded tst_QDateTime::invalid() and made it data-driven to catch the
failure cases.
Commented on a test-case that caught a mistake in my first attempt at
this, and on QDateTimeParser's surprising reliance on a quirk of
QDateTime::toMSecsSinceEpoch()'s behavior.
Fixes: QTBUG-80146
Change-Id: I24856e19ff9bf402152d17d71f83be84e366faad
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
When cloning a QTextDocument, the text fragment of the original document
is copied into the new one, which results into copying also the
formatting attributes. However, when the text document is empty, the
corresponding text fragment is also empty, so nothing is copied.
If we want to transfer the formatting attributes for an empty document,
we need to set them explicitly.
Fixes: QTBUG-80399
Change-Id: I382cd0821723436120af47c06ec7bfa849636307
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
We forgot to reset the flags when replacing the element, so we ended up
with an integer with HasByteData after:
testMap[0] = QStringLiteral("value");
testMap[0] = 42;
Fixes: QTBUG-80342
Change-Id: Ia2aa807ffa8a4c798425fffd15dabfa066ea84b0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
The code was assuming that if the parsing of the value worked,
then it must be a list of 4 variants. But in this case it's just
a single length.
This came from <td> using 4 values for border-width
while other elements use a single value. But the storage
is shared. So the fix is to use 4 values everywhere.
When reading 4 and there's only one, it gets duplicated,
so the caller can just use the first one in that case.
Task-number: QTBUG-80496
Change-Id: I682244b6e3781c4d673a62d5e6511dac263c58e8
Reviewed-by: Nils Jeisecke <nils.jeisecke@saltation.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
We need to reset the pressed index when the decoration was pressed on
otherwise if the mouse ends up over an already selected item that was
previously clicked on. This prevents it from thinking that the mouse
has been released on this item right after pressing on it.
Fixes: QTBUG-59067
Change-Id: Iab372ae20db3682ab0812661f86533079ba4083c
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Instead of OID as string, OpenSSL returns a human-readable name.
No need to fail then, use such a name in QVERIFY if OID not found.
Fixes: QTBUG-80329
Change-Id: I4392fc9f37367f7c34c05d172db015b44e2a8497
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
macOS fails to create a zone for the name its own systemTimeZone
claims to have (see new comment). So make sure we do consistently
recognize the name systemTimeZoneId() returns, using systemTimeZone
from which we got its name.
Add minimal testing of system time-zone.
Fixes: QTBUG-80173
Change-Id: I42f21efbd7c439158fee954d555414bb180e7f8f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
When the geometry of a hidden widget was set with setGeometry(),
WA_PendingMoveEvent and WA_PendingResizeEvent were set unconditionally
even if the crect already had the correct value. This lead to
unneeded Move/Resize events within sendPendingMoveAndResizeEvents().
Fixes: QTBUG-75475
Fixes: QTBUG-79906
Change-Id: Ibbe03882f039948b6b7c04887420741ed2e9c0f7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
The ones we reject used a zero offset while the one that does parse
(though it shouldn't - revised comment) has a one hour offset. Made
them all use that offset and added a partner test that has no invalid
characters, so ensure the success of the invalid character tests isn't
due to falsely rejecting the valid date/time text to which the invalid
characters are added.
Task-number: QTBUG-80038
Change-Id: I6e3dd79b981af6803e60877229c56599cfd719cb
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The qdatetime implementation's rfcDateImpl() uses regexes which did
not match its comments; nor did either the regexes or the comments
match what was documented. A review of relevant RFCs suggests we
should revise this in future, probably at Qt 6.
The documentation also only addressed the formats recognized when
parsing a date-time, without indicating how they are serialised or how
dates and times are handled separately.
Added a note to the tests for the read-only formats, to remind the
reader that the RFCs merely recommend recognising these - be
permissive in what you expect and strict in what you deliver.
Change-Id: I0f0bec752e7a50bde98cceceb7e0d11be15c6a6f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
We already did that when parsing from CBOR binary data, so the code was
already present.
[ChangeLog][QtCore][QCborValue] The constructor taking a CBOR tag and a
value to be tagged now attempts to convert to a QCborValue extended
type. For example, if the tag is 0 (UnixTime_t) and the payload is a
number, the resulting object will become tag 1 (DateTime) and the
payload will be the the ISO-8601 date/time string.
Fixes: QTBUG-79196
Change-Id: I6edce5101800424a8093fffd15cdf650fb2fc45c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
QDomElement::setAttribute(QString, double) did not use QString::setNum()
but qsnprintf(). This is wrong because qsnprintf() is using the current
locale instead QLocale::C. It was also inconsistent to
QDomElement::setAttributeNS() which was already using QString::setNum().
Also fix the documentation which stated that all
QDomElement::setAttribute() format the values according the current
locale.
Fixes: QTBUG-80068
Change-Id: Iabb0b39c0d0723060527542c283a5435f26f31ca
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Allegedly Apple has fixed the bug that made this necessary, so we
should be able to include these two test-cases once more.
This reverts commit ba9585bd02.
Fixes: QTBUG-69875
Change-Id: I5ac6019c0d647691eda6cdbb2a53e7471859d4a3
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Consider this simple example:
QLineEdit edit;
edit.setInputMask( "9-9-9-9-9-9" );
edit.show();
Without any input, m_text will contain: " - - - - - ". text() removes
the input mask's mask characters from that and returns " ". A string
with 6 spaces. Thus currently the End key jumps to position 6, which is
in the middle of the string. Using m_text the End key jumps to the actual
end.
[ChangeLog][QtWidgets][QLineEdit] Fixed End key in combination with
certain input masks.
Task-number: QTBUG-16187
Task-number: QTBUG-20414
Change-Id: Ibb30a1dfa2f78103611b5afc9971dc43e8bdcc4a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>