Commit Graph

48689 Commits

Author SHA1 Message Date
Alexandru Croitor
5fa823491b CMake: Fix automatic sysrootification detection for qmake
The way we detected whether SysrootifyPrefix needs to be set was
incorrect.

We checked if extprefix == prefix => SysrootifyPrefix should be
true. But that was previously always the case for a non-prefix build,
which means it was not possible to build apps (due to qmake expecting
to find include dirs in the sysroot, despite the non-prefix Qt not
being installed anywhere into the sysroot).

Instead we should do what qmake does. Only set SysrootifyPrefix to
true if extprefix was not provided and a sysroot is available.

To make it work for iOS and Android, the sysroot detection code had to
be moved earlier than the SysrootifyPrefix detection.

Task-number: QTBUG-86053
Change-Id: Idcc1260a675fb2ef9ae27fc9dc42a68b30f763b8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-26 13:46:49 +01:00
Robert Loehning
2096400d6e Revert changes in strto(u)ll.c to avoid integer overflows
Found in oss-fuzz issue 26045.

Pick-to: 5.12 5.15
Change-Id: Id9eac1b4f67ad9bbe2d92dd69cd03338a6ced74e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-26 11:21:33 +02:00
David Skoland
dc44e4a35e Use metaType instead of type in qlocale_mac
QVariant's type() has been deprecated in favor of metaType()

Change-Id: Ibb060bde5e946849fc1c1a67a48ff63beb1d8ffe
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-26 09:50:11 +01:00
Friedemann Kleint
e3470a98e9 Windows QPA: Use a QSharedPointer for the touch device
For reasons of symmetry with the tablet devices.

As a drive by, give it more distinct IDs.

Task-number: QTBUG-46412
Change-Id: Ie667621246b26db6fdda84c5ff2455fe38633cb3
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2020-10-26 10:14:05 +02:00
Andy Shaw
d9edad8117 Show the year correctly after it has been edited
When converting the year as an integer via the locale then it can add
in group separators which would not be desired here. Therefore it should
be converted via the QDate approach to get the right output for the year.

Fixes: QTBUG-86307
Fixes: QTBUG-85966
Pick-to: 5.15
Change-Id: I092bd1e5f69e544843fd5f28c96b94c9066490c5
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-26 09:43:37 +02:00
Mårten Nordheim
ec258b8291 QSsl: Further work around to pass network test
Our tls certificate/key are a bit on the old side and need to be
updated. But for now let's lower the openssl level. In this case openssl
complains about the server's key used for DHE being too short.

Task-number: QTBUG-86187
Change-Id: I142a7d52f7599f60b8f4f3ff3ac5ce61fed06b4c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-10-26 09:30:36 +02:00
Timur Pocheptsov
40fb97e97f QMacStyle - fix tab rendering
In BigSur NSPopupButton, it would appear, is slightly different. But different
enough so that a fragment of a disclose 'arrow' button became visible within
the clipping region, making it appear as some blue strange thing in between
inactive (non-selected) tabs.

Task-number: QTBUG-86513
Change-Id: Ib03af48069056b5ecbb8b4afebd851005583293a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-10-26 09:14:32 +02:00
Volker Hilsheimer
0f9675768d Remove documentation for removed QFlags constructor
Change-Id: I407392d8d92da2ebcfc2cb8050155ab44ba1f0ff
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-26 07:42:36 +01:00
Volker Hilsheimer
6419dd972d Document QVariant::data/constData
QMetaSequence refers to those members, and QMetaType operates on void*s,
and documents such low-level APIs as well, so can't think of a reason
why we should not document the QVariant getters as well.

