Commit Graph

51477 Commits

Author SHA1 Message Date
Joerg Bornemann
d41ef4f741 Add ABI suffix to .prl files for Android
The libraries already contain the ABI suffix, and the .prl files should
too. This is a requirement for ABI-stitching of Qt Android builds.

Fixes: QTBUG-90023
Change-Id: Ib2a7b3119ace14c8542242fc45f42648840d053a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-03 13:33:43 +02:00
Joerg Bornemann
b0e96ee181 Update the comment in QtFinishPrlFile.cmake
Clarify that OUT_FILE is not the final .prl anymore and where we get the
path of the final .prl from.

Change-Id: I4563c6ef1026bc0646e3ac9ab2fac49e426ca07f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-03 13:33:43 +02:00
Pekka Gehör
2262a9cd2d Android: Fix Application becomes unresponsive issue
Block key events until the plugin is running.

Fixes: QTBUG-67944
Pick-to: 5.15 6.1
Change-Id: Iea47f2e94d850141834a7e8fc26218be2cacf660
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-05-03 08:48:57 +03:00
Giuseppe D'Angelo
3e2e0dde47 QFlags::setFlag: don't go through Int, go through QFlags itself
Avoid a "detour" outside QFlags' type safety: operator~ is defined
on QFlags already, use that one.

Change-Id: Iedd07d1652b8f92e3881298ceafcd5c761346bb0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-03 02:54:10 +02:00
Thiago Macieira
e4ed47ef4a QCoreApplication::applicationFilePath: add ELF auxval support
This implements getting the executable file name for FreeBSD. Linux has
a similar functionality (but called AT_EXECFN), but the /proc/self/exe
trick is actually better: it returns a full canonical path instead of
the argument passed to execve(), and it follows a rename of the
executable.

