Commit Graph

40547 Commits

Author SHA1 Message Date
Marc Mutz
6fa34930c2 QFreeList: fix memory order on block deletion
Blocks are likely to have been created in a differnt thread from the one
performing their deletion, so we need an acquire fence.

The rest of the atomics use in the class looks ok, but nevertheless warrants
a deeper analysis.

Change-Id: I1571ded3a06695b0d58b5bf1d80d6283ac21f959
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-27 20:00:14 +02:00
Liang Qi
09075b40e9 Merge "Merge remote-tracking branch 'origin/5.13' into dev" 2019-06-27 20:00:14 +02:00
Liang Qi
25eb97d2d4 Merge remote-tracking branch 'origin/5.13' into dev
Conflicts:
	.qmake.conf
	src/network/ssl/qsslsocket_openssl.cpp

Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: Ibb57a0548b4977797b400637487a56245ac1c024
2019-06-27 14:38:03 +02:00
Anton Kudryavtsev
fc940b24db QString: fix comments for qsizetype
Change-Id: I445ba61513fbafd24834fa48ade849feae4f1324
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-27 11:47:27 +03:00
Friedemann Kleint
72e3d3633e 3rd-Party/Double conversion: Fix developer build with MSVC
Suppress warnings:
C4244: 'argument': conversion from 'const uc16' to 'char', possible loss of data

caused by various character handling routines.

Amends 327bfdb671.

Change-Id: I3818c5d0aecb9b6cee174f866b5e7e77aa96d877
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-06-27 10:46:41 +02:00
Volker Hilsheimer
2a756e294e macOS: lower the splash screen when a modal dialog blocks it
This fixes the usability issue of a modal dialog showing up behind a
splash screen, not visible to the user, but blocking user input and the
application startup sequence until discarded.

[ChangeLog][QtWidgets][QSlashScreen] On macOS, lower the splash screen
when a modal dialog is shown to make sure the user sees the dialog.

Change-Id: Ibae768f76909d930cb25dcf5cee31edc5f15c29a
Fixes: QTBUG-49576
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-06-26 15:49:01 +00:00
Aleix Pol
cc13b99781 Do not downscale png when the size is exactly right
Don't go through the doScaledRead path (i.e. calling read_image_scaled)
when reading an image that the target size is the image of the file we
are opening.
This makes the loading of the file much faster while keeping the output
correct.

[ChangeLog][QtGui][QImage] Improve loading time when loading png files
that have the same size as the target.

Change-Id: I2a33c49fe1ce52ec296c2175ee542b5bcdec2c4b
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2019-06-26 16:21:45 +02:00
Liang Qi
5859f7d0d9 Revert "Deprecate QAtomic::load() / store()"
This reverts commit 79bdc7cf1d.

We haven't ported every usages to loadRelaxed() / storeRelaxed() yet.
And warning as error is enabled in dev. We will revert this change
when new qt5 baseline got integrated.

Task-number: QTBUG-76611
Change-Id: I5b1f608fefbaca481311f376f22718f2c5047106
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-06-26 10:36:49 +00:00
Friedemann Kleint
ee8dfcaf67 tst_QThread: Blacklist sleep() for Windows
Task-number: QTBUG-76707
Change-Id: Iddce10fb3c8259b829d76596ffc9829f8d013bf3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-06-26 12:31:52 +02:00
Mårten Nordheim
89655525ae QHttpNetworkConnection: Change assert to early return and handle Http2
When using a http proxy (and presumably other proxies) we might have
failed/aborted (aka "finished") the request and _then_ receive a
"proxy authentication required" message from the proxy. In this case
there is no spdy/http2 reply in the queue, so asserting is wrong.

Change-Id: Id9b76b580299f6a6cd6efad62d6aaf63183816fb
Fixes: QTBUG-76426
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-06-25 17:20:35 +02:00
Heikki Halmet
0d6b4b5192 Add keyword msvc-2019 to testlib blacklisting
Change-Id: Ibb1d225909e6c0c8b35f3b41aeb619784012d43b
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-06-25 15:01:15 +00:00
Mårten Nordheim
e211697962 QHttpNetworkConnectionChannel: don't close if we're already closing
In some scenarios with QNAM we call socket->close, leading to a flush,
leading to an error, leading to another error emission... To work
around this scenario we stop trying to close the socket if the network
channel is already closing.