Change-Id: Id18de839bb0e4f5559b28bfca80eaabab1eb6479
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-26 03:32:58 +01:00
Kai Koehne
66c94b8356 CMake: Document versionless variants for CMake commands for DBus
Pick-to: 5.15
Change-Id: I7168a2d2589ef72d6e6f4bc568c5a914faa777df
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-25 10:49:59 +02:00
Kai Koehne
ae18502151 Fix included license text for PCRE2 - Stack-less Just-In-Time Compiler
[ChangeLog][Third-Party Code] Changed license text of
"PCRE2 - Stack-less Just-In-Time Compiler" component. The documentation
(incorrectly) included the generic PCRE2 license so far.

Pick-to: 5.15 5.12
Change-Id: I7b36a640ba83fb6087fe28d77f9435af13f8c84d
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-25 10:49:43 +02:00
Kai Koehne
9079e3f2fc Fix copyright information for src/3rdparty/xcb
The new copyright lines are taken from xcb-proto-1.13/COPYING, and
xcb-proto-1.13/src/xinput.xml.

[ChangeLog][Third-Party] Fixed copyright information for "XCB-XInput".

Pick-to: 5.15
Change-Id: I8afa4dab39765b85a015524fe16b085dcfe5a864
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-25 08:49:31 +00:00
Ole-Morten Duesund
260d1fe832 Make STL iterators the preferred style
Emphasize STL iterators over Java style iterators.

Details about Java style iterators moved to it's own page and only
briefly mentioned on the containers page.

Task-number: QTBUG-86584
Change-Id: Id54863f79f90214aaae87e60cee1a66f53a044ab
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-25 09:48:40 +02:00
Hiweed Mandriva
f087d6050b doc: fix description in doc_src_containers.cpp
Change-Id: Iade0a8ea7fc51df1ee624c4059f93d470abb9b08
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: <hiweedmandriva@163.com>
2020-10-25 14:30:44 +08:00
Allan Sandfeld Jensen
c2cf5f824a Whitespace cleanup in corelib/kernel
Change-Id: If061ef0af5ced4384e20a82afcea3712fa7e45d7
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-24 19:45:59 +02:00
Topi Reinio
c4245e7b8c CMake: Don't invoke QDoc excessively
The html_docs target does not need to call QDoc a third time as
both its dependencies already do that.

With qmake, html_docs did invoke QDoc if CONFIG did not include
'prepare_docs', but none of the Qt modules used that configuration.
We can manage without it for now.

Fixes: QTBUG-87751
Change-Id: I45d2d06006c566c431ae41d7f3a06d6b809987f2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-10-24 17:44:34 +00:00
Andrei Golubev
d2cf18bf03 Refine QADP::pass_parameter_by_value evaluation
Change-Id: I8327ab3eb2503228448af59098146e062d4b90d3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-24 16:28:10 +02:00
Andrei Golubev
7075b6eeae Update QList::append(const_reference) -> QList::append(parameter_type)
Forgotten during previous round of replacing const lvalue references
with parameter_type in QList methods

Task-number: QTBUG-86553
Change-Id: I9abda4db3b504521b64fab1f220559c36bfeb9f5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-24 16:27:58 +02:00
Volker Hilsheimer
e5bc777e50 Fix documentation warnings
Declare hidden friends like qdoc expects them, and other signature fixes
Document function parameters
Remove documentation for removed APIs.

Change-Id: I44c1caeed0d40be04612129d074acc30b75f5259
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-10-24 14:13:42 +02:00
Tor Arne Vestbø
b362c69171 testlib selftest: Spit out stdout/stderr when test crashes
The old test harness used to spit out stderr only, but
to be on the safe side we spit out both.

Change-Id: Ib8e57fd1b0e4d8542ac552a6fe58c07016df7f5f
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-24 13:05:02 +02:00
Alexandru Croitor
815f31799c CMake: Fix tst_qmake to work for configs with cross-compiled tools
When cross-building Qt with CMake to target qemu configs in the CI,
we specify the -DQT_BUILD_TOOLS_WHEN_CROSSCOMPILING=ON option to also
cross-build tools (like qmake).

