Commit Graph

10261 Commits

Author SHA1 Message Date
Tor Arne Vestbø
009abcd7b6 QWidget: React to platform surface being created or destroyed
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>
2019-12-09 17:43:22 +01:00
Thiago Macieira
c4b0ff4855 tst_QNetworkInterface: don't force an IPv4 link-local address
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>
2019-12-07 10:20:27 -08:00
Olivier Goffart
4c3c63d4cb QMetaType: add more static-less API
In prevision to Qt6 which is going to discourrage the use of the integer id,
add some missing API to the staticless QMetaType API:

 - Add a way to construct a QMetaType from a type without calling qMetaTypeId:
   QMetaType::fromType<T>()
 - Add equality operators
 - Add a QMetaType::name() function
 - Add a default constructor (by adding a default parameter to the existing ctor)

Change-Id: I95487c1c31bdf0d773717daa9d5452cbced30673
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-12-07 10:32:29 +01:00
Sona Kurazyan
29adc0eed9 Fix updating the text cursor position after editing
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>
2019-12-06 15:52:35 +01:00
Edward Welbourne
6b5f848ebd Allow lower-case for the T and Z in ISO 8601 date format
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>
2019-12-06 14:47:27 +01:00
Edward Welbourne
653c1aab18 Fix handling of trailing space at the end of an ISO date-time
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>
2019-12-06 14:46:48 +01:00
Edward Welbourne
49063c34d6 Fix crash when a date-time has an invalid time-zone
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>
2019-12-06 14:44:18 +01:00
Giuseppe D'Angelo
b19220d17f QByteArray: add a strict mode to fromBase64
QByteArray::fromBase64 was liberal in its input, simply skipping
over invalid characters. As a side-effect of this, it had
no error reporting, meaning it could not be used to convert
fromBase64 _and_ validate the input in one go.

Add more option flags to make fromBase64 strictly validate
its input. Since we want to know whether it has succeeded
or not, and the existing fromBase64 overloads do not
allow for that, introduce a new function that returns
an optional-like datatype.

While at it: base64 decoding can be done in-place; add an
rvalue overload to enable this use case.

[ChangeLog][QtCore][QByteArray] Added the new fromBase64Encoding
function.

[ChangeLog][QtCore][QByteArray] Added new flags to make
fromBase64 / fromBase64Encoding strictly validate their input,
instead of skipping over invalid characters.

Change-Id: I99cd5f2230f3d62970b28b4cb102913301da6ccd
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-12-05 21:04:50 +01:00
Friedemann Kleint
843be88e29 Manual High DPI test: Add a page logging all screen change signals to Metrics
Turn the Metrics widget into a QTabWidget and add a tab logging
all changed signals of QScreen.
This is useful when for example debugging issues with lock screens and
laptop hibernation.

Task-number: QTBUG-79248
Task-number: QTBUG-76902
Change-Id: Ie86789fe1514cb3333a5f3def7f613f217fa6802
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-12-05 18:37:00 +01:00
Sona Kurazyan
81459dd9c0 Copy formatting attributes when cloning an empty QTextDocument
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>
2019-12-05 17:34:02 +01:00
Thiago Macieira
1f592da7f1 QCborValue: fix replacing of elements with byte data with ones without
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>
2019-12-05 07:59:07 -08:00
Dimitrios Apostolou
75f75e997a docker-compose now brings up the docker images tagged as "latest"
This is so that we can do simple changes to the docker images
in provisioning, without needing to update the tag here.

If a backwards-incompatible change in the docker images needs to be committed
in provisioning and here, it is possible because the images retain their old
unique SHA1 tag, in addition to being tagged as latest. See comment for more
details.

Requires the change in qt5 repository, with commit sha:
e4f9ac5607a329bae045567a339d36469bc4fff6

Task-number: QTBUG-79867
Change-Id: I1bc72edec62487530575d7e113a25afe16d09129
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-12-05 15:40:00 +01:00
Lars Knoll
7b34da9ef1 Add QHash::insert(const QHash &other)
As opposed to unite(), this inserts one hash into the other
without duplicating elements.

Change-Id: Ifc786c48f5dc3ab18c29782e73eac3c1a3ef8981
Reviewed-by: Anton Kudryavtsev <antkudr@mail.ru>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-12-05 11:50:32 +01:00
Fabian Kosmale
3359b29c99 QDoubleValidator: Fix thousand separator handling
QDoubleValidator would accept "1,23" as valid in a locale which has ','
as a thousand separator. However, it should have been Intermediate
instead, as there is still one digit missing.

