Commit Graph

2138 Commits

Author SHA1 Message Date
Alexandru Croitor
3eaf6a4cad CMake: Remove Gui dependency of androidtestrunner
It doesn't use any Gui classes and thus shouldn't depend on Gui.
Also change PUBLIC_LIBRARIES to LIBRARIES, executables don't need to
propagate library dependencies.

Pick-to: 6.2 6.3 6.4
Change-Id: I9edae7e555e1d74d63b00afbf9e3931963b502c2
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-06-28 00:52:38 +02:00
Andrei Golubev
e1abacfdf7 moc: Cleanup handling of default arguments in functions
Change-Id: I0a381525b92ce5f0b51296a02d9ab98c7a204efc
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-06-27 11:05:23 +00:00
Ulf Hermann
7415e53a8b moc: Strip parentheses from RESET methods in JSON output
READ, WRITE, NOTIFY etc all come without parentheses. What we actually
want to check in the generator is whether the reset method is empty.

Task-number: QTBUG-104508
Change-Id: If8c70c7491b25e3c4d9a39dc2c0add0212e64dea
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2022-06-27 13:05:23 +02:00
Bartlomiej Moskal
9efaf8bae9 Android: Do not set release flag for signed package
Before this change, signing package by androiddeployqt automatically
implied the --release option.
It is possible to create both debug and release packages when signing on
Android, so we shouldn't be enforcing this restriction on Qt app builds.

Commit removes setting releasePackage option, when processing the --sign
argument in androiddeployqt.

Task-number: QTBUG-103281
Change-Id: Id40a41255e51d6820b44f078667dc8318a90bbc5
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
2022-06-27 07:48:35 +02:00
Thiago Macieira
8726647df4 moc: put the qt_meta_stringdata_XXXX_t type in an unnamed namespace
Not all user code is compiled with hidden visibility, so make sure one
of the types in the template parameters (the one that is supposed to be
unique anyway) is local and therefore causes the full symbol for the
inline variable not to be exported outside of the translation unit.

Pick-to: 6.4
Change-Id: I6d3880c7d99d4fc494c8fffd16fb262a59b81283
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-24 19:05:58 -07:00
Thiago Macieira
0978646a65 moc: remove the attempt to create one large string literal
Commit dda9c9e2bc fixed some outstanding
issues with moc's calculation of the maximum string length, but it
missed one. This commit instead opts to remove the calculation entirely
and instead have multiple char array members in the qt_meta_stringdata.
We needed a single string back in Qt 4.0 when the stringdata *was* a
single char array.

Since 5.0, we've used a structure with multiple members and pointer
arithmetic going past the end of the arrays, from the top of the object.
That's UB, but since it's always been UB and can't be fixed until Qt 7
anyway, let's go full monty on it and have one char array per meta
object string.

The struct qt_meta_stringdata_Qt_t for namespace Qt now has 1217
stringdataXXX members.

Pick-to: 6.2 6.3 6.4
Change-Id: I6d3880c7d99d4fc494c8fffd16fb0d1573e387dc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-24 19:05:57 -07:00
Thiago Macieira
3816b14ee8 moc: properly indent the output for the metatype array
Commit 7ff7d73f6a added the indentation,
but there were a few mistakes and it was off by 4 spaces anyway. So re-do
it and take the opportunity to add some comments to explain what we're
seeing.

Before:
qt_incomplete_metaTypeArray<qt_meta_stringdata_QTimer_t,
    QtPrivate::TypeAndForceComplete<bool, std::true_type>,
    QtPrivate::TypeAndForceComplete<int, std::true_type>,
    QtPrivate::TypeAndForceComplete<int, std::true_type>,
    QtPrivate::TypeAndForceComplete<Qt::TimerType, std::true_type>,
    QtPrivate::TypeAndForceComplete<bool, std::true_type>,
    QtPrivate::TypeAndForceComplete<QTimer, std::true_type>,
    QtPrivate::TypeAndForceComplete<void, std::false_type>
,
    QtPrivate::TypeAndForceComplete<void, std::false_type>,
    QtPrivate::TypeAndForceComplete<int, std::false_type>,
    QtPrivate::TypeAndForceComplete<void, std::false_type>,
    QtPrivate::TypeAndForceComplete<void, std::false_type>

>,

After:
    qt_incomplete_metaTypeArray<qt_meta_stringdata_QTimer_t,
        // property 'singleShot'
        QtPrivate::TypeAndForceComplete<bool, std::true_type>,
        // property 'interval'
        QtPrivate::TypeAndForceComplete<int, std::true_type>,
        // property 'remainingTime'
        QtPrivate::TypeAndForceComplete<int, std::true_type>,
        // property 'timerType'
        QtPrivate::TypeAndForceComplete<Qt::TimerType, std::true_type>,
        // property 'active'
        QtPrivate::TypeAndForceComplete<bool, std::true_type>,
        // Q_OBJECT / Q_GADGET
        QtPrivate::TypeAndForceComplete<QTimer, std::true_type>,
        // method 'timeout'
        QtPrivate::TypeAndForceComplete<void, std::false_type>,
        // method 'start'
        QtPrivate::TypeAndForceComplete<void, std::false_type>,
        QtPrivate::TypeAndForceComplete<int, std::false_type>,
        // method 'start'
        QtPrivate::TypeAndForceComplete<void, std::false_type>,
        // method 'stop'
        QtPrivate::TypeAndForceComplete<void, std::false_type>
    >,

Pick-to: 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16fa152d040ef922
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-06-24 19:05:57 -07:00
Thiago Macieira
116d8f987b moc: add Q_CONSTINIT to the static const variables we emit
The macro was added to Qt 6.4, so we define it in each moc output to
empty if it wasn't previously defined. Thus, moc retains compatibility
with older Qt versions.

Pick-to: 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16f9c1539fa0368f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
2022-06-22 13:03:17 -07:00
Thiago Macieira
9959cf60d3 moc: replace offsetof with sizeof
It's the same thing since we have exactly one field in this structure
before stringdata0. But there's a far smaller chance of producing a
warning in user code.

Pick-to: 6.2 6.3 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16f9cdceec33017d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-22 13:03:17 -07:00
Thiago Macieira
dda9c9e2bc moc: fix use of escape sequence of more than one character
We had the code to calculate the length, but were improperly using it
only for the offset, not the length of the string or its containing
array. That resulted in the generated moc output containing:

 QT_MOC_LITERAL(111, 5), // "\xffz"
 QT_MOC_LITERAL(114, 5), // "\0012"
 QT_MOC_LITERAL(117, 23), // "slotWithAReallyLongName"

The two strings are described as occupying 5 bytes (length 4 + null
terminator), which is incorrect. The offset was correct: 114 - 111 = 3
and 117 - 114 = 3. The new output is:

        QT_MOC_LITERAL(111, 2),  // "\xffz"
        QT_MOC_LITERAL(114, 2),  // "\0012"
        QT_MOC_LITERAL(117, 23),  // "slotWithAReallyLongName"

The effect of the array size calculation would only be felt if moc
decided it needed a second string array (for strings over 65535 bytes),
which would cause the offsets in the second array to be all wrong. There
was no such test until now.

Drive-by fixing of the newline, indentation, and the stale comment
referring to QByteArrayData (Qt 5).

Pick-to: 6.2 6.3 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16f9cd01b3e0709a
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-22 13:03:17 -07:00
Ulf Hermann
2c0518eb62 moc: Allow reading property values through bindables
The behavior is similar to MEMBER: If the READ accessor is "default",
synthesize it using the bindable.

[ChangeLog][QtCore] You can now specify "READ default" in a Q_PROPERTY
if you also specify a BINDABLE. moc will synthesize a READ accessor in
that case.

Task-number: QTBUG-97249
Change-Id: I4a275adabaed12df95dac505095f847c4be65dfe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-22 16:05:07 +02:00
Thiago Macieira
cb0b1ee441 moc: remove unnecessary emission of "#include <qbytearray.h>"
We don't need QByteArrayData any more (since 6.0).

[ChangeLog][Potentially Source-Incompatible Changes] moc no longer emits
an #include for QByteArray in the output file. None of the content that
moc generates needed that header, so this should not cause changes for
most people. However, codebases that #include'd the moc output
(something that is recommended) could be depending on this indirect
include.

Pick-to: 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16f9cf13dc8d61b5
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-21 21:52:57 -07:00
Thiago Macieira
3cf38290d9 moc: rename the "offsetsAndSize" member to "offsetsAndSizes"
It contains more than one size.

