Commit Graph

50171 Commits

Author SHA1 Message Date
Sona Kurazyan
519420641f Port QPauseAnimation to the new property system
Task-number: QTBUG-85520
Change-Id: I8c0ee86598f4c0f093f64b2891ee835a43964b84
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-26 21:47:47 +01:00
Andy Shaw
feb20459bd ibase: Fix the compilation and include it again so it can be detected
Change-Id: I38721155f090173862da8beab8cb04b2e015dcff
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
2021-01-26 21:47:36 +01:00
Ivan Solovev
fe7cbf8fe6 QRegularExpression: add move constructor
- Add move constructors to QRegularExpression, QRegularExpressionMatch
  and QRegularExpressionMatchIterator.
- Update the documentation to explicitly state that only destructor
  and assignment operators can be called for a moved-from object

Task-number: QTBUG-86634
Change-Id: I06b4f54e300541033a9a18339c97338717a06da0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2021-01-26 17:20:01 +01:00
Alexey Edelev
114d5c045d Fix invalid Qt prefix version when looking for HostInfo module
In QtSetup.cmake the PROJECT_VERSION_MAJOR variable was used to
identify prefix of 'Qt<version>HostInfoConfig.cmake'.
Qt<version>HostInfo is not found, if project version differs
from qtbase version.

Move the 'INSTALL_CMAKE_NAMESPACE' and 'QT_CMAKE_EXPORT_NAMESPACE'
variables to 'QtBuildInternalsConfig.cmake'. In this case
variables will be exposed for a wider list of internal routines.

Use the 'INSTALL_CMAKE_NAMESPACE' variable as prefix to find
Qt<version>HostInfo module.

Fixes: QTBUG-90345
Change-Id: Ic595d1c5beb74f34e69b58e18590a3afc2f346f7
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-26 17:16:04 +01:00
Bastien Bouclet
b69b04c479 QIcon: Use the @nx pixmaps in the paint method
Make use of the device pixel ratio in the QIcon paint method so the @nx
hi-dpi pixmaps are selected when appropriate when painting to a
QPainter.

Pick-to: 6.0
Fixes: QTBUG-90042
Change-Id: I53995a2285ef879e3c4fddb9f8da702e256a260f
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
2021-01-26 15:33:08 +00:00
Alexey Edelev
127a1ada32 Change XCB::XFIXES condition in library mapping
Replace condition of XCB::XFIXES from the 'XCB_XFIXES_FOUND' variable
to 'TARGET XCB::XFIXES'.

Fixes: QTBUG-89979
Change-Id: I77b8b4046dc6852ecb209d942ee94d864a35c378
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-26 16:18:24 +01:00
Alexey Edelev
e3e1fc4820 Add upstream version of FindPostgreSQL.cmake
Add CMake upstream(3.20.0) version of FindPostgreSQL.cmake, to avoid
server-related headers lookup.
Avoid using the Qt version of the PostgreSQL module, if it's
older than the CMake's one.

Fixes: QTBUG-89639
Change-Id: I71a0c3508000901969933aea8a08d1ad431db711
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-26 16:05:05 +01:00
Fabian Kosmale
293b7fab55 Workaround MinGW not handling error suppression macro correctly
Fixes: QTBUG-90353
Change-Id: I9270f4107f3f7083d28228f2426b34bc1e198112
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-26 15:55:21 +01:00
Volodymyr Samokhatko
976f28e7bb Fix populating selection clipboard with keyboard
Task-number: QTBUG-59879
Pick-to: 6.0 5.15
Change-Id: I6948919fc90995c60a34b5bd6b4a225c1a59fd9b
Reviewed-by: Liang Qi <liang.qi@qt.io>
2021-01-26 12:28:49 +00:00
Andy Nichols
3509fc3a1f Android: Fix deprecated QVariant usage
Change-Id: Ib14bbba726d1da352933ed418931d69443720946
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-26 13:28:35 +01:00
Mårten Nordheim
6cd5448404 Don't forward-declare non-Qt things with QT_FORWARD_DECLARE_*
As it breaks in namespace builds

Change-Id: I1a278330eeea6b2b89c8a57c0df828dff94ebf7a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-01-26 13:28:35 +01:00
Tor Arne Vestbø
c4c0c54ba1 Clean up QCocoaFileDialogHelper
- Remove indirections via helper functions that did nothing but
   redirect.
 - Remove unneeded checks of !m_helper in delegate. The helper is
   always valid for a delegate.
 - Use m_ prefix for member variables, as in the rest of Qt.
 - Implement init: as per modern Objective-C recommendations.
 - Remove respondsToSelector checks that were not needed.
 - Use modern Objective-C property syntax.
 - Fix code style issues/formatting.
 - Remove unused functions.
 - Reorder and remove unused includes.
 - Class-initialize member variables.