Change-Id: Id15504f476484ce61f11ba83a5755ceb5f581f9b
Fixes: QTBUG-76567
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-06-24 19:11:04 +02:00
Tor Arne Vestbø
44d9e9b096 Fix crash when setting QGuiApplication palette before app is available
Change-Id: Ia154f66a27cba970d179f100e66aa2daab01c9fa
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-06-25 20:08:15 +02:00
Laszlo Agocs
8862570905 rhi: d3d: gl: Remove incorrect exec.Cmd.Buf. assumption
May very well be called within an active pass when going
through beginExternal() (think examples like d3d11underqml)

Change-Id: Ie98e72609308f47497d83fbe10c19ad1ae8eade3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-06-21 15:04:13 +02:00
Laszlo Agocs
484fc8545f rhi: d3d11: Add compute and load/store res support
Also revise how we reset shader input/outputs at the beginning
of a pass.

Change-Id: I6d4057f32318ca09b12e16c602bb1033a3ec8e3c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-06-21 13:06:21 +02:00
Val Doroshchuk
f6ed603759 ANGLE: Invalidate client window area when resizing swap chain
Inspired by:
https://codereview.appspot.com/6812076/
Resizing a window larger results in the newly exposed region being invalidated
but the old region is treated as valid.
This can result in the old region no longer updating.
Was added to D3D9.

Improving a fix from Filippo Cucchetto:
https://codereview.qt-project.org/c/qt/qtbase/+/195336
and pushing to D3D11.

ifndef protects against compilation error for WinRT.
Invalidate() should be used only for desktop apps.

Task-number: QTBUG-46074
Change-Id: Ie24b8dffe130b970f2362337ac4f9bee666f82b2
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-06-21 12:30:32 +02:00
Joerg Bornemann
18a6c5ebe2 Fix QMAKE_LIBDIR_BCM_HOST for linux-rasp-pi3-g++
The directory must be prepended by = to denote the sysroot.
This amends commit 797f686e.

Change-Id: Ib85c0abc58fce3504ecccef0e223b2618ac9149a
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-06-25 09:42:09 +02:00
Joerg Bornemann
c450e8bd20 Fix .la/.pc replacements if libdir is in QMAKE_DEFAULT_LIBDIRS
We must use the same two-level replacements like for .prl files.
This amends commit d5071a40.

Change-Id: Iea065d01dee61cf2d1ff78640d045c3c76db9ac8
Fixes: QTBUG-76625
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-06-25 09:17:07 +02:00
Johan Klokkhammer Helsing
53da86fe8c Add a QVkConvenience class with vkFormatFromGlFormat
Converts from OpenGL formats to Vulkan formats.

There are commented out lines for the formats in QOpenGLTexture::TextureFormat
for which it was hard to find an unambiguous mapping to vkFormat.

Task-number: QTBUG-75108
Change-Id: I06a7fd8df7d98cef314410ffd79ca9cff6599357
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
(cherry picked from commit b21b07877a)
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Johan Helsing <johan.helsing@qt.io>
2019-06-21 11:19:58 +02:00
Ulf Hermann
084e17c4e1 Avoid undefined behavior in qjsonwriter.cpp
See comment in qnumeric_p.h:convertDoubleTo for details.

Change-Id: Ifcd13f7f67995af6a60e50ccabe843a855be04ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-20 12:19:00 +02:00
Volker Hilsheimer
7f69c13fd9 Skip tests if the required plugins were not deployed
This is usually the case on Android, where running this test would
require deployment of files to the emulator. This doesn't give us any
further testing that we don't already do by running this test on regular
Linux, so skipping the test instead if the preconditions aren't met.

Change-Id: I3722796634871213ba51c89ae7f40b19f954f2cb
Fixes: QTBUG-73566
Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2019-06-19 17:03:53 +02:00
Allan Sandfeld Jensen
64033c3592 Output all font families in HTML output
Fix our generation of font-family CSS so it contains the full list of
families.

