Commit Graph

41636 Commits

Author SHA1 Message Date
Lars Knoll
746ab5f16d Remove potential out of bounds accesses to QList
Change-Id: I13431e45ef329921a8846c38047f704a299a1a94
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
2019-10-10 19:45:30 +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
Joerg Bornemann
472f5331ca Doc: Fix QMAKE_EXTRA_TARGETS snippet description
The snippet uses the Unix touch command, not qmake's touch function.

Change-Id: I71d1460447249b8941ce4bdbb494bb419e13b119
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-10-10 14:43:15 +02:00
Joerg Bornemann
a6ece9e88a Fix relocatable prefix for hardware-specific Linux builds
Since Qt 5.3.0 we recommend that Linux distributions place a
SSE2-enabled copy of QtCore in a $PREFIX/lib/sse2 subdirectory (see Qt
5.3.0 changelog for details). Same for other hardware capabilities like
AVX2 and AVX512.

This use case was broken with the introduction of the 'relocatable'
feature, because the prefix is determined from the location of
libQt5Core.so and the relative path from libdir to prefix, which is
baked in at configure time.

We now try to locate the libdir below the prefix, and if that fails try
again in the upper directories.

Fixes: QTBUG-78948
Change-Id: Ieec6e1484974e19335cf08ae0df3ee5c0e316d28
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2019-10-10 13:26:37 +02:00
Liang Qi
386768298c Merge "Merge remote-tracking branch 'origin/5.13' into 5.14" 2019-10-10 13:26:37 +02:00
Friedemann Kleint
ae7b218982 Windows QPA: Improve reliability of clipboard retrieval
Clipboard retrieval sometimes fails due to the other application
having the clipboard locked. Retry opening the clipboard.
The choice of parameters is empirical, they have been observed
to prevent failures for MS Office applications at least.

Fixes: QTBUG-53979
Change-Id: Icbcaee149f0d377f33b222cdafbb2a21a7f1cf9d
Reviewed-by: André de la Rocha <andre.rocha@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2019-10-10 13:26:37 +02:00
Friedemann Kleint
f7cb11d6f1 QWidget: Answer question raised in fixme comment
Add a comment for fixme comment added in
f1268d137e.

Change-Id: I08cd104442b13925be2aa5a48e64e391c9903099
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-10 13:26:37 +02:00
Volker Hilsheimer
3dbc7596a3 Drag'n'Drop: fix crash when widgets are destroyed during event handling
Widgets might be destroyed when handling a dragMoveEvent, in which case
the following code will operate on dangling pointers or null pointers.
Use a QPointer to watch for the original event receiver to disappear,
and add the necessary checks for the objects we deliver events to being
null.

Change-Id: I4ca2f182540ae21113f4bea4e5c569e983cc58bf
Fixes: QTBUG-78907
Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
2019-10-10 11:02:34 +00:00
Timur Pocheptsov
9845c06d1f DTLS auto-test(s) - fix a buggy logic with pending datagrams
Fixes: QTBUG-79128
Change-Id: Ifebd5b056541b7732b15b5cf063ad22ab754a64c
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-10-10 11:28:24 +02:00
Eirik Aavitsland
d2ae838a7c Item views: fix regression causing unexpected widget overlapping
A certain geometry adjustment was (practically) introduced in Qt 5.11,
and caused very surprising behavior, where item widgets will often
overwrite neighbouring cells. This has resulted in a number of bug
reports. Since the adjustment has such serious side effects, and does
not seem to be relevant any longer for the issue for which it was
intended, remove it here.

More details: From early Qt 4 times, QStyledItemDelegate would do some
automatic expansion of the geometry of editor widgets - but only if
the layout was RightToLeft. Hence, the effect of it was rarely
seen. QTBUG-37433 did, for Qt 5.10, and complained about it. However,
the resulting code change did not remove the adjustment, but instead
extended it to apply to the normal LeftToRight layout also. Hence,
more users experienced it, and reported it as a regression.

Also, now in Qt 5.13, it seems Qt has changed in other ways, and the
geometry adjustment no longer seems to help (or indeed make any
difference to) the original case in QTBUG-37433.

Fixes: QTBUG-78495
Fixes: QTBUG-76011
Fixes: QTBUG-68476
Change-Id: I4a4e873969eb1d89843f98fc63d90371207515d1
Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
2019-10-10 10:54:31 +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
Shawn Rutledge
18aa8390ce Add qt.qpa.input.events logging to evdevtouch
The xcb platform plugin uses this category for detailed input event
logging, so we might as well be consistent in evdevtouch.  When hardware
supports pressure sensing, it's likely to need extra debugging.

