Commit Graph

896 Commits

Author SHA1 Message Date
Edward Welbourne
bb6a73260e Support digit-grouping correctly
Read three more values from CLDR and add a byte to the bit-fields at
the end of QLocaleData, indicating the three group sizes. This adds
three new parameters to various low-level formatting functions. At the
same time, rename ThousandsGroup to GroupDigits, more faithfully
expressing what this (internal) option means.

This replaces commit 27d1391280 with a
fuller implementation that handles digit-grouping in any of the ways
that CLDR supports. The formerly "Indian" formatting now also applies
to at least some locales for Bangladesh, Bhutan and Sri Lanka.

Fixed Costa Rica currency formatting test that wrongly put a separator
after the first digit; the locale (in common with several Spanish
locales) requires at least two digits before the first separator.

[ChangeLog][QtCore][Important Behavior Changes] Some locales require
more than one digit before the first grouping separator; others use
group sizes other than three. The latter was partially supported (only
for India) at 5.15 but is now systematically supported; the former is
now also supported.

Task-number: QTBUG-24301
Fixes: QTBUG-81050
Change-Id: I4ea4e331f3254d1f34801cddf51f3c65d3815573
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-07-14 14:52:08 +02:00
Joerg Bornemann
ac14858e85 configurejson2cmake: Use a context manager for file special handling
One can now write
    with special_cased_file("base/dir", "foo.txt") as fh:
        do_something(fh)

This makes the code of processJson a bit clearer, and it allows us to
easily add more files that support the special handling comments.

Change-Id: Ia25d0c0d48df1802c5e2123d05345a88b42a2981
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-13 10:51:43 +02:00
Joerg Bornemann
8a0676d5f9 configurejson2cmake: Generalize special case support
The SpecialCaseHandler supported only two file names: "CMakeLists.txt"
and "configure.cmake". Generalize the code to allow for arbitrary file
names. We will use this in a subsequent commit.

Change-Id: I0adada91409a11a369fd1cf2d6ab21cc8f28ba0f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-13 10:51:15 +02:00
Dimitrios Apostolou
1e546595e9 Remove unused imports
As found by LGTM.com.

Change-Id: I1704f10f9bab1b11ab22824aca0cfcdcb47fef2f
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-07-10 02:36:54 +02:00
Dimitrios Apostolou
3736ebf7c8 Remove duplicate dict entry
As found by LGTM.com.

Change-Id: I9d41fec8a9f80fe9cb1cae960418032f84646a99
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-10 02:36:40 +02:00
Dimitrios Apostolou
efdfdfa0fc Remove dead code
Found by LGTM.com.

Change-Id: I661e2287a6964b63d5b03c8913bc4b09f21ffdf1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-07-10 02:36:25 +02:00
Alexandru Croitor
b1f8ca8032 CMake: Fix various issues with the Android build
Certain resources and compiled jar files have to be copied into the
non-prefix build dir location. They were previously only installed,
which doesn't do anything in a non-prefix build.

Change pro2cmake to generate code that places the compiled java
jars into QT_BUILD_DIR, so that non-prefix builds work.

Place the module dependencies xml files into lib folder in non-prefix
builds.

Don't special case the output and install location of the Android QPA
plugin.

Task-number: QTBUG-85399
Change-Id: I4ac9d3929ea8ecc95ec99a77e621ad2121b68832
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-09 11:56:31 +02:00
Jarek Kobus
a7f9d5a7fa Use QList instead of QVector in util
Task-number: QTBUG-84469
Change-Id: I077fb5c32456d438a457c1f73852313ea2ea9ae5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2020-07-07 20:34:48 +02:00
Alexandru Croitor
7ad5c5346f CMake: pro2cmake: Remove dead code regarding resource retaining
qtdeclarative as of 41864db3b61d9e81a9fe4906918d2cd3d6d32a0c always
retains the resources, so there's no manual facility for retaining
left. Remove the code.