Change-Id: I37d5efa64faeb4b6aeb7e2c5d6a54ff07febe9cc
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-06-21 13:31:38 +02:00
Liang Qi
bc8f871784 Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" 2019-06-25 15:47:42 +02:00
Liang Qi
aedc59b1c3 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	src/corelib/io/qstorageinfo_unix.cpp
	src/network/ssl/qsslsocket_openssl.cpp

Change-Id: Ibc9ce799bef62d60d616beaa9fbde8ebeadfbc20
2019-06-25 15:47:42 +02:00
Joerg Bornemann
f6db25962e Add QDebug streaming operator for ProString
This saves us lots of .toQString() and .toQStringList() typing when
qDebug()'ing qmake code.

Change-Id: I037e5e1816f2dcb6a20dec4c275f3d886f155ad5
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-06-24 17:40:07 +02:00
Joerg Bornemann
3a806254fe Fix 'clean' target for MinGW DLLs
'make clean' removed the import libs for DLLs which makes them quite
unusable. Move the import lib removal to the 'distclean' target.

Fixes: QTBUG-51977
Change-Id: I727d520435f88a83a7fb14cb0ad81f8fe7c6d61b
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-06-24 17:18:20 +02:00
Timur Pocheptsov
5b5e8f78fe NSMenuItem/NSMenu - set the submenu properly
... in case the submenu is set from a slot, attached to the aboutToShow()
signal. Normally, with a 'statically' pre-populated menu, we set 'submenu'
property on a menu item from 'updateItem' callback in our menu delegate.
After that, AppKit calls our delegate's willOpen call back and this is
where we emit 'aboutToShow'. Unfortunately, if an application tries to
create a nested menu 'dynamically' at this point, it never becomes 'submenu'
of the item, since 'updateItem' was already handled at this point.

We catch this case in QCocoaMenuItem and call setAttachedItem if needed.

Fixes: QTBUG-76060
Change-Id: I676bf1d8529b9ddbfc90e4dff422b39668b7a5fa
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-06-21 15:12:57 +02:00
Venugopal Shivashankar
e3b3dbbe93 Example: Move the SQL statements
Used const variables for the SQL statements,
so that the code looks similar to its
couterpart in Qt for Python.

Change-Id: If2a505a404deff77d3d37c5ffad913c8c538d0b3
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-06-21 09:14:36 +02:00
Morten Johan Sørvig
b6ded193ee QHighDpi::fromNativePixels: use correct screen
Calls like
	QHighDpi::fromNativePixels(point, window)

would return device independent coordinates outside any
screen in cases where the window is spanning multiple
screens and the native point was not on the main screen.

Correct this by looking up the correct screen and use
its scale factor and origin when scaling coordinates.

Task-number: QTBUG-73231
Change-Id: I01a3a42f42121b8d9f4ced2bb0fb023d6ae6bfe7
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2019-06-19 15:05:15 +02:00
Tor Arne Vestbø
244ff33119 styles example: Use QImage instead of QPixmap in NorwegianWoodStyle
Using QImage allows creating the style before the application has
been created, and is the more modern API.

No changes to the documentation needed.

Change-Id: Ifa0e5fa1113802fca18fbd45bb3c0a5ba1dbfeab
Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
2019-06-25 20:08:26 +02:00
Friedemann Kleint
530c6903a4 Brush up Diaglib
Fix most clang warnings about override, nullptr, range-based for loops.

Change-Id: Id47e57adb63a38e2f397a31511b788a2432c97cf
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-06-24 08:56:00 +02:00
Laszlo Agocs
33f16af307 rhi: metal: Reuse drawable after a frame without a present
The source of this is likely a "window" grab from Qt Quick. Requesting
a new drawable is an error in this case since we do not enqueue a present
for the current one.