In this case, $prefix/bin/qmake points to the cross-compiled qmake,
and the shell script that wraps the host qmake is called
$prefix/bin/host-qmake instead.

In such a scenario, tst_qmake ends up running the cross-compiled
qmake, which thinks that it's being run on device (via user-space
qemu emulation) and doesn't specify the sysroot when computing include
paths, link paths, etc. This causes the test building to fail in
various ways.

To fix the test, check for the existence of the host-qmake wrapper,
and if it exsists use it instead.

Task-number: QTBUG-86053
Change-Id: Iaa4afdf11b17f23abef873dd15b1ed950126ab8c
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2020-10-24 13:02:54 +02:00
Morten Johan Sørvig
1b7ee06605 Rename “pixelDensity” variables
QHighDpiScaling now computes scale factors based on
QPlatformScreen::logicalDpi(), instead of by calling
QPlatformScreen::pixelDensity() as done earlier.

We forgot the rename the internal state variables,
update them to indicate that platform screen DPI is
used.

Change-Id: Ib718a6176e0ac138395eea13b292f75f69dac3ad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-10-23 21:19:51 +02:00
Joerg Bornemann
351d066adb CMake: Put the -qtconf argument in front in the qmake wrapper
For QMake's -install argument it's necessary to have -qtconf in front.

Task-number: QTBUG-87801
Change-Id: I042acdd143972cc4065660035b02678db891157f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-23 21:11:55 +02:00
Joerg Bornemann
f22644c5fa Make "qmake -qtconf my-qt.conf -install ..." possible
Detect the case where the first argument is -qtconf <file> and ignore
that for the -install argument.

Task-number: QTBUG-87801
Change-Id: If6822ee3ebef99de645aee8d110ebdcb13fb2da2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-23 21:11:50 +02:00
Joerg Bornemann
661b586a69 Make "qmake -qtconf my-qt.conf -query" possible
It's now possible to put the -qtconf argument in front of the -query
argument (and others).

Fixes: QTBUG-85136
Change-Id: I74b78f084acf264ef637ed2f6cb63b655b176056
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-23 21:11:46 +02:00
Joerg Bornemann
4bf8f70bfe CMake: Let doc targets depend on doc tools in top-level build
For top-level builds it's desirable to have "ninja generate_docs" build
all tools needed to generate the documentation.

This is problematic since the doc-generating targets are created before
the doc tool targets. Thus, we must defer the dependency connection if
the doc tool target is not yet available.

This patch adds the functions qt_internal_defer_dependency and
qt_internal_add_deferred_dependencies.

Change-Id: Ica940b80882e67cb0e0943e95541f7f4d1885948
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-23 21:11:40 +02:00
Joerg Bornemann
86064e1298 CMake: Fix typo in variable name
Change-Id: I310ff17c75970482803294bb5f4473bcaebdc151
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-23 21:11:36 +02:00
Andreas Buhr
83fce1931f Add unit tests for qdatetimeparser
The qdatetimeparser was not tested explicitly so far, but only
implicitly in tst_qdate / tst_qdatetime / tst_qdatetimeedit etc.
This made it difficult to test some corner cases, especially in the
context of unfinished dates, i.e. dates which are invalid, but could
become valid by adding more characters. This is used to validate
user input in qdatetimeedit.

Task-number: QTBUG-84334
Change-Id: I27202849abb1b7cad96d3e25f7ac81ce85272b2a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-10-23 20:33:18 +02:00
Allan Sandfeld Jensen
85e4e5bacf Make QSharedPointer comparisons hidden friends
Doesn't touch qsharedpointer.h which already seems outdated and needs
a general overhaul.

Change-Id: I051cdeb1fe03a7ef16e333a483bb68e2fada3c25
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-10-23 20:29:32 +02:00
Morten Johan Sørvig
074f71cfda Display tooltips on the correct screen
Display QTipLabel on the correct screen, also when the
parent widget spans multiple screens. In this case,
QWidget::screen() will return the main screen for the
widget, which will not necessarily be the screen at
the tool tip position.