Change-Id: Iedc084b67bb496b2ef13001a0e6aa46d4574eb57
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-01-26 13:28:35 +01:00
Tor Arne Vestbø
d7c07578bc macOS: Don't restrict non-modal file dialogs to open-dialogs only
None of the APIs used for non-modal operation require NSOpenPanel.

Pick-to: 6.0 5.15
Change-Id: I7ea49a8dad6e724a8a0d4321ea443d4cdcc5a6b1
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-01-26 13:28:35 +01:00
Tor Arne Vestbø
fce391fefb macOS: Show system tray icon on mouse button press, not release
This was a regression from 395e2d9bc4.

The system behavior is to show the menu on press, so we follow that.

This is also documented at:

 https://doc.qt.io/qt-5/qsystemtrayicon.html#ActivationReason-enum

Fixes: QTBUG-86518
Pick-to: 6.0 5.15
Change-Id: Ia4dc5356bf0377a9d55f238caf5bf1becd95648d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-26 13:28:35 +01:00
Fabian Kosmale
37b0bad8ad QVariant: avoid superfluous QMetaType lookup
Constructing a QMetaType from an id requires a lookup which isn't free,
even for builtin types. When constructing a QVariant from an integer,
this leads to a noticeable performance loss.

In the mirco-benchmark of the linked bug, we improve from
100000000 965
to
100000000 789
on Linux, Intel i5-4690, clang 11.01 with a CMake release build.
This however still does not recover the performance we had in Qt 5.

Task-number: QTBUG-90560
Change-Id: I26440bdc04ef131ce91d3698957f0df43a4c4017
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-01-26 11:36:48 +01:00
Ulf Hermann
606b03d0a3 Partially revert 813a928c7c
Otherwise ASAN complains about mismatched new/delete.

Change-Id: I76ddcc388309e20055c93c68b9b6fa8a11b884e1
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-01-26 10:57:42 +01:00
Lars Knoll
92db806aa8 Update QMutexLocker documentation
And add an entry about the API changes to qt6-changed.qdoc.

Pick-to: 6.0
Task-number: QTBUG-89429
Change-Id: I146574acd3e4aa5ed6f1629fc68888f009472f19
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-01-26 10:04:11 +01:00
Andrei Golubev
37e26d2b30 Extend alignment of QArrayData to std::max_align_t in allocation
Make stricter alignment requirements for the allocated header

This strict alignment allows reallocateUnaligned() to property account
for the padding occurring in cases when
alignof(QArrayData) < alignof(T) <= alignof(std::max_align_t), which
happens to be the case on e.g. 32-bit platforms with specific alignment
requirements.

This adds 4 bytes (the difference between alignof(std::max_align_t) and
sizeof(QArrayData)) of overhead for QString, QByteArray and certain QLists
on 32-bit systems.

Task-number: QTBUG-90359
Pick-to: 6.0
Change-Id: I8176a4cc79f100ee772b09425e88fe8ff3ae226a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-01-26 08:01:27 +00:00
Craig Scott
ecc2a28cab Ensure consistent flags for ASM language and MODULE targets
By not including ASM in the languages for which compiler flags are
adjusted, we can end up with inconsistent optimization and debug
settings between different languages. Make sure they are treated the
same.

Similarly, linker flags for MODULE target types should also have their
debugging and incremental linking flags adjusted, just like EXE and
SHARED targets. When building with MSVC, MODULE targets were having
the relevant flags stripped, but not then replaced with the desired
ones, leaving them empty in typical scenarios. This would primarily
affect plugins, which are built as MODULE rather than SHARED libraries.

Fixes: QTBUG-90237
Change-Id: I648ea74be1654d24cbecc592ce0ca4b59b2ae839
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-01-26 02:41:38 +01:00
Alexey Edelev
7c69eb8868 Use system PCRE2 for Bootstrap library
By default, use system PCRE2 for Bootstrap library, if not
cross-compiling.

Fixes: QTBUG-90556
Change-Id: I7291927565484073cadacec9a381b54b44ebeaec
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-25 20:55:14 +01:00
Kai Köhne
cf96836018 Update start of cmake/README.md
Make the document reflect the current status of the port.