Fixes: QTBUG-75110
Change-Id: I6de90f0b6f1eae95dc8dfc8e5f9658e482e46db3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-12-05 11:30:24 +01:00
Paul Olav Tvete
913146ccd4 RHI: new native texture API
The new version takes/returns a value that can be unpacked and passed to
other functions without knowing which backend is in use.

The old API will be removed in a later change when dependent modules have
been updated

Task-number: QTBUG-78570
Change-Id: I18d928ceef3cb617c0c509ecccb345551a7990af
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-12-05 10:04:46 +01:00
Qt Forward Merge Bot
d025c1a75f Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ia70e81943ef097941339f9ef9ace28592a2eb740
2019-12-04 01:00:07 +01:00
Dimitrios Apostolou
7cf8c993c7 Fix flaky test tst_QFiledialog::clearLineEdit()
Task-number: QTBUG-76989
Change-Id: I3ec7f65500476346e1a8f1017c6452517a660860
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-12-03 19:57:03 +01:00
David Faure
9f79ab360f Fix assert in QTextDocument CSS parser on "border-width: 1pt"
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>
2019-12-03 17:54:24 +01:00
Joni Poikelin
8310d636be Fix serializing QUuid with QDataStream with Qt 4 stream versions
Fixes: QTBUG-76103
Change-Id: Iac92c33539940f5f67d014db5240c6dc14bfb772
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-12-03 13:28:22 +02:00
Ulf Hermann
25bcd8f08b Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2019-12-03 06:58:19 +01:00
Heikki Halmet
ad1810e321 Blacklist tst_QNetworkInterface::localAddress(linklocal-ipv4) on Windows
This will blacklist this test for ci. Currently blocking enabling tests
for MSVC2019

Task-number: QTBUG-65667
Task-number: QTQAINFRA-2875
Change-Id: I7198490b1529ce2f4409bfa7399031dad7644a06
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-12-03 05:57:26 +00:00
Ulf Hermann
e62d04b933 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/corelib/serialization/qcborvalue.cpp

Change-Id: I675a3029955c96e81a33ed9d98b72b55b6784b52
2019-12-03 06:57:05 +01:00
Samuel Gaist
f81f21151d Session management for macOS
This patch aims to implement the session management available on macOS.
Currently applicationShouldTerminate is just a go through that closes
everything and ends the application. The new implementation calls
first appCommitData and cancels the termination properly if required.
This means that if a user wishes to logout, Qt applications can now
cancel that like e.g. answering to Safari asking whether it is ok to
close because of a number of opened tab/window.

Fixes: QTBUG-33034
Change-Id: Id5d7416cb74c762c5424a77c9c7664f0749da7f6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-12-02 18:18:22 +01:00
Mårten Nordheim
f881d00a4f QWindowsFontDatabase: Check preferred family names for all fonts
The code was initially introduced in
9204b8c31e but getting the names were
conditioned on whether or not Windows identified it as a truetype font.
This excluded cases which had preferred names embedded but was not
truetype fonts. To fix that we run the code unconditionally.

[ChangeLog][Windows] Fixed a bug where some fonts would not be
accessible by referencing their typographic name.

Fixes: QTBUG-78556
Change-Id: I8823684b09cce3b1b8722b1e609a5bb49b13da13
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-11-29 09:31:21 +01:00
Andy Shaw
985f491024 QTreeView: Reset the pressed index if the decoration was pressed on
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>
2019-11-29 06:53:10 +00:00
Allan Sandfeld Jensen
00c869a5c6 Fix lancelot PaintCommands for reuse
Some structures needed to be cleaned for the reuse to be safe.
Reusing it cuts down on the overhead in lancebench.

Also uniqueness of block names are now enforced, and the common pattern
of "end_block blockName" could now be parsed if not always commented
out by begin_block handling.

Change-Id: I0daf6445292383aaab9392550d0842e0a654ad27
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-11-28 19:52:16 +00:00
Timur Pocheptsov
67bbe28d67 tst_qsslcertificate: fix subjectAndIssuerAttributes
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>
2019-11-28 17:12:26 +01:00
Friedemann Kleint
43c8596be5 More polish of the manual High DPI test
The aim is to make it suitable to test for High DPI
bugs, ideally removing the need to provide bug report
examples.

- Add descriptive window titles/output
- Add options to force scaling on/off
- Change the updating of the text to be done in screenChanged()
  and log the signal.
- Rearrange the layout and show the descriptions as labels

Task-number: QTBUG-80323
Change-Id: Ia44c184c2b38cb18045c40b440fe785c6c17925f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-11-28 14:26:25 +01:00
Friedemann Kleint
c94e756f01 Polish the manual High DPI test
- Use C++ constructs like range-based for, member initialization
- Fix formatting in a few places
- Silence clang warnings:
  - Add override
  - Make member variables private

