Commit Graph

43803 Commits

Author SHA1 Message Date
Leander Beernaert
67ea445f09 Append to AUTO_MOC_OPTIONS in order not override existing value
Change-Id: Id1bf607e31ee2baa5ffb6d6b4aedd98ea83e5e15
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-29 15:55:49 +00:00
Leander Beernaert
f47efdac1d Only add --automoc-json to AUTOMOC_OPTIONS for metatypes targets
Change-Id: I7c2e859a83ea78c2a6cf2ad59c175c1b29a74621
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-29 15:36:55 +00:00
Alexandru Croitor
274a61d096 Skip processing '-framework' flags in qt6_generate_meta_types_dep_file
Otherwise we get generation errors due to calling GENEX_EVAL on
something that is an invalid target.

Perhaps there will be a better way once
https://gitlab.kitware.com/cmake/cmake/issues/20287 is fixed.

Change-Id: I6af9511cbb9942b9edbc3b3fc7028936308715d8
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-29 15:11:58 +00:00
Alexandru Croitor
ccdc6c2dd3 pro2cmake: Fix flake and mypy issues
Change-Id: I33ab818c53f751ede7a7840b1086a3ae8263e109
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-29 14:42:03 +00:00
Alexandru Croitor
957007a949 pro2cmake: Handle QML_IMPORT_MAJOR_VERSION and minor variants
This is needed for qtdeclarative examples, otherwise CMake configuration
fails due to missing QML import version info.

Change-Id: Iedde7b6a9e2d5ac7f6d81969ac7d6d874361c02e
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-29 14:41:40 +00:00
Leander Beernaert
a6ccef651d Generate metatypes dependency file
Due to generator expression it is impossible to recursively evaluate the
link dependencies of a target. This is required by QtDeclarative's
qmltyperegistrar.

To overcome this we generate a ${target}_metatypes_dep.txt file which
contain lines with the following pattern:
${PATH_TO_METATYPES.json}=${PATH_TO_METATYPES_DEP.txt}

This can be used to recursively evaluate the dependencies at run time.

Change-Id: Ia4cee0632c16ba9631e0289db906fe9d320844a3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CMake Build Bot
2020-01-29 14:20:54 +00:00
Alexandru Croitor
34a112e383 Fix CMAKE_BUILD_TYPE to be a cache variable in QtBuildInternalsExtra
Rather than pass the build type in the wrapper, make sure the build
type is a cache var, so it gets picked up when building other repos.

This reverts commit f72ca4cf85.

Change-Id: I5d91ab66249b6c40c5e548b0eec0e467ba0f2ebc
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-01-29 11:56:27 +00:00
Ville Voutilainen
3ad5d7aa55 configure: Add support for -feature and -no-feature for cmake builds
Change-Id: I160a9513da0401f1c83598691294ec48737e08a5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-29 11:35:42 +00:00
Leander Beernaert
f72ca4cf85 Forward CMAKE_BUILD_TYPE, if available, in qt-cmake
Change-Id: I299e16cfc084b3fc009e806902e26121ebdd454b
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-01-29 09:39:32 +00:00
Leander Beernaert
88b7f64e73 Fix example generation without qmldir file
Do not return when no qmldir file is present and no dynamic qmldir
information is set.

Change-Id: I04e458f69e4e4a6ec9b1e7ca7ba0b0f7520996f7
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-28 20:43:44 +00:00
Alexandru Croitor
3c6b0a07da pro2cmake: Don't set OUTPUT_NAME for qml plugins
Amends f67d8ae2d4

Change-Id: I288a9388d4ebd354199bfa0913eff34d93a58d75
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-27 15:10:16 +00:00
Alexandru Croitor
fd590b9482 Don't create convenience plugin target when not needed
If the OUTPUT_NAME of a plugin is the same as the CMake target name,
don't try to create a custom target with the same name. That will
cause configuration errors due to duplicate targets.

Amends f67d8ae2d4