Change-Id: If79b66683897b5f430844e13c0230e41a2cf061d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-07 11:48:46 +02:00
Alexandru Croitor
19b04f6928 CMake: pro2cmake: Fix handling of QT_SKIP_QUICKCOMPILER
If a file was part of a resource that has a non-empty base directory,
the script generated set_source_files_properties calls to the file
path without including the base dir, which means the command did
nothing.

The script should set the QT_SKIP_QUICKCOMPILER on the full file path
if a base dir is present, similar to how the alias handled.

Refactor the alias property writing code to write all properties
into the command that uses the full correct path.

Change-Id: Ic75d51ecf60eef3ada9bd6ca26882de3447896e9
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-07-07 11:48:45 +02:00
Lars Knoll
a46caf087c Simplify Q_ARRAY_LITERAL
And clean up some unused pieces of code.

Change-Id: I285b6862dc67b7130af66d3e08f652b1a56b990e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-07-06 21:30:06 +02:00
Tor Arne Vestbø
8dd6957cd7 Make QtPlatformHeaders a private module
The APIs will be reintroduced as part of the new platform interface
API where appropriate.

Clients that still depend on the platform headers can include it
via QT += platformheaders-private.

Change-Id: Ifbd836d833d19f3cf48cd4f933d7fe754c06d2d9
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-07-06 11:52:14 +02:00
Joerg Bornemann
943340222e CMake: Generate qdevice.pri when cross-building
This adds the CMake equivalent to the classical -device-option key=value
configure argument:
-DQT_QMAKE_DEVICE_OPTIONS=key1=value1[;keyN=valueN]
The keys and values get dumped verbatim into qdevice.pri.

This patch also ports the machineTuple configure test. Its result is
written into qdevice.pri as value for the GCC_MACHINE_DUMP variable.

Change-Id: I29f2323fd87639fafaed99ec7446c7ee75504705
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-29 12:47:59 +02:00
Alexandru Croitor
7fcc9cf055 CMake: Create a Find module wrapper for OpenGL
Our .prl files embedded an absolute path to the OpenGL.tbd file. This
obviously breaks their usage when used on another machine when no SDK
exists.

To fix that we need to use a "-framework OpenGL" linker flag instead
of linking against the absolute path library.
To convince CMake to do that, we have to create a wrapping
OpenGL target which sets an appropriate INTERFACE_LINK_LIBRARIES
property.

So create a FindWrapOpenGL find module to do that on darwin platforms.
Adjust helper.py and our build system to use it.

This tangentially amends 38cd18384f
because it recreates the FindWrapOpenGL module, but for a different
purpose.

Task-number: QTBUG-85240
Task-number: QTBUG-84781
Change-Id: I3498c19157ae31db5099e6edfb9d71490187f1d3
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-29 12:22:49 +02:00
Joerg Bornemann
f6b7b64ed0 CMake: Adjust conversion scripts to iconv changes in qt5compat
Change-Id: I8e06a09768bd3554500d666273060d2e130965b8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-28 17:17:02 +02:00
Ulf Hermann
fd52a6fcb9 pro2cmake.py: Parse qmldir import statements with versions
You can write the following in a qmldir file these days:

import QtQuick auto
import QtQml 2.4

pro2cmake should understand and convert these to cmake.

Change-Id: Ica1728de0c8d7a0b2b5aa341d20e60b23dfa7fe1
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2020-06-24 15:49:35 +00:00
Karsten Heimrich
18ec53156e Move QTextCodec support out of QtCore
* Assume UTF-8 on all Unix like systems
* Export some functions to be able to compile QTextCodec once
  moved to Qt5Compat.

Task-number: QTBUG-75665
Change-Id: I52ec47a848bc0ba72e9c7689668b1bcc5d736c29
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-20 02:04:38 +02:00
Giuseppe D'Angelo
3e1d03b1ea Port Q_STATIC_ASSERT(_X) to static_assert
There is no reason for keep using our macro now that we have C++17.
The macro itself is left in for the moment being, as well as its
detection logic, because it's needed for C code (not everything
supports C11 yet).  A few more cleanups will arrive in the next few
patches.