Task-number: QTBUG-80323
Change-Id: I5b0fda06acb6c8054aafa4dd934b763f8493a6b3
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-11-28 14:26:19 +01:00
Edward Welbourne
cfd2f3c46e Work around macOS's inconsistency in naming of India's time-zone
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>
2019-11-28 14:16:33 +01:00
Christian Ehrlicher
4422a9bd88 QWidget: don't set WA_PendingMoveEvent when geometry does not change
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>
2019-11-27 20:00:45 +01:00
Christian Ehrlicher
e70fe301d9 Widget autotests: replace deprecated QWidget::repaint() calls
Replace QWidget::repaint() with update() + wait until the paint event is
received.

Task-number: QTBUG-80237
Change-Id: I57da7cd8fa119344484b849a88729bca7b48616c
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-11-27 19:11:25 +01:00
Laszlo Agocs
64760504e7 rhi: Allow testing QRhiRenderPassDescriptors for compatibility
For Metal and Vulkan this needs actual work because that's where
the concept of renderpass descriptors is relevant. GL and D3D can
just return true always.

The big benefit of this is that Qt Quick can now compare renderpass
descriptors via isCompatible() for its pipeline cache (similarly to
how it is already using isLayoutCompatible() for srbs), and so
renderpass descriptors for layers (Item.layer, ShaderEffect) will
typically be compatible and so can pick up pipelines created by other
layers from the cache.

Also add autotests for shader resource binding and renderpass descriptor
compatibility.

Task-number: QTBUG-80318
Change-Id: I0008bc51c4ee13b0113d2c8caf799e1257f18a18
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-11-27 19:07:36 +01:00
Edward Welbourne
52affd322c Be consistent in the RFC2822Date invalid character tests
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>
2019-11-27 18:27:43 +01:00
Edward Welbourne
0debb205b2 Permit leading space at start of RFC 2822 Date format
Relevant RFCs explicitly permit such space.

Change-Id: I8eb444e96287368cbbf973c77513b43d1d36f972
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-11-27 18:27:43 +01:00
Edward Welbourne
6566157df3 Make Qt::RFC2822Date's doc match up with its implementation
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>
2019-11-27 18:27:43 +01:00
Laszlo Agocs
f3c37c839c Enable QRhi Metal backend on iOS
While we are at it, remove the Border and MirrorOnce wrap modes that have
not been supported on OpenGL, because they are unsupported with Metal+iOS
as well.

Task-number: QTBUG-78580
Change-Id: I0db94b9d3a6125b3bb5d7b1db5d02a42cd94d2c2
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-11-27 09:51:28 +01:00
Friedemann Kleint
d556d7a6b8 Avoid initializing QFlags with 0 or nullptr in tests
Amends qtbase/af2daafde72db02454d24b7d691aa6861525ab99.

Change-Id: Ib5d17611e43e7ab2c63c7f0587f549377f262e32
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-11-26 09:08:51 +01:00
Sona Kurazyan
ccc2133c64 Port QDomDocument to QXmlStreamReader
Reimplement QDomDocument using QXmlStreamReader and switch to the new
implementation starting from Qt 6.

The changes in the behavior are reflected in tests: some test cases
which were marked as "expected to fail" are now passing.

Task-number: QTBUG-76178
Change-Id: I5ace2f13c036a9a778de922b47a1ce35957ce5f6
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-11-26 09:07:26 +01:00
Thiago Macieira
bcbefcd645 QCborValue: Extend the constructor to also create extended types
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>
2019-11-23 02:14:42 +01:00
Thiago Macieira
8027fb60dd Fix QCborValue::toCbor with non-ASCII URLs
Found while fixing QTBUG-79196.

Change-Id: Ia2aa807ffa8a4c798425fffd15d841657def99af
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-11-23 02:14:39 +01:00
Qt Forward Merge Bot
59a705e371 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2019-11-23 01:00:34 +01:00
Qt Forward Merge Bot
a5e4a67e8b Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I1c68f2f6bc35d344c60a1898b68bf2ca79e54a9d
2019-11-23 01:00:23 +01:00
Christian Ehrlicher
96c27eb710 QList/Table/TreeWidgetItem: Allow reseting values by passing the default value
The convenience functions setBackground(), setForeground() and
setSizeHint() a default constructed value as 'reset'. This means a
default constructed QBrush or QSize is returned in the data() function
which leads to an unexpected background or forground color or size hint.
Therefore check if the passed value is a default constructed value and
set an empty QVariant instead which.