Change-Id: I64bab03ff46743ce1f270b251229be126f9ad9fb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-06-18 16:18:05 +02:00
Andy Shaw
9be66cb282 Android: Use Android button layout for the DialogButtonBoxLayout hint
Fixes: QTBUG-70045
Change-Id: I9c51e9a769f510a6f14f6e9d78583caf3df15031
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-06-18 11:04:22 +00:00
Volker Hilsheimer
0f3f143f6d Fix window shortcuts when a completer popup has focus
The completer popup has focus, making QShortcut direct to it's window
rather than to the window the completer belongs to. As QShortcut handles
the case for Tool windows that have a parent, but doens't do the same
for popups. And they shouldn't be treated the same way, as a context
menu popup for a e.g. text edit should in fact block the text edit's
shortcuts while open.

However, the completer popup is special, in that it explicitly makes the
widget completes for its focusProxy, which is what we can use to fix
this issue.

Change-Id: Ie7177d39668b3af14a1d9e0ee5d93eca9c67c8af
Fixes: QTBUG-4485
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2019-06-25 00:04:15 +02:00
Thiago Macieira
859eb2467d Add qmake config for controlling LTCG behavior for static libs
Static libraries may get installed and used by other builds, which may
be done with a different version or build of the compiler. So this
commit introduces two new flags:
 - no-static-ltcg: disables LTCG completely for static libraries
 - fat-static-lto: forces static libraries to produce fat LTO objects

fat-static-lto is useful for Linux distributions, since installed static
libraries should not carry LTO information, but that information is
useful during Qt's own build. This feature should be used alongside some
compiler-specific method of removing the LTO information from the
static libraries prior to installation, so only the regular part
remains.

For current GCC versions, this command suffices:
  strip -R '.gnu.lto*' -R '.gnu.debuglto*' libname.a

Otherwise, distributions can use "no-static-ltcg" to disable it
completely.

Change-Id: I495bc19409f348069f5bfffd155237ade9f4b42f
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2019-06-17 15:27:51 +00:00
Thiago Macieira
cbdc9a7786 RCC: Change the default compression to Zlib
Codebases using QResource::isCompressed() and assuming it is Zlib break
if zstd is enabled. So change the default back to Zlib until Qt 6.0.

[ChangeLog][Important Behavior Changes] RCC's default compression
algorithm was changed back to Zlib, as it was in all previous releases
until 5.13.0. The default will remain Zlib for all Qt 5.x releases but
will change in Qt 6.0. To activate Zstd compression for your resources,
either pass the --compress-algo=zstd option to the rcc tool or add the
XML attribute compression-algorithm="zstd" to the <file> tags in the
.qrc file.

Task-number: QTBUG-76521
Change-Id: Ief874765cd7b43798de3fffd15a9f56fd9ad1ad4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-06-20 09:51:40 -07:00
Eirik Aavitsland
2ce4a9f487 Fix crash in QPainterPath::reserve()
Function did not handle default-constructed (null d_ptr) path correctly.

Fixes: QTBUG-76516
Change-Id: I2925d4306f7fce34ece6739b18a8e275e7970837
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2019-06-19 16:47:19 +02:00
Liang Qi
71ed62bc4c Merge "Merge remote-tracking branch 'origin/5.12' into 5.13" 2019-06-20 07:50:44 +02:00
Liang Qi
bd9959bde2 Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts:
	.qmake.conf
	src/gui/painting/qdrawhelper.cpp
	src/network/ssl/qsslsocket_openssl.cpp
	src/widgets/styles/qstylesheetstyle.cpp

Change-Id: Ibe1cd40f46a823c9e5edbe0a3cd16be1e1686b17
2019-06-20 07:50:44 +02:00
Paul Wicking
6398588338 Doc: Fix typo in brief
Fixes: QTBUG-76512
Change-Id: I8db4288b22416c6af9aaaa72c5005b81d79bf620
Reviewed-by: Martin Smith <martin.smith@qt.io>
2019-06-19 15:18:50 +02:00
Volker Hilsheimer
b877285694 Android: don't run test function for fd leakage, make test pass
It is sufficient to run this test on systems where we don't need to
set up dependencies and satisfy other assumptions the test makes. It is
safe to assume that if this test passes on regular Unix, then
QTemporaryFile will behave as expected on Android as well.