Change-Id: I7a386ad4f0cb4e2ba629fffd16789acda415213f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-05-02 22:21:00 +00:00
David Faure
831aea1ce1 qdbus: add support for "aay" (QByteArrayList)
(I wish these common mappings were centralized though, so that
annotations in the XML file wouldn't be needed)

Pick-to: 6.0 6.1 5.15
Change-Id: Ie3e8731e44b6e0338c8a044408c34160cf0a3a1e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-02 22:00:43 +02:00
Giuseppe D'Angelo
3c16330c2d QLocalSocket: declare operators for the SocketOptions flag
The flag existed, without the operators.

Change-Id: I386f76b358422fbfc3fbd7b227901803ec27202d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-02 20:25:41 +02:00
Giuseppe D'Angelo
7507afccee QFlags: streamline some macros
There's little point at keeping the separate Q_DECLARE_INCOMPATIBLE_FLAGS
macro, only to invoke it exactly once (from the expansion of
Q_DECLARE_OPERATORS_FOR_FLAGS). Besides, Q_DECLARE_OPERATORS_FOR_FLAGS
already had some "incompatible" operators in its expansion (the
deleted arithmetic ones), so adding the "incompatible" ones in there is
consistent.

Change-Id: I591d57af8eec5b03ecaa7a3b0de23a967b13f7a5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-02 20:25:41 +02:00
Giuseppe D'Angelo
99e95a2cc6 QLocalSocket: fix inclusions in namespaced builds
An include statement appeared after opening the Qt namespace, thus
injecting symbols in there. Move it outside.

Change-Id: I8e95e821b36ad4e4ceed5b0645bf8ebf7e531e06
Pick-to: 5.15 6.0 6.1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-02 20:25:41 +02:00
Giuseppe D'Angelo
36cf5d905a QFlags: remove the doc-only declaration of copy operations
qdoc is now able to recognize the special members automatically.

Change-Id: I773d94d9e622e67340f3acdbe8bff66143ee1aaa
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-02 20:25:41 +02:00
Giuseppe D'Angelo
79d7801388 QFlags: kill Q_NO_TYPESAFE_FLAGS
The macro is undocumented and unused.

Change-Id: I5c09f4e0e2d41e13d2678e2936e0d0e39ed69639
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-02 20:25:41 +02:00
Giuseppe D'Angelo
e2145a47fc QUrl: code tidies
Change some casts of enumeration/flag types from int to uint.
In fact, the enumerations (and flags) in question are *defined* to
be backed by unsigned int.

Change-Id: I757ded61a26fe979deeaa1e5a524478102960ffe
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-02 17:28:56 +02:00
Giuseppe D'Angelo
6ab8ea2d58 QRandom: enable a check also on MSVC
We require MSVC 2019 these days, so we can actually check for
constexpr initialization.

Change-Id: Idc14b785d51c8baaa0bca0ec7dd2e8a85a7e2092
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-02 11:52:30 +02:00
Giuseppe D'Angelo
6351b5433d QRandom: drop a usage of std::is_literal_type
It's deprecated/removed, and indeed doesn't check anything that it's
not also already being checked by the previous line.

Change-Id: Ic80ca43f390dd989ced69f196efa7313069e7c6d
Pick-to: 5.15 6.0 6.1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-05-02 11:52:12 +02:00
Thiago Macieira
d08d456844 cmake: FreeBSD has DF_ORIGIN support
Pick-to: 6.1 6.0
Change-Id: I755911ae7d0341f49039fffd167afce7fe6b2b38
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-01 16:02:31 -07:00
Thiago Macieira
19fa58447e Revert "Include qsimd.cpp in bootstrap build"
This reverts commit 9268cb8085. That was
done in the mistaken assumption that the bootstrap library needs the
fast hashing algorithms. It doesn't, since it's only used for tools that
need deterministic output anyway.

This fixes the build on x86 where the compiler is enabling rdrand by
default (Ivy Bridge systems, but also -march=haswell and the GCC 11
-march=x86-64-v3):

qsimd.cpp:750:37: error: redefinition of ‘qsizetype qRandomCpu(void*, qsizetype)’
  750 | QT_FUNCTION_TARGET(RDRND) qsizetype qRandomCpu(void *buffer, qsizetype count) noexcept
      |                                     ^~~~~~~~~~
In file included from qsimd.cpp:44:
qsimd_p.h:354:25: note: ‘qsizetype qRandomCpu(void*, qsizetype)’ previously defined here
  354 | static inline qsizetype qRandomCpu(void *, qsizetype) noexcept
      |                         ^~~~~~~~~~

Change-Id: I755911ae7d0341f49039fffd167afc7540bf0dd6
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-01 18:55:42 +00:00
Thiago Macieira
26a7c53009 QHash: disable the AES based one on the bootstrap library
The bootstrap library doesn't need it. All bootstrapped tools are
expected to produce deterministic output, given the enforced seed of 0:

 #ifdef QT_BOOTSTRAPPED
     // the seed is always 0 in bootstrapped mode (no seed generation code),
     // so help the compiler do dead code elimination
     seed = 0;
 #endif

Change-Id: I755911ae7d0341f49039fffd167afc934ff1c9e1
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-05-01 11:55:42 -07:00
Shawn Rutledge
c8736e8e61 Add grabber context pointers
In Qt Quick we now need to keep track of which QQDeliveryAgent is
responsible when a point is grabbed, either passively or exclusively.
When we re-deliver to that grabber, we need to do it via the same agent,
so that the same scene transform is used, and the grabber will see the
event in the correct coordinate system.  It's easier to track this
mapping here instead of in a separate map in Qt Quick.

(This is an alternative to 40330b8f0a:
it was not possible to use QFlatMap, because we need to keep the passive
grabbers in the same order as they were added.  We don't use a QList of
structs, because QPointerEvent::passiveGrabbers() needs to return a
QList of just the grabbers, and it's not as efficient to construct that
list in the accessor.)

Change-Id: I457114f816736749d2ea5ee48fa03524eb93d2d0
Pick-to: 6.1
Task-number: QTBUG-92944
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-05-01 19:40:36 +02:00
Friedemann Kleint
f55fc61346 uic: Update qclass_lib_map.h
Task-number: PYSIDE-1404
Change-Id: I6101402891749a767119a5688d9a5a6299ee840d
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2021-05-01 16:39:48 +02:00
Szabolcs David
9e1b49c53c Silence warning in QPrintDialog
Selecting "Print all" at page range options and accepting the
dialog prints a warning message:

"QPageRanges::addRange: 'from' and 'to' must be greater than 0"

This happens because QPrintDialog tries to clear the printer's range
collection by setting 'from' and 'to' to zero - which is an invalid
page number. Avoid the validation method by setting QPageRanges
directly to a clean instance.

Pick-to: 6.1
Change-Id: I23b66a97b36aa23506904e93688cb60a9d496bfb
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2021-05-01 04:36:06 +00:00
Volker Hilsheimer
808a6dedcb ItemViews: don't delete dragged items when a subclass accepted the move
Amends 0f1008a593, which introduced the
dropEventMoved private data member through which the drop-site itemview
can notify the drag-site that the drop handler has taken care of the move
operation.

However, if a subclass of an item view overrides dropEvent to move and
accept the event before calling the default implementation, then the flag
would not be set, as the dropOn helper would return false.
So QAbstractItemView still removed the item, resulting in two items
being removed when one was move-dropped.

Set the dropEventMoved member also when the QTreeWidget::dropEvent
handler is called by a subclass override and the event is already accepted.
This way, overrides don't have to artifically set the accepted action to
"IgnoreAction" to disable the handling in drag site.

[ChangeLog][QtWidgets][QAbstractItemView] Classes overriding dropEvent
for MoveAction events to move data can call accept() on the event before
calling the superclass to prevent QAbstractItemView from deleting the
source item.

Task-number: QTBUG-87057
Task-number: QTBUG-77427
Pick-to: 6.1
Change-Id: Ibe75fc1b2ca60627c825ad9b9b6d48953577edec
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2021-05-01 06:35:42 +02:00
Alexey Edelev
b3f9c2b3d1 Add _qt_internal_wrap_tool_command to replace QT_TOOL_PATH_SETUP_COMMAND
QT_TOOL_PATH_SETUP_COMMAND is used in COMMAND list when call
add_custom_command/add_custom_target. This is necessary to setup
the necessary environment for the tool to run correctly. This approach
is weak according to CMake documentation:
   "If more than one COMMAND is specified they will be executed in
    order, but not necessarily composed into a stateful shell or
    batch script."
This change introduces the _qt_internal_wrap_tool_command function
that uses a wrapping script that setups necessary environment for
the tool and runs it in a single shell.

The script is generated by the _qt_generate_tool_command_wrapper
function.

Change-Id: Id5270b91619b607a0c1e3a19b8c706edec43f388
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-30 23:11:29 +02:00
Sona Kurazyan
7a1fdcedfc Port QVariantAnimation to the new property system
Skipped startValue/endValue properties, since they are computed and
writable, which is not supported at the moment.

Skipped currentValue, since its setter might be called inside the
getter, which is not recommended.

Task-number: QTBUG-85520
Change-Id: I1f872b4fcc7227ed91b6915891bbc66019151826
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-04-30 18:59:50 +02:00
Ivan Solovev
0d76a5cd2c QSFPM: fix filterCaseSensitivityChanged signal emission logic
This patch amends bcbbbdb2d6.
It fixes the logic of filterCaseSensitivityChanged signal emission.
The call to QRegularExpression overload of setFilterRegularExpression
could change the filterCaseSensitivity, but the signal was never
emitted.

[ChangeLog][QtCore][QSortFilterProxyModel] A call to QRegularExpression
overload of setFilterRegularExpression now emits a
filterCaseSensitivityChanged signal, if required.

Pick-to: 6.0
Pick-to: 6.1
Change-Id: Id4ef04227c1f8ed98153fa5107ec3fbe4c0c77fb
Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-04-30 14:57:28 +02:00
Alexey Edelev
5ae7527411 Do not use qt_internal_module_info for non-module targets
The qt_internal_module_info function suppose to provide the information
only about the Qt modules. Avoid using it for the tool and extra
package dependencies, since some targets do not always exist, when
function is called.
Add the qt_internal_qtfy_target function to make the prefixed target
names.

Change-Id: Ifa8c61064d9c6c430889f00a4ead304029da711b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-30 14:55:11 +02:00
Mårten Nordheim
deda40b859 Let the h2 test server both send and receive DATA frames
And use this in the authenticationRequired test.

Pick-to: 6.1 6.0 5.15
Change-Id: I18e991eb67168214c2c4f829afaca5018568e989
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-04-30 14:43:24 +02:00
Juha Vuolle
000120d47c Add a helper method for testing write-once bindable properties
Change-Id: I4f5a2ca983902beccf967e983083cc7a315b8ef6
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-04-30 15:37:27 +03:00
Morten Sørvig
fa11071abf Exclude unused functions from WASM build
Fix “unused function” warnings.

Change-Id: I1d8d1de3c181385769bffc094d6c9e3319e1dc98
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-04-30 14:01:37 +02:00
Morten Sørvig
9f3962443f Add missing case for ResizeNone
Change-Id: If7c5fb0aa7d00745da54b1184d192c8921668075
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2021-04-30 14:01:34 +02:00
Morten Sørvig
c8865aecb8 Fix “unused variable” warning
Change-Id: I6755cb05064c87d9b619bc4ff06e70740d94ccb3
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
2021-04-30 14:01:30 +02:00
Morten Sørvig
d73a73c408 Fix “unused variable” warning
Change-Id: I2b151d7a0cda8774c236de1a024acbb3a1875c7e
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-04-30 14:01:27 +02:00
Eirik Aavitsland
c494c1e875 QVnc: clip requested screen region to available screen image
Avoid potential oob memory access.

Pick-to: 6.1 6.0 5.15 5.12
Fixes: QTBUG-91770
Change-Id: I34fff1cf8dec5275572a027288b0e8310359d9f8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2021-04-30 11:37:03 +02:00
Gong Heng
bb8fc324d1 fix: Optimize the performance of the inotify file system monitoring program。
When the ioctl() functions is executed correctly, the value of buffSize may be 0.
In this situation, there is no need to execute the following code.
This modification can solve two benefits:
1. The readFromInotify function runs frequently, and this modification can improve the
efficiency of the program.
2. When the buffSize is equal to 0, "read(inotifyFd, buffer.data(), buffSize)" function will
be stuck.(I have encountered this kind of problem)

Pick-to: 5.15 6.0 6.1
Change-Id: I9f85491ec91e336b4a1bec5c99b911835c5c06a5
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-04-30 09:37:03 +00:00
Thiago Macieira
f5e9444460 QCoreApplication::applicationFilePath: remove redundant cleanPath
QFileInfo::canonicalFilePath below cleans the path anyway.

Change-Id: I7a386ad4f0cb4e2ba629fffd1678fc6f39ddf74a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-04-30 02:54:42 +00:00
Thiago Macieira
21b123f888 QCoreApplication::applicationFilePath: don't check for existence twice
A file that doesn't exist can't have a canonical path, so we don't need
to check fi.exists() before calling fi.canonicalFilePath(). Also avoids
a TOCTOU mistake: if the exists() returned true, we would store whatever
canonicalFilePath() returned, even an empty string (which can also
happen if realpath(3) fails for some reason).

Change-Id: I7a386ad4f0cb4e2ba629fffd16789aaa8367e641
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-04-29 19:54:39 -07:00
Thiago Macieira
ccd47237ee QCoreApplication::applicationFilePath: simplify by merging some code
And by introducing a local qAppFileName() for non-Windows and non-Mac.

This merges the simplification that each OS does to the obtained file
path to a common procedure, removing differences in behavior.
Previously, some would get the canonical file path and some wouldn't.

Change-Id: I6cdea00671e8479b9c50fffd167899036eaaa23e
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-04-29 19:54:37 -07:00
Thiago Macieira
f3446acbcd QCoreApplication::applicationDirPath/Linux: use /proc/self
There's no need to format our PID there if /proc/self exists and is a
link to the current process.

Drive-by replace with QStringLiteral, since we won't do any formatting
anyway.

Change-Id: I7a386ad4f0cb4e2ba629fffd1678fbf0a484ea69
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2021-04-29 19:54:35 -07:00
Alexandru Croitor
e1c1558218 CMake: Fix reconfiguration when using a static top-level build
... and configuring another repo using qt-configure-module.

It's possible to configure a top-level Qt with a subset of repos and
then afterwards configure additional repos with qt-configure-module.

We didn't define QT_REPO_DEPENDENCIES in that case, which caused all
plugin config files to be loaded on reconfiguration, thus causing
duplicate target errors.

Move the QT_SUPERBUILD check to be done every time in
QtBuildInternals.cmake rather than when configuring qtbase/qt5.

Amends 98e8180e56

Pick-to: 6.1
Fixes: QTBUG-86670
Fixes: QTBUG-91887
Fixes: QTBUG-92578
Change-Id: I975835ffa02f702799a3c9f68a5e059d2763a951
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-04-29 23:42:40 +02:00
Friedemann Kleint
ac95326ad4 uic/Python: Add comments for mypy to ignore star imports
Amends 2f975b39a9.

Pick-to: 6.1 5.15
Fixes: PYSIDE-1404
Change-Id: I534d78bdf44eb02bf80831a3d6c1d080a4e08698
Reviewed-by: Christian Tismer <tismer@stackless.com>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2021-04-29 21:12:12 +02:00
Li Xinwei
ebf91d1d13 Fix wrong note "Using pthreads" and only show it for WASM
MSVC does not have pthreads.

"QT_FEATURE_thread" should mean "Enable thread support".

And I think this note is only meaningful for WASM. For other platforms,
thread support should be enabled by default.

amends 4972fdb350

Change-Id: I5a4fc05219c9b2ff9c6e54fd444b4b94230727bb
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-29 23:09:06 +08:00
Shawn Rutledge
2ecd0f4194 Revert "Add grabber context pointers"
This reverts commit 40330b8f0a.
It was a bad idea to use QFlatMap here, because it is a sorted map, but
we need to keep the passive grabbers in the same order as the grabs happened.
So need to go back to an earlier version of the patch that uses two parallel QLists.

Pick-to: 6.1
Change-Id: I9e6013c2565986fe1eb9fd754f8259766f83bee5
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-04-29 16:49:57 +02:00
Edward Welbourne
9bad096c09 Use a more forgiving threshold for qFuzzyIsNull(qfloat16)
Analysis of problems with the new test for qFuzzyIsNull() revealed
that, where its version for double uses approximately 4500 * epsilon
and for float used 84 * epsilon as threshold, the qfloat16 version's
value was barely more than epsilon, with the result that the test had
to use a different value than the threshold to pass. (Converting the
threshold from float to qfloat16 and back made it bigger; in effect,
the threshold value was not <= itself.)

Furthermore, comparison with qFuzzyCompare() implied a value of
1/102.5 should be used, roughly 10 * epsilon, for consistency.  When
1/102.5 is rounded to three significant digits (the precision we use
in QTest::toString(), for example), to give 0.00976f as threshold, we
get a value that, after conversion to qfloat16 and back to float, does
give a result <= what we started with. So change qFuzzyIsNull() and
its test to use this as qfloat16's threshold value.

[ChangeLog][QtCore][QFloat16] The qfloat16 threshold value for
qFuzzyIsNull() has changed from 1e-3 to 9.76e-3, almost a factor of
ten increase, for consistency with qFuzzyCompare()'s tolerance. Values
between these would previously have had qFuzzyIsNull(f) false despite
qFuzzyCompre(f, 1+f) being true.

Change-Id: I35816dce78da34a3e2339c8bc42d5bd03714a3f6
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-29 14:13:23 +02:00
Edward Welbourne
6dfec83051 Add tests for qFuzzyIsNull() to tst_QNumeric and tst_QFloat16
They were missing.
I also wanted to verify that it's true for sub-normal values.

At the same time, relocate qfloat16's implementation of qFuzzyIsNull()
to between those of qFuzzyCompare() and qIsNull(), since its apparent
absence initially confused me.

Change-Id: I9637c0070e754d16744c76fc9f846596257c6a63
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-29 14:13:23 +02:00
Edward Welbourne
16c9683718 Revert early return from QTimeZone on invalid ID
This reverts commit ec8808c302 but
retains its test, as the problem it fixed is now solved by having the
TZ backend validate the ID it's passed, so that it now only accepts
valid POSIX zone-descriptions and valid IANA IDs. The former were
being excluded by this check.

Amended a POSIX test to fail with the check in place; it passes now.

Change-Id: I0d5e8c6e0a315ac2509f3d23bebb52aede8f79d0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2021-04-29 14:13:23 +02:00
Edward Welbourne
ae5d40e674 Handle invalid system zone case when falling back from time_t functions
Ammends commit 530e0bd469, in which I
added a QTimeZone-based fall-back for handling of conversions between
local time and UTC when outside the range supported by time_t-based
functions. That replaced prior kludges, when feature timezone is
enabled; however, even with feature timezone, it's possible for the
system zone to be invalid. So retain the old kludges also as fall-back
for when the system zone is invalid, as well as when we have no
timezones to fall back on.

Change-Id: Ie2b8af7f1a87d7b0e39cc5ac0c04b04d574f84b5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-29 14:13:23 +02:00
Edward Welbourne
8ec07b4afc Fix mix-guided use of const reference variable
It needs to be a mutable value variable to be std::move()d.

Pick-to: 6.1 5.15
Change-Id: I9d78b2975f8964e7a7eb06771b0069d9b9e6661e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-29 14:13:23 +02:00
Joerg Bornemann
582fdf06d1 Make a documentation-only build possible
Packagers usually build Qt per repo, but the documentation must be built
from the full Qt source archive to ensure that inter-repo links are set
up correctly. When building the documentation, it's desirable to avoid
building tools and re-use to tools of an existing Qt build.

One now can do a documentation-only build by configuring Qt like this:

    cmake /path/to/Qt/source -GNinja \
          -DQT_HOST_PATH=/path/to/Qt/installation

and build the documentation with

    ninja docs

To avoid building tools, this patch removes the DEPENDS arguments from
some add_custom_target calls in QtDocsHelpers.cmake and makes another
one conditional. The removed dependencies are added at the end of
qt_internal_add_docs. Adding of tool dependencies is not done if
QT_HOST_PATH is set.

Fixes: QTBUG-88441
Change-Id: I3b7a908e22d252d2edcdc1dd522a78b8ad6c487e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-29 13:05:16 +02:00
Mårten Nordheim
56572f74e4 HTTP: Don't call allDone twice
Change-Id: Ia3fb2e2c185f4e61234ce237416028b0c45357f8
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-04-29 13:05:16 +02:00
Mårten Nordheim
52a0eb4791 HTTP/2 authentication required
With Qt 6 we made HTTP/2 default, which exposed missing handling of
401 Unauthorized (and 407 Proxy Authentication Required).

In HTTP/1.* we would handle this after the response had finished, while
handling the status code. For h2 this path isn't used since it is
heavily reliant on the structure we have for HTTP/1.* (one request per
channel). So we must handle the status code and header directly.

Having that part fixed exposed another issue - when resetting/rewinding
uploaded data we were not resetting the 'totallyUploadedData' counter in
the reply (this, in turn, exposed another small issue). Because of that
we did not actually send any data on the retry, only sending the
content-length followed by no data.

Finally, the small issue mentioned in the previous paragraph was how we
check if we have uploaded all our data. It was only checking if the
byte-device was atEnd(), which it was. But only because it had not yet
prepared any data for us.

Fixes: QTBUG-91284
Pick-to: 6.1 6.0 5.15
Change-Id: I798d105b02688b18a02897cc476f19f57a47f98f
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-04-29 13:05:16 +02:00
Zhang Xiang
675a4b0cc7 Fix namespace error of std::source_location under C++20
With C++20 standard, src/corelib/kernel/qproperty.h of Qt Base cannot be
compiled at line 100:

QPropertyBindingSourceLocation(
	const std::experimental::source_location &cppLocation
	)

The reason is that source_location has been merged into namespace std
since C++20, and the header file has also been change from
<experimental/source_location> to <source_location>.

The problem can be avoided by define a constant.

Fixes: QTBUG-93270
Change-Id: I46b4daac6ea20f9623b43746880500d41396afb2
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-04-29 09:12:47 +00:00