Drive-by drop the const from the structure, so it becomes properly
trivial (though there's disagreement, see[1]).

[1] https://conformance.godbolt.org/z/rK1xW669K

Pick-to: 6.2 6.3 6.4
Change-Id: Id0fb9ab0089845ee8843fffd16f9cc69ffd90aa4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-06-22 04:52:57 +00:00
Mate Barany
b9b5734559 Disable useless-cast warning for moc generated code
The useless-cast gcc warning is disabled in the files generated by
the moc. A typical warning is like

using_t = void(Counter::*)(int );
if (*reinterpret_cast<_t*>(_a[1]) ==
    static_cast<_t>(&Counter::valueChanged)) {
        *result = 0;
         return;
    }

Removing the static cast results in a compilation error
"address of overloaded function with no contextual type-of
information" in moc_myobject.cpp files.

Checking whether we have an overload set or a single function
might be too much effort for too little benefit and may not worth
it.

Fixes: QTBUG-71938
Change-Id: I6f67e163a3493b51fb95f54218ce6bf9a302f824
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-22 00:08:34 +02:00
Kai Köhne
9d2cc4dd76 Fix typos in docs and comments
Found by codespell

Pick-to: 6.4
Change-Id: Ie3e301a23830c773a2e9aff487c702a223d246eb
Reviewed-by: Nicholas Bennett <nicholas.bennett@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-06-15 21:31:02 +02:00
Guineng Ni
6dbe45c96a macdeployqt: macdeployqt process some libraries(e.g. ffmpeg) incorrect
ffmpeg and nettle are different from other libraries, they use symbol
link as their inner module dependencies. Calling one more
install_name_tool can handle this case.

Fixes: QTBUG-100093
Pick-to: 6.2 6.3 6.4
Change-Id: I12cdd53bd5aa3120910070ba283178686deb3eb0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-06-15 07:11:10 +00:00
Alexandru Croitor
e2f14e5be7 androiddeployqt: use QFile::exists instead of QDir().exists
Internally QDir().exists calls QFile::exists(filePath(name))

Pick-to: 6.2 6.3 6.4
Change-Id: I2993d924268b10135bd9df4e9f8165b869946efc
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-06-10 21:10:34 +02:00
Alexandru Croitor
0c82f98ec5 androiddeployqt: Only pass qt_install_dir/qml directory if it exists
In Conan's case, the qtbase installed package directory lacks a qml
directory. We pass that as a valid qml import path via CMake ->
deployment json file -> androiddeployqt -> qmlimportscanner
which causes the qmlimportscanner to fail with

 qmlimportscanner: No such file or directory:
 "~/package/some_sha_1/qml"
 Invalid json output from qmlimportscanner.

which in turn fails the androiddeploqt build step.

Make sure to only pass qtbase_install_dir/qml if it actually exists.

Amends 4ef3da04c3
Amends c08b9a49ba

Pick-to: 6.2 6.3 6.4
Fixes: QTBUG-104056
Task-number: QTBUG-88519
Task-number: QTBUG-89588
Change-Id: I4310eb4e265ae8d3e3f09e1e1dbed79210e23de6
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-06-10 21:10:34 +02:00
Ulf Hermann
47c545d983 moc: Improve formatting of output
If we are going to append an else clause, keep it on the same line as
the closing brace.

Change-Id: Idfa0eec49240086dc24268aebbf610d64a2f53d0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-06-10 14:41:14 +02:00
Friedemann Kleint
613b52bfee uic: Fix string list properties for Python
Use the opportunity to modernize the code to use an
initializer list instead of stream operators.
This then makes it easier to generate a comma-delimited
list that works for Python as well.

Fixes: PYSIDE-1942
Change-Id: I5291b55bd0685e06ad62e52c7ebccffce98e9c23
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-05-26 00:11:40 +02:00
Edward Welbourne
6d97cf0e57 Split qtLocalTime out into a new QLocalTime namespace
... in new qlocaltime* files, now that it's decoupled enough from the
internals of QDateTime for this to be possible. Part of the
consolidation of time_t code in one place.

Move assorted constants from qdatetime.cpp to a private namespace in
qdatetimeprivate_p.h to be shared between q*time.cpp hereafter (fixing
an out of date comment in the process - julianDayFromDate() is long
gone).

Task-number: QTBUG-95993
Change-Id: I03d97e959118041f9d86b8bb2e738599bc0b17e1
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-05-20 13:09:23 +02:00
Tinja Paavoseppä
9af1f3557a Add option to not include native libraries in APK
Sometimes it is not desirable to include the libraries in the APK,
e.g. system and vendor apps could prefer having one set of libraries
installed on the device. If unbundled deployment is specified,
native libraries will not be included in the APK.

With unbundled deployment, optional arguments can be passed to
set the path to load the libraries on the device.

[ChangeLog][Android][Deployment Changes] Adds option for Unbundled
deployment, where native libraries are not packaged in the APK.

Task-number: QAA-771
Change-Id: Ica51ef83a24dad58c7586bf610a58abe21fc1100
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-05-20 08:08:02 +03:00
Volker Hilsheimer
76e441c9ee Make uic generate correct C++ comments
Revert the change to uic of 05fc3aef53.

Task-number: QTBUG-67283
Change-Id: Icfd83bb6d80b91d4e58f1be460f6772ba49a6921
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-05-18 11:53:26 +02:00
Friedemann Kleint
cf3843a268 moc: Add line breaks to the qt_incomplete_metaTypeArray<>
The code is hard to read due to the long line generated.

Task-number: QTBUG-100145
Change-Id: I1d1a7a547db71cca1e710d39df809f079fc2dafe
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-05-18 00:07:34 +02:00
Lucie Gérard
05fc3aef53 Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Task-number: QTBUG-67283
Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-05-16 16:37:38 +02:00
Joerg Bornemann
fbdd076ae9 Revert introduction of QT_USE_BOOTSTRAP_SOURCE_COPY
This removes the hack that creates a copy of bootstraplib sources to
avoid rebuilding the world if a bootstraplib source file changed.

Said hack led to confusing behavior:
- when accidentally editing bootstraplib copies instead of the real
  sources
- when header files were changed in a way that were incompatible to the
  bootstraplib source copy

This reverts commit 80a8ead08d.
This reverts commit 743bb66744.

The official way to avoid the QTBUG-92269 problem is now to set
QT_HOST_PATH=<host-Qt-installation> and QT_FORCE_FIND_TOOLS=ON.

If you want to build the tools as well, set QT_FORCE_BUILD_TOOLS=ON.

Fixes: QTBUG-92269
Change-Id: I226bf5792f9ca8e7e207dc53e01c2903018d82d3
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-05-09 08:32:10 +02:00
Alexey Edelev
f087e63bf5 CMake: Make possible building Qt tools without the use of core library
Replace BOOTSTRAP option with the single value CORE_LIBRARY argument
in qt_internal_add_tool and qt_internal_add_executable functions.
The introduced argument now may accept 'Bootstap' and 'None' values.
Use 'Bootstap' to link Qt::Boostrap library instead Qt::Core or 'None'
to avoid any core library linking. This is useful for tools that need
to use the CMake deployment routines, but not require the Qt::Core
functionality.

Task-number: QTBUG-87480
Change-Id: I64a8b17f16ac5fe43c6b385252dc21def0c88d2c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-05-06 22:06:22 +02:00
Sona Kurazyan
e65e3f3021 Tools: replace remaining uses of QLatin1String with QLatin1StringView
Task-number: QTBUG-98434
Change-Id: Ie136f600f823019c29461561d4e30be66a66e87b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-05-03 01:38:46 +02:00
Sona Kurazyan
39a6307178 Tools: use _L1 for for creating Latin-1 string literals
As a drive-by, fix qsizetype -> int narrowing conversion warnings for
the touched lines.

Task-number: QTBUG-98434
Change-Id: I6d4712a71b5ebf3f379f1f98ea476557bce963ef
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-05-03 01:38:46 +02:00
Sona Kurazyan
a0539ed53f Tools: stop using QLatin1Char constructor for creating char literals
Required for porting away from QLatin1Char/QLatin1String in scope of
QTBUG-98434.

As a drive-by, fix qsizetype -> int narrowing conversion warnings for
the touched lines.

Change-Id: Ib9e01ede4e0d7869fc95414d36f37df4a30b16b4
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-05-02 23:38:45 +00:00
Sona Kurazyan
c5e36ca85a uic: replace remaining uses of QLatin1String with QLatin1StringView
Task-number: QTBUG-98434
Change-Id: Ied042c0a61e48844694f6a94f0423735e92fb6d3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-04-26 21:59:07 +02:00
Sona Kurazyan
cd9cbc34db uic: replace QLatin1String uses with _L1 or _s
Task-number: QTBUG-98434
Change-Id: I5a9b01d1dd2a2a727cfb71e829dbf631bf25e2db
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-04-26 21:59:07 +02:00
Tor Arne Vestbø
12fb2cfa11 macdeployqt: Ignore repeated references to binary when parsing otool -L
macdeployqt doesn't know or care about universal build (yet), and
will just scan all the lines produced by otool -L as if they were for
a single architecture, ignoring any lines it doesn't recognize.

This fails when the second arch starts off with a reference to the
binary we're processing, which then gets interpreted as a dependency
of itself. If that binary doesn't have a path, we end up looking for
a match in /usr/lib, which we can't find in the best case, or actually
end up deploying from an incompatible Qt version in the worst case.

Ideally we'd teach macdeployqt about the multiple slices, bur for now
we work around it by skipping any references to dependent libraries
that match the binary itself.

Fixes: QTBUG-102607
Pick-to: 6.2 6.3 5.15
Change-Id: Ia039fafdce90896e61aab90b9c8ac52543cc2c8c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2022-04-26 15:10:16 +02:00
Sona Kurazyan
fedba8eaab uic: stop using QLatin1Char constructor for creating char literals
Required for porting away from QLatin1Char/QLatin1String in scope of
QTBUG-98434.

As a drive-by, fix qsizetype -> int narrowing conversion warnings for
the touched lines.

Change-Id: I0d3c232a9fa95aea854445922f100b89c6d6f5a1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2022-04-23 09:47:03 +02:00
Sona Kurazyan
77b9ddfb53 Android: use Qt major version for detecting OpenGL and QtQuick libraries
Change-Id: Ia7651ad09d7aab70cf32fcd56f9fb75202ace768
Pick-to: 6.3 6.2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-22 20:43:50 +02:00
Friedemann Kleint
6eb9439809 Adapt generated sources of uic to latest string changes
Use _s literals everywhere, removing all codepaths generating
QLatin1Strings for comparisons and other optimizations.
This is now possible since string literals are now longer duplicated.

Task-number: QTBUG-98434
Change-Id: Ie35199593dc13a36afd92e3a0dd8d58ec492e4b7
Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
2022-04-22 08:09:24 +02:00
Joerg Bornemann
80a8ead08d Fix unresolved include in bootstraplib when using source copies
When QT_USE_BOOTSTRAP_SOURCE_COPY is ON, there are situations where
includes like
    "../../3rdparty/sha1/sha1.cpp"
in qcryptographichash.cpp cannot be resolved.  For example,
out-of-source MSVC builds are affected.

In-source builds are working by accident, because we're adding the
include path "<qtbase-build-dir>/src/corelib/global", and
<qtbase-build-dir> is <qtbase-source-dir>.

Linux/macOS builds are working by accident, because we're adding the
include path "<qtbase-source-dir>/src/3rdparty/forkfd".

Fix this by explicitly adding the directory where qcryptographichash.cpp
resides to INCLUDE_DIRECTORIES.

This amends commit 743bb66744.

Fixes: QTBUG-102720
Change-Id: I55fcc186ea4c81134c39023ced3f04458230109b
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-04-21 20:35:24 +02:00
Assam Boudjelthia
a9f18a6ec0 Android: de-duplicate shellquote helpers code in deploy and test tools
Move shellquote helper functions into a common place instead of having a
copy in each tool's code.

Change-Id: I9723c11f894a211864788a7635773610c0fde739
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-04-21 11:52:52 +03:00
Assam Boudjelthia
905bfb8503 Android: remove what appears to be non-necessary debug print leftovers
Change-Id: Ib87c6ada78180dcc686d24a048dbcfa159cac974
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-04-21 11:52:47 +03:00
Assam Boudjelthia
a91cc01011 Android: add helper functions to append .exe/.bat suffix when needed
Instead of having to do that each time for multiple paths, a common
helper function is better.

Change-Id: Ice2499f390a5790c5768eca037d186ad2e656ec7
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-04-21 11:52:43 +03:00
Assam Boudjelthia
63d630bcbb Android: remove unused function in androiddeployqt
The "android" tool is deprecated and never used now, and this function
is not called by anything either.

Change-Id: I6fdb09934c93f5bc03610bcc4fd677f8bb2d4189
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-04-21 11:52:39 +03:00
Assam Boudjelthia
7fbf01bf07 Android: remove the old copy of gradle.properties after reading it
The file is going to be remove anyways in the next build, so just delete
it once we're done with it, this also makes the build folder doesn't
have files that are not needed.

Pick-to: 6.2 6.3 5.15
Change-Id: I948f028e9151b38a3ccc1ec628239ac91397e0d0
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-04-21 11:52:35 +03:00
Sona Kurazyan
908e85cc85 Replace uses of _qs with _s in sources and examples
Task-number: QTBUG-101408
Change-Id: I48360ba3b23965cd3d90ac243c100a0656a4cde8
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-04-19 19:12:20 +02:00
Assam Boudjelthia
e629efc82c Android: use libexec path for qmlimportscanner
This should've been done already for Qt 6.2.

Pick-to: 6.2 6.3
Change-Id: I2f943254698a4f0f2742619fd7fcab9ac3a5014a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-04-19 12:16:43 +00:00
Sona Kurazyan
adad2a468d Android: replace remaining uses of QLatin1String with QLatin1StringView
Task-number: QTBUG-98434
Change-Id: I35a97eef61746039738b4a5f2271c3bffd5711b4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-04-14 15:29:06 +02:00
Sona Kurazyan
b28ed7fdc2 Android: use _L1 for for creating Latin-1 string literals
Task-number: QTBUG-98434
Change-Id: I5ee5fe079c9a4530f636e59f6171abfa523591f4
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-04-14 15:29:06 +02:00
Sona Kurazyan
d0a08d1f11 Android: stop using QLatin1Char constructor for creating char literals
Required for porting away from QLatin1Char/QLatin1String in scope of
QTBUG-98434.

As a drive-by, fix qsizetype -> int narrowing conversion warnings for
the touched lines.

Change-Id: Iebcbdbd7cecac09d0a7039e3ef6a4509d33039ba
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-04-14 15:29:06 +02:00
Joerg Bornemann
743bb66744 Avoid rebuilds when changing sources belonging to bootstraplib
Whenever a source file is touched that belongs to the bootstrap library,
all bootstrap tools are rebuilt.  This includes moc.  The moc binary
however, is a dependency whose invalidation results in a rebuilt of
quite some parts of Qt.

There's no easy way to turn off this dependency.  To mitigate the
rebuilds, the bootstrap lib now can use a copy of the corelib sources.
That means the bootstrap lib is not rebuilt if its sources are changed.
This is basically the situation we had in Qt5.

The sources are not updated on reconfiguration.  There's a new target
'update_bootstrap_sources' that can be built to update the copied source
tree of the bootstrap lib.

This new behavior can be controlled with the variable
QT_USE_BOOTSTRAP_SOURCE_COPY.  It's on by default for developer builds.

Fixes: QTBUG-92269
Change-Id: I50234df66590c39594d208424394c7a600dc5606
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2022-04-13 12:41:14 +02:00
Assam Boudjelthia
bc71496a34 Android: fix androidtestrunner failure parsing
Make sure androidtestrunner reports the following cases as failures:
* XPASS test case
* The test output doesn't have closing block.
* The test result read from output.txt is empty

Pick-to: 6.2 6.3
Fixes: QTBUG-100312
Task-number: QTBUG-100470
Change-Id: Ifbb3c31fa22159df0c39b264e95e2f1ccd16e5ff
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
2022-04-06 14:50:17 +03:00
Alexandru Croitor
da97bc5f53 moc: Add --debug-includes option to moc
Because moc silently ignores missing headers, or sometimes includes
the wrong header, it is useful to have a facility to print which
header paths were considered and found.

Add a new --debug-includes option that does that.

Task-number: QTBUG-101775
Change-Id: I72b294ae53d6e47252c7d8afe0f2245da78bfadb
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-04-05 19:40:17 +02:00
Andreas Buhr
edf9b23145 Extend androidtestrunner default timeout to 8 minutes
qmake had a feature to set androidtestrunner's timeout. This
feature is not yet ported to CMake. So with CMake, we always
have androidtestrunner's default timeout. Which was
five minutes. We have several tests which take just shy of five
minutes and are thus flaky.
This patch extends the timeout to eight minutes. This should be
a temporary workaround until the timeout feature is implemented
in CMake.

Task-number: QTBUG-101596
Pick-to: 6.2 6.3
Change-Id: Ia67ed6ab40a40f1b82861bd15bd04528ee9334ee
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-04-05 19:40:17 +02:00
Alexey Edelev
2eb7a92aa3 Android: Throw an error if project uses versioned shared library
Android internally cannot handle versioned shared libraries.
There is no explicit rule for that, but indirect signs point to this.
This adds an explicit error to androiddeployqt to give the clear
understanding of the error nature to user. Error is also thrown if
versioned library was used when linking Qt libraries.

E.g. when linking Qt with liba.so it might be symlink to liba.so.1.0
This means that liba.so.1.0 Qt will require liba.so.1.0 at runtime.
But since Android doesn't handle versioned shared libraries,
liba.so.1.0 will never be packaged correctly. Most build systems
support generating of versionless shared libraries, and this should
be used when building 3rdparty libraries for Android.

Task-number: QTBUG-101346
Change-Id: Ic49d1a0d7d3a4c5c0dc308a570e98e8a0a223053
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-30 22:55:59 +02:00
Aleix Pol
3ec95f943a qdbusxml2cpp: Improve error message
Instead of saying:
You should add <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="<type>"/> to the XML description
It now says
You should add <annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="<type>"/> to the XML description for 'Bind'

So you get an idea of which type it's asking to annotate.

Change-Id: Ia0842d3b54681825201813fe0875014cd35d8192
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: David Faure <david.faure@kdab.com>
2022-03-24 05:24:13 +01:00
Fabian Kosmale
a9cef86b8f Remove qipaddress from boostrap lib
Change-Id: I31a883404f34d0933fe8b316d05b0f28103e48ae
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-23 08:17:44 +01:00
Fabian Kosmale
c25a5b4e1f Remove QTemporary(file|dir) from boostrap lib
Change-Id: I851f0fd8150592784a7b38d3d30d69d8346de112
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-23 08:16:49 +01:00
Fabian Kosmale
aa29de37a7 Remove QUrl* from boostrap lib
Change-Id: I669ad12588adfd6fb409525616e145120e5a7c76
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-23 03:13:02 +01:00
Marc Mutz
9985cc330a uic: use C string literals for setObjectName()
Because setObjectName() now takes a QAnyStringView, passing C string
literals is much more efficient than using QString::fromUtf8().

This patch only deals with setObjectName() as a known property,
probably from a name attribute. If the objectName property is set by a
<property> element (or so I assume), we still emit a
QString::fromUtf8(). Detecting objectName there would be too much
magic.

Besides, I haven't been able to find why sometimes there's a second
setObjectName call right after the first, when in the XML it seems all
kosher (name attribute and objectName <property> agreeing on the
content).

Change-Id: Icf07bad841ac735a9c744bbd955428ba15758089
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2022-03-18 18:35:03 +01:00
Fabian Kosmale
468e9c13a9 Misc: Do not depend on transitive includes
As a drive-by, remove superfluous includes from qnetworkmanagerservice.h
and obey the coding conventions for includes in a few more places.

Change-Id: I65b68c0cef7598d06a125e97637040392d4be9ff
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-17 17:14:37 +01:00
Fabian Kosmale
caed0c3ac3 Gui: Do not depend on transitive includes
Change-Id: I27321235d9c8428de0cff1e22a618299b9e5a97f
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-17 17:14:37 +01:00
Fabian Kosmale
ffa5820fa3 Core: Do not depend on transitive includes
Change-Id: I2c71188a4d27692a2d6ef1aa447b329627214b17
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-03-17 17:14:36 +01:00
Joerg Bornemann
7d00e72677 cmake_automoc_parser: Fix issue found by CodeChecker
Fix exp63-cpp by assigning fresh values to mocEntries and mocIncludes to
get them out of the moved-from state.

Change-Id: I9ad36c0ebd922bc6a0c9e61c15be02cb987c1edb
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-03-15 12:45:46 +01:00
Sona Kurazyan
6585963583 Deprecate {QString, QByteArray}::count()
And remove their uses.

[ChangeLog][QtCore][Deprecation Notice] Deprecated QString::count()
and QByteArray::count() that take no parameters, to avoid confusion
with the algorithm overloads of the same name. They can be replaced
by size() or length() methods.

Change-Id: I6541e3235ab58cf750d89568d66d3b1d9bbd4a04
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-03-12 01:05:45 +01:00
Kai Köhne
dfe6601974 Bootstrap: Make compiler warnings fatal
Prevent compiler warnings from creeping into the bootstrap library.

Pick-to: 6.3
Change-Id: I8054416564c91fee256cad616911dd4ad231d0df
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-03-02 11:03:44 +01:00
Alexandru Croitor
34a4fe0166 CMake: Rename FindZSTD to FindWrapZSTD
And the target ZSTD::ZSTD to WrapZSTD::WrapZSTD.
This should allow building Qt with the
-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON set.

Pick-to: 6.2 6.3
Fixes: QTBUG-100537
Change-Id: I748601e4ad6f518323bf1034d6fc1de582c815e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-02-28 23:08:20 +01:00
Fabian Kosmale
8079361852 typeNameForCast: use add_pointer instead of string manipulation
Relying on string manipulation leads to -Wredundant-parens warnings in
the best case, and to non-compiling code (when using typedefs) in the
worst case.
We can avoid both issues by simply generating code that uses
add_pointer, which takes care of reference types (even typedef'd ones),
and creates no warnings about parens (as we don't write any anymore).

Fixes: QTBUG-100915
Pick-to: 6.3 6.2
Change-Id: Ic5b1cbfda20d920d11f51beeb62e9479261d5f00
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2022-02-18 13:44:41 +01:00
Marc Mutz
f310f426d0 qvkgen: optimize generated string tables
Use qOffsetStringArray instead of array-of-const-char* to hold
strings. Saves 174 relocations, as well as over 4KiB in combined TEXT
and DATA size on optimized Linux GCC 11.2 C++20 AMD64 builds.

Pick-to: 6.3
Task-number: QTBUG-100536
Change-Id: I5849168d0340f78664e566920f92ad136f9dc435
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-02-16 16:49:16 +01:00
Kai Köhne
8275611766 Core: Remove 'properties' feature
Even QtCore alone cannot be built without the properties feature since
Qt 5.5. While fixing this is easy, other modules like dbus,
networking are also using QObject::property() and friends liberally.

All in all I doubt that anybody will miss the feature (otherwise it
would have been fixed in the last decade).

Change-Id: Iaf3cc20bda54ee2ff3b809fac8fa82b94ecc88c0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2022-02-14 12:50:59 +01:00
Assam Boudjelthia
5deb4e7d25 Android: document how to handle code that loads QML from strings
If an app is loading QML from a string at runtime from C++, the
dependencies/imports might not be bundled into the app package,
and then the app might fail at runtime. A fix is to have a QML
file with needed imports to properly deploy those impots' libs.

Fixes: QTBUG-100394
Pick-to: 6.2 6.3
Change-Id: I10136dc2dd1ac1f4ffe00bcf2cfd6c98e050ef28
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
2022-02-10 01:45:10 +02:00
Joerg Bornemann
d03385df9d Remove QXml* from bootstrap lib
Those classes are not used by any bootstrapped tool.

Also remove the QT_BOOTSTRAPPED code paths.

Change-Id: Ic5a9b153a578fedcba37cd81a62ccf0182a2d34f
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-02-09 19:49:37 +01:00
Joerg Bornemann
4fb5923432 Remove QLine, QPoint, QRect, and QSize from bootstrap lib
Those classes are not used by any bootstrapped tool.

Change-Id: I82fc32e16d044b91ab3a79109ab98a3010df2e2d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-09 19:49:37 +01:00
Joerg Bornemann
b9cd52bef3 Remove QDom from bootstrap lib
It's not used by any bootstrapped tool.

Change-Id: Id6751e80bb34642aeaea1c2bb4f24b480280623d
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-09 19:49:36 +01:00
Joerg Bornemann
c22b30f594 Remove QSystemSemaphore from bootstrap lib
This class is used by androidtestrunner, which is not bootstrapped.

Change-Id: Ie75b4dd039f773a8ccb58f243bf9f74a5121c3f3
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-02-09 19:49:36 +01:00
Fabian Kosmale
0477c78a04 QMetaProperty: remove property auto-registration code
Qt 6 automatically registers all types used in properties. Thus, the
functionality is mostly obsolete since Qt 6. We can simply return the
stored metatype's id instead.
The code in moc is kept in place for compatibility with older code,
though there seem to be no remaining users of the metacall in Qt itself
anymore.

Change-Id: I3c654150988ae7780b4e9ea1f16191fdadf8d791
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2022-02-09 14:02:57 +01:00
Thiago Macieira
8058127a9d QLibraryInfo: remove load-time variable
Since this is only used by qtpaths and qmake, let's not make every
application pay the price of dynamically initializing a QString whenever
QtCore is loaded (which 100% of Qt applications do). Instead,
initializing a null pointer costs zero and is one third the size of
QString. Even the assignment in qmake and qtpaths is faster this way.

Pick-to: 6.3
Change-Id: I6fcda969a9e9427198bffffd16ce8d1eb8dc19da
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-02-05 11:57:34 -08:00
Joerg Bornemann
75082c9f20 Remove QSharedMemory from the bootstrap library
It's not used by any bootstrapped tool anymore.

Pick-to: 6.2 6.3
Fixes: QTBUG-100074
Change-Id: I92cf441c200174e73b483cb4f08bab6c3e7d9c09
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2022-01-27 13:31:56 +01:00
Alessandro Portale
edf1c3b001 Unify indentation in help information of androiddeployqt
Some of the parameters in the help information were indented by 3
characters instead of by 4.

Pick-to: 6.3
Change-Id: Id11cda79d61c4eab82ee09e33034db55730123c5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2022-01-24 12:57:23 +00:00
Kai Köhne
197b5de0d8 qtpaths: Expose new PublicShareLocation, TemplatesLocation
These were added to QStandardPaths in commit 68c4669ce4

[ChangeLog][QtCore] PublicShareLocation, TemplatesLocation got added as
known locations to QStandardPaths.

Task-number: QTBUG-86106
Task-number: QTBUG-78092
Change-Id: I453b6a07dd7775f81f81a1b18fa95f5c1230cb1e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2022-01-14 17:42:49 +01:00
Friedemann Kleint
e376c229e9 uic/Python: Import base class for flag values
Extend the logic extracting enum base classes to flags
to handle things like  QAbstractItemView::EditTriggers.
Exclude the Qt namespace.

Amends de15836dbf.

Fixes: PYSIDE-1773
Task-number: PYSIDE-1404
Pick-to: 6.2 6.2.3 6.3
Change-Id: Ib0cd0836a91f330e5bc3307690062a965abec7eb
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2022-01-13 15:47:46 +01:00
Kai Köhne
6205cb161d Update copyright year to 2022
Pick-to: 5.15 6.2 6.3
Change-Id: If6f1d6f9f82a601f8e2b6d36650d6e737518aa60
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2022-01-04 12:44:19 +01:00
Alexey Edelev
bde2764ab0 Check if QML plugin has the embedded QML files before copying to the Android bundle
We can detect if QML module has the embedded into the plugin QML files
using the 'prefer' record from qmldir files. No need to duplicate QML
files inside the android_rcc_bundle if 'prefer' record starts
with ':/'.

Pick-to: 6.3
Fixes: QTBUG-95984
Change-Id: Iee4f2248e3c0239c4f95a5db6e8fb3f16be636c5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-12-21 13:17:37 +01:00
Alexey Edelev
fe7fc3f23e Copy only files that belongs to QML module
Instead of copying all files that the QML module directory contains,
this approach only copies files that belong to the QML module
according to the qmlimportscanner output.

Pick-to: 6.3
Fixes: QTBUG-97834
Change-Id: I881a6fba28ca24be4f33de8693b41b6dfefe8d6b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-12-20 18:08:10 +01:00
Morten Johan Sørvig
4184a127fa macdeployqt: don’t err on unexpected otool output
Binaries with multiple slices (e.g. arm64, x86_64)
will have an extra line for the slice, like:

“/path/to/QtGui.framework/QtGui (architecture arm64)”

The parsing code will skip this line since it does
not match the regexp. In other words the parsing works
by looking for lines which matches, and finding lines
which don’t match is not an error condition.

Pick-to: 6.3
Task-number: QTBUG-98466
Change-Id: I0afebdc0dd19e76de00157518f3409d690f18fc0
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2021-12-15 15:43:16 +01:00
Friedemann Kleint
49a8ab50ba uic: Generate parameters for ambiguous signals
Fixes: PYSIDE-1720
Pick-to: 6.2
Change-Id: I71b77db73471bdec7826bf69c7df521d7686537e
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-12-07 14:01:58 +01:00
Kai Köhne
6598a26a13 androiddeployqt: Fix signing of paths with spaces
Only use shellQuote() if the path is actually passed to a native API.
For QFile API, use the unquoted path.

Fixes: QTBUG-97649
Pick-to: 5.15 6.2
Change-Id: I9d8131819010bbd2faa8a81eef367245d90a767f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-12-03 15:09:26 +00:00
Alexey Edelev
63b8840380 Fix dependency chain that collects the metatype json files
cmake_automoc_parser has the logic preventing the run of moc with the
--collect-json parameter if metatype json files are not changed.
This logic only verify if the file list is changed but not their
content. This change adds a timestamp file that contains the last
metatype json file timestamp that was modified during the last
cmake_automoc_parser run. The logic still prevents of running
'moc --collect-json' when the list of metatype json files is not
changed, but also checks if their content is no changed.

Another approach it to generate the depfile that can be utilized by
CMake in add_custom_command as DEPFILE argument. But this concept only
works from the second build attempt because of an issue related to
dyndep.

Pick-to: 6.2
Fixes: QTBUG-98532
Change-Id: I713f8bfa9ae769cefe0beac0b7fa19750b00a765
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-12-02 16:34:23 +01:00
Alexey Edelev
6b025f9b27 Use depfile to control ABI-specific builds of executable targets
qt_internal_${target}_copy_apk_dependencies should use CMake DEPFILE
approach when it's possible. Since we don't have any specific
artifact that androiddeployqt can produce when collecting dependencies
this change adds simple timestamp file that is touched each time when
androiddeployqt is running. The timestamp is used then as a file-level
dependency for the qt_internal_${target}_copy_apk_dependencies target.

Task-number: QTBUG-88841
Change-Id: I985535c7b6e471cb4cfbf90128628087dadc72d0
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-12-02 14:28:09 +01:00
Alexey Edelev
87db26bdfe Change the external projects approach for multi-abi builds
Instead of generating external projects that build the project tree
for each target, this creates a single project for each ABI that have
the common for all targets configure steps. Each executable target
then adds additional build step to each ABI-specific external project,
that builds and copies dependencies to the "main" project build tree.

To resolve dependencies from the build tree, when building multi-abi
apk instead of scanning the build directories of external projects for
dependencies, it makes sense to run androiddeployqt for each
ABI-specific external project to copy all necessary libraries. This
is done by adding --copy-dependencies-only flag to androiddeployqt
that only copies the apk dependencies, but avoids creating apk and all
the essential steps. The ABI-specific external project now handles the
deploying of the build artifacts to the end-point apk deployment
directory and the "main" project assembles the apk using collected
artifacts. The ABI-specific external project uses the
qt_internal_${target}_copy_apk_dependencies target to run androiddeployqt
with the introduced --copy-dependencies-only flag.

TODO: Build steps that build and copy the ABI-specific apk
dependencies are non-skipable and will run each time top-level build
is triggered. This behavior should be fixed by adding dependencies to
the generated by androiddeployqt DEPFILES for each ABI in the
top-level build.

Task-number: QTBUG-88841
Tash-number: QTBUG-94714
Change-Id: Id442a9fbd589f58b70f4204c5215645056b379a2
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-12-02 14:28:09 +01:00
Marc Mutz
a0f9aef11b Long live Q_GADGET_EXPORT!
Like Q_NAMESPACE_EXPORT for Q_NAMESPACE, this variant of Q_GADGET
allows passing an export macro. This is useful to avoid exporting the
whole class just to get the staticMetaObject hidden therein exported.

Before anyone asks: No, we don't need Q_OBJECT_EXPORT, because QObject
subclasses, being polymorphic, always need to have a class-level
export macro (to export their vtable), but while that technique also
works for value classes (the Q_GADGET audience), it is not desirable
for them, because it makes inline functions exported in Windows debug
builds, which is not what we want, because it needlessly restricts
what you can to with the inline functions (e.g. remove).

[ChangeLog][QtCore] Added the Q_GADGET_EXPORT macro, which is like
Q_GADGET, but allows passing an export macro (like Q_NAMESPACE_EXPORT
for Q_NAMESPACE).

Fixes: QTBUG-55458
Change-Id: I546297de1e8aa45d83381991bcd3fbca61e1eef0
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-11-27 01:25:10 +01:00
Friedemann Kleint
fac5b084a9 uic: Refactor CustomWidgetsInfo::extends() to use QAnyStringView
Task-number: PYSIDE-1720
Pick-to: 6.2
Change-Id: I2db4ee9586a87c70db08298e311d692e20a93af0
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2021-11-26 18:19:07 +00:00
Joerg Bornemann
20783c4170 CMake: Fix cross-compilation to Windows
...and potentially to macOS.

This amends 3f56950862.

Change-Id: Idf2acded37b59994459bc80ecda5733232f721f6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-11-26 13:13:09 +01:00
Joerg Bornemann
3f56950862 Move macdeployqt and windeployqt from qttools to qtbase
Having all *deployqt tools in qtbase will allow us to couple deployment
support more tightly with the build system.

Change-Id: I299efdacfa6b66a303bb3996ff3ff84e723210a5
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-11-23 21:11:45 +01:00
Yuhang Zhao
e01c25e859 QtBase: replace windows.h with qt_windows.h
We have some special handling in qt_windows.h,
use it instead of the original windows.h

Change-Id: I12fa45b09d3f2aad355573dce45861d7d28e1d77
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2021-11-23 12:53:46 +08:00
Marc Mutz
4c7759cae2 Restore src/tools/moc/util/generate_keywords.pro
The file was inadvertently removed in
ad2da2d27a.

Pick-to: 6.2
Change-Id: Iaaf74d7ae382b0c9487fb25a58632dfc5be6538d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-11-23 00:36:34 +00:00
Joerg Bornemann
610123b1c8 Move the 'qmake' feature to src/tools/configure.cmake
This allows us to present 'qmake' in the tool-related section of the
configure summary.

Change-Id: I897dec23cb0608706ec01d9b91283dbce92b293f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-11-19 20:44:51 +01:00
Joerg Bornemann
d29f76f5e5 Add configure feature 'androiddeployqt'
This makes it possible to turn off the build of the Android deployment
tool.

A new src/tools/configure.cmake is added that will be the place for all
tool-related features in qtbase.

Change-Id: Ic9264c93ee96de06c97d21d2f27f73256f48ffda
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-11-19 20:44:51 +01:00
Nicholas Bennett
a4dca9936d Docs: Move manifest and androiddeployqt docs to where code lives
Removed content describing androiddeployqt from deployment-android.html
to androiddeployqt.html,the qdoc source now living in qtbase.
Docs src locations added to the qtcore.qdocconf.

Task-number: QTBUG-97842
Pick-to: 6.2
Change-Id: I94783520280098ce1ab35f335a644bea70b8131a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-11-19 12:18:50 +00:00
Mitch Curtis
0d6438f808 Disable some tools and plugins if regularexpression feature is disabled
There are still more failures, but these are low-hanging fruit.

Pick-to: 6.2
Change-Id: I3d3a1dc9e754bd4865c850cc1549b0b6fd6fa2f8
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-11-12 09:57:44 +01:00
Andreas Buhr
0098dd8120 Capture full logcat output in Android unit tests
Previously, when running unit tests on Android, the log presented
to the user was the log as known to the Qt logging system. This
does not include log messages generated by Java code using e.g.
Log.d("message"). Neither does it include log messages by system
libs. This patch changes androidtestrunner to capture the full
logcat output for the unit test. This improves the developer
experience when working with unit tests.

Fixes: QTBUG-93438
Change-Id: I580f728349041eb8a84a32d187754b7b5448f512
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-11-09 22:39:24 +01:00
Alexey Edelev
388136e860 Add --no-rcc-bundle-cleanup option to androiddeployqt tool
Add --no-rcc-bundle-cleanup option to androiddeployqt tool that helps
to debug android build procedures and check the raw rcc bundle for
missing items. Also add the QT_INTERNAL_NO_ANDROID_RCC_BUNDLE_CLEANUP
CMake variable that adds the option when configuring projects for
Android.

Change-Id: I1f30ba979f9fb3274e44a53fdc5ebde4e65f0843
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-10-29 19:32:16 +02:00
Alexey Edelev
d273f38726 Replace deleteRecursively function with QDir::removeRecursively
Use QDir::removeRecursively instead of deleteRecursively when cleaning
up top-level build folders.

Change-Id: Ifb406fc1965a0781eab4fd63a3764a84f4309d25
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-29 14:53:56 +02:00
Ivan Solovev
164e575673 Fix -trace build on Windows
The TraceLoggingValue template does not have overloads for Qt
types, so it was throwing multiple template instantiation errors
while trying to log the unknown types.
Fix it by serializing such types to QString using QDebug::toString,
and the logging this string.

Apart from that, fixes some other compiler errors on Windows build
with -trace enabled:
- implicit size_t to ULONG conversion
- complaints on std::min
- add QT_BEGIN_NAMESPACE/QT_END_NAMESPACE to the generated
  *_tracepoints_p.h headers to fix the namespace build.

Task-number: QTBUG-97246
Fixes: QTBUG-97241
Pick-to: 6.2
Change-Id: Ifba134bab8d7fda7f1e30da9938e25cae813e1c6
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-10-25 14:57:18 +02:00
Ivan Solovev
2a72f0f15d Fix compilation with QT_NAMESPACE and tracing on Linux
The tracegen tool was not taking into account that Qt could be build
with a custom namespace. As a result, the combination of namespace
build and tracing enabled was not working, because tracegen generated
classes without the namespace.

This patch fixes it.
We cannot add QT_BEGIN_NAMESPACE/QT_END_NAMESPACE because of the
tricky logic that recursively includes the generated header file
multiple times, also including the code like

static const struct lttng_event_desc *_TP_COMBINE_TOKENS(__event_desc___, TRACEPOINT_PROVIDER)[] = {
(hash)include TRACEPOINT_INCLUDE
    NULL, /* Dummy, C99 forbids 0-len array. */
};

where TRACEPOINT_INCLUDE is the path to the generated header.

This patch is using QT_USE_NAMESPACE, wrapped into some #ifdefs.
This should be safe, considering that the generated trace headers
are only used as private API.

The windows tracing support seems to be broken even in a
non-namespace build, so it's not handled in this patch.

Task-number: QTBUG-97246
Pick-to: 6.2
Change-Id: I12db76e199a3aa3abde641fbf99a6e1a3d7de203
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ievgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>
2021-10-25 14:57:18 +02:00
Bartlomiej Moskal
6dd6342864 androidtestrunner: make sure that system-user is used
It happens on Android Automotive emulator, that output file is in other
directory.

According android spec [1]:
"If a default user isn't specified, each adb subcommand has a different
user. The best practice is to retrieve the user ID with am
get-current-user and then explicitly use --user <userId> for any
command that supports it."

That is the reason why output file can be found in
/data/user/USER_ID/PACKAGE_NAME directory.

Checking path related to current user was added as backup solution.

[1]https://source.android.com/devices/tech/admin/multi-user-testing

Pick-to: 6.2
Change-Id: Id7e6ddef74f4f20b7469a07bba6a71d3622c4e20
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-21 08:23:22 +00:00
Friedemann Kleint
5074679cfc uic: Fix missing Python import when setting tab orders
Add QWidget as default import so that QWidget.setTabOrder() is found.

Pick-to: 6.2
Change-Id: I7593008d1395e3fddacf7124d271a0eaf4c345d9
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2021-10-20 11:34:03 +02:00
Joerg Bornemann
879f86098e Remove zlib from bootstrap library
None of the bootstrapped tools use zlib anymore.

Change-Id: I2cd7cb855ed671916a21c23449d9b6c4506f8546
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-10-16 14:33:28 +02:00
Assam Boudjelthia
7235eeab19 Android: replace ndk.dir with android.ndkVersion in build.gradle
The use of ndk.dir in local.properties is deprecated in favor of
android.ndkVersion in build.gradle, and will be totatlly removed in
the future, so we need to adapt to that.

Fixes: QTBUG-91391
Pick-to: 6.2
Change-Id: I54c57113a759d43c3685c9cdf2b9dcc5c948c0fd
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Rami Potinkara <rami.potinkara@qt.io>
2021-10-13 18:33:32 +03:00
Giuseppe D'Angelo
2bd3c53a95 QLalr: use QList iterators in algorithms
There's no need to dereference+reference a QList's iterator
only to pass the result to an algorithm, just pass the iterator.

Change-Id: I7367010f6ab489d951715259bd51aeec790d3c84
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-10-13 04:33:21 +02:00
Jonas Kvinge
9f701b6ffc tools: Fix typos in source code comments
Change-Id: I9666104a320f66b22c5144375ce7440bb59737e6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-10-12 12:52:02 +02:00
Fabian Kosmale
e5183c49dd androiddeployqt: Use QElapsedTimer to get elapsed time
No need to reinevent the wheel. Also, use nanoseconds
now that we have the precision available.

Change-Id: I287d06198edc3f5bdf7f85bd5f3e235b1fea95a3
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-08 20:03:22 +02:00
Thiago Macieira
788a7bfdb1 QPlugin: move some of the logic from moc's output to qplugin.h
This will allow us to make changes in QtCore itself, without having to
worry about moc compatibility.

The output uses an #ifdef so this version of moc can still be used to
compile earlier versions of Qt (usually, in cross-compilation
environments). See discussion in the mailing list[1].

[1] https://lists.qt-project.org/pipermail/development/2021-September/041732.html

Change-Id: I2de1b4dfacd443148279fffd16a39784c80c5f3b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-10-04 14:01:34 -07:00
Andreas Buhr
1405c1d5bf androiddeployqt: only write enabled architectures to build.gradle
androiddeployqt writes a list of architectures into the build.gradle
file. This list should only contain the architectures which are enabled.
This patch adapts the generation of this list accordingly.
Amends 07cfab07a2.

Change-Id: I5c7c1886c54cc3b9a7e42af6eefbaf2a067a67d5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-10-04 12:04:16 +02:00
Raphael Cotty
cdfcb98bc0 androiddeployqt: Allow to also provide multiple qt install directories
The "qt" property can also be filled with a json object like this:
"qt": {
    "x86":"/home/.../Qt/6.3.0/android_x86",
    "x86_64":"/home/.../Qt/6.3.0/android_x86_64",
    "arm64-v8a":"/home/.../Qt/6.3.0/android_arm64_v8a",
    "armeabi-v7a":"/home/.../Qt/6.3.0/android_armv7"}
That allows to update the options.qtInstallDirectory when changing the
current architecture.

The "qtHostDir" property is also added to provide the path to the qt
host installation (rcc, qmlimportscanner).

Change-Id: I3f0c36cc7a7030d45adc1a4dccaaad61dd538aea
Task-number: QTBUG-88841
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-10-01 18:51:07 +02:00
Andreas Buhr
07cfab07a2 Specify Android architecture in gradle files
When building for armeabi-v7a, building and APK using
"ninja foo_make_apk" works. Building it by calling
"gradlew assembleDebug" works. Opening the "android-build" folder
in Android Studio and clicking the "Build" button works.
But clicking the "Run" or "Debug" button in Android Studio does not
work when the attached phone is arm64-v8a. Then Android Studio
automatically selects the v8 architecture which does not find the Qt
libraries. This patch adds explicit ABI selection to the gradle
configuration files. With explicit ABI selection, Android Studio does
not try to outsmart you.

Pick-to: 6.2
Fixes: QTBUG-96701
Task-number: QTBUG-87022
Change-Id: I4ad6356c38b7eca004c0e0dbbb357cab7de84c0f
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-09-30 17:27:16 +02:00
Andreas Buhr
95ef193715 Rename variable to not reference Qt5
In the Android gradle files, the variable qt5AndroidDir refers to Qt5
and might confuse users. This patch renames to qtAndroidDir.

Pick-to: 6.2
Change-Id: Ib18a3cd2c38646e4c6c0435dae9234f0f7887eb5
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-09-30 13:58:34 +02:00
Joerg Bornemann
a0e56294c1 Skip unnecessary commands when cross-building tools
Introduce a new macro qt_internal_return_unless_building_tools which
simply calls return() if tools are not built.  This macro is supposed to
be called after qt_internal_add_tool().

Using this macro avoids having to special-case code for when
qt_internal_add_tool() creates imported targets in cross-builds.

Adjust pro2cmake accordingly.

Task-number: QTBUG-85084
Change-Id: I9e1c455c29535dd8c318efa890ebd739c42effc1
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-09-27 16:34:23 +02:00
Assam Boudjelthia
bbf115dec0 Android: fix error when signing bundles
The jarsigner command that was being used was malformed before the
file path leading to wrong signing command. A sample of the malformed
command part "-storepass password⍣/path/to/package", note the char
after 'password'. So having auto produces a QStringBuilder that's
returning the malformed char.

Fixes: QTBUG-96838
Change-Id: I5477f6913a74d79ebaf029ef7f4e2745c9f7ced0
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
(cherry picked from commit f492790611fe15a4745c8ad0c97259f438c91b6b)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-09-24 13:45:07 +00:00
Friedemann Kleint
710842f075 uic: Add QWebEngineView
This is required to generate the correct import for Python.

Pick-to: 6.2 6.2.0
Task-number: QTBUG-63235
Change-Id: I6aaff82058e3f0a5453da15d8d470f06ad9a5a16
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-09-20 17:00:05 +00:00
Joerg Bornemann
63dcb31049 Don't bootstrap rcc
The rcc tool doesn't contribute to the build of QtCore anymore.
There's no need to link it against the bootstrap lib.

Change-Id: I5272d439a05f852eeea88b3a6b95c5ad6dd4e987
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-09-20 13:19:02 +02:00
Alexey Edelev
d20f4ae706 Support deploying of libraries from a build tree when building android apk
If the project consists of an executable and multiple libraries that
are linked to the executable, currently you need to specify them
manually using QT_ANDROID_EXTRA_LIBS target property.

This automates deploying of the libraries that are a part of the
project build tree. _qt_internal_collect_target_apk_dependencies
collects all the known non-imported shared libraries from the project
build tree. When running androiddeployqt we specify extra library
directories that point to the collected library locations in build
tree, to help androiddeployqt resolve shared libraries that are build
as a part of the project.

The described procedure is running automatically if CMake version is
greater than or equal to 3.18 is. For the CMake versions less than
3.18 users need to call a new public qt_finalize_project function at
the end of project's top-level CMakeLists.txt

Task-number: QTBUG-94714
Change-Id: I400ca4e49e940cfc25ae90d65372e79825bee55a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-09-09 21:49:37 +02:00
Alexey Edelev
42d0089d44 androiddeployqt: Add support of multiple qml root paths
If application uses qml files from multiple locations, e.g.
subdirectories inside source directory it's important to provide this
information to qmlimportscanner to produce consistent set of QML
modules that need to be included into the end-point application apk.

This makes possible to specify more than one QT_QML_ROOT_PATH per
target and propagates these paths to the qmlimportscanner using
androiddeployqt tool.

Pick-to: 6.2
Task-number: QTBUG-93340
Change-Id: Ic31017b3f2671108adb6d6118ef1c75f1ccc3ec5
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-09-08 23:37:51 +02:00
Assam Boudjelthia
7dc05252a0 Allow building android{deployqt, testrunner} under target host_tools
When doing a cross build for Android we need only the host tools which
are available under cmake's host_tools target, but androiddeployqt and
androidtestrunner are not part of that. This fixes that.

Pick-to: 6.2
Change-Id: Icdbc4a78ca050b66ec8df656d9ec766ef6c9f4b9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-09-07 17:08:25 +00:00
Assam Boudjelthia
07283f1527 Android: pass -g to testrunner to grant run time permissions
Some Qt modules/tests go through features that require run-time
Android permissions which are granted by user input, that of
course is not ideally possible while running unit tests. So when
installing the app adb can do that for us.

Pick-to: 6.2
Change-Id: I92d33d5213c3779d7ca246ec0fb359d2ead4fa6f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-29 19:39:42 +03:00
Juha Vuolle
17d7a8dc2e Update Android default SDK from 29 to 30
By the time of Qt 6.2 release all new apps targeting Play store must
target API level 30 (Android 11) or above (starting in 08/2021 for
new apps and 11/2021 for existing apps' updates).

Pick-to: 6.2 5.15
Task-number: QTBUG-94451
Change-Id: Id7fa2fd62899a7259e365c917292c6c3ac0d2b0d
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-08-27 18:31:17 +00:00
David Faure
531b913f61 qdbuscpp2xml: add support for custom types with a new -t option
qdbuscpp2xml can't know about custom types registered with
qDBusRegisterMetaType<> in the server application whose header file
it's parsing. So add support for custom types using a command line
argument. For example:
    qdbuscpp2xml -t 'std::vector<Person>=a{ssss}' peopleserver.h
which generates
    <arg name="people" type="a{ssss}" direction="in"/>
    <annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="std::vector&lt;Person&gt;"/>

[ChangeLog][QtDBus][qdbuscpp2xml] Added a -t option to specify how to
handle custom types.

Change-Id: Ic0cad4f4eec8d5dfa48055c3a46cc772b1a60174
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-08-25 01:03:54 +02:00
David Faure
511bbbdfc0 qdbusxml2cpp: generate "using" rather than "typedef"
It's more modern :)

I was hoping it would allow to forward declare the org::kde::Foo class,
but unfortunately it doesn't, the forward declaration has to use
"using" or "typedef" too...

Change-Id: I9ec2900ac25c1bca75d097aa339fd2a872568f95
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-08-24 15:34:59 +02:00
David Faure
7a5f8baa67 qdbusxml2cpp: don't generate an include for all of QtDBus+QtCore
This, however, has to wait for Qt 7 for compat reasons.

Change-Id: I84db4715bf2e9d080d1446d24f0996c78a875e63
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-08-23 23:07:30 +02:00
Alexey Edelev
f037357232 Add the json option to disable the zstd based compression
Need to disable zstd compression if its support is not built in Qt
for Android. The flag is dected when configuring user's project and
is a part of the deployment settings. This partially fixes loading of
android_rcc_bundle.rcc.

Pick-to: 6.2
Task-number: QTBUG-93340
Task-number: QTBUG-95969
Change-Id: I635afb3f9e182a559d53e9344e07f62788f9837d
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-23 20:05:27 +02:00
Andrei Golubev
d4e62f2c5a moc: Support BINDABLE for private properties
Hopefully we won't need it but let's have it still at least for
consistency

Change-Id: I72289e65e5e5613174ad4d98cf8d614f9caae8e6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-08-06 17:25:50 +02:00
Fabian Kosmale
87973325f1 Handle even more include in enum cases
The solution in d3ed7dac8a was needlessly
complicated, and broke a valid use case.
The issue of no identifier being available to parse after the include
has been processed can instead be solved by moving the test for the
closing brace after the include processing.

Fixes: QTBUG-94790
Pick-to: 6.2 6.1 5.15
Change-Id: Ieec4b89e1d117637f11479e8bddc4060f93da43d
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-08-06 11:54:11 +00:00
Li Xinwei
a251443949 Avoid to call _qt_internal_set_up_static_runtime_library() twice
Pick-to: 6.2
Change-Id: I28985470b3e0b88befbbd2d62a027670d7d6c822
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-08-03 04:18:42 +08:00
Tor Arne Vestbø
7c14223b1e testlib: Update a few remaining instances of the deprecated -xunitxml format
The format was renamed in 27db9e458c.

Pick-to: 6.2
Change-Id: I53975c7467d8768dc9dc9ac2d89c42eefa12e22f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-07-29 18:46:39 +02:00
Marc Mutz
25fff849e8 QDirIterator: add nextFileInfo()
Before this change, next() was the only way to advance the iterator,
whether the caller was ultimately interested in just the filePath()
(good) or not (bad luck, had to call .fileInfo()).

Add a new function, nextFileInfo(), with returns fileInfo() instead.
Incidentally, the returned object has already been constructed as part
of advance()ing the iterator, so the new function is faster than
next() even if the result is ignored, because we're not calculating a
QString result the caller may not be interested in.

Use the new function around the code.

Fix a couple of cases of next(); fileInfo().filePath() (just use
next()'s return value) as a drive-by.

[ChangeLog][QtCore][QDirIterator] Added nextFileInfo(), which is like
next(), but returns fileInfo() instead of filePath().

Change-Id: I601220575961169b44139fc55b9eae6c3197afb4
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-07-28 15:16:42 +02:00
Kai Köhne
1a43be7893 Add qtpaths6 alias
Make qtpaths also available under qtpaths6. In  fef850c51a, qtpaths
got extended to replicate the 'qmake -query' behavior. This was meant for
IDE's like Qt Creator, so that they can use qtpaths instead of qmake to
identify Qt versions.

Anyhow, since qtpaths was also available in Qt 5, letting users just select
_any_ qtpaths executable won't work for this purpose. Adding qtpaths6 - like
qmake 6 - allows IDE's to query for a Qt 6 qtpaths.

Pick-to: 6.2
Task-number: QTCREATORBUG-25546
Change-Id: Ifc7e1a76b26cf706872db1bb1f9d3de5f006de24
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-07-16 07:43:02 +00:00
Marc Mutz
a7564e2657 QDuplicateTracker: accept the number of elements to reserve as a ctor argument
This prevents us from first reserve()ing Prealloc elements, and then
possibly reserve()ing a larger number, which leaves the first bucket
list's memory unused.

Consequently, deprecate reserve().

Change-Id: Ifc0a5a021097f4589557e7b5e45d9d0892797ade
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
2021-07-14 08:57:39 +02:00
Marc Mutz
f5bcfb8f57 Fix C++20 compilation of androiddeployqt
u8 literals changed type from const char[] to const char8_t[] in C++20
and Qt APIs that don't use QUtf8StringView aren't prepared for it. Use
a classical char literal for the time being.

Amends 857be50b2e.

Pick-to: 6.2
Change-Id: I7f194befc08ab50cdef321d8900ee3553599a19e
Reviewed-by: Andreas Buhr <andreas.buhr@qt.io>
2021-07-09 13:35:54 +00:00
Andreas Buhr
857be50b2e Let androiddeployqt write a dependency file
Let androiddeployqt write a dependency file so that
the build system knows when to re-run it.

Fixes: QTBUG-94567
Change-Id: I5985d707f257b22789013a74f0a6f7c4de6e5e88
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-07-08 17:30:20 +02:00
Assam Boudjelthia
963a31c0f4 Android: Make the manifest less to scary to read and edit
Remove unnecessary elements from the manifest file, making it
easier to manage and read. Mostly, the removed elements are
more internal data that is populated by the build system
and the user shouldn't have to worry or confront that.

Also, use the same formatting used by Android Studio.

[ChangeLog][Android] Remove some elements from the manifest
file that are internal, to make it easier to deal with the
manifest.

Pick-to: 6.2
Change-Id: I6a1f275b579370972c0bf022502a8fbfe7d0bfd1
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2021-07-01 23:54:15 +03:00
Assam Boudjelthia
af6bc5a21b Remove ministro code
Since Ministro no longer work on recent Android versions (Android 8+),
and it hasn't been maintained and the repos are not updated, the
existing code is practically a dead code.

[ChangeLog][Android] Remove ministro code since it's been unmaintained
and not working with recent Android versions.

Task-number: QTBUG-85201
Pick-to: 6.2
Change-Id: I18d7b1e209cba3cfd04674060e9bf39aa5a5510f
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2021-07-01 23:54:14 +03:00
Assam Boudjelthia
705877682e Revert "Android: fix androidtestrunner passing when output file doesn't exist"
This reverts commit 1365a1c7a7.

Reason for revert: Causes the issue in QTBUG-94445.

Pick-to: 6.2
Task-number: QTBUG-88508
Fixes: QTBUG-94445
Change-Id: I131234c9b1daeecd5f5f4921a9150d65a26db972
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2021-07-01 13:29:43 +00:00
Giuseppe D'Angelo
7efacc7cbe Enable QT_TYPESAFE_FLAGS for bootstrap and QtCore
Change-Id: I5c64a29ffecece9e527f5db78cceb912836153d3
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-06-23 12:49:19 +02:00
Friedemann Kleint
41725faa7e qtpaths: Prevent tool messages from appearing in qtbase.ts
The tool used QCoreApplication::translate(), but did not attempt
to load a QTranslator. Use QStringLiteral() instead.

Pick-to: 6.2
Task-number: QTBUG-75870
Change-Id: Ib3c6b1893889a82b186a310c0c725dbf1a1885b3
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-06-15 13:59:53 +02:00
Assam Boudjelthia
c08b9a49ba Android: don't call qmlimportscanner if no qml dir exist
If only qtbase is installed, androiddeployqt might call qmlimportscanner
which will fail to find a qml dir under the Qt install path. Thus, we
check if the qml dir exists before calling qmlimportscanner otherwise
throw a warning.

Fixes: QTBUG-89588
Change-Id: I706eb2a233e9ab5b250652cd46aae75cab178648
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-06-07 18:40:27 +00:00
Assam Boudjelthia
1365a1c7a7 Android: fix androidtestrunner passing when output file doesn't exist
Task-number: QTBUG-88508
Change-Id: If19d2b272b1760228b6a1e6e1af6db3bfbf0ec1e
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2021-06-07 18:40:27 +00:00
Andrei Golubev
e6a2892772 moc: Add relative property index to JSON output of PropertyDef
Needed for QML compiler to know property index of C++ type at
compile time without going through QMetaObject::indexOfProperty

Change-Id: I404e71d6071d36812661df17d12b879a8dcbd146
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-06-02 19:03:45 +02:00
Assam Boudjelthia
2a6e30c9c4 Android: make the help print a bit easier to read and navigate
Add new line between each argument type in the help print to make it
easier to read and not a big wall of text.

Change-Id: I7c7b2d2b59ef3a0889d1bb8c7af3d00b82bf820d
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-06-02 08:19:37 +00:00
Friedemann Kleint
de15836dbf uic: No longer generate star imports in Python
Use class WriteIncludesBase and store classes encountered in a
per-module hash (Qt/custom widgets). Write out only the required
classes.

Add --star-import as a fallback should the change cause issues.

Task-number: PYSIDE-1404
Change-Id: Ic50e26758ddd0f2f8aebbce470d32a36fb09a2c4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2021-06-01 16:29:15 +02:00
Alexey Edelev
c4b5e84e9e Avoid blocking read from stdin when collecting json files
Change the behavior of moc when collecting json files. If argument files
are specified, suppose moc received empty input and skip input from
standard input.

Pick-to: 6.1
Fixes: QTBUG-93504
Change-Id: I45ec790ed458f1fae543d069555bc8abc6560816
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-31 07:13:09 +00:00
Friedemann Kleint
cb881f7c97 uic: Add further widgets to class lib map
It should be possible to use them with promotion.

Task-number: PYSIDE-1404
Change-Id: Idea0ab076c66d2842958eabf66e5dc4f8e1bad3f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-05-25 22:01:56 +02:00
Friedemann Kleint
4b82c1c727 uic: Extract a base class for WriteIncludes
Extract base class WriteIncludesBase from WriteIncludes which
basically adds the dependent classes.
Move the classlibmap there as well.

Task-number: PYSIDE-1404
Change-Id: I899c7818cb96dd3b1af5f328cd20d64fbaf7755b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Christian Tismer <tismer@stackless.com>
2021-05-25 22:01:53 +02:00
Thiago Macieira
4ef99b8fbb Deprecate qGlobalQHashSeed and qSetGlobalQHashSeed in Qt 6.6
That's two years from when the replacements were added (6.2).

Change-Id: Id2983978ad544ff79911fffd1671f7dd38fede02
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2021-05-23 12:08:43 -07:00
Li Xinwei
19bb9837a1 Skip building debug bootstrap lib for CMake 3.20 and multi-config build
When building qtbase with CMake 3.20, only release tools will be built
by default in a multi-config build, so it is possible to skip building
debug bootstrap lib.

Task-number: QTBUG-88414
Change-Id: I266ac458ae3c89c593656e4ebdc788ae5797b788
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-05-23 14:00:53 +08:00
Joerg Bornemann
c3b5ca129a rcc: Fix error message when temporary file cannot be opened
If rcc cannot open the file passed with --temp, display the path of the
temporary file, not the one of the output file.

Pick-to: 6.1
Change-Id: I58f8ab2f68ac2f1a19feb6b02974dff9fc8b7ec1
Reviewed-by: hjk <hjk@qt.io>
2021-05-21 23:15:42 +02:00
Lars Schmertmann
46db337975 androiddeployqt: Refactor apkSignerRunner
Avoid to publish all local variables in the lambda and
only provide the necessary information as parameter.

Change-Id: Iea68280f79f90ac3d5f7b9a0a92e073865a1d291
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-05-21 16:05:44 +02:00
Joerg Bornemann
76eefab088 Add proper dependencies to apk targets
Before, building ${target}_make_apk always re-built the apk, instead of
rebuilding the apk only when inputs changed. This patch fixes that by
moving the creation code from a custom target to a custom command with
proper dependencies.

The androidtestrunner tool now does not check for the existence of an
apk anymore and always runs the make command that is supposed to build
the apk.

The ${target}_prepare_apk_dir target is not needed anymore by the Qt
build but is still used by Qt Creator's Android support. Add a
clarifying comment.

Fixes: QTBUG-93431
Change-Id: I00d65d616fef9511b03b65f879c4bc6cb92dfc30
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-05-17 19:14:44 +02:00
Andy Shaw
a8a6558a84 Allow for arguments that have an equals as part of it
Since you can pass a define to org.gradle.jvmargs that can have the
name=value approach, then we need to ensure that this is accounted for.

Task-number: QTBUG-88989
Pick-to: 6.1 5.15
Change-Id: I2a795bff7ce683eca521b3a987293b3320accb6a
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-05-14 08:12:09 +00:00
Assam Boudjelthia
531d12edaf Android: check that app's lib_name value doesn't contain spaces
android.app.lib_name is used for the app's lib that contains the main()
function, *.so lib files usually have non-spaced names, thus to avoid
wrong changes done to the manifest file, it's better to throw an error
in this case.

Change-Id: I4d4f0235612b308c78fd06a77690604c5c69f8ff
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2021-05-12 12:49:45 +00:00
Mike Achtelik
08d8c59629 androiddeployqt: Check if apk is already aligned
Newer versions of the android gradle plugin already align the apk
internally. Therefore it is not necessary to indiscriminately align
every apk. So let's first check, if it is already aligned and only
align it if necessary. This prevents possible alignment errors,
which might occur when aligning it again. If it is already aligned,
we can just copy and continue signing the apk.

Fixes: QTBUG-88989
Change-Id: If29004e372e7927c88a900dc56f490bf9bce9ec7
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-05-12 10:09:17 +02:00
Fabian Kosmale
300dec66ce QMetaMethod: Store method constness in metaobject system
[ChangeLog][QtCore][QMetaMethod] It is now possible to query the
constness of a method with QMetaMethod::isConst.

Change-Id: I8a94480b8074ef5b30555aeccd64937c4c6d97d4
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-05-07 21:50:58 +02:00
Mårten Nordheim
12b8283f89 Moc: parse trailing return type
Pick-to: 5.15 6.1
Fixes: QTBUG-71123
Change-Id: I1c3749f0892fddcc433c9afcb1d6d7c30c97c9d9
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2021-05-04 01:39:48 +02:00
Friedemann Kleint
96d9cf8de4 uic: Fix font family code generation for python
Amend the code introduced by d8602ce58b
to generator correct code for Python.

Change-Id: I71fc9a1830d6bd591d32ce08002572c29f02a27f
Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit b2ebc64dd9914359fe8acf2bc9960e341e98cf80)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2021-05-03 16:09:23 +00: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
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
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
Tor Arne Vestbø
9268cb8085 Include qsimd.cpp in bootstrap build
QHash, which is included in the bootstrap library, uses qCpuFeatures()
as part of the implementation of qHashBits(), when the __ARM_FEATURE_CRYPTO
is available, so we need to ensure the definition of that function is
also included.

Change-Id: I3eeb3685335120a4861c397ab9c82540bcfcd17c
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-27 22:07:44 +02:00
Alexandru Croitor
b25eb6e0bd CMake: Introduce zlib find script to work around hardcoded iOS SDK
Xcode allows building a project targeting either the device or
simulator sysroot in one single build dir, but for the sysroot
switching to work there should be no linker or compiler flags
referencing absolute paths of a specific sysroot.

During CMake configuration of a project targeting iOS, all found
system libraries will be within one single sysroot, either the device
one or the simulator one, whichever one was passed to
CMAKE_OSX_SYSROOT. CMake will then generate the Xcode project
and pass those absolute paths, which makes sysroot switching within
Xcode not work.

To avoid that, the CMake documentation recommends passing linker and
framework flags of the form '-lfoo' and '-framework bar' instead of
absolute paths. Xcode then takes care of setting the correct framework
search path.

Zlib is one of the libraries found in the iOS sysroot and thus passed
as absolute path.
To avoid that, create a new FindWrapZLIB find script. The target it
creates will pass the absolute path to the library on non Apple
platforms and an -lz linker flag on Apple platforms (macOS and iOS).

To avoid issues with target global promotion when system PNG package
is found, ensure that a found ZLIB::ZLIB target is promoted to global
manually in src/gui/configure.cmake.

Pick-to: 6.1
Change-Id: I8bd8649be4f680a331ad51925f27cb9d13ac5e5f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-04-19 20:30:45 +02:00
JiDe Zhang
50a7eb8cf7 Add the "Territory" enumerated type for QLocale
The use of "Country" is misleading as some entries in the enumeration
are not countries (eg, HongKong), for all that most are. The Unicode
Consortium's Common Locale Data Repository (CLDR, from which QLocale's
data is taken) calls these territories, so introduce territory-based
names and prepare to deprecate the country-based ones in due course.

[ChangeLog][QtCore][QLocale] QLocale now has Territory as an alias for
its Country enumeration, and associated territory-based names to match
its country-named methods, to better match the usage in relevant
standards. The country-based names shall in due course be deprecated
in favor of the territory-based names.

Fixes: QTBUG-91686
Change-Id: Ia1ae1ad7323867016186fb775c9600cd5113aa42
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2021-04-15 20:17:49 +08:00
Tasuku Suzuki
865f3c2a11 Fix build without features.systemsemaphore
Change-Id: I73059f48d37253b5f962f96f693f26c7d55a31e1
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
2021-04-14 16:24:33 +09:00
Joerg Bornemann
20db8dbeeb androiddeployqt: Fix the fallback location of rcc
Now, that rcc lives in libexec, we need to assume the location of rcc to
be "bin" on Windows and "libexec" elsewhere.

Pick-to: 6.1
Fixes: QTBUG-92245
Change-Id: Idb81a5d02bae9ca3254e7590140a128500572b07
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-04-07 10:21:52 +02:00
Qt CI Bot
87308fb95d Merge integration refs/builds/qtci/dev/1616690051 2021-03-25 20:23:15 +00:00
Fabian Kosmale
cb43aaca11 Introduce QMetaObject::metaType
This function returns the metatype corresponding to the metaobject, or
an invalid metatype for namespaces.

This works as follows: First we increment the metaobject revision for
new metaobjects. Metaobjects with older revisions are handled by doing a
lookup by name. That fallback is also used for dynamic metaobjects (from
QtDBUS and those created by QMetaObjectBuilder).
For new metaobjects, we store the metatype in its metatype array, behind
the property metatypes. This avoids any changes to the property and
method metatype extraction logic: For properties, the metatype access
does not change, as the new metatype is after their metatypes. For
method metatypes, we already have an indirection layer (using offsets),
so by adjusting those offsets by one, the same logic keeps working.

To distinguish between namespaces and dynamic metaobjects, namespaces
store the metatypeinterface pointer for void in the metatype array,
whereas dynamic metaobjects store a nullptr.

One nice additional benefit is that this simplifies the generator logic
in moc, as the metatype array is now never empty.

Task-number: QTBUG-92077
Change-Id: Id3f920f28553f12032a71a1a87dad29e5374dbe7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2021-03-25 17:33:07 +01:00
Alexey Edelev
fef850c51a Extend qtpaths functionally to replicate the 'qmake -query' behavior
'qt-version', 'install-prefix', 'binaries-dir' and 'plugin-dir' are
covered by the introduced qt-query option. So make them obsolete and
hidden in the application help.
Note that the 'qtconf' option will affect the output of options
associated with QLibraryInfo.

[ChangeLog][Tools] qtpaths got new --qt-query argument that can be
used instead of qmake -query. The new --qtconf, --query-format
arguments allow you to further tweak its output.

[ChangeLog][Tools] The qt-version, install-prefix, binaries-dir
and plugin-dir options of the qtpaths tool are deprecated.

[ChangeLog][Tools] The qtpaths tool has been moved from the
qttools repository to the qtbase repository.

Fixes: QTBUG-75870
Change-Id: I949acf79c8ce321811ee81cf707c1ae0eccb547d
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-25 12:58:04 +01:00
Martin Storsjö
1ac2e85025 qtpaths: Fix cross compilation for windows
The cmake target may not be named "qtpaths", but one should be using
${target_name} instead. If cross compiling, and
QT_BUILD_TOOLS_WHEN_CROSSCOMPILING isn't set, the tool won't be built
at all and there's no such target to set properties on, and if it
isn't set, the target name is something else.

Change-Id: I3d904036106b38df6e56ad35d400cf9a0bb1cbdf
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-15 10:30:18 +02:00
Alexey Edelev
933343b16d Move qtpaths from qttools repository to qtbase
qtpath should replicate the functionality of 'qmake -query'. Also we
want this tool to be available in builds without qttools.

Task-number: QTBUG-75870
Change-Id: I6578fc4fc45dd940fd353a5cfe6db0a12744230a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2021-03-12 13:20:04 +01:00
Joerg Bornemann
1f30bcf336 Move build tools to libexec instead of the bin dir
[ChangeLog][Build System] Tools that are called by the build system and
are unlikely to be called by the user are now installed to the libexec
directory.

This is a step towards easier co-installability of different Qt
versions.

Pick-to: 6.1
Task-number: QTBUG-88791
Change-Id: Id19575b5ba27795f7715e4ea6a09391b26dd4942
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-02-23 17:02:30 +01:00
Edward Welbourne
36ea42effc Remove redundant code in androiddeployqt/main.cpp
Prompted by a PVS-studio article.

Pick-to: 6.1 6.0
Change-Id: I9699cc9baf9c90a6cf5b9564cd175205a9b2fa6b
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-02-18 13:05:50 +01:00
Alexey Edelev
566ba523ad Move static PCRE2 defines to non-system PCRE2 section
Private PCRE2-specific definitions should be only used with the
built-in PCRE2 library.

Ammends 7c69eb8868

Fixes: QTBUG-90556
Change-Id: If47e0b9eaaece290676d6c2b484bb52281aa7c68
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2021-02-01 14:34:46 +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
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
Laszlo Agocs
c6d6029909 Update QVulkan(Device)Functions to Vulkan 1.2
This also needs improvements to qvkgen. What we get with this patch
are the Vulkan 1.1 and 1.2 core API's additional 11 instance-level
and 30 device-level commands present in QVulkanFunctions and
QVulkanDeviceFunctions.

All of these are attempted to be resolved upon construction. When the
implementation does not return a valid function pointer for some of them
(e.g. because it is a Vulkan 1.0 instance or physical device), calling
the corresponding wrapper functions will lead to unspecified behavior.
This is in line with how QOpenGLExtraFunctions works. The simple
autotest added to exercise some Vulkan 1.1 APIs demonstrates this in
action.

The member functions in the generated qvulkan(device)functions header
and source files are ifdefed by VK_VERSION_1_{0,1,2}. This is essential
because otherwise a Qt build made on a system with Vulkan 1.2
headers would cause compilation breaks in application build environments
with Vulkan 1.0/1.1 headers when including qvulkanfunctions.h (due to
missing the 1.1/1.2 types and constants, some of which are used in the
function prototypes). In practice this should be alright - the only
caveat to keep in mind is that the Qt builds meant to be distributed
to a wide variety of systems need to be made with a sufficiently new
version of the Vulkan headers installed, just to ensure that the
1.1 and 1.2 wrapper functions are compiled into the Qt libraries.

Task-number: QTBUG-90219
Change-Id: I48360a8a2e915d2709fe82993f65e99b2ccd5d53
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-01-19 14:17:55 +01:00
Jarek Kobus
98a89fb711 Hardcode a special case of using qOverload for slots without arguments
Pick-to: 6.0
Fixes: QTBUG-90308
Change-Id: I35cd45679ded626654dd0e7e3eea8a7bb14c1d56
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-01-15 17:39:46 +01:00
Laszlo Agocs
2aa7ad5e67 qvkgen: Skip command elements with alias
Otherwise we end up with generating broken qvulkanfunctions cpp and h
files.

For example, encountering the following command element should lead to
taking no action, this is not something we want to emit a corresponding
wrapper function for:
  <command name="vkResetQueryPoolEXT" alias="vkResetQueryPool"/>

This is required to be able to upgrade the bundled vk.xml to something
newer.

Fixes: QTBUG-90330
Task-number: QTBUG-90219
Change-Id: Ie6e3a8794207e30a172820eb055238bf52a0c0b9
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2021-01-15 15:21:15 +01:00
Joerg Bornemann
04f11f9935 Remove .prev_CMakeLists.txt files
Those serve no purpose anymore, now that the .pro files are gone.

Task-number: QTBUG-88742
Change-Id: I39943327b8c9871785b58e9973e4e7602371793e
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-01-12 20:59:13 +01:00
Joerg Bornemann
ad2da2d27a Remove the qmake project files
Remove the qmake project files for most of Qt.

Leave the qmake project files for examples, because we still test those
in the CI to ensure qmake does not regress.

Also leave the qmake project files for utils and other minor parts that
lack CMake project files.

Task-number: QTBUG-88742
Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
2021-01-07 15:32:28 +01:00
Friedemann Kleint
179696fcb8 uic: Do not generate QComboBox::AdjustToMinimumContentsLength into code
The enumeration value was removed in Qt 6 by
1a342b2db1. Ignore it.

Add a check to helper function checkProperty() and move
the code from a5e2f2ddad there
as well.

Pick-to: 6.0
Task-number: QTBUG-89093
Fixes: QTBUG-89700
Change-Id: I0890be8fff155d7342e2386b7f6b0783a5f3a192
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-01-04 10:25:41 +01:00
Joerg Bornemann
88fe9d3d97 CMake: Fix FEATURE_static_runtime build
We must call qt_set_common_target_properties on Bootstrap too, because
that's were FEATURE_static_runtime is handled.

Change-Id: Ie54f7d599d0c3a54b761e6c679983b475e77c17d
Pick-to: 6.0
Fixes: QTBUG-89201
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Eric Lemanissier <eric.lemanissier@gmail.com>
2020-12-09 22:12:17 +01:00
Assam Boudjelthia
fa0dc83135 Revert "Android: print tailored warning if qml dependency path is a dir"
This reverts commit c730a29260.

Reason for revert: The original change was wrong and caused
androiddeployqt to skip valid QML resource paths. 

Additionally, change log output from "file" to "path" when skipping
an import path.

Pick-to: 6.0 5.15
Fixes: QTBUG-89281
Change-Id: Ic338d147a04a03bb1d7acbede11b647ff036922a
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-12-09 20:01:13 +00:00
Kai Koehne
9198d7f044 Remove qlalr documentation stub
The documentation is only a stub, and hasn't been built since Qt 4 times.
qlalr is also first and foremost an internal tool nowadays, so it's very
unlikely we will fully document it.

Change-Id: I68821bf1f9ca3811ec8adda583f0c7326421c6b6
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
2020-12-08 15:15:58 +01:00
Friedemann Kleint
3fb039ca23 rcc: Remove support for Python2
Qt for Python only supports Python3.

Change-Id: I7b13b1f9482579b1e1128d15ee5734d063a7c4b8
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-12-07 17:09:07 +01:00
Friedemann Kleint
cb064dee3a uic/rcc: Use QT_VERSION_MAJOR for major version
Amends 539a16a69fa1ef302cf4eb97ff5a7f8afb606d15.

Task-number: QTBUG-89124
Change-Id: I68c9ab2179d464d83c3fd9eefc5609b7a5a58e27
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
2020-12-07 11:37:35 +01:00
Friedemann Kleint
e4395f3f68 Fix uic/rcc generating outdated export for Qt for Python
Bump version to 6.

Fixes: QTBUG-89124
Change-Id: Ifcf60552b5b6efb86f79da34da9c34b8efae9fa4
Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
(cherry picked from commit fc9cda5f08ac848e88f63dd4a07c08b2fbc6bf17)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2020-12-04 15:46:04 +00:00
Li Xinwei
013abe3206 CMake: Avoid MSVC C4996 warnings
The qmake build system defines _CRT_SECURE_NO_WARNINGS in
mkspecs/features/qt_module.prf, the cmake build system should do the
same thing in qt_internal_add_module().

Adding this definition can avoid warnings like:
warning C4996: 'strncpy': This function or variable may be unsafe.

As a special case, Bootstrap uses add_library() instead of
qt_internal_add_module(), so _CRT_SECURE_NO_WARNINGS should also be
defined in src/tools/bootstrap/CMakeLists.txt.

Pick-to: 6.0
Change-Id: Ic82193d177f82785fd84948efa78c49ca8d8db46
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-12-04 13:54:49 +08:00
Friedemann Kleint
a5e2f2ddad uic: Do not generate QDockWidget::AllDockWidgetFeatures into code
The enumeration value was deprecated by
qtbase/f15aa1fd84e46dfc4d9a78b3a7ba482e42abd9c1 and removed in Qt 6.

Pick-to: 6.0
Task-number: QTBUG-89093
Change-Id: Iaf46adc1e1bd79e4aaab066c9fa4bf84a8ee34d0
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
2020-12-03 17:17:03 +01:00
Fabian Kosmale
df8fbcf382 Avoid signed overflow in moc
moc's preprocessor needs to implement certain math operation to
correctly handle #if conditions. Unfortunately, its implementation is
not overflow safe. However, those are rare enough in practice that we
in general do not need to care about them.
This patch adds a workaround for one case where UBSAN run into an
overflow related issue.
A complete fix would require to make moc spec compliant (do math with
std::max_(u)int_t operands; always wrap on overflow) in all operations.

Pick-to: 6.0 5.15
Fixes: QTBUG-88825
Change-Id: Ic4d2cb097db2fa2f9d4681bbaab3068eaa2745aa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2020-12-03 13:51:32 +01:00
Assam Boudjelthia
c730a29260 Android: print tailored warning if qml dependency path is a dir
androiddeployqt might be misleading when the path is adir
and the warning says that the file does not exist.

Pick-to: 5.15
Change-Id: I1129f49af58a0637a240fcfd425a61b2ed15c840
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
2020-12-01 15:13:10 +02:00
Joerg Bornemann
d4e9f0e633 CMake: Re-generate project files in src
Pick-to: 6.0
Change-Id: I1f5f822d68129490f1a7c495f718aead0b520ca9
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
2020-11-30 23:17:47 +01:00
Andreas Buhr
0440614af0 Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE
Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with
move semantics, its name is misleading. Q_RELOCATABLE_TYPE was
introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE
is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE
by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this
patch should have no impact on users.

Pick-to: 6.0
Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
2020-11-30 17:16:21 +01:00
Fabio Falsini
88ab9e1800 Change android target SDK version to 29
Play Store now accept only app with target
SDK version set to 29 or above

Pick-to: 6.0
Change-Id: If38f20c88fd6b0e6f29939cdf3d2eb793c0e1489
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2020-11-26 20:05:41 +01:00
Andy Shaw
d8602ce58b QFont: Prefer setFamilies() over setFamily()
By depending on setFamilies() then we can be sure that font names with
spaces, commas, quotes and so on are correctly handled without being
misinterpreted. For now it will split on the comma when a string
containing one is passed to setFamily. But from Qt 6.2 this will be
removed to preserve the family string as a convenience function.

[ChangeLog][QtGui][QFont] Indicated that setFamilies/families is
preferred over setFamily/family to ensure that font family names are
preserved when spaces, commas and so on are used in the name.

Change-Id: Id3c1a4e827756a4c928fed461a4aafa5a0f06633
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2020-11-20 14:30:22 +01:00
Assam Boudjelthia
4ef3da04c3 Android: use extraPrefixDirs with qmlimportscanner
This will ensure that qmlimportscanner can use the extraPrefixDirs,
when an extra prefix is provided like the case with Conan builds.

Task-number: QTBUG-88519
Change-Id: Idec3916b043822da094973a7e246a6ee4af14c83
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
2020-11-19 13:28:46 +02:00
Lars Knoll
185d212bf5 Avoid linker errors for the bootstrap lib in debug builds on MSVC
Change-Id: I35406ede2246c9eadba9dcecb1bdb65848b07e42
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-11-19 12:28:44 +01:00