Task-number: QTBUG-77142
Change-Id: I7682bb5d49e669054523f9cf556715e511bcd572
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-10-10 06:10:29 +02:00
Giuseppe D'Angelo
22891dd897 Explain an usage of volatile
It's to work around QTBUG-45307.

Change-Id: Ib6076223013e5b1ccfa6ec25e2d040daaa2f19dd
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2019-10-09 22:39:52 +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
Timur Pocheptsov
5e7365573e Remove a new-line
that was accidentally introduced this week.

Change-Id: I0731c7c64e51b40f230b42694603056d89a05712
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-10-09 17:15:06 +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
59604405c9 rhi: Fix non-base level copy and readback wrt source size
When the source size is not explicitly specified, we take the entire
subresource. However, just using the texture's size is wrong: when the
source level in a copy or readback is not 0, the size for the corresponding
mip level has to be used instead.

This fixes occasional crashes with Metal in the autotest.

Change-Id: I99f689feef93ec86dffdc9e82d6bfdaf5c1eb041
Reviewed-by: Paul Olav Tvete <paul.tvete@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
32924110ce rhi: gl: Switch GetBufferSubData emulation to MapBufferRange
Use only APIs that are in GLES 3.0.

glMapBuffer() is an old OES extension, stop bothering with that.
Not the least because ANGLE claims supporting it and then fails the
map. (not that we care much about ANGLE, but, for instance, the qrhi
autotest is run with ANGLE configurations as well in the CI, so have
to still take care of it for the duration of Qt 5.x)

Change-Id: I29140402cedffe0430f920ee0c061673257c3aa1
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
e22399af82 Make QRhi::create() return false when there is no MTLDevice
The interesting part here is that sending messages to a null
object is valid in Objective-C, so without an explicit check it
is not necessarily straightforward to discover that we do not
have working rendering. (because the application won't just
simply crash)

Do the right thing now and return false like other backends do.

Task-number: QTBUG-78994
Change-Id: I0d3c4a49a3fc78f9149f8af4fe67d581e74daae7
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
Thiago Macieira
780137d585 QRandom: add support for RDSEED
The Intel whitepaer[1] recommends using the RDSEED over RDRAND whenever
present. libstdc++ from GCC 10 will also use it in std::random_device.

[ChangeLog][QtCore][QRandomGenerator] The system() random generator will
now use the RDSEED instruction on x86 processors whenever available as
the first source of random data. It will fall back to RDRAND and then to
the system functions, in that order.

[1] https://software.intel.com/en-us/articles/intel-digital-random-number-generator-drng-software-implementation-guide

Change-Id: I907a43cd9a714da288a2fffd15bab176e54e1975
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2019-10-09 07:31:28 -07:00
Milian Wolff
63a3b26b6b Fix QMake build system to support trace points in a cross-compiled build
CONFIG(cross_compile) implies CONFIG(force_bootstrap). The latter is
errorneously used within qt_tracepoints.prf and to decide when
tracegen is to be build.

For the tracepoints, we just need to check if etw/lttng trace points
are enabled.

For tracegen, we don't need to check anything - it doesn't depend
on etw or lttng, it is just a code generator similar to moc or rcc
and should be handled like these tools.

Change-Id: I3784b37db10680efd0ed7ee7860059bdf62b4118
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-09 16:20:08 +02:00
Milian Wolff
2d7ec5922a Fix compile with tracing enabled: include QStringList header
Change-Id: I40f737338d10a871442bb453fe1eeede9dacec79
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-09 16:19:17 +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
Lars Knoll
8c092570fc Fix warning about out of bounds access in QString::operator[]
Fixes runtime warnings that got triggered by change
c2d2757bcc.

Change-Id: I50620b179de8608f45d6f2ef053eeb8b1e10ae43
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2019-10-09 15:58:08 +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
Kai Koehne
a1ea498789 configure: Do use pkg-config --libs for static libs
This ensures that also linker commands like -pthread are returned.

Fixes: QTBUG-77159
Change-Id: If9ab3797ccfb52c6b96a4ab120c59fd8896d5466
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
(cherry picked from commit 4ddc50c0cd16ddd146ea9ea21d6565c8f4a5e2bc)
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2019-10-09 07:27:14 +00:00
Timur Pocheptsov
b7a915398a QAuthenticator - use GSS framework, as Apple requires
since declarations in gssapi.h are marked as deprecated.

