Commit Graph

10082 Commits

Author SHA1 Message Date
Johan Klokkhammer Helsing
332c255c69 tst_qgraphicsitem: Skip tests that fail on Wayland
Task-number: QTBUG-62188
Change-Id: If0638d51bffa6ef375476c0a601c387bd05583ae
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-14 14:06:32 +02:00
Johan Klokkhammer Helsing
df91ff5551 tst_qgraphicsitem: Don't assume window activation is available
Some windowing systems (i.e. Wayland) do not allow applications to steal window
focus.

Normally, we would just replace qWaitForWindowActive with
qWaitForWindowExposed, because that is usually the intent, in this test
however, there are many occurrences of both variants right after each other.
And, as described in the commit message of 153e8b49a, this may be because
window activation may cause repaints, and we want to wait for it to reduce
the chance of receiving an extra repaint later (possibly causing tests to be
racy).

Therefore, I took the conservative approach, and kept the qWaitForWindowActive
calls, except when the capability is not available. Hopefully this will not
cause flakiness in existing platforms, while also allowing tests to pass on
platforms where activation is not supported.

Task-number: QTBUG-62188
Change-Id: I15502baa28c464a808d585a5e6d67c9b745b17ae
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-14 08:39:31 +02:00
Qt Forward Merge Bot
8d8140dffa Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I9953c1ca16862184c2373027e946c482ce8e6f0e
2019-10-13 01:00:43 +02:00
Christian Ehrlicher
b43f5ed2da QMYSQL: remove support for MySql 4.x
MySql 5.0 was released 2005 so it's time to remove support for MySql 4.x
14 years later.

[ChangeLog][QtSql][QMYSQL] Removed support for MySql < 5.0 since 5.0 was
released 14 years ago.

Change-Id: I45005accdffefbd9338ac0e710512a4c7ea8e09e
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2019-10-12 08:31:01 +02:00
Volker Hilsheimer
1748dc3e2d QGroupBox: always disable children in a checkable, unchecked groupbox
The childEvent handler sets the enabled property of children as they are
added to the groupbox, but applications might later enable children and
check/uncheck the groupbox's checkbox in undefined order. In that case,
we would end up with enabled children inside a conceptually disabled
groupbox (the groupbox's checkbox represents the logical "disabled"
state), which breaks documented QWidget::enabled rules.

To make sure that all children are disabled as per the state of the
groupbox, we need to run that logic once the UI has been set up, and
before it becomes visible. This is what polishing is for, so listen
for that event in addition and handle it the same way as adding (which
duplicates things, but keeps existing code that might depend on things
being updated as they are added working).

Adds the case to the existing enabledChildPropagation test case.

[ChangeLog][QWidget][QGroupBox] Always disable children of a checkable,
unchecked group box before showing.

Change-Id: I978bd27b6f1a3f54ec745faeea529a98d0d93619
Fixes: QTBUG-25938
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-10-11 13:53:49 +02:00
Eirik Aavitsland
c54083ff93 Fix QEasingCurve possible imprecision at endpoints
Both the spline curves and (most of) the predefines curves are defined
as having start value 0.0 and end value 1.0. The spline and In/OutBack
functions would sometimes not produce that result precisely, so code
could not reliably depend on expressions like (easedValue < 1.0)
becoming false. Fix by explicitly handling endpoints.

Fixes: QTBUG-76781
Fixes: QTBUG-72630
Change-Id: I21be43af469a76c090154bffef8406a9baf2d0b1
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-10-11 12:29:27 +02:00
Edward Welbourne
60deb69034 Distinguish invalid datetimes from others
A default-constructed QDateTime is invalid, but compared equal to a
valid one referencing the start of 1970.  This lead to date properties
in QML being initialized invalid but not getting an onChange if the
first value they're set to is the start of 1970.

Fixing that then lead to some tests failing. Indeed, the original
equality check involved using toMSecsSinceEpoch(), whose value is
undefined unless the datetime is valid, without a prior check on its
validity: so ensure all uses of toMSecsSinceEpoch() are guarded with
isValid() checks.

Reworked tst_QDateTime::toSecsSinceEpoch() to use its bool column
(previously unused, after separating from toTime_t(), which uses this
column for "out of time_t's range") for validity of the datetime.

[ChangeLog][QtCore][QDateTime] Invalid datetimes are now treated as
equal and less than all valid ones. They could previously be found
equal to valid datetimes.