Note that this is a mere search/replace; some places were using
double braces to work around the presence of commas in a macro, no
attempt has been done to fix those.

tst_qglobal had just some minor changes to keep testing the macro.

Change-Id: I1c1c397d9f3e63db3338842bf350c9069ea57639
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-06-19 19:38:23 +02:00
Alexandru Croitor
7e03bc39b8 CMake: Improve sanitizer detection
The change fixes the labels to show up correctly in the configure
summary.
It also allows enabling the sanitizer via the feature flags, e.g.
-DFEATURE_sanitize_address=ON.
Finally the qtbase sanitizer option is saved in QtBuildInternalsExtra
so that repos built after qtbase have the same sanitizer options
enabled.

Change-Id: Ic9d9e3ce3c7ebbc244ced2e6d163d1ac8ee06b12
Fixes: QTBUG-84721
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-06-15 18:41:35 +02:00
Alexandru Croitor
a08bf7f00a CMake: Fix usage of gc_binaries feature
The qt_internal_apply_gc_binaries function should apply both compile
and link flags, not just link flags.

The flags should be applied publically to all consumers of Bootstrap
regardless if the gc_binaries feature is enabled.

The flags should be applied publically to Core only in case if the
feature is enabled (aka for static builds only).

Change-Id: Id42af0d9b527004d74c04eff2c9e3c2be1e76aac
Fixes: QTBUG-84461
Task-number: QTBUG-83929
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-06-12 22:34:12 +02:00
Eirik Aavitsland
56f40cdca6 Remove the openglextensions module
[ChangeLog][General] The QtOpenglExtensions module has been
discontinued. It provided only convenience functionality for certain
direct OpenGL usage. With the new RHI graphics API abstraction, that
is no longer a primary use case. Applications that still need to
access that API have a number of alternative options, including
QOpenGLExtraFunctions.

Fixes: QTBUG-84085
Change-Id: I272af61c69ebcec207b576d67d08b59623d485ec
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-06-10 09:35:04 +02:00
Ulf Hermann
910804a420 pro2cmake: Parse "optional plugin" from qmldir files
Task-number: QTBUG-84639
Change-Id: Iedfa2e53c686a7c7c855efc7b9deee097a15f4b7
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-09 14:10:10 +02:00
Tor Arne Vestbø
93a04332eb Move QtAccessibilitySupport into QtGui
Task-number: QTBUG-83255
Change-Id: Ibc1b38e77c3c90030a832c41f4de65c6c38bc91d
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-06-02 23:32:36 +02:00
Jannis Voelker
33fc2ff663 Adds library mappings for the Qt OPC UA module in helper.py
Change-Id: I64bee2a7c149b8e4b14b71103ebc748c32993145
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-02 23:12:56 +02:00
Leander Beernaert
5a779a4ad3 CMake: Make it possible to build tools when cross-compiling
This patch allows tools to be built for the target platform when the
QT_BUILD_TOOLS_WHEN_CROSSCOMPILING parameter is set at configuration
time.

To avoid naming conflicts, the target tools are suffixed with "_native".
The qt_get_tool_target_name() function can be used to get the tool name
for both scenarios (cross and non-cross compilation).

Extend pro2cmake to refer to the right target name for tools.
The relevant write_XXX functions have a new target_ref parameter that
will be "${target_name}" for tools and literally the target name for
everything else.

Fixes: QTBUG-81901
Change-Id: If4efbc1fae07a4a3a044dd09c9c06be6d517825e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-06-02 22:42:15 +02:00
Laszlo Agocs
e3361c1614 CMake: Update src\gui\configure.json and the conversion script
The ANGLE removal's manual configure.cmake changes are now replaced
by updating the conversion script's special cases instead.