[ChangeLog][QtWidgets][ItemViews] The convenience views
QList/Table/TreeWidgetItem now treat a default constructed QBrush or
QSize as an empty QVariant which allows to reset the values set to it's
default values.

Task-number: QTBUG-76423
Change-Id: I840570bbad3e5fd8c5b4b58903b4fd0066dbdeb7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-11-22 22:02:15 +01:00
Robert Loehning
924887965c Fuzzing: Update location of testcases in Readme
At the time of writing, they were still planned to be in qtbase.

Change-Id: I27cba2bbd176d930990270ea68f077ec6e0a2d5b
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-11-21 13:41:18 +01:00
Allan Sandfeld Jensen
af2daafde7 Deprecate constructing QFlags from a pointer
This was used to support QFlags f = 0 initialization, but with 0 used
as a pointer literal now considered bad form, it had been changed many
places to QFlags f = nullptr, which is meaningless and confusing.

Change-Id: I4bc592151c255dc5cab1a232615caecc520f02e8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-11-20 19:43:38 +01:00
Qt Forward Merge Bot
1315133233 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ic4ffd206bdd3ed68fd3d21a93818923e8d3a1e7a
2019-11-20 01:00:51 +01:00
Kari Oikarinen
315c2c468e tst_QScopeGuard: Remove unused lambda capture
qt5/qtbase/tests/auto/corelib/tools/qscopeguard/tst_qscopeguard.cpp💯38:
      warning: lambda capture 'caught' is not used [-Wunused-lambda-capture]
        auto cleanup = qScopeGuard([&caught] { s_globalState++; });
                                    ~^~~~~~

Change-Id: I0d9b85896594f3ea35c8003846d4ac7ab5e33d16
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-11-19 18:33:43 +02:00
Christian Ehrlicher
d7cb21ac08 QDom: use QLocale::C when converting a double to a xml attribute
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>
2019-11-19 17:33:33 +01:00
Qt Forward Merge Bot
587f1cbc5d Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I4e5c8a1fcef443c3383e207102f21d41000ff322
2019-11-19 01:00:12 +01:00
Edward Welbourne
4218c3044d Revert "[macOS] Skip test that triggers a buffer overflow in CoreFoundation"
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>
2019-11-18 10:15:39 +01:00
Christian Ehrlicher
360df2cf74 QComboBox: add property placeholderText
QComboBox had no option to tell the user that he must select an item -
there was no placeholder text like e.g. in QLineEdit. This feature is
widely used in html forms so we should support it also.
Therefore add a new property 'placeholderText' to specify a text which
should be shown when the current selected index is invalid.

[ChangeLog][QtWidgets][QComboBox] QComboBox got a new property
'placeholderText'

Change-Id: If6dac45c9f43455474e267907b0b0d893301c611
Fixes: QTBUG-1556
Fixes: QTBUG-2776
Fixes: QTBUG-77141
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-11-15 20:45:24 +01:00
Qt Forward Merge Bot
5abb976f23 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2019-11-15 16:30:51 +01:00
Qt Forward Merge Bot
adc7bbe910 Merge remote-tracking branch 'origin/5.14' into 5.15
Conflicts:
	src/gui/rhi/qshader.cpp
	tests/auto/corelib/time/qtimezone/tst_qtimezone.cpp

Change-Id: I1c4ae718eb3592a0a0a90af9d11553f3ab68cad5
2019-11-15 16:29:40 +01:00
Daniel Teske
9f48f1ebc2 QLineEdit: Fix End key for input masks
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>
2019-11-15 13:40:05 +02:00
Christian Ehrlicher
a4751f8824 QShortcut: add pmf ctor overloads
Provide pointer to member function overloads for the QShortcut ctor. The
ctor with two functors but no contexts is not provided since it creates
ambiguousness.

[ChangeLog][QtWidgets][QShortcut] QShortcut ctor has now pmf overloads

Fixes: QTBUG-77816
Change-Id: Ic9a759cde5150dbb94c2fd351b88ee8e447e0852
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-11-14 19:59:23 +01:00
Christian Ehrlicher
c15a069830 QTreeView: make sure to not ask the old model during setModel
Within QTreeView::setModel() the header might emit columnCountChanged
which then tries to update the geometries based on the old model which
is wrong.
Fix it by setting geometryRecursionBlock to true so
QTreeView::updateGeometries() will not ask the old model for it's data.

Fixes: QTBUG-75982
Change-Id: Ia0dd36cd7c6c5347fbc285deac43da6941accbe7
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-11-14 20:47:45 +02:00
Robert Loehning
6e42ed217c configure: Add sanitizer "fuzzer-no-link"
Adds instrumentation for fuzzing to the binaries but links to the usual
main function instead of a fuzzer's. The similar sanitizer "fuzzer"
should then be used only for building the test itself.