Fixes: QTBUG-79006
Change-Id: Ie72deb8af4350a5e808144d0f6e42dc8eb3ff5ef
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-11 11:59:41 +02:00
Mårten Nordheim
d79726e9eb Win: QUdpSocket: Use QVarLengthArray for retrieving size
Increased size of the peek buffer to 2048 from 1500 and now
uses QVarLengthArray with space for 10 stack-allocated WSABUF instances,
but still growing at the pace of 5.

In benchmarking (created for and included in this patch) this shows
better performance when retrieving the datagram size for larger
datagrams, and the same performance as before for smaller datagrams
(at the cost of 2048 - 1500 + 16 * 10 = 708 bytes extra stack space).

Benchmarks:

With changes:

********* Start testing of tst_QUdpSocket *********
Config: Using QtTest library 5.13.1, Qt 5.13.1 (x86_64-little_endian-llp64 shared (dynamic) release build; by MSVC 2019)
PASS   : tst_QUdpSocket::initTestCase()
PASS   : tst_QUdpSocket::pendingDatagramSize(52)
RESULT : tst_QUdpSocket::pendingDatagramSize():"52":
     0.0038 msecs per iteration (total: 63, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(1024)
RESULT : tst_QUdpSocket::pendingDatagramSize():"1024":
     0.0039 msecs per iteration (total: 64, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(2049)
RESULT : tst_QUdpSocket::pendingDatagramSize():"2049":
     0.0038 msecs per iteration (total: 63, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(4500)
RESULT : tst_QUdpSocket::pendingDatagramSize():"4500":
     0.0039 msecs per iteration (total: 64, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(4098)
RESULT : tst_QUdpSocket::pendingDatagramSize():"4098":
     0.0040 msecs per iteration (total: 66, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(8192)
RESULT : tst_QUdpSocket::pendingDatagramSize():"8192":
     0.0040 msecs per iteration (total: 67, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(12000)
RESULT : tst_QUdpSocket::pendingDatagramSize():"12000":
     0.010 msecs per iteration (total: 90, iterations: 8192)
PASS   : tst_QUdpSocket::pendingDatagramSize(25000)
RESULT : tst_QUdpSocket::pendingDatagramSize():"25000":
     0.021 msecs per iteration (total: 88, iterations: 4096)
PASS   : tst_QUdpSocket::pendingDatagramSize(32768)
RESULT : tst_QUdpSocket::pendingDatagramSize():"32768":
     0.033 msecs per iteration (total: 69, iterations: 2048)
PASS   : tst_QUdpSocket::pendingDatagramSize(64512)
RESULT : tst_QUdpSocket::pendingDatagramSize():"64512":
     0.088 msecs per iteration (total: 91, iterations: 1024)
PASS   : tst_QUdpSocket::cleanupTestCase()
Totals: 12 passed, 0 failed, 0 skipped, 0 blacklisted, 3090ms
********* Finished testing of tst_QUdpSocket *********

Without changes:

********* Start testing of tst_QUdpSocket *********
Config: Using QtTest library 5.13.1, Qt 5.13.1
(x86_64-little_endian-llp64 shared (dynamic) release build; by MSVC 2019)
PASS   : tst_QUdpSocket::initTestCase()
PASS   : tst_QUdpSocket::pendingDatagramSize(52)
RESULT : tst_QUdpSocket::pendingDatagramSize():"52":
     0.0039 msecs per iteration (total: 65, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(1024)
RESULT : tst_QUdpSocket::pendingDatagramSize():"1024":
     0.0039 msecs per iteration (total: 65, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(2049)
RESULT : tst_QUdpSocket::pendingDatagramSize():"2049":
     0.0040 msecs per iteration (total: 66, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(4500)
RESULT : tst_QUdpSocket::pendingDatagramSize():"4500":
     0.0040 msecs per iteration (total: 67, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(4098)
RESULT : tst_QUdpSocket::pendingDatagramSize():"4098":
     0.0040 msecs per iteration (total: 67, iterations: 16384)
PASS   : tst_QUdpSocket::pendingDatagramSize(8192)
RESULT : tst_QUdpSocket::pendingDatagramSize():"8192":
     0.010 msecs per iteration (total: 90, iterations: 8192)
PASS   : tst_QUdpSocket::pendingDatagramSize(12000)
RESULT : tst_QUdpSocket::pendingDatagramSize():"12000":
     0.010 msecs per iteration (total: 90, iterations: 8192)
PASS   : tst_QUdpSocket::pendingDatagramSize(25000)
RESULT : tst_QUdpSocket::pendingDatagramSize():"25000":
     0.033 msecs per iteration (total: 69, iterations: 2048)
PASS   : tst_QUdpSocket::pendingDatagramSize(32768)
RESULT : tst_QUdpSocket::pendingDatagramSize():"32768":
     0.0502 msecs per iteration (total: 103, iterations: 2048)
PASS   : tst_QUdpSocket::pendingDatagramSize(64512)
RESULT : tst_QUdpSocket::pendingDatagramSize():"64512":
     0.13 msecs per iteration (total: 70, iterations: 512)
PASS   : tst_QUdpSocket::cleanupTestCase()
Totals: 12 passed, 0 failed, 0 skipped, 0 blacklisted, 3192ms
********* Finished testing of tst_QUdpSocket *********

Fixes: QTBUG-78275
Change-Id: If86a226620244aa4e470600c6c1db4a7863b5617
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-11 11:36:16 +02:00
Shawn Rutledge
f1dd6addda Make QTextBlockFormat::MarkerType an enum class
This came up during API review.

Change-Id: I9198e1eb96db0c21e46a226a032919bb62d3ca66
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2019-10-10 21:08:08 +02:00
Christian Ehrlicher
95717ea834 tst_QAbstractItemView: cleanup
Cleanup QAbstractItemView autotest:
 - use range-based for loops
 - use nullptr
 - use member initialization
 - use new signal/slot syntax
 - use static invocations
 - use override
 - replaced QCoreApplication::processEvents with
   QTRY_VERIFY/QTRY_COMPARE

Change-Id: Iba91811db6fb925364fc88ec36357e758b937329
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-10 18:08:36 +02:00
Frederik Gladhorn
5e421957de Fix strange qmake syntax
It seems like qmake is happy with the comment, followed by a
continuation and then another comment, but having the continuation at
the end of the line makes more sense.
This will make it easier to port to CMake.

Change-Id: I20c964e8c3b6fea4745095783503045b191b000b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-10 16:57:37 +02:00
Liang Qi
9c84b7786c Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/plugins/platforms/xcb/qxcbscreen.h
	src/src.pro

Change-Id: I4e1981e69a1ddcbe4078ec6ab2a64b0da6a445de
2019-10-10 09:13:49 +02:00
Qt Forward Merge Bot
68375b4f3d Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: Iadeca81f499d6b19e86ceae1edd7960db2575e90
2019-10-10 09:10:27 +02:00
Robert Loehning
d6734e8ab7 Fuzzing: Don't copy input data to QByteArray
Change-Id: I603413805dca46a85709c2ab6ff573687849572e
Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
2019-10-09 17:16:09 +02:00
Laszlo Agocs
b62b80706e rhi: Autotest for rendering a triangle into a window
Change-Id: Id1562ff8cf7c6bc7e5bd147bb628f3d9dd57f2b5
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-09 17:15:06 +02:00
Laszlo Agocs
df0b1836b5 rhi: Autotest rendering with uniform buffer
Change-Id: I4251f31494680c78e90a08a2b471cb1af08ecd81
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-09 17:15:06 +02:00
Laszlo Agocs
b2de7f8583 rhi: Autotest rendering a textured quad
Task-number: QTBUG-78971
Change-Id: I0e7e0f3c00f9509031f7b4a8a389e51c915f01c2
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-09 17:15:06 +02:00
Laszlo Agocs
8f44da1f55 rhi: Enable the qrhi autotest on WinRT
There is no onscreen support for WinRT in the D3D11 backend yet.
However, offscreen operations (rendering into a texture) should work.
One catch is that there is no D3DCompile available for deployed WinRT
apps. So ship the intermediate format (DXBC output from fxc) in the
.qsb files.

Change-Id: Ic0aba4b817c27d13dcf3af41bf7612d799382655
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-10-09 17:15:05 +02:00
Laszlo Agocs
dd105fab8d rhi: Autotest rendering a triangle
Also improve (docs and runtime checks) and test the minimum set
of required data to create a graphics pipeline.

Task-number: QTBUG-78971
Change-Id: If5c14f1ab1ff3cf70f168fde585f05fc9d28ec91
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-09 17:15:05 +02:00
Laszlo Agocs
9baf69c765 rhi: gl: Add a feature flag for reading back non-zero mip levels
The joys of "level - Specifies the mipmap level of the texture
image to be attached, which must be 0." for glFramebufferTexture2D
in OpenGL ES 2.0.

Change-Id: Iaf19502f48d7ba73b26abb72535bfa6696a1e182
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-09 17:15:05 +02:00
Laszlo Agocs
9c466946d0 rhi: Autotest basic texture operations
...and make the Null backend able to deal with these, for RGBA8 textures
at least. Naturally it is all QImage and QPainter under the hood.

Also fix a bug in the OpenGL backend, as discovered by the autotest:
the size from the readback did not reflect the mip level.

Task-number: QTBUG-78971
Change-Id: Ie424b268bf5feb09021099b67068f4418a9b583e
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-09 17:15:05 +02:00
Laszlo Agocs
89ec1b3618 rhi: Add support for buffer readbacks
This also marks the beginnings of significantly extending autotesting
of the resource and rendering functionality in QRhi.

Also involves fixing up the buffer operation lists like we did
for textures before. This is to ensure updates and reads on the
same batch execute in the correct order. So just have two lists:
one with buffer, one with texture operations.

Also simplify the struct layouts. No need for those inner structs
with many duplicate members. This reduces the size even, since using a
union was never an option here. Also switch to a VLA, the size is around
253 KB per batch.

The Null backend now keeps track of the QRhiBuffer data so it can return
valid results in readbacks.

Task-number: QTBUG-78984
Task-number: QTBUG-78986
Task-number: QTBUG-78971
Task-number: QTBUG-78883
Change-Id: I9694bd7fec523a4e71cf8a5c77c828123ebbb3bd
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-09 15:15:05 +00:00
Laszlo Agocs
4a3ee77f65 rhi: Exercise nativeHandles() in qrhi test
Task-number: QTBUG-78971
Task-number: QTBUG-78972
Change-Id: Ibce10caf1ccd74ae7efead9579f4a4342ef896b8
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-09 17:15:05 +02:00
Lars Knoll
ba26496647 Don't crash when calling jumpToFrame() on an empty QMovie
Properly return an invalid frame when calling jumpToFrame()
with a non existent frame number.

Fixes: QTBUG-79029
Change-Id: Ic40f4a6de3106fab42c0bb6c961194be47b04e31
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-10-09 15:58:26 +02:00
Edward Welbourne
61ec1abc08 Suppress deprecation warnings on a test of a deprecated QString method
QString::fromAscii() is deprecated since 5.0 but still tested.
So suppress deprecations for its code.

Change-Id: Ic048a843c43551021da39a16d94c3222201573dc
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2019-10-09 11:18:22 +02:00
Qt Forward Merge Bot
74858dc4af Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I03d82c5bc47908a97e7a908d7e67a7301b28d8cb
2019-10-09 01:00:42 +02:00
Robert Loehning
af8f3c5da4 Add libfuzzer test for QTextLayout::beginLayout()
Task-number: QTBUG-77819
Change-Id: I34e9cbaa615896222bcf947012cfed9f6c3186c7
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
2019-10-07 15:40:34 +02:00
Qt Forward Merge Bot
327b305e95 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I554a2762890391b3b6013c8b82211a8386a4ced8
2019-10-05 01:01:06 +02:00
Simon Hausmann
da284ef10e Add support for machine-readable JSON output to the MOC
The --output-json parameter will make moc produce a .json file next to
the regular output file. With --collect-json the .json files for a
module can be merged into a single one.

Task-number: QTBUG-68796
Change-Id: I0e8fb802d47bd22da219701a8df947973d4bd7b5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-10-04 18:35:29 +02:00
Christian Ehrlicher
64473c9320 tst_QColumnView: cleanup
Cleanup QColumnView autotest:
 - use range-based for loops
 - use nullptr
 - use member initialization
 - use new signal/slot syntax
 - use static invocations
 - use override

Change-Id: Iae94e9074b65cca1e4d9eb199ea2b13e0cfa2880
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-04 15:36:39 +02:00
Tor Arne Vestbø
0768a28fbf Remove CFBundleGetInfoString from Info.plist templates
Is't been deprecated since Mac OS X 10.5.

Task-number: QTBUG-74872
Change-Id: I8b1ad7aca6448883cb164fd0c4b329592ca60548
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-04 13:09:34 +00:00
Robert Loehning
de182ea0be Add libfuzzer test for QTextDocument::setMarkdown()
Change-Id: I729d4a3bb276523011a6f17a800e72aa34540e47
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2019-10-04 14:47:59 +02:00
Qt Forward Merge Bot
3a1613c227 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I43393cf47675fd6c14972df1221986335c6f493c
2019-10-04 01:01:48 +02:00
Joerg Bornemann
5ab8efd66a Make conflicting targets check less strict
People tend to "turn off debug and release builds" by just not building
one of the variants. For example, Qt's own rcc is built in release only,
however it is configured for debug_and_release with the same TARGET for
both.

Let qmake complain about conflicting TARGETs only we're about to build
all of those conflicting targets, i.e. if build_all is set.

Change-Id: I0448bf5cb421e2d801d3cc30e0d80353fba0d999
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-10-03 20:28:03 +02:00
Simon Hausmann
dcecaeb7b9 Prospective fix to stabilize tst_qwindow::isActive() on Windows 10
It is conceivable that during the try-compare loop of processing
windowing system events we loose and regain the focus. That would
explain the occasional test failure where instead of the expected 3
focus in events, we have received four.

Task-number: QTBUG-77769
Change-Id: I2221440d09a74d4d18a72f7786232b4491cf45a8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 56f084781e)
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-10-03 15:09:16 +00:00
Edward Welbourne
d448f2ecb8 Correct handling of -qfloat16(0)
It is finite and normal; it classifies as a zero; and it should not be > qfloat16(0).
Added tests to match.

Change-Id: I7874fb54f622b4cdf28b0894050ad3e75cf5d77c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-03 16:30:40 +02:00
Edward Welbourne
b4efdd3769 Reorganise the qfloat16 auto-test
Its limits() test was rather large and had some overlap with an older
qNan() test, that needed some clean-up (it combined qfloat16 values
with double and float values in ways that caused qfloat16 to be
promoted to another type, so we weren't testing qfloat16).

Renamed the qNan() test to qNaN(), separated out the parts of it that
actually tested infinity. Moved various parts of limits() to these and
rationalised the result. Split out a properties() test from limits()
for the properties of the qfloat16 type that are supplied by its
numeric_limits. Split out a data-driven finite() test to cover some
repeated code that was in limits() and extended it to test more
values. Added more tests of isNormal().

Fixed my earlier UK-ish spelling of "optimise", in the process, and
identify the processor rather than the virtualization as the context
where the compiler errs.

Change-Id: I8133da6fb7995ee20e5802c6357d611c8c0cba73
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-03 11:09:47 +02:00
Laszlo Agocs
f1c7814a55 rhi: Remove QVectors from the data description structs as well
As usual, keep some QVector overloads around to allow Qt Quick to compile.

Color attachments and vertex input bindings get an at(index) type of
accessor, unlike any other of similar lists. This is because there the
index is significant, and sequential iteration is not the only type of
operation that is performed. Sometimes a lookup based on an index will
be needed as well.

Task-number: QTBUG-78883
Change-Id: I3882941f09e94ee2f179e0e9b8161551f0d5dae7
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-03 09:37:48 +02:00
Mårten Nordheim
6e203824a2 Move away from recently deprecated HTTP2 attributes
Amends f59f67287f

Change-Id: I74045c558e9d20f9f45f150a91f181a04e9b8c69
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-10-01 18:40:29 +02:00
Qt Forward Merge Bot
8791a8398a Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2019-10-01 11:47:42 +02:00
Simon Hausmann
56f084781e Prospective fix to stabilize tst_qwindow::isActive() on Windows 10
It is conceivable that during the try-compare loop of processing
windowing system events we loose and regain the focus. That would
explain the occasional test failure where instead of the expected 3
focus in events, we have received four.

Task-number: QTBUG-77769
Change-Id: I2221440d09a74d4d18a72f7786232b4491cf45a8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-01 11:47:37 +02:00
Qt Forward Merge Bot
4e40c54a3c Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I77ba01f09b3dbcaf13cb265a70d9da661c32a61f
2019-10-01 01:01:20 +02:00
Laszlo Agocs
7000b66f7e Remove QVector in the API of QRhiResource subclasses
Forcing users to go through a QVector, when in practice they almost
always want to source the data from an initializer list, a QVarLengthArray,
or a plain C array, is not ideal. Especially since we can reason about
the maximum number of elements in the vast majority of use cases for all
the affected lists. QRhiResource is also not copyable so we do not need
the usual machinery offered by containers. So switch to a
QVarLengthArray.

Note that a resource is not a container. The only operations we are
interested in is to be able to source data either via an initializer
list or by iterating on something, and to be able to extract the data,
in case a user wishes to set up another resource based on the existing
one.

In some cases a QVector overload is kept for source compatibility with
other modules (Qt Quick). These may be removed in the future.

Also do a similar QVector->QVarLengthArray change in the srb-related
data in the backends.

Change-Id: I6f5b2ebd8e75416ce0cca0817bb529446a4cb664
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-30 20:07:43 +02:00
Liang Qi
6f9a215cc4 Merge "Merge remote-tracking branch 'origin/5.13' into 5.14" 2019-09-30 20:07:25 +02:00
Edward Welbourne
4bd6cd1992 Featurize support for signaling NaN
One of our compilers for emscripten coerces all signaling NaNs to
quiet ones, so won't do any actual signaling. Anyone relying on them
to do so shall be disappointed, so it's better that they know about it
at compile-time - or, at least, have the ability to find it out.

Put the signaling NaN producers (and remaining (test) code using them)
under the control of a feature that's disabled when numeric_limits
claims double has no signaling NaN. Assume the bootstrap library
doesn't need signaling NaNs. Sadly, until C++20 <bit>, there's no
contexpr way to test that alleged signalling and quiet NaNs are
actually distinct.

Added some auto-tests for signaling NaN, including that it's distinct
from quiet NaN. Any platform on which the last fails should disable
this feature.

Task-number: QTBUG-77967
Change-Id: I57e9d14bfe276732cd313887adc9acc354d88f08
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-09-30 20:05:42 +02:00
Liang Qi
99cdd5fc67 Merge remote-tracking branch 'origin/5.13' into 5.14
Conflicts:
	src/corelib/global/qrandom.cpp
	src/corelib/io/qfileinfo.cpp
	src/corelib/kernel/qeventdispatcher_win.cpp
	src/corelib/kernel/qeventdispatcher_win_p.h
	src/gui/text/qfontdatabase.cpp
	src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm
	src/plugins/platforms/windows/qwindowsglcontext.cpp
	src/testlib/qtestcase.cpp

Done-With: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Done-With: Edward Welbourne <edward.welbourne@qt.io>
Change-Id: I4893212471aa24be804c989a581810e2f714545c
2019-09-30 14:43:02 +02:00
Laszlo Agocs
86876744f0 Ensure drawable size atomicity within a frame
Revert surfacePixelSize() to be a getter only. With Metal this will
mean returning the "live" layer size (and so not the
layer.drawableSize), which is in line with what we expect with other
backends.

Instead, we leave it to the swapchain's buildOrResize() to "commit"
the size by setting drawableSize on the layer. With typical
application or Qt Quick logic this ensures that layer.drawableSize is
set once and stays static until we get to process the next resize - on
the rendering thread.

This of course would still mean that there was a race when a client
queries surfacePixelSize() to set the depth-stencil buffer size that
is associated with a swapchain. (because that must happen before
calling buildOrResize() according to the current semantics)

That can however be solved in a quite elegant way, it turns out,
because we already have a flag that indicates if a QRhiRenderBuffer is
used in combination with (and only in combination with) a
swapchain. If we simply say that setting the UsedWithSwapChainOnly
flag provides automatic sizing as well (so no setPixelSize() call is
needed), clients can simply get rid of the problematic
surfacePixelSize() query and everything works.

Task-number: QTBUG-78641
Change-Id: Ib1bfc9ef8531bcce033d1f1e5d4d5b4984d6d69f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-29 22:16:55 +02:00
Laszlo Agocs
cd5a0bc735 rhi: Always enable debug info printing from manual tests
It can be important to see for example the adapter enumeration that is
printed when qt.rhi.general is enabled. Make it enabled by default in
the tests.

Change-Id: I7bd073781e176d9b17b5386c548e9f8a2e16c10f
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-29 00:12:53 +02:00
Qt Forward Merge Bot
e8d7df4cb2 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I98086dc1584e90a24a4f90cd7b86582df047e81d
2019-09-28 01:00:51 +02:00
Friedemann Kleint
e7272ee9bd Re-enable tst_QOpenGLWindow on Win32
The test was found crashing with software rendering in Qt 5.7.

Removing the insignification revealed that there are failures
on WinRT as well, blacklist them for the moment.

Task-number: QTBUG-78802
Fixes: QTBUG-49630
Change-Id: Ib1a3efe69d7b63cdd98c6da364ab09e0e2dbdf62
Reviewed-by: Tony Sarajärvi <tony.sarajarvi@qt.io>
2019-09-27 20:41:55 +02:00