Change-Id: I06317fe0202b25bd9f9524da14e1bb0ccbb30cc1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-29 23:23:02 +02:00
Alexandru Croitor
c4e09cf267 CMake: pro2cmake: Check existence of QMLTYPES_INSTALL_DIR
When writing the qt6_qml_type_registration call, make sure to write
the set(QT_QML_MODULE_INSTALL_QMLTYPES TRUE) statement only if an
explicit path was provided via
QMLTYPES_INSTALL_DIR / QT_QML_MODULE_INSTALL_DIR.

This will remove the QT_QML_MODULE_INSTALL_QMLTYPES property from
many examples and tests in qtdeclarative, thus not installing the
.qmltypes file into the Qt prefix, thus polluting it.

Task-number: QTBUG-84403
Change-Id: I5c64d42915896d14f2591cbb64d73d912dbf7c7d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-29 17:17:18 +02:00
Volker Hilsheimer
37eb5d38aa Add SvgWidgets library
Change-Id: I243aa35a0628f80219b589a0ba943ec1a25bb972
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-29 16:58:43 +02:00
Tor Arne Vestbø
7172b5112e Move QtPlatformCompositorSupport into QtOpenGL
Task-number: QTBUG-83255
Change-Id: Id9ea654db8efb00b487d53aea03d7f23a7ab1a54
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-05-28 21:39:48 +02:00
Dimitrios Apostolou
52f218ee83 Change const arrays to constexpr
so that they can be used with Q_STATIC_ASSERT().
Also constify more another array.

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

Change-Id: I2bc9a78bcc2982845fce75a413e2048b0bfd12a0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2020-05-28 10:48:57 +02:00
Friedemann Kleint
9c31acbf47 Move windowsuiautomation API support into QtGui
Task-number: QTBUG-83255
Change-Id: Ibface71931b6384494842ba9744d76f738c5ca85
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-05-27 22:28:41 +02:00
Tor Arne Vestbø
7a1650e343 Move QtVulkanSupport into QtGui and QtOpenGL
Task-number: QTBUG-83255
Change-Id: Ib021cecebda89fa2ab9332752124a8cec0a51a10
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2020-05-22 15:38:28 +02:00
Tor Arne Vestbø
f76161d61f Move QRasterBackingStore to QtGui
Task-number: QTBUG-83255
Change-Id: I339173de6e109c5a9b9572972ba894c15053c034
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-05-21 20:28:37 +02:00
Tor Arne Vestbø
42024666a3 Move QMacInternalPasteboardMime to QtGui
Task-number: QTBUG-83255
Change-Id: I00fda24479ad2c04781c5fefaa15fac1118033a8
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2020-05-21 13:21:53 +02:00
Joerg Bornemann
759da6742a CMake: Generate information about 3rdparty libs in module .pri files
For modules that are not yet ported to CMake and that use
   QMAKE_USE += libfoo
we need to provide the information about libfoo in the qt_lib_XXX.pri
files.

Also, we now generate qt_ext_XXX.pri files for bundled 3rdparty libs.

Task-number: QTBUG-75666
Change-Id: I9e4b057a197554ecb37c294c0bf09e2a2b3aa053
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-19 13:26:53 +02:00
Joerg Bornemann
d5cb44cd3a pro2cmake: Fix Scope.get_string for list values
QMake variables are always string lists, but some variables are used to
represent single string values. People tend to fill those variables with
multiple values and expect them to be joined by spaces.

Exhibit A: qtdeclarative/tools/qml/qml.pro
    QMAKE_TARGET_DESCRIPTION = QML Runtime

QMake supports this for many values. Do the same for Scope.get_string().