Requires clang 6 or higher.

Change-Id: I24ee1f018b0b97f2977dc86fbdc29a164d7c4e01
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-11-14 15:45:02 +01:00
Edward Welbourne
ad11cab484 Allow longer time-zone components on Android
Android uses its own time-zone naming, which includes a zone called
"Canada/East-Saskatchewan", whose second component is 17 characters
long. This violates a rule in the IANA naming scheme for zones, that
limits components to 14 characters each. So tweak the isValidId()
check to allow Android its long names.

Android has added Outer Mongolian time-zones, which are as borked as
many others in 1970, so blacklist those transitionEachZone() tests.

Fixes: QTBUG-69128
Change-Id: I46f674f095431335b16900860d83b624257ae3bb
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2019-11-14 10:47:57 +01:00
Robert Loehning
6961d46b6e Fuzzing: Add comment how to recude noise in iccparser's fuzzer
With logging enabled, all the output will slow down
execution and fill up your hard disc in about a day.

Task-number: QTBUG-79050
Change-Id: I5dcac2f349f7dbe471a5e6dd7006b89d312aeeaf
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-11-13 12:37:44 +02:00
Edward Welbourne
17b8a49fde Move some tests of QTimeZonePrivate::isValidId() to where they belong
They were tucked away in the back-end of the isTimeZoneIdAvailable()
test, but a separate isValidId() test had been added more recently,
which made some (arguably all) of them redundant. Reworked this test
in the process, so that the QSKIP() happens in _data() once instead of
in the test that's never run because there are no data rows.

Change-Id: Icaa6227ace9a1aa944d085691cdcfb3adf4a51dc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-11-13 10:52:00 +01:00
Ryan Chu
004e3e0dc2 Make Qt aware of NTFS Junctions on Windows
On NTFS, a junction point can be created and deleted by the mklink and
rmdir commands, respectively. If a directory is not identified
correctly as a junction, then applications will likely try to remove
it using recursive methods, leading to fatal data loss.

With this change, Qt can identify file system entries as junctions,
allowing applications to use the correct file system operation to
remove it.

The test needs to delay the cleaning up of junctions and files it
creates until the checks are complete; since they might fail and make
the test function return prematurely, use a scope guard.

[ChangeLog][QtCore][QFileInfo] Add QFileInfo::isJunction so that
applications can recognize NTFS file system entries as junctions

Task-number: QTBUG-75869
Change-Id: I3c208245afbd9fb7555515fb776ff63b133ca858
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-11-09 00:47:45 +01:00
Friedemann Kleint
1dd83dd202 Diaglib/Windows: Output more information on geometry for native handles
Obtain the client area and output frame and position relative to the
parent window.

Task-number: QTBUG-79861
Change-Id: I193dfbcdec7e27d32a70ada08ba271260eedc969
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2019-11-08 11:34:11 +01:00
Qt Forward Merge Bot
78c687f98e Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I963b5f48b5d6f3500ca379fbd7f1a4290b570175
2019-11-08 09:11:02 +01:00
Allan Sandfeld Jensen
52a3f1b00c Fix accuracy of ARGB32->A2RGB30 conversions
It was converted over ARGB32PM, when it should have been directly
converted to not lose accuracy, instead there was an unnecessary direct
ARGB32->RGB30 conversion, which was converted to the necessary type.

This also improves the selection of conversion over ARGB32PM or RGBA64PM
for ARGB32 and RGBA8888 by using 32-bit conversion when alpha is not
relevant.

Change-Id: I5990d8a23b2909d3910d8c1213fa46477742b052
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-11-07 10:42:08 +01:00
Edward Welbourne
e6a0a945c5 Simplify two complex test conditions
Since the test was fatuous for i == 0, iterate from i = 1, instead.

Change-Id: I9b9c1b7b10639aefdd74f48051d592da4f84dc85
Reviewed-by: Jesus Fernandez <jsfdez@gmail.com>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-11-07 10:35:03 +01:00
Qt Forward Merge Bot
e3cc16e9fb Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	.qmake.conf
	mkspecs/features/mac/default_post.prf
	src/corelib/tools/qsimd_p.h
	src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
	util/qfloat16-tables/gen_qfloat16_tables.cpp

Change-Id: If48fa8a3bc3c983706b609a6d3822cb67c1352a4
2019-11-06 11:41:19 +01:00
Edward Welbourne
7bf4f81de8 Add qfloat16::copySign() since we can't overload std::copysign()
Change-Id: Idfaf841b3eb3538f076ae4f0de2d7d029e1588fe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-11-06 11:36:49 +01:00
Lars Knoll
2faccdf9a6 Don't insert multiple names for the same role
It doesn't make a lot of sense to have two names for the
same role. Use 'fileIcon' exclusively for the Qt::Decoration/
FileIconRole.