Change-Id: Iaea7c68e22dbc1e345ba10950c312618abba4c21
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-27 14:21:58 +00:00
Michal Klocek
a3ff42ade6 Relax rules about not having dbus session
Some desktops do not run dbus session and still want to build qt.

Change-Id: I898a3c25c9b47c1a953e426873280ab9e160c669
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-27 13:09:40 +00:00
Alexandru Croitor
b714219fea Fix qt_import_plugins compatibility with Qt 5
Handle versionless plugin names passed to qt_import_plugins.

Task-number: QTBUG-74137
Task-number: QTBUG-80477
Change-Id: Ic7fb6e54d2822c7eb58a7874b4a1c137f0c101d9
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-27 11:59:51 +00:00
Alexandru Croitor
f53ca8a4fc CMake: Add Qt 5 backward compatible CMake API
Create versionless function names, that coincide with the Qt 5 CMake
API.

Task-number: QTBUG-74137
Task-number: QTBUG-80477
Change-Id: I8559b2c8a49b23e5a89ec81603aaec54ea634d70
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-27 11:49:44 +00:00
Alexandru Croitor
b10d8eab04 Regenerate plugin projects to get new target names
And also to get the original output names (qmake's "TARGET"), so that
the plugin file names are as they were in Qt 5.

Change-Id: I96a060d1a81693652847857372bec334728cb549
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-27 11:49:34 +00:00
Alexandru Croitor
604aa83ad9 Reformat pro2cmake
Change-Id: I97175e8edbd4b911397f5b03a646006eff32a5bc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Qt CMake Build Bot
2020-01-27 11:49:25 +00:00
Alexandru Croitor
f67d8ae2d4 Fix plugin target names to be compatible with Qt 5
In Qt 5, qmake generates CMake Config files which expose the plugins
as imported libraries. The name of these libraries are derived from
the plugin class name. So QCocoaIntegrationPlugin, and not qcocoa.

To keep compatibility between Qt5 and Qt6 CMake target names,
the pro2cmake script should generate plugin target names based on the
plugin class names.
To avoid passing the same name in qt_add_plugin (target and CLASS_NAME),
derive the class name from the target if the class name is
not explicitly specified.

Also add a new OUTPUT_NAME parameter which is used to change the
final file name of the plugin, so that it's compatible with Qt5.
For example to generate a qcocoa.dylib file, instead of
QCocoaIntegrationPlugin.dylib file.

The same OUTPUT_NAME value will be used for generation of plugin .prl
files for qmake consumption.

Change-Id: I4d53e680d7beb62befecd359cdf6bba60a34ff0d
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-27 11:49:11 +00:00
Alexandru Croitor
c9bea1ad62 Add initial support for CMake "Ninja Multi-Config" generator
This allows doing debug_and_release builds with Ninja on all
platforms.
The "Ninja Multi-Config generator" is available starting with CMake
3.17.

Desired configurations can be set via CMAKE_CONFIGURATION_TYPES.
Possible values: "Release, Debug, RelWithDebInfo, MinRelSize".
For example -DCMAKE_CONFIGURATION_TYPES="Release;Debug".

The first configuration is the 'default' configuration which is
built when calling ninja with no arguments.

To build all targets of a certain configuration use "ninja all:Release"
or "ninja all:Debug".

To build all targets in all configurations use "ninja all:all".

Note that the first configuration influences which configuration of
tools will be used when building the libraries for all configurations.
In simple terms, when configured with
-DCMAKE_CONFIGURATION_TYPES="Release;Debug" the release version of moc
is used by AUTOMOC.
When configured with -DCMAKE_CONFIGURATION_TYPES="Debug;Release"
the debug version of moc is used by AUTOMOC.

Framework builds and Ninja Multi-Config don't currently work together
due to multiple bugs in CMake, which ends up generating an invalid ninja
file with duplicate rules. There are also issues with placement of the
debug artifacts.

This will be handled in a follow up patch after CMake is fixed.

Task-number: QTBUG-76899
Change-Id: If224adc0b71b7d1d6606738101536146aa866cd7
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-27 11:47:57 +00:00
Leander Beernaert
cce8ada814 Support for QML Type Registrar
Change-Id: Ifc1f44cf40b22c20ab768333ba9d5ce58a5f7250
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-24 12:29:30 +00:00
Leander Beernaert
48c82e90af Post Merge Fixes
Change-Id: I1e06c01b76b119c3f23b6e6ecbaae8df719b70ce
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-24 12:29:18 +00:00
Leander Beernaert
502d3d6744 Merge remote-tracking branch 'origin/dev' into merge-dev
Change-Id: I31b761cfd5ea01373c60d02a5da8c33398d34739
2020-01-24 13:17:33 +01:00
Alexandru Croitor
d1be8b9ceb Fix dependencies for SIMD object libraries in macOS framework builds
This manifested in Coin when ninja tried to build qdrawhelper_sse2.cpp
before the Core framework headers were copied, resulting in a
fatal error: 'qatomic.h' file not found.

Make sure every SIMD object library has all PRIVATE dependencies of
its parent library PRIVATE dependencies (except for other SIMD object
libraries), to make sure that the framework headers are copied by the
time the SIMD source file is compiled.

Here's an example for clarification. Gui_simd_sse2's LINK_LIBRARIES
property should have all the values of Gui's LINK_LIBRARIES property
(like Qt::Core) filtering out all SIMD object library targets (
like Gui_simd_sse2, Gui_simd_sse3, etc).
Thus we make sure the SIMD object libraries are built after Gui's
dependencies are built.

Note that using INTERFACE_LINK_LIBRARIES to avoid the filtering of SIMD
targets in the generator expression would only work in shared Qt builds.
In static Qt builds where PRIVATE dependencies become PUBLIC, CMake would
insert $<LINK_ONLY:Gui_simd_foo> entries in INTERFACE_LINK_LIBRARIES
which causes CMake to be confused and fail at generation time.

Change-Id: I246c1394b9c9830c0ebd11e6621e56b992a6a1f2
Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-22 12:36:06 +00:00
Leander Beernaert
6eb32dc28a Fix qt-cmake.bat for paths with spaces
Change-Id: Id338f7f2f0392e2fe3933659af156644e8fac6c1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2020-01-22 08:47:58 +00:00
Johan Klokkhammer Helsing
06bb315beb Remove QOpenGLTextureHelper dependency from QOpenGLContext
It's now just a pointer to a forward declared class

Task-number: QTBUG-74409
Change-Id: I34df385154dcff2bbba2f6318825ab5258fa6695
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-01-20 15:03:15 +01:00
Qt Forward Merge Bot
35a461d026 Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: I68702c9f9680772d332b5bb777ddd2663168abd5
2020-01-19 01:00:10 +01:00
Qt Forward Merge Bot
858c5a73fc Merge "Merge remote-tracking branch 'origin/5.14' into 5.15" 2020-01-18 01:00:20 +01:00
Qt Forward Merge Bot
3e9f8b5249 Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I12148e7b20bcdb72d9b328035d528c99633b1e92
2020-01-18 01:00:08 +01:00
Mårten Nordheim
4ec6748c6a QMap: deprecate insertMulti, unite and friends
insertMulti and unite will silently transform a QMap into a multi-map
which is not behavior we want to keep around anymore and as such is
being deprecated. QMap functions that only make sense in a multi-map
scenario are also deprecated and the implementation is moved to
QMultiMap where it makes sense.

Use QMultiMap if multiple keys are desired and insert(const QMap &)
if a non multi-map-converting unite is desired.

[ChangeLog][QtCore][QMap] insertMulti(), unite(), values(Key),
uniqueKeys(), count(Key) is now deprecated. Please use
QMultiMap instead.

Task-number: QTBUG-35544
Change-Id: I158c938ceefb5aaba0e6e7513b2c26a64d29d521
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-01-17 22:17:03 +01:00
Mårten Nordheim
cd5ce46dc5 QUdpSocket: Blacklist writeDatagramToNonExistingPeer for msvc2019
Same as other versions of MSVC

Fixes: QTBUG-80328
Change-Id: I05c5ffe6d36e0cdfb781080a736c90b6a6d4b2ba
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-01-17 22:16:23 +01:00
Paul Wicking
9c172af7d5 Doc: Update text that refers to deprecated member function width()
* Add see also links from the deprecated function to the replacement.
* Change introduction text to reflect new function name rather than the
  old and deprecated width().
* Change see also and inline references to width(), so that they now
  refer to horizontalAdvance().

Task-number: QTBUG-65141
Change-Id: Iadfbc517e5df96e32058516f8795bd210cc4c5e4
Reviewed-by: Nico Vertriest <nico.vertriest@qt.io>
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2020-01-17 14:19:03 +01:00
Paul Wicking
fd31e4ce43 Doc: Display correct include for QWindowsWindowFunctions
Fixes: QTBUG-55412
Change-Id: I3a38fa26911b1c151af9f0b47f1be602058aa4af
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2020-01-17 14:19:00 +01:00
Nico Vertriest
28f95d4688 Doc: Fix qdoc compilation errors qtbase
Task-number: QTBUG-79824
Change-Id: I5a39525e3e735415ba96e2d585c5de754deb15de
Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
2020-01-17 12:56:08 +00:00
Volker Hilsheimer
89312b2eab Remove unused parameters from default-synthesized members
Fixes build error with gcc when compiled with -Werror=unused-parameters.

Change-Id: I12c3ecb30f489986b112f9736caec40aa50c7283
Fixes: QTBUG-81465
Reviewed-by: Liang Qi <liang.qi@qt.io>
2020-01-17 11:31:55 +01:00
Ulf Hermann
1e65445015 qml_plugin.prf: Use and prefer QML_IMPORT_VERSION over IMPORT_VERSION
qmltypes.prf does the same and the name is nicer.

Change-Id: I3364f7a244a941a4c6178cf87c65e289dc64ca22
Reviewed-by: Maximilian Goldstein <max.goldstein@qt.io>
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-01-17 11:16:44 +01:00
Giuseppe D'Angelo
a3b2eac380 QColor: add casts to ushort
Silence lossy conversion warnings on MSVC.

Task-number: QTBUG-80997
Change-Id: I0e5778b9f20b599de6fc8894c4b98fbc1b1510b9
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
2020-01-17 11:16:17 +01:00
Qt Forward Merge Bot
c70208c2d0 Merge "Merge remote-tracking branch 'origin/5.15' into dev" 2020-01-17 08:52:14 +01:00
Vitaly Fanaskov
63b0b857f3 QPalette: fix function swap and move operator
Additional data should also be taken into account when using move
operator and function swap. This is already implemented for move
constructor.

Task-number: QTBUG-78544
Change-Id: I24ba34b0957a8fba7e15a934f2d08222dc95650f
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-01-17 02:22:22 +01:00
Olivier Goffart
983432effd Introduce Q_MOC_INCLUDE
A new macro that can be added in the header file parsed by moc to tell moc
to include that file in the generated file

Change-Id: I03ad702c3fcd8380371015f226ee4b7456daf132
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-17 02:22:22 +01:00
Topi Reinio
5dc16d1324 Doc: Fix ButtonRole enum docs for QMessageBox and QDialogButtonBox
Multiple topic commands (in this case, \enum) do not work across
different classes.

Reuse the documentation comment via an \include statement instead.

Fixes: QTBUG-78910
Change-Id: Ife83bdc9bbad650835fafc072180d10037648d0a
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-01-17 01:11:21 +00:00
Giuseppe D'Angelo
800dda19a6 Do not anchor an already-anchored regexp
wildcardToRegularExpression() returns an anchored regexp, so it is
pointless to anchor it again.

Change-Id: If470179d63ae7ca2e7f137c0f403ec5bb5be8aaf
Task-number: QTBUG-81396
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
2020-01-17 01:53:12 +01:00
Qt Forward Merge Bot
0a4e5bb265 Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
	src/widgets/kernel/qshortcut.cpp
	tests/auto/network/access/spdy/tst_spdy.cpp

Change-Id: If76c434beac2c0a393440aa365f89f77439774ce
2020-01-16 11:20:42 +01:00
Edward Welbourne
c0ea88a677 Fix MS-Win system locale code to return QString for numeric tokens
QSystemLocale::query() is specified to return a QString (wrapped in a
QVariant) for the various tokens used in formatting numbers (zero
digit, signs, separators) but the MS-Win back-end was returning QChar
(wrapped as QVariant) instead, using the first UCS-2 code-point of the
string (even if this was the first of a surrogate pair). The same
error shall be perpetrated by its caller, but we can at least DTRT in
the back-end, ready for the coming fix (in Qt 6) to its caller.

In the process, eliminate some local variables that shadowed a member
variable and adapt number-conversion to cope with surrogate-pair
digits. Optimised the latter for the case where zero is "0".

Change-Id: Idfb416c301add4c961dde613b3dc28b2e31fd0af
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-16 10:28:08 +01:00
Topi Reinio
e05511a364 Pad Navigator example: Remove duplicated property animations
The example created two QPropertyAnimation instances that controlled
the same property; this caused a clash for some transitions.

Remove the smoothFlipXRotation and smoothFlipYRotation animations;
they are not needed as equivalent animations are already set as
defaults for the state machine.

Fixes: QTBUG-28081
Change-Id: Ifa7a09d48cd4905df720e3327914320ed74ebae6
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-01-16 10:24:06 +01:00
Leander Beernaert
b29cb7889a Run make format
Change-Id: If1107aefbfd374d6b664a94b21b9bbb5ed4cc178
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-16 08:41:08 +00:00
Leander Beernaert
99a824bbb7 Do not set OUTPUT_DIRECTORY if it is already set
This can happen in unit tests where a test has TARGET set to "../name",
which requires the target to placed in the parent binary directory.

It is possible to run into a second assignment for OUTPUT_DIRECTORY via
the DESTDIR property (e.g: qdbushmarshall test) which can then result in
two OUTPUT_DIRECTORY values.

However, the first one needs to take precedence or the tests won't
execute properly.

Change-Id: Ib263843fa86c3dd68d92a0989b95f2890335c92d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-01-16 08:36:43 +00:00
Mårten Nordheim
6faaef5a66 QNetworkAccessManager: Avoid unnecessary calls to sender()
As it searches through all connections, of which we have multiple for
each network reply.

Fixes: QTBUG-81336
Change-Id: Iba28278edae5f254bf884f427e0944d348b47d03
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2020-01-16 08:30:41 +00:00
Leander Beernaert
7c6f763d85 Regenerate Tests
Change-Id: I78f1efbec809610bcf6a8224392fa0dc8dbf3b3b
Reviewed-by: Qt CMake Build Bot
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-16 08:16:17 +00:00
Giuseppe D'Angelo
9f1948f59b QRegularExpression: fixup docs of wildcardToRegularExpression
Fix a couple of typos, and add a paragraph explaining
that there is no need of anchor the pattern again; a wildcard
is always anchored.

Fixes: QTBUG-81396
Change-Id: Ia67dc7477a05a450bdcc3def1ebbacce2006da4d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-01-15 22:59:00 +01:00
Thiago Macieira
bd828bacb9 QResource: Add API to get the decompressed content
[ChangeLog][QtCore][QResource] Added uncompressedSize() and
uncompressedData(), which will perform any required decompression on the
data, prior to returning (unlike data() and size()).

Change-Id: Ief874765cd7b43798de3fffd15aa053bc505dcb1
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2020-01-15 12:36:59 -08:00