Change-Id: Iaf9a67d7c12b3acfd0992bab591c3f906b073d9e
Fixes: QTBUG-73564
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-06-19 00:04:29 +02:00
Volker Hilsheimer
6275e037bf Android: Make sure that the root file system is in the list of volumes
On Android (at least in the emulator), the root file system is reported
to be of type rootfs, which we usually ignore on Linux as legacy.

Also, it's a read-only file system with bytesTotal reported as zero. We
usually ignore such volumes, but as the root file system is expected to
be in the list, we should never ignore it.

This fixes the failing QStorageInfo test.

Change-Id: I778ee9e76e385649e58d5e5ac7e0ae2d8e0ba92b
Fixes: QTBUG-73563
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2019-06-18 23:03:01 +02:00
Timur Pocheptsov
cdfe8c76af checkOcspResponse - remove unneeded locking
and also plain wrong comments: since we don't set verification callback
on a store - we don't have to lock (our q_X509Callback never gets called).
This change should simplify the merge with change I have in 5.12 (where
I completely got rid of locking). Since I don't care about exact errors
found (relying on the fact it's the same chain of certs we check in
SSL_connect/SSL_accept), for now we don't try to extract them from
OCSP_basic_verify. In fufure, if these chains are different, we
can create a temporary store (see how it's done in 'verify', for example)
and set a VF callback on this store.

Change-Id: I4a36e19836d19c2ea95c869dcfe85f49fe723ff0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-06-17 14:55:55 +02:00
Laszlo Agocs
6f4aa54131 rhi: Add compute api and implement for Vulkan and Metal
D3D11 and GL (4.3+, ES 3.1+) will come separately at a
later time.

Change-Id: If30f2f3d062fa27e57e9912674669225b82a7b93
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-06-17 10:32:57 +02:00
Laszlo Agocs
4c297bdca8 rhi: Make it possible to request making the context current on GL
Needed by Qt Quick to handle cases where the application (or other Qt)
code contains OpenGL calls, and Qt Quick facilitates this by ensuring
the scenegraph's GL context is current. The expectation is that when
running with the GL backend of the rhi, all such code remains fully
functional. So add a makeCurrent type of call into the QRhi API that is
a no-op with anything other than OpenGL.

Change-Id: I6f774bf828e31802bdab0c3fef9421cdc0cebe5c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-06-17 12:17:19 +02:00
Laszlo Agocs
39d74b5b3d rhi: Remove reserved and since from the shader classes
Private API, do not bother with these yet.

Change-Id: I77fb8fadee427425759ed42234944b30155db0f5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2019-06-17 09:31:03 +02:00
Liang Qi
6657d8b925 Merge "Merge remote-tracking branch 'origin/5.12' into dev" 2019-06-25 13:04:27 +02:00
Liang Qi
ef37ab9970 Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
	.qmake.conf
	src/gui/painting/qdrawhelper.cpp
	src/gui/text/qdistancefield.cpp
	src/gui/text/qdistancefield_p.h
	src/network/ssl/qsslsocket_openssl.cpp
	src/plugins/platforms/android/qandroidinputcontext.cpp
	src/widgets/styles/qstylesheetstyle.cpp

Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io>
Change-Id: Ia7daad21f077ea889898f17734ec46303e71fe6b
2019-06-25 13:04:27 +02:00
Tor Arne Vestbø
6fa5dfddf8 Don't hardcode compiler when building headers
Normal sources are built using $(CXX), which is defined in the makefile,
but can be overridden. We should do the same lazy evaluation of the
compiler for headers.

Change-Id: Ic548786bd18ed8fb7eb0b58a527615ab19000323
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2019-06-13 14:11:50 +02:00
Tor Arne Vestbø
d5adaacbb2 macOS: Make QMacStyle::standardPalette() reflect the platform theme
This palette isn't usually used, and the platform theme's palette is
preferred, but if a client asks for the standard palette (e.g. as
used in the styles example) we should try to report a palette that
gives the system look.

Change-Id: Ie5e58c890c13c716a9e9b5093b954a737e550dee
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2019-06-19 11:43:14 +02:00