Change-Id: Icaa46ba4aa61efc56ba007a14bab5e59ea26cd35
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-11-05 16:32:28 +00:00
Shawn Rutledge
d1c6f7e5a2 QTextMarkdownWriter: preserve empty lists
You can save a "skeletal" document with list items to fill in later,
the same as you can do in HTML or ODF format.  Reading them back via
QTextDocument::fromMarkdown() isn't always perfect though.

Fixes: QTBUG-79217
Change-Id: Iacdb3e6792250ebdead05f314c9e3d00546eeb9f
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-11-05 16:40:18 +02:00
Shawn Rutledge
524ab7b535 Avoid crashing when the end of an empty markdown list is detected
The markdown parser generates empty lists in some cases when a character
that can be used as a bullet is found on a line by itself.
cbEnterBlock() and cbLeaveBlock() are called symmetrically in such cases.
QStack::pop() on an empty stack triggers an assert, so push and pop need
to be done symmetrically too.  But it's difficult to actually create the
list as soon as the MD_BLOCK_UL or MD_BLOCK_OL callback occurs, without
breaking the case fixed in 7224d0e427 (and
probably other cases).  That's because QTextCursor::insertList() creates
a list item at the same time as it creates the list itself, and also
inherits block formatting from the previous block.  We now insert empty
lists with empty items whenever the need for that is detected though,
and there's a failsafe to prevent popping in case something still goes
wrong with that logic.  We aren't strict about reproducing the original
markdown when regenerating it via toMarkdown(), but it's getting closer.

Fixes: QTBUG-78870
Change-Id: Ided194ce7aec2710c60dbac42761ee4169ed9b78
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Robert Loehning <robert.loehning@qt.io>
2019-11-05 16:39:13 +02:00
Andy Shaw
b1004c7d0a If only family is set, prefer that in the families list after resolving
If a font with only a family set is resolved with one that has been setup
with setFamilies() then the family needs to be prepended to the families
list after resolving. This is so that the font still prefers the one set
as just a family with no famillies set.

This also amends the QFontDialog test to account for this too.

[ChangeLog][QtGui][Text] Resolving a font that just has a family set
with families set will prepend the family to the families so that it
is still the first preference for the font.

Task-number: QTBUG-46322
Change-Id: Icc4005732f95b2b4c684e592b06b31e133270e44
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-11-05 09:46:29 +01:00
Frederik Gladhorn
7ba1d611cf Fix qtHaveModule(widgets) condition
In qmake syntax there should be a colon or curly braces following a condition.

Change-Id: Ibd989662aef6320cec8093e7c6103bf8362b8255
Reviewed-by: Liang Qi <liang.qi@qt.io>
2019-11-02 08:55:27 +01:00
Timur Pocheptsov
1a878e65c2 QSslSocket - remove old OpenSSL backend (< 1.1)
OpenSSL 1.0.2 will stop receiving all support at the end
of 2019. Qt 5.15 is our next LTS thus makes sense remove
OpenSSL 1.0.2 support there. This also allows us quite
a significant cleanup of an old heavily if-defed code
and all 'pre11' suffixed source files.

[ChangeLog][QtNetwork][SSL] Removed OpenSSL 1.0.x support, now 1.1.x is required

Change-Id: I70c70c56cbd8aeff793afe793335696d1b1b7408
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-11-01 14:52:09 +01:00
Qt Forward Merge Bot
7a13a09116 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ic13ef00d76c81295076bb2432576db70ec84fe29
2019-11-01 01:00:45 +01:00
Ville Voutilainen
36e277e917 Add a transfer timeout at QNAM level as well
Task-number: QTBUG-3443
Change-Id: Idc4d3c9b1ace69bd8b6456506778116a3e8a5490
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-10-31 19:12:07 +02:00
Laszlo Agocs
09ee9ef65d Avoid EGL_BAD_MATCH in tst_qrhi autotest
Call adjustedFormat() as advised by the docs: "Applications are advised
to set this format on their QWindow in order to avoid potential BAD_MATCH
failures."

Task-number: QTBUG-79659
Change-Id: Ibf415fb0ee64bdd3f01d4ba744244bce811c0d27
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-31 14:41:07 +01:00
Edward Welbourne
c3eb521a0f Update UCD data to Unicode 12.1.0's Revision 24
Had to teach the update program to accept category Lm as for
Joining_Transparent, for the sake of a new ArabicShaping.txt entry.
Added three new Unicode versions, several new scripts and a new
word-break class.

