Commit Graph

45921 Commits

Author SHA1 Message Date
Oliver Wolff
2216f10ffd Update src/gui/CMakeLists.txt
The result of running pro2cmake.py

Change-Id: Iaaf959069db527c43c8bcdc2cf51e2813bf8d140
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-29 11:30:30 +02:00
Lars Knoll
ef5631ef91 Remove duplicated snippets
This file hasn't been touched in years, the current snippets file
is in src/corelib/doc/snippets

Change-Id: I919649a4284805d15ccb76d50fb690f5d3a23455
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-05-29 11:30:30 +02:00
Eskil Abrahamsen Blomfeldt
4e5d686a87 Make tst_QTextLayout::textWidthVsWIdth() more robust
Some fonts misreport the minimum right bearing, and in those cases
we may not be able to do a perfect text layout inside the bounds
set. This is a limitation we have chosen to accept.

To avoid random failure when testing this, we detect the case and
skip the test if we see that it may fail.

Fixes: QTBUG-84415
Pick-to: 5.15
Change-Id: I6b53ea2631c5c6e476e2902b5514829a2141796f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-05-29 07:28:10 +02:00
Lorn Potter
bc380b242d wasm: add more debugging information
This also fixes source maps not getting created in debug mode.

Pick-to: 5.15
Fixes: QTBUG-83607
Change-Id: I3ed388c4fef6c286fa452a1c700fa65c2a8f9529
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-05-29 11:56:36 +10:00
Simon Hausmann
36f6922925 Implement support for QProperty<T> with a static observer
A common pattern in Qt Quick will be QProperty members that are
connected to a callback that needs to perform something when the value
changes, for example emitting a compatibility signal or marking scene
graph node data dirty.

To make such a pattern more efficient, a new QNotifiedProperty type is
introduced that offers the same API as QProperty<T>, with two changes:

    (1) The template instantiation not only takes the property type as
    parameter but also a callback pointer-to-member.

    (2) Since that member itself cannot be called without an instance
    and to avoid storing an instance pointer permanently, the API for
    setBinding and setValue are adjusted to also take the instance
    pointer. For the former it gets stored in the binding, for the
    latter it is used to invoke the callback after setting the new
    value.

Change-Id: I85cc1d1d1c0472164c4ae87808cfdc0d0b1475e1
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-05-28 21:08:51 +00:00
Lars Knoll
66d6943478 Add missing number/setNum() overloads
QString has the overloads taking a long/ulong. QByteArray also has
toLong/ULong(), so add these to make the API symmetric.

Change-Id: I6d1f98ca95fabd32b012f1c3df603dc54e187ec3
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-05-28 22:09:45 +02:00
Tor Arne Vestbø
7172b5112e Move QtPlatformCompositorSupport into QtOpenGL
Task-number: QTBUG-83255
Change-Id: Id9ea654db8efb00b487d53aea03d7f23a7ab1a54
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-05-28 21:39:48 +02:00
Allan Sandfeld Jensen
d80a98d525 Fix ExtendedRgb and Rgb encoding comparisons
ExtendedRgb should be treated as Rgb as it can be an automatic upgrade.

Pick-to: 5.15
Change-Id: I2942a1067ed5cacb2f60f303f467887cb44c36dd
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-05-28 21:15:55 +02:00
Cristian Adam
0ea99a68f9 CMake Build: Rename cmake_command to cmake_language
The function name has been changed upstream (3.18).

Change-Id: I76a26cdc8de71dffa5402a7c7423006a7a01552e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-28 20:47:18 +02:00
Alexandru Croitor
c83a9bfb9a CMake: Tidy up qt_get_direct_module_dependencies
It's only calls were with the PUBLIC argument, so remove the argument
both in the declaration and call sites, and just return the public
dependencies.

Fix up the names of the variables as well.
Amends b56dc55c3a

Change-Id: I830c1894376d0d3a2eb2bd4ffa38a1b3b3066292
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-28 20:47:09 +02:00
Michal Klocek
d479c6db2c Override debug generation request on mac for toolchain.prf
Override request for debug info during compiler 'test',
otherwise call to dsymutil will fail call with /dev/null.