Also link to https://doc.qt.io/qt-6/build-sources.html  and
https://wiki.qt.io/Building_Qt_6_from_Git as official sources
on how to build Qt. This document should IMO rather
concentrate on documenting the build system internals.

Pick-to: 6.0
Change-Id: If62cb966b41b7452edb5b63725756916b66affac
Reviewed-by: Craig Scott <craig.scott@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-25 20:01:00 +01:00
Kai Köhne
87ffd79622 QMimeDatabase/xml: support both 'xmlstarlet' and 'xml' for minifying XML
Commit 370324f6e2 changed the call to 'xml' to 'xmlstarlet' because
some Linux distributions do not provide a binary called xml. Anyhow,
the official Windows packages of xmlstarlet only provide 'xml.exe'.

Therefore just check for both.

Pick-to: 5.15 6.0
Change-Id: I4381b256850e4101b760df21f2b0baffb4414620
Reviewed-by: Eric Lemanissier <eric.lemanissier@gmail.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-01-25 19:00:53 +00:00
Kai Köhne
9165866b19 Bump copyright year to 2021
Change-Id: I18a9c2de391ca51655148b2e3cc9abdfbb8ddbcf
Reviewed-by: Tarja Sundqvist <tarja.sundqvist@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-25 20:00:44 +01:00
Kai Köhne
e7c028bb9c QLocale: Allow direct conversion from language, country, and script codes
This complements patch a148c7b5d71d244, where languageToCode(),
countryToCode() scriptToCode() methods were introduced, with matching
codeToLanguage(), codeToCountry(), and codeToScript() methods.

This allows us to remove the use of private Qt Core API in Qt Linguist.

[ChangeLog][QtCore][QLocale] Added static codeToLanguage(),
codeToCountry(), codeToScript() methods that convert ISO code strings
to the respective enum values.

Change-Id: If5c0843a718c006ade086a6f74ceb86ac6e0fce4
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-25 19:56:59 +01:00
Tor Arne Vestbø
aa3b42d634 macOS: Don't exec file dialogs via runModal unless they are app modal
Non-modal or window modal dialogs are shown at show(), via AppKit APIs
that are non-blocking. If we want to block execution at this point, we
need to spin our own event loop. The runModal API of NSSavePanel is not
meant to be used for blocking execution for already shown dialogs, but
is reserved for application modal dialogs.

This means we no longer trip over AppKit's understanding of what state
the dialog is in, which would result in the dialog not reporting back
any files. It also allows us to remove the guard for closing dialogs
twice.

We now also correctly close and end the application modal session if
the dialog is closed programmatically using Qt APIs.

Task-number: QTBUG-89959
Fixes: QTBUG-85547
Pick-to: 6.0 5.15
Change-Id: Ida3dc404417789d4823822ecfbf0935591c23878
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-01-25 18:26:47 +01:00
Edward Welbourne
0180a1ab82 Make QCalendar's backend registration reentrant-safe
Previously, different threads instantiating the same back-end could
collide in the register, with various unwelcome results.

Give Registry an atomic status flag to track whether it has been
populated or is being destroyed; and protect it with a mutex to ensure
distinct threads do not collide during registration or attempt to
register while the registry is being destroyed.

Document the correct way to instantiate custom backends, and that no
code other than the QCalendar implementation should instantiate the
built-in ones. Instantiators that follow these rules should be safe
from failed registrations, provided they don't pick a name that
conflicts with some other backend. They can also use the recent change
to semantics of registerAlias() to verify that registration *has*
succeeded.

Done-with: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Pick-to: 6.0 5.15
Task-number: QTBUG-88815
Task-number: QTBUG-85692
Fixes: QTBUG-84575
Change-Id: Ie78e700e71d610454152c05cafb38f6f713649ad
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-01-25 18:04:36 +01:00
Edward Welbourne
56f12656f5 Eliminate the need to preprocess the public suffix list
The program to digest the public suffix list required the user to
initially grep away the comments and blank lines. Filtering those
lines out in the code to read the file is trivial, so save the user
one step in the process.

Change-Id: I08f2594fc4236a689c849d42b5446efa9ec2ef7a
Reviewed-by: Dimitrios Apostolou <jimis@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-01-25 18:03:00 +01:00
Allan Sandfeld Jensen
fdc7eb80dd Add QPlatformScreen::colorSpace()
Added for macOS and X11 screens