Updated UCD's test data for tst_QTextBoundaryFinder.  This left 57
tests failing; I have commented out the data rows for those tests,
pending someone with more knowledge addressing this.

Task-number: QTBUG-79631
Task-number: QTBUG-79418
Change-Id: Ic33d3b3551195d47a84d98e84020f57a68f0b201
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-10-30 17:38:02 +01:00
Qt Forward Merge Bot
c51ca1d1b2 Merge remote-tracking branch 'origin/5.13.2' into 5.13
Change-Id: Ieb5afc87086758119bcfc8efbe355f5c0a93fc04
2019-10-30 06:52:03 +01:00
Qt Forward Merge Bot
a317bff298 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Ib4df563fc7b1f7c40f425e0e71180d9517a672be
2019-10-30 01:00:14 +01:00
Edward Welbourne
d05ca484cf Make tst_QNumeric more systematic about checking float as well as double
Do this by templating the floating-point tests, which removes some
existing duplication as well as avoiding new duplication. Did some
renaming in the process. Added some tests of fuzzyCompare that come
closer to its boundary. Increased number of tests from 69 to 97. Use
std::numeric_limits to replace assorted hard-coded constants and old
C-library boundary-value macros.

It turns out MSVC's float conflates quiet and signaling NaN (although
MinGW's doesn't); and WebAssembly's old fastcomp compiler conflates
NaNs for both float and double; so XFAIL the test for distinct NaNs in
those cases.

Change-Id: I0a1c0d2f68f75d51b8cda9e3ddfe7fa9c190a3e2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
2019-10-29 16:46:54 +01:00
Laszlo Agocs
58a67e4e0a rhi: Move to CBOR in QShader and expand the autotest
Binary JSON is said to become deprecated. Therefore, add support
for CBOR. Binary JSON is still supported for deserialization, so
all existing .qsb files will continue to work, as long as the
binaryjson feature is enabled in the Qt build.

Also makes QShaderDescription comparable. This is important for
tests in particular.

A nice side effect of using CBOR is that .qsb files become smaller.
For a typical Qt Quick material shader this can mean a reduction of
300 bytes or more.

Task-number: QTBUG-79576
Change-Id: I5547c0266e3e8128c9653e954e47487352267f71
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-29 15:22:46 +01:00
Morten Johan Sørvig
dcbcda81b4 wasm: add local file access manual test
Testes file load and save, computes a sha256 hash
for verifying file content.

Change-Id: Id7f697c4dfd41e051442350f4050f04b493cfc18
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-10-29 14:02:43 +00:00
Andy Shaw
ccd3bf0871 Ensure that child windows are visible again when showing their parent
When a window is closed, then it will cause the child windows to be
closed as well as a result. Therefore in order to ensure that they are
shown again as a result, we need to remove the WA_WState_ExplicitShowHide
attribute if the widget was not already hidden before. This enables us to
test for this attribute when calling showChildren(), so that if the
window has a windowHandle then we can make sure that this widget is shown
again.

Fixes: QTBUG-73021
Change-Id: I1186242b889899dfcd38d782a67567348e2055ee
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-10-29 10:45:19 +02:00
Christian Ehrlicher
c87e2c37de tst_QDataWidgetMapper/QFileIconProvider/ItemEditorFactory: cleanup
Cleanup QDataWidgetMapper/QFileIconProvider/ItemEditorFactory autotests:
 - use range-based for loops
 - use nullptr
 - use member initialization
 - use new signal/slot syntax
 - use static invocations
 - use override

Change-Id: I1a36ea2da7de1cfa5d5d4e305ef508fda3a6c460
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-29 06:24:01 +01:00
Ville Voutilainen
c33d8bfc99 Add a timeout for transfers
If a transfer timeout is set for QNetworkRequest, downloads
and uploads are aborted if the timeout expires and bytes
haven't been transmitted in either direction.

Task-number: QTBUG-3443
Change-Id: I702d223d673f0c6612343dc9d053815acfcb61b8
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-10-28 21:15:43 +03:00
Qt Forward Merge Bot
08f90adffd Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/corelib/serialization/qjson_p.h

Change-Id: I83cea141a4de8b3998478bfded84ca9029f7a2a9
2019-10-28 10:50:03 +01:00
Qt Forward Merge Bot
86e74d60d2 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I208a36bf1c88c8291baaa5ca8fe8e838bc9d7aea
2019-10-26 01:01:14 +02:00
Edward Welbourne
43f64b4dc8 Update CLDR to v36
Released on October 4th.
Adds Windows names for two time zones, Qyzylorda and Volgograd.
Added languages Chickasaw (cic), Muscogee (mus) and Silesian (szl).