Use case here is to pass for example -glldb with CXXFLAGS.

Fixes: QTBUG-62953
Fixes: QTBUG-84467
Pick-to: 5.15
Change-Id: Ief8f987afb40d0b90da732195d67d476e7bb3aff
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-05-28 18:40:57 +00:00
Ivan Tkachenko
93c8b4c0c8 Fix most obvious typos in doc comments
Just opened some files with spell checker turned on,
and corrected what was underlined.

Also, see QTBUG-84427.

Change-Id: I702b5bf2cfe1f23c928a6a57f117a2f571ad86ea
Pick-to: 5.15
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2020-05-28 15:57:13 +00:00
Laszlo Agocs
56977990e0 rhi: Harmonize create-destroy API pattern with the rest of Qt
For historical reasons we use build and release instead of create and
destroy. This becomes confusing now that more modules in Qt start taking
QRhi into use. Migrate to the more familiar naming, so those who have
used QWindow or QOpenGLContext before will find it natural.

Change-Id: I05eb2243ce274c59b03a5f8bcbb2792a4f37120f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-05-28 17:53:32 +02:00
Laszlo Agocs
c991d87ee2 rhi: d3d11: Use qstrncpy to avoid MSVC warning
Switch strncpy to qstrncpy, which internally uses strncpy_s with MSVC.

This way we will not get the following warning:

qrhid3d11.cpp(933): warning C4996: 'strncpy': This function or variable
may be unsafe. Consider using strncpy_s instead. To disable deprecation,
use _CRT_SECURE_NO_WARNINGS. See online help for details.

Change-Id: Iaed86033b0fc182e68804f311ac382c93c72abda
Reviewed-by: Christian Strømme <christian.stromme@qt.io>
2020-05-28 17:53:23 +02:00
Edward Welbourne
449b347644 Rework QLocale and QDateTime tests that expect CET abbreviation
The name CET is locale-dependent; but QLocale doesn't know about
localization of time zone names. Such abbreviated zone names are, in
any case, potentially ambiguous - various zones around the world have
collisions - so they can't be relied on.