Fixes regression introduced by 7e2fded5.

Change-Id: Iffb920b6658468c5032928eadbd749f58fe077a7
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2020-10-23 20:19:45 +02:00
Morten Johan Sørvig
07466a52c6 macOS: Remove alpha from default surface format
(This reverts commit 2ca1253b13).

This allowed use to avoid backing store RGB -> RGBA conversions
on the CPU back before macOS was layer backed. The conversion should be
GPU accelerated now, and we can return to the cross-platform default.

In addition, RGBA backingstores requires filling with transparent
pixels on each paint event, which causes increased CPU usage - often
for no reason if transparency effects are not used.

Change-Id: Ic795128b7e474b63f44f9f4f3526d0b205652e62
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-10-23 20:19:30 +02:00
Tor Arne Vestbø
4485f0d626 qmake: Don't warn about using private headers if there are none
Change-Id: I1d9ab0b4d25671931faa469e66cb2beb7bd846fd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-23 20:19:29 +02:00
Tor Arne Vestbø
addd3b5292 testlib: Spit out crash backtraces to stderr
Ensures that the backtrace is interleaved with the header and
footer that we print ourselves.

Change-Id: I728f4a05be31e345687cbb5fefe49f76dbe8ae36
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-10-23 20:19:28 +02:00
Alexandru Croitor
419db858f5 CMake: Fix deprecation defines not being set properly
Instead of propagating the deprecation wranings, we compiled all code
with -Ddeprecations.

Change-Id: I0233ddc85bdbdcb93d366073b2cea5d47bdbe52a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-10-23 20:12:12 +02:00
Giuseppe D'Angelo
6f265faa17 QList/QVLA: fixup the docs
I'm not 100% sure that qdoc needs this, but in case it does,
here's the commit.

Change-Id: Ia3e17a56fd5df766c250f4875ba5e19e12b98d11
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-23 20:08:07 +02:00
Tor Arne Vestbø
85ba43061f Make entry point module an internal module
Change-Id: I9eaadc7ce8ca03d64ff3a33c7b6641b073570a61
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-23 20:08:07 +02:00
Tor Arne Vestbø
83ad237771 cmake: Produce internal module pris like qmake does
qmake treats internal modules as just the regular module file,
but with a _private suffix, as opposed to the current cmake
logic, that treats it as the private module file, resulting
in missing e.g. the Qt.foo.module entry.

Change-Id: Id55ca4c23921656d5abfd1d0fdf6430d4fe120bf
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-23 16:37:14 +02:00
Giuseppe D'Angelo
155ee2bbd7 QList/QVLA: default the parameter for indexOf/contains/remove/etc.
This allows to use list-initialization when calling these functions,
for instance list.removeAll({}).

Change-Id: I2828d900a44bd0bc5aea5fba4777304b09190bc9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-10-23 16:37:14 +02:00
Giuseppe D'Angelo
45cf0cf513 QList: make (last)IndexOf and contains function templates
There's no reason why they shouldn't be; one might want to do a
lookup passing an object which is comparable with the list's value
type (e.g. search with a QByteArrayView needle into a QByteArrayList
haystack). Insofar we've had to add overloads to QListSpecialMethods
for all these cases, which clearly doesn't scale and creates
top-tier and low-tier lists.

There is one downside, namely, calling QList<A>::indexOf(B) for a B
for which there isn't an operator==(A, B) but only a conversion
towards A.  Before, B was converted only once (at call site), now
it's converted at every call of operator==.
In general: such types are broken and should be fixed on their own.
However let's avoid a possible regression in client code, so I've
left the QString overloads in QStringList in.

To get there: centralize the implementation of those methods in a
empty base class, which gets then inherited by QListSpecialMethods,
which is inherited by QList. This is there are still special methods
that may want to overload contains, e.g. QStringList which also
passes a case sensitivity).

