Commit Graph

1935 Commits

Author SHA1 Message Date
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