QTimeZone's various backends have differing handlings of how to
abbreviate zone names (MS's provides no abbreviated names at all); and
it appears macOS actually follows the relevant localizations.

So it is hopeless to hard-code the expected zone abbreviations.
Changed the tests to consult QTimeZone for the abbreviation and
compare what it gets with the results of checks which should match
this. This is less stringent, but it is at least robustly correct,
thereby getting rid of assorted kludges and #if-ery.

Pick-to: 5.15
Task-number: QTBUG-70149
Change-Id: I0c565de3fd8b5987c8f5a3f785ebd8f6e941e055
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-05-28 15:15:17 +02:00
Topi Reinio
67d6b05aac Doc: Fix issues with Qt Test documentation configuration
Remove '/' as an example directory. We do not want to retrieve the
directory tree of the entire system.

Change-Id: I1caa7ef659dfe326515a4d81193682dacb373856
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-05-28 15:14:09 +02:00
Giuseppe D'Angelo
7c8c8272b4 Actually apply the shadow stack Intel CET flags
C&P mistake dropped $$ from qmake variables, my fault.
Will squash manually in 5.15 to avoid introducing a bug there.

Amends fa98adbd04.

Change-Id: I3ce33dba16f512cd20c8d3c6adc4c1a09506c1ea
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-28 15:13:59 +02:00
Alexandru Croitor
b56dc55c3a CMake: Fix qmake .depends info generated for module_private.pri files
Previously we checked the LINK_LIBRARIES property of the main module
target, but we should instead use the values of
INTERFACE_LINK_LIBRARIES set on the FooPrivate module.

Because both versionless targets and private targets are interface
libraries, we need to properly differentiate between them when
following versionless targets to their main associated target.

To do that, instead of using string comparison, export an additional
private _qt_is_versionless_target property, and query that.

Also make sure to set and export the _qt_config_module_name property
on the FooPrivate targets.

Also make sure to APPEND to EXPORT_PROPERTIES rather than override
(looking at you QtFeature.cmake).

Task-number: QTBUG-75666
Change-Id: Ia3261e218840e9f5217ab49755e8c876560e294d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-05-28 15:13:43 +02:00
Alexandru Croitor
e189126f1a CMake: Use -fapplication-extension when building Qt libraries on macOS
Needed to avoid linker warnings transformed into errors, when linking
QtWebEngine with qmake mixing.

ld: warning: linking against a dylib which is not safe for use in
application extensions:

The flag is added to libraries and plugins, unless opted out.

CMake equivalent of 944110089d

Task-number: QTBUG-83929
Task-number: QTBUG-75666
Change-Id: I3e9acca4712c9a266bf54c6e35e2fd2c0096692b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-05-28 15:13:27 +02:00
Edward Welbourne
f20f0b03d5 Cache system zone ID when fetched from the file-system
Record the device and inode numbers when found and assume we can
safely re-use the name if those have not changed.

Tidy up some preprocessor trivia in the process and moved
zone-availability check functions to before the system name lookup.

Pick-to: 5.15
Task-number: QTBUG-75585
Change-Id: I3660922ef3c94b553a20f887a676e8921693b30f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-28 15:13:05 +02:00
Jarek Kobus
bd877e76a8 Make threadCount a const member of ReduceKernel
Change-Id: I8e75263d3e02a6e6a20520ebecfdb4e40b562bbf
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-05-28 15:12:56 +02:00
Jarek Kobus
eb5d8efc51 Pass the thread pool into ReduceKernel
This was overlooked when enabling setting a custom thread pool
for various concurrent methods.

Fixes: QTBUG-53465
Change-Id: I189a7776fa02bbc3e995538cc154a7246ad1ad7a
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-05-28 15:12:41 +02:00
Jarek Kobus
9aea74f2c6 Pass the thread pool into BlockSizeManager
This was overlooked when enabling setting a custom thread pool
for various concurrent methods.

Fixes: QTBUG-53465
Change-Id: I8b0a0086e46639639051fe99cf52d049f7bb3bb2
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-05-28 15:12:29 +02:00
Jarek Kobus
b6a2962a52 Make some members of IterateKernel const
Change-Id: Ifeabebcbb7212a8c2799a37665b290983fd64105
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2020-05-28 15:12:16 +02:00
Dimitrios Apostolou
b37cf68810 Add tests for a couple of edge cases
Change-Id: I1cd799cc671fa2191e20d4681632588dc79e98dd
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-05-28 10:48:58 +02:00
Dimitrios Apostolou
bc58e0dc7a Address Coverity defect about buffer overrun
Coverity warned that chunk could be >= tldChunkCount (2), and
tldData[chunk] (array of length 2) would be accessed out of bounds.

This can not happen, but it was unclear.
Clarify logic with comments and asserts, that Coverity will hopefully
understand now.

Change-Id: I2a38c685cfcbc69ed123918e8cbed360b20b1035
Coverity-Id: 178254
Pick-to: 5.15
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-05-28 10:48:58 +02:00
Dimitrios Apostolou
d4d08e009d Regenerate qurltlds_p.h
With the recent changes in the utility that generates it, it now has
improved readability and constexpr arrays, usable in static asserts.

It also has an updated list of TLDs.

Change-Id: Ibdc986d667feebeb141ff81f6fddbc05b6be8488
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-05-28 10:48:58 +02:00
Dimitrios Apostolou
52f218ee83 Change const arrays to constexpr
so that they can be used with Q_STATIC_ASSERT().
Also constify more another array.

Change-Id: I1e7208127e06abb33af9bdc46712657af5dc98fe
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-05-28 10:48:58 +02:00
Dimitrios Apostolou
fa81b3ebe2 Update paths pointing to old locations
Change-Id: I2fb14834b34827ed4e84e9f7dc0791aa810a32ce
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-05-28 10:48:58 +02:00
Dimitrios Apostolou
5b3c3ff97e Improve readability of the autogenerated arrays in qurltlds_p.h
The next time qurltlds_p.h is generated, array sizes shall be explicit.
Also added some helpful comments. And updated copyright date.

Change-Id: I2bc9a78bcc2982845fce75a413e2048b0bfd12a0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-05-28 10:48:57 +02:00
Andrei Golubev
cfbb30decd Make QDateTimeParser recognize local time offsets
Fixes: QTBUG-84209
Pick-to: 5.15
Change-Id: Iedbc7beafcaa55c72fec3ac5a5f519c6ed5f7770
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-05-28 11:48:57 +03:00
Christian Ehrlicher
33fc622686 QTableWidget: simplify QTableWidgetSelectionRange
Simplify QTableWidgetSelectionRange by removing the unneeded
user-defined functions - the compiler can generate them by it's own.

Change-Id: Ia96ea29f595851e58c5b714bb316174406d42b8e
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
2020-05-28 06:13:56 +02:00
Giuseppe D'Angelo
fa98adbd04 Fix compilation of PCRE2 under Intel CET
Ubuntu 20.04 enables -fcf-protection by default.

PCRE2 10.35 sees this but complains that -mshstk is also necessary
to build its JIT. Detect whether the compiler is enabling Intel CET
automatically, and if so, build PCRE2 with the right options.

Pick-to: 5.15
Change-Id: I3440e689b81f4f07055f211a4fa7331a43eb410d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-27 22:29:55 +02:00
Friedemann Kleint
9c31acbf47 Move windowsuiautomation API support into QtGui
Task-number: QTBUG-83255
Change-Id: Ibface71931b6384494842ba9744d76f738c5ca85
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-05-27 22:28:41 +02:00
Tor Arne Vestbø
6a0995525d macOS: Fix use of deprecated NSOffState
Pick-to: 5.15
Change-Id: Ic799c52350f99a14f57efa9907db772d19264ca2
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-05-27 20:26:11 +00:00
Joerg Bornemann
e7d12b876a Fix qmake builds of Windows applications against a CMake-built Qt
QMake's windows.prf expects the WinMain library to be named
'qtmain[d].lib' and not 'Qt6WinMain[d].lib'. We're renaming the
library to 'qtmain[d].lib' in the CMake build now to avoid adjusting
the qmake build of Qt.

Also, we have to add the private library shell32.lib to WinMain to
make it appear in qtmain.prl and having it linked to Windows GUI
applications.

Fixes: QTBUG-84425
Change-Id: Ia94090b89e037b17ebfded359b293c8586371d59
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-27 21:44:39 +02:00
Tor Arne Vestbø
ce2bc0e2d5 Move CoreText font engine/database to QtGui
Task-number: QTBUG-83255
Change-Id: Id34ed1759fdebbb1d09e51009f0370736002167c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-05-27 17:51:24 +02:00
Mårten Nordheim
cbb9c53704 QNetworkReplyFileImpl: Fix typo
Causes emission to not happen and prints a warning

Pick-to: 5.15
Change-Id: Ie80cc89549741079c243e6fd4269f793bccca9fd
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-05-27 12:43:01 +00:00
Tor Arne Vestbø
da1b0d2d6a Move FreeType font engine/database to QtGui
Task-number: QTBUG-83255
Change-Id: If6be7057d6bd25b34acd99e18658744161985ed0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-05-27 14:42:59 +02:00
Ulf Hermann
a64a0ce331 Add a QPropertyAlias
A property alias is the equivalent of the "alias" keyword in QML. It
provides the same API as QProperty, but redirects any access to the
QProperty it was initialized with. When the original property is
destroyed the binding becomes invalid and ignores any further acccess.

Task-number: QTBUG-84370
Change-Id: I0aef8d50e73a2aa9e7703d51194d4c5480573578
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-05-27 14:41:52 +02:00
Lars Knoll
0a07f9528c Never include windows.h directly in Qt code
Please use qt_windows.h instead, so we avoid having min/max defined.

Change-Id: Ic1b29666c427bf24556da5494af45ee5953ae827
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-05-27 12:41:52 +00:00
Tor Arne Vestbø
af4e8e21f8 Run moc on non-PCH sources as well
Change-Id: Idccfc8f7b182169c5becfb28dec5aef4fc7079b1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-27 14:41:52 +02:00
Eskil Abrahamsen Blomfeldt
8b0f5763b2 Fix various offset issues with DirectWrite font engine
This reverts commit 318a991907
and its follow-up commit beede51bca.
This fix was incorrect and caused regressions elsewhere (QTBUG-84357)

The issue in QTBUG-71928 (offsets on emojis) turned out to be much
simpler: The emojis are expected to be drawn without any margin,
but since we retrieved the margin for A32 there would be a mismatch
between the margin used for positioning and the actual margin in the
returned QImage from the font engine.

Passing the correct margin in bitmapForGlyph() fixes this.

But reverting these fixes reintroduces a clipping bug when using
software rendering in Qt Quick: QTBUG-80180. This needs to be addressed
in Qt Quick. It also exposes an existing issue with positioning in
Qt Quick NativeRendering: QTBUG-84454.

In addition, it caused an assert when running with ClearType disabled,
which turned out to be because we were using the A32 margin in the
A8 case in the DirectWrite engine. This was also the cause of
QTBUG-50024 before, which is now also fixed.

However, it also needs to work with Qt Quick, where the text is currently
offset by margin * dpr and glyphs are clipped with the software renderer,
possibly because of the offset in position.

Task-number: QTBUG-71928
Task-number: QTBUG-84042
Task-number: QTBUG-80180
Task-number: QTBUG-84454
Fixes: QTBUG-84357
Fixes: QTBUG-50024
Pick-to: 5.15
Change-Id: I2c8f9f9e7dfb34d492e9833a02fa0c93e6a19513
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-05-27 14:41:52 +02:00
Allan Sandfeld Jensen
dfc5a10356 Do a proper convert from [0-65535] to [0-255] on QColor integer reads
We need to divide by 257 and round to undo our setter.

Pick-to: 5.15
Fixes: QTBUG-84168
Change-Id: I55d2a8d1d05125d9560309cd77459cc94a92030f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2020-05-27 12:41:52 +00:00
Volker Hilsheimer
ee92ee7a3c Remove deprecated QProcess methods
Add default parameter for arguments in start, startDetached, and
execute for better source compatibility with Qt 5.15. This has the risk
of then hiding incorrect calls to the previous overload taking a single
"command" strings if code is ported from pre-5.15 or ignores deprecation
warnings. This is acceptable, given that the alternative is that all
calls to these functions would require a default constructed QStringList
as the second parameter.

Change-Id: I1ba4df97ac4894d007da5083c8359015d784ddbb
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-27 11:55:06 +02:00
Shawn Rutledge
3373aa8b35 QTextMarkdownImporter: allow nesting text span formatting
The bold+italic combination indicated by ***triple stars*** requires
this; but it enables combinations of italics, bold, strikeout, anchor
text (and associated link formatting), image alternate text, and inline
code formatting (monospace). A code span overrides the formatting from
surrounding spans (which might be a bug to fix in another patch, if we
compare to how md2html formats code nested in bold-italics for example),
but the format stack restores state when any char format span ends.

Task-number: QTBUG-81306
Pick-to: 5.15
Change-Id: I289556fa53de400eb50a4d159b9b344eafc517da
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-05-27 11:55:02 +02:00
Inho Lee
2503a59e35 QRhiVertexInputAttribute : Add unsigned int formats for vertex input
Task-number: QTBUG-83173
Change-Id: I640cd1fe74227d2cc96672d6c7aaac93e1930bcd
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-05-27 11:54:56 +02:00
Ulf Hermann
524d781607 QProperty: Support multiple observers
Previously, only the first observer would get notified. Also, make sure
that the notifiers are always retained when switching between bindings
and values.

Change-Id: I9c25c0f2e288dac3a335b68e618f7ddeb44be25a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-05-27 11:54:30 +02:00
Ulf Hermann
36bd34dbdc QProperty: Apply coding style and avoid warnings
Change-Id: I14efdb293a4be39b3849b34bd8013fdab016ce7e
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
2020-05-27 11:54:16 +02:00
Allan Sandfeld Jensen
3768a915bc Update QColor::operator== documentation
We also compare exact encoding, not just the same values in RGB.

Pick-to: 5.15
Fixes: QTBUG-84436
Change-Id: Ia50be17864ee42cf1f6d44dd2cad27daca317faa
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-05-27 11:53:28 +02:00