Fixes: QTBUG-78810
Change-Id: I241ae4913f362f6e9219438e9bfe7a63dfc91b7c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2019-10-09 06:08:19 +02:00
Tor Arne Vestbø
9115c7ae45 qmake: Avoid writing glue project file when only generating prl files
When qmake is run with -prl we don't need to write the glue makefile,
and doing so will end up with MakefileGenerator::writeProjectMakefile
trying to write to an invalid Option::output, resulting in warnings:

  QIODevice::write device not open

Change-Id: I196b185570e7329c621c2ccb8530b43f4be51ee6
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-09 02:10:03 +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
Volker Hilsheimer
0683de205f QtConcurrent: fix warning about function parameters shadowing class members
No functional change.

Change-Id: I76aa01e8eb044c794d518ca72e6861cf95060dfc
Fixes: QTBUG-79071
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2019-10-08 23:21:14 +02:00
Volker Hilsheimer
00e8f044e1 QWidget: document that a widget might only get a mouseDoubleClickEvent
If two widgets are on top of each other, and the top widget disappears
in response to a press or release that is followed by a double click,
then the widget at the bottom only receives the double click event.

This is a sequence of events that the application developer that choses
to build such a UI has to take care of.

Change-Id: I440efd2cac01631de8995abf9a9fb76815de8f9a
Fixes: QTBUG-61173
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2019-10-08 23:20:39 +02:00
Shawn Rutledge
ee9bc61cd9 evdevtouch: Report stationary touchpoints that include pressure changes
Task-number: QTBUG-77142
Change-Id: I35446092679573df51891302155c896a3bb6fc1c
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-10-08 23:16:30 +02:00
Alex Henrie
ca81c884f8 Include XDG font locations in QStandardPaths::FontsLocation on Linux
~/.fonts was deprecated in 2012, see
https://wiki.archlinux.org/index.php/Font_configuration#Fontconfig_configuration

Few people keep fonts there anymore.

Change-Id: Ide048e1df2c2db4856a38c574df36663ab684f89
Reviewed-by: David Faure <david.faure@kdab.com>
2019-10-08 12:42:38 -06:00
David Edmundson
3425c9c6d7 Handle context loss in QPlatformBackingStore
This powers a QQuickWidget and we also need to reset the context if we
get a context loss event.

Change-Id: Id8b7112606670985860069c2bb11cf141b3ac723
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-10-08 18:11:12 +01:00
Tor Arne Vestbø
c962c77044 CoreText: Warn the user when family alias lookup slows down the application
If the user specifies a font family in their application that doesn't
exist in the system, or one that uses the localized family name, we
will end up resolving the family alias for all fonts in the system,
which typically adds 600-800ms of startup time. Let the user know
when this happens.

Change-Id: Id8d6f55028e37f681ec4a686df25d33240b5a30f
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2019-10-08 19:11:12 +02:00
Tor Arne Vestbø
6906b0647a macOS: Pass required parameters to NSOpenSavePanelDelegate callbacks
Change-Id: I0e0322734a077e4ee948128f3ba6c074514ccbb9
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-08 19:11:12 +02:00
Tor Arne Vestbø
b8a17ee135 Fix double free when debug printing QFont with non-default verbosity
Change-Id: Ieb7fa19e8bdd98f5283f7f6d8751e6532c8e0fc4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-08 19:11:12 +02:00
Joerg Bornemann
53ac8094b1 Fix PRE_TARGETDEPS for iOS projects
This variable was ignored for iOS projects, because the generated
Makefile includes xcodebuild.mk that defines its own default target.

Export PRE_TARGETDEPS to the Makefile before including xcodebuild.mk
and use it there for the dependencies of the generic build targets.

Fixes: QTBUG-41325
Change-Id: I5faa82e05570974b5a844ae95b0a012c3badc64a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2019-10-08 17:24:57 +02:00
Kari Hormi
b6ce61f486 Fix text not rendering properly after setAlignment call
Sometimes when setAlignment is called, the text stops rendering
correctly at some point. Adding relayoutDocument call to setAlignment
fixes the problem.

Fixes: QTBUG-78728
Change-Id: Iab1cf161f0c8d700804448733338c813b5bf9762
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2019-10-08 14:52:09 +03:00
Johan Klokkhammer Helsing
7a3d647bab Vulkan: Add platform hooks before presenting
This allows the Wayland plugin to circumvent the frame callback handling of the
driver (which blocks until the frame is presented, potentially forever, if the
window is minimized).

Task-number: QTBUG-78000
Change-Id: Ia7d347019dfeae3bfcfad3d0cca3f4fffdc8c7a9
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2019-10-08 12:16:51 +02:00