The only breakages comes from code that was already broken, for
instance mixing signed and unsigned types, and the beauty of this is
that now we *detect* that instead of silently ignoring.

QVLA and other QList methods will be tackled in future commits.

[ChangeLog][QtCore][QList] The indexOf, lastIndexOf and contains
methods now take an object of any datatype -- and not just the
list's own value type. This allows for heterogenous lookup in
QLists.

Change-Id: Ib34812217eb2b0f926fad1fc195b33758196941c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-23 16:37:14 +02:00
Volker Krause
d53bbecf4c Fix QSaveFile always failing on content: URLs
QSaveFile needs QFileInfo::isWritable() to work, which 7e5f38aec6 caused
to always return false for content: URLs.

Change-Id: If839331e4bd176765ed242791cb253c2064f5f6d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-10-23 16:37:14 +02:00
Friedemann Kleint
f6d09d426b Fix tst_qsslkey to compile when SSL is disabled
Move it to the section requiring SSL tests since it
requires QSslConfiguration.

Change-Id: I5c807976ce75fa5967bddb8edd7788dbfbb89375
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-10-23 11:36:48 +02:00
Joerg Bornemann
6681fa7b73 CMake: Allow docs generation without installing in top-level builds
This patch allows in top-level prefix builds to build Qt and to generate
the documentation without running cmake --install first.

For top-level builds we now always use the qdoc binary from the build
directory, not the installation directory.

We also have to copy the global doc files to the build directory to make
them accessible to the generate_docs target.

Change-Id: I2251603418fc3df9a21c7f2892789e9ff6c8cc21
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-23 11:36:48 +02:00
Tor Arne Vestbø
1f53a91ed3 cmake: Respect NO_PRIVATE_MODULE when generating module pri files
Change-Id: Id5816d6598a0a484c20674f34f6f809e68671e6b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-23 11:36:48 +02:00
Tor Arne Vestbø
6baa0f4ccc cmake: Don't add include paths to module pri if there are no headers
Change-Id: I8fa01f45410805399a511a87c6f04192ce42d374
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-10-23 11:36:48 +02:00
Ales Erjavec
c3fd24164b QSplitter: Respect managed widget's growth/expand size policy
Use qSmartMaxSize to get the maximum size a widget can take.

[ChangeLog][QtWidgets][QSplitter] Respect QSizePolicy::Maximum and
QSizePolicy::Fixed layout policy of child widgets.

Fixes: QTBUG-87133
Change-Id: I166ef3f6608303b8695f5c05a7bf0d1be4653f4a
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2020-10-23 11:36:47 +02:00
Karsten Heimrich
216c2ed5ce Remove usage of deprecated QStandardPaths::DataLocation
* Rearrange the documention to match the enumeration order.

Fixes: QTBUG-87037
Change-Id: Iad001351e0f309e694b8bbd503813017e6586a21
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
2020-10-23 11:36:47 +02:00
Karsten Heimrich
25edeaa3d6 Doc: Add porting Guide for QRegExp
Fixes: QTBUG-87101
Change-Id: I370c79e295489f4eaf8418bbd53b326f0a8e5123
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-23 11:36:47 +02:00
Volker Hilsheimer
aa38ab8f68 Make Q(Multi)Map equality operators documentation-friendly
Change-Id: I1a84c437bb19dd3c667596c59e1404bbbf39978e
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-23 10:25:42 +02:00
Volker Hilsheimer
cbefd42e39 Fix documentation for QVariantRef and QVariantPointer
Change-Id: I86b749ec14876df98d5d873cf2274facea49f0c5
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-10-23 10:25:38 +02:00
Topi Reinio
2f91cbaccb Doc: Fix documentation warnings for QProperty and related classes
Task-number: QTBUG-86295
Change-Id: I547f4cf34d9721f56ba1cd665218f66597ffbb5c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-10-23 10:16:32 +02:00