Change-Id: I6af22bc1bfed07a4d8eac94d7315051a5bcb7a4d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-15 08:54:21 +02:00
Joerg Bornemann
286d79d2ed pro2cmake: Handle QMAKE_TARGET_XXX variables
Change-Id: I62151e04d21c20d8c8ad5825464f26074c8abc3d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-12 14:31:12 +02:00
Alexandru Croitor
64f62105ce CMake: pro2cmake: Fix cmake api detection for plugins
We should search for the values of function names rather than
the mapping key.

Change-Id: Iedef7fcf4d716ff7f6d277d9626d9dc2dd781401
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2020-05-12 13:03:11 +02:00
Friedemann Kleint
d2ae13b75b cmake: Add MinGW platform check
Task-number: QTBUG-78167
Change-Id: Id203925d69c5b4d7e0841c0dbdd298269a13f06a
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-12 08:57:04 +02:00
Marc Mutz
19e7c0d2b5 QChar/QString: centralize case folding in qchar.cpp
There are (at least) two implementations of the low-level case-folding
algorithm, one of which (for QChar::toLower()) seems to be wrong (it
doesn't deal with special cases which expand to more than one code
point).

The algoithm hidden in QString and entangled with the QString
detaching code makes reusing the code much harder.

At the same time, the dependency of the algorithm on the unicode
tables makes exposing a non-allocating result type in the public API
hard. std::u16string would be an alternative if we can assure that all
implementations use SSO with at least four characters.

So, for the time being, leave this as internal API for use in an
upcoming QStringView::toLower() as well as case-insensitive hashing.

Change-Id: Iabb2611846f6176776aa20e634f44d8464f3305c
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2020-05-09 06:25:05 +00:00
Joerg Bornemann
95b441d097 pro2cmake: Add library mappings for the restructured ActiveQt module
Change-Id: I643cb2afc0e4b74abcbd67bb9002ab334337be37
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-07 16:23:15 +02:00
Christophe Giboudeaux
5dcaa11cc2 pro2cmake: Honor INSTALL_EXAMPLESDIR if defined
When building examples standalone, 'INSTALL_EXAMPLESDIR' may be
undefined.

The converted .pro files now check whether the variable is
set to prevent installation into unexpected locations.

Fixes: QTBUG-81797
Change-Id: I9f97568923c8103011a41d9af7cfe02dd1e40b56
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-07 15:41:26 +02:00
Mårten Nordheim
9c85078dc2 Support special casing in configure.cmake
Change-Id: Ib899a5446a81e2604ba3642b9ad37aedc18ca650
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-05-05 15:34:15 +02:00
Mårten Nordheim
6ffe9b1c42 pro2cmake.py: Generate .cmake.conf files for versioning
And create one for QtBase at the same time.

Fixes: QTBUG-83835
Change-Id: Icc6b022165a57bd4e22c23bdb0016522b99a5b80
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-30 17:44:03 +00:00
Tor Arne Vestbø
ebc3350be7 pro2cmake: Translate (QT|QMAKE_USE)_FOR_PRIVATE into PRIVATE_MODULE_INTERFACE
Fixes: QTBUG-83063
Change-Id: I5b02cd236ef0fd3a9ed389294c05f8e3024463cd
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-30 14:20:26 +02:00
Tor Arne Vestbø
4618fa6f8d Fix pro2cmake help text
Change-Id: I84980dda981c50da159e4bb81b08190b882d6978
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-30 14:20:26 +02:00
Fabian Kosmale
14c713e759 pro2cmake: convert QMLTYPES_FILENAME to QT_QMLTYPES_FILENAME
Change-Id: I9afc6d4c0c9b3fd87ef28f15da0a984d778b83ac
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-30 10:13:56 +02:00
Joerg Bornemann
062b50abff CMake: Namespace all our IMPORTED targets
CMake IMPORTED targets should be namespaced so that CMake knows that
the name refers to a target and not a file.

Use the existing WrapXXX naming scheme where applicable.

Fixes: QTBUG-83773
Change-Id: I5b0b722c811200c56c260c69e76940a625228769
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-04-29 23:08:32 +02:00