Norwegian number formatting has flipped back to using colon rather
than dot as time separator; it's flipped back and forth over the last
several CLDR releases.  The dot form is present as a variant, the
colon form was long given as the normal pattern, then went away; but
now it's back as a contributed draft and that's what we pick up.

The MS-Win time-zone ID script was iterating a dict, causing random
reshuffling when new entries are added. Fixed that by doing the
critical iteration in sorted order.

Omitted locales ccp_BD and ccp_IN due to QTBUG-69324.

Task-number: QTBUG-79418
Change-Id: I43869ee1810ecc1fe876523947ddcbcddf4e550a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-10-25 11:44:48 +02:00
Edward Welbourne
ef9c498215 Tidy up data-stream test
While I was looking into a bug related to problems building the test
without GUI, I noticed a lot of spurious #include lines so tidied up a
bit.  Split some long lines, while I was about it.

Change-Id: Id87eb6f612c6b174f8240dfe9c00e0929244fb6c
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-10-25 11:44:13 +02:00
Edward Welbourne
59ca056a79 Exclude tests that need GUI when GUI isn't available
Thanks to Dmitriy Purgin for pointing out the serialization one.

Task-number: QTBUG-79353
Change-Id: Ia3d750b17ddd8fbb7a83a55df7e4546ca78c358b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-10-25 11:42:09 +02:00
Edward Welbourne
fd3db1dc3a Don't try to define QT_NO_CAST_TO_ASCII when the test undefines it
The qmake config for tst_QString tried to impose QT_NO_CAST_TO_ASCII
on it, but the source file explicitly #undef-s this symbol and its
friends. Leave the define commented out in the .pro so that a comment
can explain why it's no good.

Change-Id: I7620f4e104f0cdab05fdc246b903c40026e63d76
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-25 11:41:44 +02:00
Edward Welbourne
946c701883 Move a test for feature ICU from .pro to .cpp
Test QT_CONFIG(icu) in the code instead of testing qtConfig(icu) in
the profile and setting an extra define just to shadow what's already
defined. Also remove the matching define from qcollator.pro, whose
test code didn't use it.

Noticed while reviewing the conversions to CMake.

Change-Id: I19d3b1026b2a8f50ec424c450614e721500fd38a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-10-25 11:41:30 +02:00
Johan Klokkhammer Helsing
c9b3091be5 tst_qgraphicspixmaptiem: Fix undefined behavior in contains
See the comment in the test for details.

Change-Id: Ie3d356e476ba0419d304bccd396fc18a831a30cd
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-10-25 07:20:54 +00:00
Qt Forward Merge Bot
375efdd0e1 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Iebedaa967a263854f18cd403ce007d7965f26d2b
2019-10-25 01:00:16 +02:00
Christian Ehrlicher
9ae0fa4d49 cleanup QSortFilterProxyModel tests
Cleanup QSortFilterProxyModel tests:
 - adjust includes
 - use nullptr
 - use override
 - avoid unneeded casts
 - use new signal/slot syntax

Change-Id: I05f7c18cd2642bc8251bf1560803e7635684d24d
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-24 19:41:16 +02:00
Christian Ehrlicher
5edf34848a QTableView: properly deselect row when column 0 is hidden/not visible
When the first column is hidden or not visible in the current viewport,
it is not possible to deselect the current row.
Fix it by passing the correct column to
QItemSelectionModel::selectedRows() when testing if the current index is
selected.

Fixes: QTBUG-79092
Change-Id: I9d8082d2b29ad2f799156aee910c6ff6e3217771
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-24 19:41:14 +02:00
Ulf Hermann
9ab043b688 QFileSystemEngine: Consistently check for invalid file names
stat() and friends expect a null-terminated C string. There is no way to
generate anything useful from a string that has null bytes in the
middle. It's important to catch this early, as otherwise, for example, a
QDir::exists() on such a path can return true, as the path is silently
truncated.

Extend the checks for empty file names to windows and add checks for null
bytes.

Change-Id: Ie9794c3a7c4fd57f9a66bdbbab8b45a08b6f9170
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-24 13:37:22 +02:00
Robert Loehning
c46eec096f QStateMachine: Don't scream at the user
Change-Id: I171606d10985bc7338b0f24ceb142fc0d88e7932
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-10-24 10:26:03 +02:00
Qt Forward Merge Bot
4158de330d Merge "Merge remote-tracking branch 'origin/5.13' into 5.14" 2019-10-24 10:25:37 +02:00