Commit Graph

41390 Commits

Author SHA1 Message Date
Frederik Gladhorn
936444d859 tst_qnetworkreply: Remove getFromHttp:success-external
The test fails because the server (reasonably) sends a https redirect.
Let's not rely on external servers serving http indefinitely.

Fixes: QTBUG-71953
Change-Id: I20937b2c6f268519636349bae8c99c1afe64fcf9
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-10-02 11:36:04 +02:00
Albert Astals Cid
b5b78f43fe QDom: Add & to const QString
Change-Id: Ib761f34c891a28e1285f08787047a48de4d2d750
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-02 09:03:12 +02:00
Qt Forward Merge Bot
4c8814a341 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ideaa64d583746f1ce8265997131fb1ce3a9acbcf
2019-10-02 08:39:15 +02:00
Tobias Hunger
009d86da2d Use same condition for QT_USE_MMAP as in qresource.cpp
Consistently use the same condition to decide whether or not to
set QT_USE_MMAP.

Change-Id: Ica83d40c8051a8957d875334b821037b25fa8677
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-01 12:49:19 +02:00
Tobias Hunger
ace9c7853c Simplify code guarded by QT_USE_MMAP
QT_USE_MMAP is true only on systems with a defined Q_OS_UNIX,
so there is no need to have code for windows in a section guarded
by QT_USE_MMAP.

Change-Id: I33d4ad596cc96f8f2e41374742fd5ec15b9e91a2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-01 12:49:13 +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
Simon Hausmann
6b3de85f2b Revert "Windows QPA: Preferably use DXGI to obtain adapter info"
This reverts commit 94902905ec.