Task-number: QTBUG-90535
Change-Id: Ifafe7a07ee2abc3c42cd12785db2d7329878375b
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-01-25 17:21:54 +01:00
Christian Ehrlicher
4e2a942369 QSql/PostgreSQL: allow blobs with more than 2^30 bytes
Due to limitations of QByteArray it was not possible to store more than
2^31 bytes. This was fixed in Qt6 so throw away the casts to int in the
postgres plugin

Fixes: QTBUG-79059
Change-Id: I8ae7276a04d4936bcf5ba6c413e3412f6c342ff5
Pick-to: 6.0
Reviewed-by: Robert Szefner <robertsz27@interia.pl>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-01-25 16:37:25 +01:00
Eskil Abrahamsen Blomfeldt
d79a9b1a4f Implement vertical subpixel positioning where available
For some use cases, vertical subpixel positioning may be
useful, as it allows you to vertically align text with
other painting primitives. This does impose an overhead,
so we make it opt-int with a render hint on the painter.

Note that this is only supported on Freetype currently.
It might be possible to support on older macOS versions,
prior to Mojave (which has disabled subpixel positioning
entirely), but since it would have limited usefulness
and Freetype is cross-platform anyway, I skipped that.

Note: This drive-by-fixes an issue with subpixel
positioning where glyphs would always be offset by 1/64,
because we added the aliasing offset *after* we had
determined the closest subpixel position. The idea of
this, as far as I can understand, is rather to snap to
nearest subpixel position upwards, not to add an offset
to all glyphs, so it should be added before finding the
correct position. It had a subtle visual effect when
animating the position. It might be that we could get
rid of it entirely, as I haven't been able to reproduce
any issues with that, but I have moved it instead, to
match what I believe the intention was.

[ChangeLog][QtGui][Text] Added render hint flag
QPainter::VerticalSubpixelPositioning which will position
text at subpixel positions vertically whenever supported.
In absence of this, text position will be rounded
vertically as before.

Fixes: QTBUG-35682
Change-Id: I8ce7a72a64e5a0924dac7c244e3e07c2938bfd09
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-01-25 15:56:50 +01:00
Kevin Funk
80e87ca05c dbus: Fix missing QVersionNumber include
Fixes the build

Change-Id: Ie0b7a1476bb1f80ee2ccfe1cbc6ca37e9c93e758
Reviewed-by: David Skoland <david.skoland@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-25 12:09:17 +01:00
Kimmo Ollila
77cfbd755a Add correct prefix for GHS compiler
This fixes INTEGRITY build error:

cannot access position 53 in array of 49 elements
          constexpr const char *begin = func + prefix;

and many "expression must have a constant value" errors.

Change-Id: I0e043028fbcb479c6657b59ea144b4536cc65651
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-01-25 08:37:06 +02:00
Christian Ehrlicher
1a9095e1fa QComboBox/Fusion style: elide text when it's too long
The fusion style did not elide a very long text in a QComboBox as it's
done in other styles / non-popup mode.

Fixes: QTBUG-86632
Pick-to: 6.0 5.15
Change-Id: I356a61809220d41717a9039d2b33dd706d034941
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-23 15:03:36 +00:00
Joerg Bornemann
1ef5016bab Fix QMAKE_PRL_LIBS entries on Windows for modules from other repos
When building a repository != qtbase, like qtactiveqt, QMAKE_PRL_LIBS
contained entries like Qt6Core and Qt6Widgets, meaning the linker line
would contain exactly these arguments.

When building an activeqt example with qmake, the link then failed with
"LNK1181: cannot open input file 'Qt6Widgets.obj'".

The correct entry would have been $$[QT_INSTALL_LIBS]/Qt6Widgets.obj.

Fix this by determining the full path to the import library in the first
step of the prl generation. This enables QtFinishPrlFile.cmake to
recognize Qt6Widgets as Qt module and generate the right QMAKE_PRL_LIBS
entry.

Pick-to: 6.0
Fixes: QTBUG-90520
Change-Id: Id0d9178da0e0dfc3ea4fadbbe8f5900d792ffc84
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-01-22 18:24:06 +00:00
Joerg Bornemann
88e24e6a25 Remove the QT_CMAKE_BUILD preprocessor define
Qt is now always built with CMake.

The "cmake" keyword for QtTest blacklists remains for now. Removal is
tracked in QTBUG-90545.

Change-Id: I0011d56176a07c82698b2eb9aa330e77efa6cd34
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-01-22 19:22:15 +01:00
Dimitrios Apostolou
a0aaa4ae2e Github Actions: many minor updates
+ Add Ubuntu-20.04 Github Actions runner
+ Use as many system libraries as possible on all
  platforms except Windows
