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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
The file was inadvertently removed in
ad2da2d27a.
Pick-to: 6.2
Change-Id: Iaaf74d7ae382b0c9487fb25a58632dfc5be6538d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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<Person>"/>
[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>
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>
This, however, has to wait for Qt 7 for compat reasons.
Change-Id: I84db4715bf2e9d080d1446d24f0996c78a875e63
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
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>
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>
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>
The format was renamed in 27db9e458c.
Pick-to: 6.2
Change-Id: I53975c7467d8768dc9dc9ac2d89c42eefa12e22f
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
It should be possible to use them with promotion.
Task-number: PYSIDE-1404
Change-Id: Idea0ab076c66d2842958eabf66e5dc4f8e1bad3f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
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>
That's two years from when the replacements were added (6.2).
Change-Id: Id2983978ad544ff79911fffd1671f7dd38fede02
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
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>
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>
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>
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>
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>
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>
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>
[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>
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>
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>
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>
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>
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>
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>
'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>
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>
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>
[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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
These look like leftovers (API flaws).
Construction of QFileInfo from QString (or similar) should be not
implicit, as QFileInfo construction is expensive (might hit the file
system), and this may have users overlook APIs (for instance build a
QFileInfo out of QDirIterator::next(), instead of using ::fileInfo();
using QDir::entryList instead of entryInfoList; etc.).
Leave an opt-out mechanism to ease porting.
Fix a handful of usages around qtbase, with at least a couple of them
likely to be actual "sloppy" code.
[ChangeLog][Potentially Source-Incompatible Changes][QFileInfo] Most
QFileInfo constructors are now explicit. The
QT_IMPLICIT_QFILEINFO_CONSTRUCTION macro is provided to keep old code
working.
Change-Id: Ic580e6316e67edbc840aa0c60d98c7aaabaf1af6
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
*Not* using /permissive- exposes Qt and client apps to interesting
bugs and/or build failures, (e.g. QTBUG-87225, or
19b5520abf). We demand strict
conformance by any other compiler, it's time to demand it from
MSVC too.
The Windows headers themselves are clean starting from the
Windows Fall Creators SDK (10.0.16299.0), and moreover Qt 6 will
drop WinRT; therefore, the comment in the mkspecs does not apply
any more.
Since /permissive- implies /Zc:referenceBinding, drop that
option. The other implied options are set on MSVC < 2017,
but I leave them in to avoid tinkering with the fragile lists
of C/C++ flags.
Rename the CMake internal helper function to better describe
what it does.
Fixes: QTBUG-85633
Fixes: QTBUG-85637
Fixes: QTBUG-85635
Fixes: QTBUG-88244
Change-Id: Ie03fddb61aa066fdc14b7231c22e7108b4a02fbb
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
gcc, clang, and MSVC all use lowercase "warning:", "error:" and
"note:". Follow that standard.
Also, include a column number; just print 1, as the Symbol doesn't
give us a column number, and searching backwards for a newline seems
overkill.
This fixes IDE integrations that parse compiler output using regular
expressions.
The test checks for moc output, but most tests were so far only
running on Linux systems. Expand this to Unix for most tests, which
then includes macOS.
Change-Id: I0a6151cc0dc50e52ca72ff8048a45213aebdb3a8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
The existing logic broke down when we reentered the enumerator parsing
loop, and encountered a INCLUDE_MOC_END token in the first handleInclude
call. Fix this by restarting the loop in that case.
Amends d8a2456fbf.
Fixes: QTBUG-88125
Pick-to: 5.15
Change-Id: I87acaa986a81de53730eddc40bc7d48c15328aba
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
And add a QMultiHash::unite(const QHash &) method to avoid
a copy of the data when inserting a QHash into a multi hash.
Change-Id: I864aa9d2b9b7b2c367c3c4d140a2ce2f5408ae09
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This change allows the user to use -Wextra-semi-stmt without a warning.
A macro should never include a ; by it's own. Macro Q_UNUSED already
adds semicolon.
Fixes: QTBUG-82978
Pick-to: 5.15
Change-Id: I6d8d009cf89f0c8bbb6a9fee986e81302ebd7459
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
These classes should not inherit from each other
anymore in Qt 6. The reason is that this makes
the 95% case of using a non-recursive mutex
much slower than it has to be.
This way, QMutex can now inline the fast path
and be pretty much as fast as QBasicMutex is
in Qt 5. They actually use the same code paths
now. The main difference is that QMutex allows
calling tryLock() with a timeout, which that
is not allowed for QBasicMutex.
[ChangeLog][QtCore][QMutex] QMutex does not support
recursive locking anymore. Use QRecursiveMutex for that
purpose. QRecursiveMutex does not inherit QMutex anymore
in Qt 6.
Change-Id: I10f9bab6269a9181a2e9f534fb72ce65bc76d989
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
In a macOS environment, Clang throws a number of compiler warnings
about loop variables when building qtbase.
See task for more info about the environment.
This changes a handful of loop variables,
like QJsonValue references into QJsonValueRefs.
Task-number: QTBUG-87216
Pick-to: 5.15
Change-Id: I26006efd7c75c2d56ebc7f7efb4c9bdcabe92e8b
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
The androiddeployqt tool wasn't handling dependencies with backslashes
properly, some dependencies like libplugins_platforms_qtforandroid was
written into libs.xml as
plugins\platforms\libplugins_platforms_qtforandroid_armeabi, the the app
won't be looking for the correct path of the lib to load.
Task-number: QTBUG-87574
Change-Id: Iad8c74d30d090adf69a17f2dafb455dff50b3d99
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This time based on grepping to also include documentation, tests and
examples previously missed by the automatic tool.
Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Rename Android package name org.qtproject.qt5.android to
org.qtproject.qt.android to avoid inconsistency with Qt 6 name.
Also, we include the major version number in the jar target.
Task-number: QTBUG-86969
Change-Id: Ibb68947289be1079911b34ea157bf089cc52c47f
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
The path of dependencies (.so, .jar, etc.) might use either native or
non-native dir separators. Let's support both cases.
Amends: 4e94465096
Task-number: QTBUG-87066
Change-Id: I8ce3235db5bab8c4c139f841d3a2fe74d3c7c7f2
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
The path of dependencies (.so, .jar, etc.) might use native dir
separators, but if checks when not accounting for that.
Task-number: QTBUG-87066
Change-Id: I0a09231f2a19f448f1ba520fd738d129d64ff5c7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Make name format of QT_ANDROID_DEPLOYMENT_SETTINGS_FILE consistent with
qmake, that is android-${target}-deployment-settings.json.
Task-number: QTCREATORBUG-24678
Change-Id: I2bdb056cf7a82fd83aaf658f3a405a0c9ef05756
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Change the implementation of Qt DBus to use QMetaType directly
instead of integer based type ids.
Change-Id: I999023b58fa50dcc3504386467faf09874f7d2cf
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Modify special case locations to use the new API as well.
Clean up some stale .prev files that are not needed anymore.
Clean up some project files that are not used anymore.
Task-number: QTBUG-86815
Change-Id: I9947da921f98686023c6bb053dfcc101851276b5
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Clean up the state of the projects,
before changing the internal CMake API function names.
Task-number: QTBUG-86815
Change-Id: I90f1b21b8ae4439a4a293872c3bb728dab44a50d
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
QDirIterator is documented to be non-deterministic.
Fixes: QTBUG-86675
Pick-to: 5.15
Change-Id: I4161871a409bbaf85347ee6a60ef1189f56a1b22
Reviewed-by: hjk <hjk@qt.io>
Various places in moc relied on the magic behavior of QByteArray, that
provided a non-null pointer to a null byte when the byte array was
null, resulting in crashes when QT5_NULL_STRINGS is turned off. Fixed
them to cope with this (and optimised out some pointless effort, when
empty QByteArrays are involved, in the process).
Change-Id: I617a878eb2e9ac8be244080efa1f0de4ac9a68a2
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Allow Gradle builds to run using JVM daemon, this will improve the
current build time noticeably for clean builds and hugely for
incremental builds.
This will bring the Gradle build to comparable speed with a normal
Gradle build in Android Studio.
Task-number: QTBUG-86674
Pick-to: 5.15
Change-Id: Icc4267223802e4c9350b48099236650c023f868d
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Some CMake files currently assume that QtGui is always enabled and we
get a configure-time failure without these changes.
Task-number: QTBUG-86053
Change-Id: I28e32c180c32221f32519017bac6b518a19d5983
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
It has been deprecated and will live in qt5compat from now on.
Fixes: QTBUG-86480
Change-Id: I3744c7cee058d51d0fce633a174ab1a0f9235d2c
Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
Simply use qcontainerfwd.h, instead of declaring those manually.
Change-Id: I6d87bf14b60469b457e8e9335868f8cdb0303817
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Fix superfluous space in qtgui.tracepoints and make tracegen more
lenient towards unknown types (the ETW implementation outright ignores
those).
Pick-to: 5.15
Fixes: QTBUG-86546
Change-Id: I71cc323afa1009dbaefe20e55818ecb6c0b09c59
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Milian Wolff <milian.wolff@kdab.com>
If we require complete types when generating the list of metatypes, then
we also need to require them when generating each entry, and vice versa.
Change-Id: I68394f8628bb6cd89f77bb829b1d4b5ab35071a0
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@qt.io>
For QML, we like to avoid doing string to type lookups at runtime as
much as possible. Therefore, QML registration macros like QML_ELEMENT
now cause moc to require complete types not only for properties, but
also for all methods known to the metatype system.
Change-Id: Ied3d940c102719db4852d3a748d05be1f415b353
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
In 3558704ed5, we added code to
support old .ui files which used the old integer scale for font
weights by checking for a special attribute which would help
separate new and old files.
Since then, it has become apparent that the weight element in
.ui is not actually used for anything, since it is only emitted
when the bold flag is set and always has to match QFont::Bold
in these cases.
So instead of converting, we simply ignore it now, and respect
the bold flag instead.
This also reverts the changes to ui4.* in uic, since the
scale attribute is no longer needed.
Task-number: QTBUG-42248
Change-Id: I1898868b58004099590f4eaf01f24c57bd34d779
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Add a new BINDABLE declaration to the Q_PROPERTY() macro that tells moc
where to find the QBindable for the property.
Add a QUntypedBindable base class to QBindable<T> that gives access to
generic functionality and checks argument compatibility at runtime.
QBindable<T> will still do static checking at compile time.
Add QMetaProperty::isBindable() and QMetaProperty::bindable()
to be able to dynamically access the binding functionality.
Change-Id: Ic7b08ae2cde83fd43e627d813a886e1de01fa3dc
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
And all related functionality. This is being replaced by
Q_BINDABLE_PROPERTY and Q_OBJECT_BINDABLE_PROPERTY in the
next few commits. The new infrastructure coming will play
nicer along with the existing property system.
Commented out some autotests, that will get reimplemented
with the updated infrastructure.
Change-Id: I50c30bd4d5c6c6b6471f8eb93870e27d86f5a009
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This is in line with QMetaType and will be used to implement a mutable
QSequentialIterable. Later on, a QMetaAssociation will be added as
well, to implement a mutable QAssociativeIterable.
The code here represents the minimal set of functionality needed to have
a practical sequential container. The functionality is not completely
orthogonal. In particular, the index based operations could be
implemented in terms of iterator-based operations.
Task-number: QTBUG-81716
Change-Id: Ibd41eb7db248a774673c701549d9a03cbf2e48b6
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
The functionality should be available via QWidget::winId(),
and QWidget::createWindowContainer() + QWindow::fromWinId().
Any bugs in this area should be fixed by improving the general
wrapping APIs.
Fixes: QTBUG-83254
Change-Id: I86584a4a8138d17d65a50da39efd58039f10da91
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Since Qt 6 CMake installs the host and target into separate directories,
androiddeployqt fails to get the correct path to rcc. This change
includes the host's rcc binary path in deployment-settings.json.
Task-number: QTBUG-85399
Change-Id: I610bb6fea1180a119e4c0ceb75bf78c175ae430e
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
AndroidManifest.xml file and the Android plugin already has a way
to provide commandline-arguments to app with the tag
"android.app.arguments". This change allow to set it from qmake/cmake
and allow Qt Creator to use that.
Task-number: QTCREATORBUG-23712
Change-Id: I3e680f40fd36ba6aaac7f344fb9509d2c3360e74
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
Use the following env vars to help conceal private signing information:
- QT_ANDROID_KEYSTORE_PATH
- QT_ANDROID_KEYSTORE_ALIAS
- QT_ANDROID_KEYSTORE_STORE_PASS
- QT_ANDROID_KEYSTORE_KEY_PASS
[ChangeLog][Platform Specific Changes][Android] Added the option to
conceal package
signing information using environment variables.
Task-number: QTBUG-84922
Change-Id: I1fac51ed9e88ef42c761bc916ba1c3bf439806e8
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
This requires a QAbstractFileIconProvider in QtGui, as the standard
QFileIconProvider depends on QStyle, and cannot be moved out of
QtWidgets.
QAbstractFileIconProvider returns strings for file types, but returns
no icons yet. Support for a default icon set might be added in a
follow-up commit.
Change-Id: Ib9d095cd612fdcf04db62f2e40709fcffe3dc2b7
Fixes: QTBUG-66177
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
make apk takes a LOT of time, showing that it's not hanged it's useful.
Change-Id: I4fb11e0f535cf2311d71dff3710135b465ecc06b
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
First and foremost the condition was wrong ...
In order to help running qml test cases on Android without any android
specific hack on
user's .pro files we copy the entire project folder to assets. I copy the
entire folder
and not only the tst_*.qml files because it might contain data which is
needed by the tests to run.
Change-Id: I06323d9d52904317410dd2f440de65a0766a48b5
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
And don't use int based type mapping anymore.
Change-Id: I456e76d1933ef646a7bd39ce565886b89e938a44
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
And remove one of the type id to name mapping that still
existed in QMetaType. QMetaTypeInterface can provide that,
so there's no need to have a second copy of the data.
qMetaTypeTypeInternal() can still map all the names of all
builtin types to ids. That functionality is for now still
required by moc and can't be removed yet.
Change-Id: Ib4f8e9c71e1e7d99d52da9e44477c9a1f1805e57
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Export some private functions from QUtf8 to resolve
undefined symbols in Qt5Compat after moving QStringRef.
Task-number: QTBUG-84437
Change-Id: I9046dcb14ed520d8868a511d79da6e721e26f72b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Use a QStringPrivate inside the implementation. This saves
two pointers, and actually makes this a safe replacement for
QStringRef inside the implementation of QXmlStreamReader.
Unexport the class as all members are inline, and move it
into the QtPrivate namespace as class QXmlString.
Change-Id: I43fa4684f569514c8c621838dcc346657ac1a915
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Pull the file apart, so that the parts generated from qxmlstream.g
are separated from the definition of the private class.
This will in the future simplify maintenance and refactoring.
Change-Id: I4a9c1bb1e377dee1e6d3b9aa9b0dfa64c5806c45
Reviewed-by: Alex Blasche <alexander.blasche@qt.io>
This gives some source incompatibilities, most of them can be
handled by using auto instead of QStringRef explicitly.
[ChangeLog][Important API changes] QXmlStream now uses QStringView
insteead of QStringRef in it's API. Using auto forvariables returning
a QStringRef in Qt 5 should lead to code that can be used against both
Qt versions.
Fixes: QTBUG-84317
Change-Id: I6df3a9507276f5d16d044a6bdbe0e4810cf99440
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Left the translation NOOP for later, pending advice on how to fix
QIODevice, which doesn't compile without them.
Task-number: QTBUG-85700
Change-Id: Icc423ecabb43714d98b5d9b0f9a96c5bb6ef1d78
Reviewed-by: Martin Storsjö <martin@martin.st>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
...to pull in extra defines, includes, libdirs and framework paths.
Change-Id: I7c252f5edbcf15f7e2ad69ace4e15fbacf6cca8a
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
For Qt 6.0, all versioned style option types have been merged into the base
class, and version number has been reset to 1.
Task-number: QTBUG-84221
Change-Id: If729720813c0cf284271a9084311ed6eb820ecca
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Move the QIODevice::OpenMode enum into a base class, so that
we can remove the full QIODevice (and thus QObject) dependency
from qdatastream.h and qtextstream.h.
This is required so that we can include QDataStream in qmetatype.h
without getting circular dependencies.
As a nice side effect, QDataStream and QTextStream can now inherit
QIODeviceBase and provide the OpenMode enum directly in their
class scope.
Change-Id: Ifa68b7b1d8d95687ed032f6c9206f92e63bfacdf
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
It's unclear that the actual file searched for is different from the
error output. Make it clearer.
Task-number: QTBUG-85399
Change-Id: Ia5eb6d03c42b399604ce452b88408e0e5071d17c
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
Introduce a Q_OFFSETOF() macro that uses the optional support of
offsetof() for non standard layout types and disables the
corresponding compiler warnings. All our supported compilers
support offsetof() on non standard layout types.
Use the macro to do the offset calculations required in moc
generated code to replace a manual offset calculation that
was dereferencing a null pointer.
Change-Id: I4aab3af3c8bbaa90372f2234aa1cf8399d023c22
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
... and QMultiMap as std::multimap.
Just use the implementation from the STL; we can't really claim that
our code is much better than STL's, or does things any differently
(de facto they're both red-black trees).
Decouple QMultiMap from QMap, by making it NOT inherit from
QMap any longer. This completes the deprecation started in 5.15:
QMap now does not store duplicated keys any more.
Something to establish is where to put the
QExplictlySharedDataPointer replcement that is in there as an
ad-hoc solution. There's a number of patches in-flight by Marc
that try to introduce the same (or very similar) functionality.
Miscellanea changes to the Q(Multi)Map code itself:
* consistently use size_type instead of int;
* pass iterators by value;
* drop QT_STRICT_ITERATORS;
* iterators implictly convert to const_iterators, and APIs
take const_iterators;
* iterators are just bidirectional and not random access;
* added noexcept where it makes sense;
* "inline" dropped (churn);
* qMapLessThanKey dropped (undocumented, 0 hits in Qt, 1 hit in KDE);
* operator== on Q(Multi)Map requires operator== on the key type
(we're checking for equality, not equivalence!).
Very few breakages occur in qtbase.
[ChangeLog][Potentially Source-Incompatible Changes] QMap does not
support multiple equivalent keys any more. Any related functionality
has been removed from QMap, following the deprecation that happened
in Qt 5.15. Use QMultiMap for this use case.
[ChangeLog][Potentially Source-Incompatible Changes] QMap and
QMultiMap iterators random-access API have been removed. Note that
the iterators have always been just bidirectional; moving
an iterator by N positions can still be achieved using std::next
or std::advance, at the same cost as before (O(N)).
[ChangeLog][Potentially Source-Incompatible Changes] QMultiMap does
not inherit from QMap any more. Amongst other things, this means
that iterators on a QMultiMap now belong to the QMultiMap class
(and not to the QMap class); new Java iterators have been added.
Change-Id: I5a0fe9b020f92c21b37065a1defff783b5d2b7a9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
When the compile time metatype support for methods was introduced, we
needed to allow incomplete types to avoid breaking a large amount of
code. However, this mistakenly enabled using incomplete types for
properties, too. In contrast to methods, properties lack the fallback
code to retrieve the metatype at runtime. Thus, this commit restores the
completeness requirement for properties again. This is done by always
calling QMetaTypeForType for properties in qTryMetaTypeForType.
Amends fa987d4441
Change-Id: I5f66ff289631c056eecebe40926bf321d283eea7
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Allows defining multiple static plugins in the same translation unit.
Change-Id: I175fd4980b21a461a18c23ed1a62a3cea73e67a0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
At the time when we parse it we don't know if the property will be a
QProperty.
Change-Id: I720afa6d5ec284c727328db92c791771def82f41
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Previously, only QNotifiedProperty was supported. As moc cannot
determine by itself whether the backing property is a QProperty or a
QNotifiedProperty, allow NOTIFY false to indicate that it is a plain
QProperty. For symmetry, NOTIFY true is also allowed and means that the
backing property is a QNotifiedProperty.
Change-Id: I66f3105c976ef084198ce8658bc07499a3cb1cd8
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This way we can return a nullptr for cases where the class does not want
to provide a property at all. For example outside of bindings when
reading the default value. The moc-generated code can check for such
nullptrs and handle them.
Change-Id: I7ff478cb254012147bb7aed3feb160e3e679cb6d
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
If you pass "STORED false" the name is interpreted as function to be
invoked in order to access the property. This allows storage of a
property in a lazily allocated data type.
Change-Id: I4d3a9cac6985c6419ce687868cb74b91921595a6
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Created a QByteArrayView in symmetry with QStringView.
Added the basic tests symmetrical to QStringView tests.
Moved the implementations of non-modifying methods of QByteArray to
namespace QtPrivate, to be reused inline from both QByteArray and
QByteArrayView. Changed QByteArray's counterparts of those methods to
take QByteArrayView as argument instead of QByteArray. Removed
QByteArray's operator QNoImplicitBoolCast(), because it was causing
ambiguity when calling those methods with QByteArray argument (it was
there to perevnt if(!ba)/if(ba) from compiling, but currently that would
be ambiguous and won't compile anyway).
[ChangeLog][QtCore][QByteArrayView] New class.
Task-number: QTBUG-84321
Change-Id: I05f92e654cf65c95f2bb31b9c9018746ac110426
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
As done in 939f5112a1 elsewhere, use %zd
and cast explicitly to size_t.
Change-Id: I2fc7607725829f80cc125568246503af341749f1
Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
The change creates a slight source incompatibility. The main
things to take care of are
* code using printf statements on list.size(). Using qsizetype in
printf statements will always require a cast to work on both 32
and 64 bit.
* A few places where overloads now get ambiguous. One example is
QRandomGenerator::bounded() that has overloads for int, uint and
double, but not int64.
* Streaming list.size() to a QDataStream will change the format
depending on the architecture.
[ChangeLog][QtCore][QList] QList now uses qsizetype to index into
elements.
Change-Id: Iaff562a4d072b97f458417b670f95971bd47cbc6
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This avoids ambiguities in our API when someone e.g. writes
vector.insert(0, ...).
It requires a slight workaround in qlalr, where std::search()
for libc++ doesn't like that our difference_type is qsizetype.
Change-Id: I40aa1040781ffbdd12d04410078207969b3bde53
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This addresses two issues:
1. The generated code for QNotifiedProperty<T, ...> was broken when T is
a pointer. Notably, const S* & is not a constant reference to S*.
This is addressed by consistently using T const& instead of const T&.
2. The Q_PRIVATE_QPROPERTY approach assumed that the property name and
the getter are equal. This does break when they are not, and we are
unable to change either of them due to API compatibility concerns. An
example of this would be QQuickItem's parent property with a
parentItem getter. Therefore, we now allow the usage of NAME to
override the name of the property.
Change-Id: Idf2e85576c74371b5b0f6db15dbe6f2d17c5e33d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Assume UTF-8 on all Unix like systems
* Export some functions to be able to compile QTextCodec once
moved to Qt5Compat.
Task-number: QTBUG-75665
Change-Id: I52ec47a848bc0ba72e9c7689668b1bcc5d736c29
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Change the meaning of Q_PRIVATE_QPROPERTY to imply that the property is
implemented using a QNotifiedProperty. That requires passing the owner
object instance to the value and binding setters.
Similarly, detect QNotifiedProperty members like QProperty.
Change-Id: If49bbb04c8ccd4a661973888c50d2d556c25034f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
If Gradle build fails on Windows, check for java files that exceed
the max length of 260 that Gradle can handle, then warn about the length
issue.
Pick-to: 5.15
Task-number: QTBUG-83875
Change-Id: Ia7462bc816b3efa4ba9fdd0f179fdc4c06e23248
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
The qt_internal_apply_gc_binaries function should apply both compile
and link flags, not just link flags.
The flags should be applied publically to all consumers of Bootstrap
regardless if the gc_binaries feature is enabled.
The flags should be applied publically to Core only in case if the
feature is enabled (aka for static builds only).
Change-Id: Id42af0d9b527004d74c04eff2c9e3c2be1e76aac
Fixes: QTBUG-84461
Task-number: QTBUG-83929
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
This changes the layout of the meta object data, so
also bump the meta object revision.
Original-patch-by: Lars Knoll <lars.knoll@qt.io>
Change-Id: I176fb16c207e8ebe59e358e69554be813406232f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Property flags should be compile time booleans, not something to
be determined at runtime.
We've been using this to dynamically disable some properties in QWidget
based classes dependent on the state of a different property, but this
should better get implemented on top of our widgets.
Change-Id: I6296e8761303ecdf24d9e842142e8596304c015d
Reviewed-by: Simon Hausmann <hausmann@gmail.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Remove QDestopWidget public header, simplify the implementation that
maintains a Qt::Desktop type QWidget for each QScreen, and turn
QWidget's initial target screen into a QScreen pointer.
QApplication::desktop() now takes an optional QScreen pointer, and
returns a QWidget pointer, so that applications and widgets can get
access to the root widget for a specific screen without having to
resort to private APIs.
QDesktopWidgetPrivate implementations to look up a screen for an index,
widget, or point are now all inline functions that thinly wrap
QGuiApplication::screens/screenAt calls. We should consider adding those
as convenience APIs to QScreen instead.
Note that QWidget::screen is assumed to return a valid pointer; there is
code that handles the case that it returns nullptr (but also code that
trusts that it never is nullptr), so this needs to be defined, verified
with tests, and asserted. We can then simplify the code further.
Change-Id: Ifc89be65a0dce265b6729feaf54121c35137cb94
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
QFileSystemModel is the documented replacement. It uses threads to
populate the model, which QDirModel doesn't.
Change-Id: I7818ecd8f849eb566ac176612f382e17a0471c47
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
This patch allows tools to be built for the target platform when the
QT_BUILD_TOOLS_WHEN_CROSSCOMPILING parameter is set at configuration
time.
To avoid naming conflicts, the target tools are suffixed with "_native".
The qt_get_tool_target_name() function can be used to get the tool name
for both scenarios (cross and non-cross compilation).
Extend pro2cmake to refer to the right target name for tools.
The relevant write_XXX functions have a new target_ref parameter that
will be "${target_name}" for tools and literally the target name for
everything else.
Fixes: QTBUG-81901
Change-Id: If4efbc1fae07a4a3a044dd09c9c06be6d517825e
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This does the analog of 46f407126e for the
methods we care about (signals, slots, Q_INVOKABLEs). In addition to the
actual QMetaType, we store an array with offsets so that we later can do
a mapping from methodIndex to metatype.
The newly added QMetaMethod::{return,parameter}MetaType methods can then
be used to retrieve the metatypes.
This does however require that all involved types are complete. This is
unfortunately not a feasible requirement. Thus, we only populate the
metatype array on a best effort basis. For any incomplete type, we store
QMetaType::Unknown. Then, when accessing the metatype, we fall back to
the old string based code base if it's Unknown.
Squashes "moc: support incomplete types" and "Fix compile failures
after QMetaMethod change"
Fixes: QTBUG-82932
Change-Id: I6b7a587cc364b7cad0c158d6de54e8a204289ad4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
When including files, moc inserts a MOC_INCLUDE_BEGIN and
MOC_INCLUDE_END token into the token stream. Those are already handled
in the toplevel Moc::parse function, but parseEnum lacked support so
far.
Pick-to: 5.15
Fixes: QTBUG-80578
Change-Id: I35c8fd959347d94af20090b3a505dd9e6bfaff88
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
There's no real dependency to QTextCodec in those files anymore.
Change-Id: Ifaf19ab554fd108fa26095db4e2bd4a3e9ea427f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
As a first step add setEncoding/encoding() methods that use the
QStringConverter::Encoding enum, and port all uses of setCodec()/
codec() over to the new API.
Internally QTextStream still uses QTextCodec, this will be ported
over to QStringConverter in a follow-up change.
Change-Id: Icd764cf47b449b57f4ebd010c2dad89e6717d6c0
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>