The patch caused various test failures on Windows 7 in the CI system in qtdeclarative and qt3d.
Without the patch we ended up using openglsw32.dll, with this patch we get

    qt.qpa.gl unknown - supportedRenderers GpuDescription(vendorId=0x0, deviceId=0x0, subSysId=0x0, revision=0, driver: \"\", version=, \"\"\"\") 0 renderer:  QFlags(0x8|0x20)

and then end up using ANGLE, which fails.

Change-Id: I97c51f9c360461e1a05722d02d50c2450ca87b78
Task-number: QTBUG-78832
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-01 09:47:33 +00: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
Christian Ehrlicher
b0042601ed Cleanup QtOpenGL examples
Cleanup the OpenGL examples
 - use nullptr (clang-tidy)
 - use member-initialization
 - avoid redundant checks for != nullptr when deleting a pointer

Change-Id: I3e4702690ed79e71c3e952d51ceef83b907b45b7
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-09-30 22:16:27 +02:00
Laszlo Agocs
9e59024bf8 rhi: Speed up buffer and texture tracking
Task-number: QTBUG-78862
Change-Id: If278bd55530081cbbdbab8dd6e14d86e28da558e
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-30 20:07:53 +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
Laszlo Agocs
d4c17725ab De-d-pointer QRhiShaderResourceBinding
Sad to see this go since the d pointer pattern with implicit sharing
would have been perfect for this class, had this been a public API.

However, as binary compatibility will not be a concern for QRhi classes,
it is wasteful to allocate memory on every QRhiShaderResourceBinding.
This allows users, such as Qt Quick, to use QRhiShaderResourceBinding as
a cheap, simple, value class, without having to invent their own
alternatives in performance critical places.

The change brings a not insignficant improvement in certain qmlbench scenes
(the ones with thousands of unbatched geometry nodes).

Change-Id: I6d1dced6498d9ad625f90ead78bc0a417ea99ed8
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-30 20:07:36 +02:00
Laszlo Agocs
e1ed2c3864 Share and enable shader disk cache in QRhi OpenGL backend
The expectation for it is to function identically to what we get with
QOpenGLShaderProgram. (same environment variables, same logging
categories, etc.).

QOpenGLProgramBinaryCache is now shared between the QOpenGL convenience
classes (like QOpenGLShaderProgram) and QRhi. To achieve more modularity
and to prepare for QOpenGLShaderProgram and friends moving out of QtGui,
this class cannot depend on QOpenGLShader* anymore. This involves adding
some minor conversions between QRhi and QOpenGL enums for example.

Change-Id: I2f4664e074823ea536281aea8006a6db159a7381
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-30 20:07:28 +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
08a601035c rhi: gl: Remove fake uniform buffer offset alignment requirement
Change-Id: I5408e53f90c1c19836c400659bac15a8690c6ae8
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-09-28 22:13:14 +00: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
Laszlo Agocs
46201f0e82 QVarLengthArray: Avoid int vs. size_t warnings in operator=
Change-Id: I879b62c55e4211d3e4e1a18f6699f26e3f5de1f8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-09-29 00:11:42 +02:00
Alberto Mardegan
20b823f5a7 Doc: remove wrong documentation for Qt D-Bus delayed replies
People implementing D-Bus services *should not* immediately call
QDBusConnection::send() when intending to delay their reply, as this
indeed causes a reply to be sent to the client.

Change-Id: I50817f6b91ac1a02a2a25f6d31e73ad9832f1092
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-09-29 00:33:48 +03:00
Tor Arne Vestbø
72dd9de283 macOS: Avoid automatic resizing of layers by fixing them to top-left
When a layer is resized, e.g. during a window resize, the contents of
the layer may lag behind if the client doesn't fill the layer in
response to the window resize and corresponding expose event.

The default behavior is for Core Animation to stretch the content
to fill the layer, but this results in the content "jumping" back
and forth when the content then picks up the new size and fills
the layer.

Instead we tell Core Animation to fix the content to the top left
corner. If a layer is sized up without a corresponding layer contents
update this will result in missing/transparent pixels in the bottom
or right part of the layer, explicitly showing what the result of
the missing paint is. During debugging we also highlight this area
by adding a magenta background color to the layer.

Conversely, if the layer is sized down we don't need to resize it,
we can just keep the fixed top left position, and the content will
stay in place during the resize. This allows for optimizations
during window resizing, where we don't need to allocate new
buffers if the old buffer is larger than the new one.

Change-Id: I265b57e3a0ddff8bbcda3af5d670cd8c3b00b181
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-28 15:35:14 +00:00
Tor Arne Vestbø
4fade3c3b8 macOS: Resolve layer contents scale based on DPR
Change-Id: I32de4610a2aebbc7e0adcad9bb3440683cae5906
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-09-28 11:00:06 +02:00
Tor Arne Vestbø
cefd214b1b macOS: Improve layer delegate setup
We should detect the cases where there's already a delegate, and
setting up the delegate before the layer is added makes sense.

Change-Id: I67896cbc96d11ce9a3826fd8aa0e5e104a83a21c
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-09-28 11:00:02 +02:00
Tor Arne Vestbø
fd49d5e315 macOS: Flesh out and clarify layer setup
Change-Id: I10d972254c02de8789e64c8503861d51764a1633
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-09-28 10:59:58 +02:00
Tor Arne Vestbø
ce8a9c1b01 macOS: Propagate drawRect: dirty bounding rect as fallback
Change-Id: I333e2bfe4a25bfbfebef7b2ec30a600fd441c9a9
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2019-09-28 10:59:54 +02:00
Tor Arne Vestbø
10780c7b8c macOS: Gather QNSView draw callbacks together
Change-Id: I29881b379481287b4938e47fc06405c918aa39a3
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-09-28 10:59:43 +02:00
Kai Uwe Broulik
6883699994 QCommonStyle: Add SP_DialogNoButton case in standardIcon
It is present in standardPixmap but missing from standardIcon resulting in
QMessageBox using the fallback PNG provided by Qt for the "No" button.

Change-Id: If4f14c7de26eb32277cd19a7be75360dba4f4e29
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-09-28 06:53:11 +00:00
Laszlo Agocs
d83995caab Add an i.MX8 (aarch64) device spec
Not much different from i.MX6, apart from switching to aarch64 and the
appropriate tune flags.

[ChangeLog][Platform Specific Changes][Linux] Added a device spec for
64-bit i.MX8 systems (Vivante graphics stack)

Change-Id: I1fe939fca87d5f3031cefbf43fa359aeeaf44752
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2019-09-28 08:36:12 +02:00
Laszlo Agocs
d8cdf87de6 rhi: d3d11: Make tdr header private
Forgot the _p suffix.

Change-Id: I48225418fd40d45020b016b59578fcc1944d15c0
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-28 08:35:59 +02:00
Tor Arne Vestbø
401e81063f Replace use of deprecated API in macOS event dispatchers
Change-Id: I077ba12b406f662ba22b2f2cddf0171963335739
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-09-28 01:13:11 +02:00
Qt Forward Merge Bot
fbda189e08 Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2019-09-28 01:01:03 +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
d35de9e1b2 Windows/MinGW: Fix posted events timer not stopping
Specify the type of the enum value SendPostedEventsWindowsTimerId
to be UINT_PTR to work with the g++ interpretation of enumeration
signedness and use the correct type for the returned timer id.

Fixes: QTBUG-78491
Change-Id: I7b3f306d3f60da7a21500ece5243ac90854ccf1a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-09-27 20:44:31 +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
Albert Astals Cid
d12bf4eb83 Port two examples from QTime to QElapsedTimer
Change-Id: I23d13bf1e909801797a8fc2785c46f341ef5ee77
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2019-09-27 18:01:58 +02:00
Alexander Volkov
388d539865 doc: Fix variable name in QDBusArgument snippet
Change-Id: I751802d3f9f389e80cbb9aabcdb637d4742d3832
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-09-27 18:27:17 +03:00
Joerg Bornemann
21d988a199 Doc: Document CONFIG values that are worth documenting
Fixes: QTBUG-538
Change-Id: Id06e316e7ae3d59b63b256ef565a1ad6dc5d9dd2
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-09-27 15:51:25 +02:00
Leena Miettinen
f92a7c1288 I18N: Load qtbase_ translation catalogs in examples
...instead of the qt_ meta catalogs. The qt_ catalogs
are needed for backwards compatibility and depend on
translations for now deprecated modules, such as qtscript,
that might not be installed in the system. This causes
loading the translation to fail.

Instead of the qt_ catalogs, the examples should use the
translation files for the Qt modules used, here qtbase_.

Task-number: QTBUG-69203
Change-Id: I13f5a3d6653cef8379a712fbc02ec320eea4e51a
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-09-27 13:48:53 +00:00
Edward Welbourne
25430f90e6 Fix documentation of qfloat16
Various methods were undocumented and even one that was lacked a \since 5.14

Change-Id: I1e65ed1bb9c5b9de06210d7e18af36539aafc4ec
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-09-27 13:56:59 +02:00
Edward Welbourne
72457ed076 Fix doc of QDateTime::YearRange; include its \since 5.14
Change-Id: I2e6c27953ecce95df3ac4868a6d953596ba115f2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-09-27 13:56:55 +02:00
Marc Mutz
e24c387413 Short live QtPrivate::{condition_variable,mutex}!
This is a temporary measure to work around an implementation bug on
Integrity: For all other platforms, QtPrivate::condition_variable is
just std::condition_variable. On Integrity, it's a class that wraps
QWaitCondition to provide the interface of std::condition_variable.

This allows the use of std::condition_variable across Qt without
running into the Integrity issue. Once we can depend on an more modern
Integrity toolchain, removing QtPrivate::condition_variable is a
simple mechanical change:

   s/QtPrivate::condition_variable/std::condition_variable/g;
   s/QtPrivate::mutex/std::mutex/g;

Task-number: QTBUG-78450
Change-Id: I293a99d1cdc48691817b926aa51ecd84556e5e90
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-09-27 07:04:42 +00:00
Allan Sandfeld Jensen
0a8be8127b Fix robustness detection for windows
Fixes detecting requested robustness for OpenGL < 4.0.

Fixes: QTBUG-78781
Change-Id: I6a10f3ed925dd05d5caa7d6b6e12935e27eed3e9
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-09-27 06:44:59 +00:00
Christian Ehrlicher
efb9f2e1e4 tst_QListView: cleanup
Cleanup QListView autotest:
 - fix indentation
 - use QCoreApplication::sendEvent instead of QApplication::sendEvent

Change-Id: If6bb686502f6b4f2bc2dd0db52b331b2c35cf36d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-09-26 17:29:50 +00:00
Dmitry Kazakov
5839714d98 Fix QRandomGenerator initialization on AMD CPUs
Some AMD CPUs (e.g. AMD A4-6250J and AMD Ryzen 3000-series) have a
failing random generation instruction, which always returns
0xffffffff, even when generation was "successful".

This code checks if hardware random generator generates four consecutive
equal numbers. If it does, then we probably have a failing one and
should disable it completely.

Change-Id: I38c87920ca2e8cce4143afbff5e453ce3845d11a
Fixes: QTBUG-69423
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-09-26 19:52:50 +03:00
Laszlo Agocs
fc8d6d3ea1 rhi: gl: Fix not resetting color write bits when switching pipeline
This was visible in the triquadcube test when enabling transparent window
background: the cube on the left was rendered incorrectly because alpha
was not written out due to not setting glColorMask() back to the defaults
when switching to another pipeline.

Change-Id: I7a8c94072e0b68a58fffcc8c1a200e3940dcad44
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-26 17:02:43 +02:00
Laszlo Agocs
0628932fef Move cache key calculation to QOpenGLProgramBinaryCache
This class will likely be used by the OpenGL backend of QRhi as well.
Therefore, we need to make it more self-contained and independent.

Change-Id: If046ed41e25c70cc9abb45219b451f9179feaa1c
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-26 17:02:39 +02:00
Laszlo Agocs
c06627a230 rhi: metal: Eliminate redundant setCullMode and setFrontFaceWinding calls
Task-number: QTBUG-78605
Change-Id: Icc3a9636055b5f45418da28cc05aa02e19370c02
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-26 17:02:28 +02:00
Laszlo Agocs
22d22eb282 rhi: Add a --transparent option to manual tests
This will also cause clearing to 0,0,0,0.

Essential in order to allow fast testing of window transparency
issues in combination with QRhi and the various backends.

Change-Id: Iee2763c1d06f1d3e5d59a9142abaf30fab1dc543
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2019-09-26 17:02:12 +02:00