+ Checkout the git repository into a directory named "source",
  so that it's possible to checkout more repositories in the future
+ Configure with install prefix set to a temporary path,
  it will be used for uploading binary artifacts in the future
+ Configure with -pkg-config instead of -feature-pkg-config;
  this was the traditional way and it works for cmake now
+ Split long lines using double quotes instead of backslashes,
  makes the yaml file more readable and does not leak
  backslashes into the command line
+ Adjust cache to work in multiple branches, provided that the
  environment variables at the top of the file are set correctly
+ Do not let homebrew waste time cleaning up
+ Print logfiles in case of failure
+ Typos and other minor fixes.

Pick-to: 6.0
Change-Id: I1ac8afebbdbea50549a334c07b8b3117a823f0fe
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-22 18:48:54 +01:00
Dimitrios Apostolou
e4194b6f9e Github Actions: install old ccache version on Windows
ccache 4.0 is crashing consistently. Fix is merged upstream, but it's
not released yet:
https: //github.com/ccache/ccache/pull/736

Pick-to: 6.0
Change-Id: I27d154a1ff1ea3afe111bd8f931db58c6f518809
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-22 18:48:49 +01:00
Dimitrios Apostolou
7ff1123711 Github Actions: ccache updates
+ Specify the ccache cache directory to avoid the defaults, because
  ccache >= 4.0 puts the cache directory in system-dependent paths
+ Adjust sloppiness to increase cache hit ratio
+ print compression stats but don't err if `-x` flag is missing
  (only available only on ccache >= 4.0)
+ Print ccache config for debugging purposes
+ Enable ccache compression and limit size

Regarding the last point, ccache < v4.0 optionally compresses using the
zlib algorithm, but ccache >= v4.0 uses zstd and compression is enabled
by default.  By forcing compression to true, all platforms will need
similar size cache. We have to limit it because the default (5GB) fills
up the cache artifacts size that Github Actions offers.

Pick-to: 6.0
Change-Id: Iea72d08b223c611ee4a4443625647a1f01809b08
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-01-22 18:48:45 +01:00
Morten Johan Sørvig
3a1773dd76 High-DPI: Test application startup with no screens
Initialize the offscreen platform plugin with no screens,
create QGuiApplication object.

Not much of the high-dpi related Qt API can be used
in this configuration, but at least Qt should not crash
on startup.

Task-number: QTBUG-71034
Change-Id: I6620843c3bd8b692c5c2419b1ba290e16175ba5b
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2021-01-22 14:27:27 +00:00
Andreas Buhr
df912d08c3 Update pro2cmake to require CMake 3.16
pro2cmake generated CMakeLists.txt with cmake_minimum_required(3.15.0).
But 3.16 is required now. This patch updates pro2cmake.py accordingly.

Change-Id: I8283e1c4da4d2d36e1d9127cab410c7bfc58830c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-22 15:27:22 +01:00
Alex Trotsenko
3fc6b45cbb QProcess/Win: move pipe draining into QWindowsPipeReader
... where it belongs.

To avoid the loop, introduce the drainAndStop() function, which allows
QWindowsPipeReader to flush the pipe itself. It determines the number of
bytes pending and blocks until the remainder of the process output is
received.

Note that the loop in drainOutputPipes() didn't actually have to
interleave the two pipes (because we're presuming that the operations
will finish instantly), so we don't do it now. Also, the code violated
the API contract: 'true' was returned when the 'wrong' channel received
data; this is now fixed as a side effect.

Change-Id: I38ed4861a238e39e793c3716e856e5bfdeed3d74
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-01-22 16:26:39 +02:00
Edward Welbourne
5ea701337d Mark the public suffix generator as a command-line program
It's a purely command-line program, no need for gui.
Noticed on making a first (abortive) attempt to convert to CMake.

Change-Id: I767f59587d9fe902aec46cd1742576b6bfc84274
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-22 12:16:53 +01:00
Friedemann Kleint
db942d6125 QTestlib: Speed up comparison of qsizetype
Add a qCompare() overload for qsizetype, preventing it
falling back to the slow code path pre-formatting expected/actual.
toString() should use the correct format from the already present
int-types (see macro TO_STRING_IMPL).

Complements  94aa350621.

Task-number: QTBUG-38890
Change-Id: Ieb8cea7de086141a2c80f93b4c1be01572be96df
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-01-22 12:11:39 +01:00
Thiago Macieira
cbdf2ba46a Update TinyCBOR
Updated to commit e6a4fa4862bcc3a6f6b07cf9d9b784d0ab6068b4.

Pick-to: 6.0
Fixes: QTBUG-89650
Task-number: QTBUG-90214
Change-Id: I6edce5101800424a8093fffd15cdf6591cbf809d
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-01-22 03:02:39 -08:00
Alexey Edelev
e425a2a4b8 Tune compilation flags to reduce libraries size
Add '_WINDLL' definition for the MSVC compilers family.
Check the 'FEATURE_optimize_size' value before replacing compiler flags
in the qt_internal_add_optimize_full_flags function. This is required,
because Qt::Core and Qt::Gui modules lost their ability to shrink,
when selecting the appropriate build type or features.

Fixes: QTBUG-89952
Change-Id: I982c25ea84e4793b4006ead0ee516b3f3eb2a054
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-01-22 10:27:17 +01:00
Laszlo Agocs
df0e98d408 rhi: Pipeline cache load/save
Add QRhi APIs to retrieve and reload the contents of the "pipeline
cache".

The only API where there is a true pipeline cache is object is Vulkan
(VkPipelineCache). For OpenGL, the other backend where we support this,
it is simulated with program binaries. The Qt 5 style OpenGL program
binary disk cache continues to work like before, but one has now the
option to do things in a more modern, graphics API agnostic way, that
leads to generating a single blob instead of a large set of files in
some system location, allowing easier "pre-baking" of the cache content.

It is expected that Qt Quick exposes the two new functions in form
if QSG_RHI_ environment variables, thus allowing easy testing and
cache file generation.

As an example for the performance improvements this can give, consider
Vulkan, where we do not have any existing persistent caching mechanism
in place:

Running BenchmarkDemoQt6.exe --scene flythrough --mode demo creates 18
QRhiGraphicsPipeline objects from Qt Quick and Qt Quick 3D.

The total time spent in QRhiGraphicsPipeline::create() during application
startup for these 18 pipelines is 35-40 ms on a given Windows (NVIDIA)
system.

When exporting the pipeline cache contents to a file, and then, in a
subsequent run, reloading the cache contents, this is reduced to 5-7 ms
on the same system, meaning we get a 6-7x improvement.

The generated data is always specific to a given Qt version, RHI
backend, graphics device, and driver version. Much of the implementation
consists of adding and verifying the appropriate header to the blobs
retrieved from the driver, to allow gracefully ignoring data that was
generated with a device or driver that differs from the one used at
run time. This should provide robustness, even if the Vulkan or OpenGL
implementation is for some reason not prepared to identity and reject
incompatible cache/program blobs.

Fixes: QTBUG-90398
Change-Id: I67b197f393562434f372c7b7377f638abab85cb3
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-01-22 10:26:03 +01:00
Joerg Bornemann
3c54b72961 Fix static top-level build
Commit d0071a4f87 broke static top-level builds:

CMake Error at .../qtbase/lib/cmake/Qt6Gui/Qt6GuiPlugins.cmake:17 (set_property):
  set_property can not be used on an ALIAS target.

Fixed by moving the un-aliasing of the target before the set_property
call.

Pick-to: 6.0
Change-Id: I96c731353798a58ff9b3a664f3614ef03c897dcb
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-01-22 09:16:10 +01:00
Timur Pocheptsov
7cf8e5ada9 QSsl: add a new private API
This is an abstraction for TLS backend and its factory, preparing to transition
to plugin-based design.

Task-number: QTBUG-65922
Change-Id: Ibe810e77fd1b715a6bea66cd3f44312b015ac274
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-01-22 09:09:46 +01:00
Samuli Piippo
946facb1ae tst_qfont: expect failure on font testcase for QEMU ARMv7
FontConfig related tests fail on ARMv7 QEMU.

Task-number: QTQAINFRA-4127
Change-Id: I3202f660d12d09a65bc50747d679921b6dfa75f8
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-01-22 09:00:24 +02:00
Timur Pocheptsov
ee89f3a6e3 QSslSocket - introduce the API providing information about backends
This API gives the names of available backends and provides a basic
information about features/protocols supported by those backends.
Also, it has the 'loadBackend' functions which allow to select
a particular backend (which are becoming plugins).

At the moment, the implementation is still 'hardcoded', the
follow-up patch will allow to select different backends in runtime.

Task-number: QTBUG-65922
Change-Id: I05877de9c02857594e76b24d52e7578bdb01df69
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-01-21 23:01:33 +01:00